limixbot 0.3.135 → 0.3.136
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-DjVLSVDv.js → ActivityPanel-MPoEGN1W.js} +1 -1
- package/dist/assets/{App-DMZROkHu.js → App-CT5e2g7D.js} +132 -132
- package/dist/assets/{AppEventEditor-CXK0WxXV.js → AppEventEditor-BMkYh-qO.js} +1 -1
- package/dist/assets/{BotSettingsDialog-ZwHvXHHr.js → BotSettingsDialog-CPm8aCzT.js} +1 -1
- package/dist/assets/{BrowserPanel-tRCrHmKv.js → BrowserPanel-ClI8lPYS.js} +1 -1
- package/dist/assets/{BrowserProfilesManager-BWoDchS6.js → BrowserProfilesManager-B8iL0Hch.js} +1 -1
- package/dist/assets/{CloudAddDialog-BOAMJ2Gd.js → CloudAddDialog-BUTwNbHM.js} +1 -1
- package/dist/assets/{ComputerFilesPane-DtWsRRX6.js → ComputerFilesPane-DbPKCGzt.js} +1 -1
- package/dist/assets/{ComputerPanel-zr1zS3es.js → ComputerPanel-ep5Rn_1J.js} +2 -2
- package/dist/assets/{DataPanel-B1epzi7q.js → DataPanel-acWpbfff.js} +1 -1
- package/dist/assets/{DesktopViewer-CgTlC2ON.js → DesktopViewer-DQLJ65-k.js} +1 -1
- package/dist/assets/{GrokMoveDialog-DKJAof8J.js → GrokMoveDialog-CldySKob.js} +1 -1
- package/dist/assets/{InspectorPanel-gprzb4_u.js → InspectorPanel-6u8dxVtV.js} +1 -1
- package/dist/assets/{KeyboardShortcutsModal-CE9N1dXT.js → KeyboardShortcutsModal-D4o-wfHd.js} +1 -1
- package/dist/assets/{LimixResizeHandles-B50AKDOJ.js → LimixResizeHandles-0gHgPmp7.js} +1 -1
- package/dist/assets/{LiveDesktop-BrfH5QA8.js → LiveDesktop-NOP98i6E.js} +1 -1
- package/dist/assets/{LocalVmWorkspace-BmUbj7aQ.js → LocalVmWorkspace-kziKHh5B.js} +1 -1
- package/dist/assets/{MacLocalControl-CzXC4Tgd.js → MacLocalControl-CIeSlq0T.js} +1 -1
- package/dist/assets/{MarkdownFilePreview-CT1RA1r5.js → MarkdownFilePreview-CDfh4Bhg.js} +1 -1
- package/dist/assets/{MenuMotion-D8l5zOOH.js → MenuMotion-DnZ3mfiD.js} +1 -1
- package/dist/assets/{NewBotDialog-CZ_StdcO.js → NewBotDialog-BIWFnIBt.js} +1 -1
- package/dist/assets/{PhoneAppDialog-91WMYhKP.js → PhoneAppDialog-DmKPwUQi.js} +1 -1
- package/dist/assets/{PlacesRail-B0T5a390.js → PlacesRail-BBWcVP0k.js} +1 -1
- package/dist/assets/{PluginsPanel-BY75zgwJ.js → PluginsPanel-PLSAuSyn.js} +1 -1
- package/dist/assets/{ProIntroduction-DDfPJuIt.js → ProIntroduction-DtAG3s5c.js} +1 -1
- package/dist/assets/{RemoteAgentSettingsPanel-BwwoEqBC.js → RemoteAgentSettingsPanel-7UYQ4Xuw.js} +1 -1
- package/dist/assets/{RoomPanel-DP3kKFVr.js → RoomPanel-DYcsBJ-b.js} +1 -1
- package/dist/assets/{RoutinesPage-WXSWeFW8.js → RoutinesPage-izgtqLVW.js} +1 -1
- package/dist/assets/{SettingsModal-Bn4qDLvA.js → SettingsModal-EpHpx5ga.js} +1 -1
- package/dist/assets/{ShareTeamDialog-c9DSnMza.js → ShareTeamDialog-D0B2J-Qe.js} +1 -1
- package/dist/assets/{SignedInSites-Bsx2MhaX.js → SignedInSites-BXTobVc6.js} +1 -1
- package/dist/assets/{TeamLibraryPanel-2GwNQCES.js → TeamLibraryPanel-CyxhXvOc.js} +1 -1
- package/dist/assets/{TeamMapPage-OKvL9bz-.js → TeamMapPage-Bml94lT8.js} +1 -1
- package/dist/assets/{TriggersPage-Cre9mjDc.js → TriggersPage-xPJGMqUi.js} +1 -1
- package/dist/assets/{VisibilitySection-B0MKCxoj.js → VisibilitySection-D9Vq-wjr.js} +1 -1
- package/dist/assets/{WebhookTrigger-BJxGnNpz.js → WebhookTrigger-CcohPlPV.js} +1 -1
- package/dist/assets/{WorksOnGrid-BPqYWeeK.js → WorksOnGrid-BtVis_N0.js} +1 -1
- package/dist/assets/{abnfDiagram-YUKMZFIV-CBc7oFEe.js → abnfDiagram-YUKMZFIV-Ce8eTiWW.js} +1 -1
- package/dist/assets/{activity-BVpu0XkG.js → activity--SWQgP4n.js} +1 -1
- package/dist/assets/{architectureDiagram-47P4ROYG-B5jJZs7S.js → architectureDiagram-47P4ROYG-uK5gzFcN.js} +1 -1
- package/dist/assets/{blockDiagram-E7TT5TSB-DAjxXILv.js → blockDiagram-E7TT5TSB-h0sJ21LK.js} +1 -1
- package/dist/assets/{c4Diagram-CRA5TL53-KWoy72TL.js → c4Diagram-CRA5TL53-D6FSuQ4K.js} +1 -1
- package/dist/assets/{calendar-days-DNA-E4Np.js → calendar-days-DitBJQ7q.js} +1 -1
- package/dist/assets/channel-DXsnTIKn.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-D3Ycc8P6.js → chunk-2Q5K7J3B-uToClUtI.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-C7mfSQVV.js → chunk-5VM5RSS4-D-aGvVMe.js} +1 -1
- package/dist/assets/{chunk-7TKQ45FW-BKvAYNH2.js → chunk-7TKQ45FW-BLunZGXD.js} +1 -1
- package/dist/assets/{chunk-AW2ZBBNX-Ca8gRTzc.js → chunk-AW2ZBBNX-CNTLlxEl.js} +1 -1
- package/dist/assets/{chunk-FVRAUYC3-Bzkks_DT.js → chunk-FVRAUYC3-DjOBV8XJ.js} +2 -2
- package/dist/assets/{chunk-HTAEGDNF-Zo7ZYlx6.js → chunk-HTAEGDNF-lPxF8CJg.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-DuQPO5Rt.js → chunk-JWPE2WC7-De4B0D7D.js} +1 -1
- package/dist/assets/{chunk-KQW6MTUR-C3yGOwbc.js → chunk-KQW6MTUR-cx8qFIBr.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-Dza0vL4n.js → chunk-XXDRQBXY-BUeyVkn0.js} +1 -1
- package/dist/assets/{classDiagram-v2-K4WV4PDN-DTtDRSzj.js → classDiagram-v2-K4WV4PDN-dK4st9xs.js} +1 -1
- package/dist/assets/{coins-Bn14rFjr.js → coins-MJbwpEBq.js} +1 -1
- package/dist/assets/{core-C76obLjh.js → core-C7D8cCTF.js} +1 -1
- package/dist/assets/{cose-bilkent-JH36ORCC-wZ_7CqXu.js → cose-bilkent-JH36ORCC-jCX-7UJX.js} +1 -1
- package/dist/assets/{cynefin-EF2NZ3EQ-CE0jDEB2.js → cynefin-EF2NZ3EQ-CP2d7lx5.js} +1 -1
- package/dist/assets/{cynefinDiagram-3GCD6N5R-CHr9A4jc.js → cynefinDiagram-3GCD6N5R-FY_TCIwN.js} +1 -1
- package/dist/assets/{dagre-W4DXFKR2-C3IEvn1u.js → dagre-W4DXFKR2-BWXmKLRg.js} +1 -1
- package/dist/assets/{diagram-2UJZ2QOL-D6GEShaY.js → diagram-2UJZ2QOL-CHEKJ_l4.js} +1 -1
- package/dist/assets/{diagram-OVF4WLC6-vc-kIw0c.js → diagram-OVF4WLC6-DCb8-TQG.js} +1 -1
- package/dist/assets/{diagram-PFPMY2P6-Dz6L5P0U.js → diagram-PFPMY2P6-CIYmKBh5.js} +1 -1
- package/dist/assets/{diagram-UMYRVEAY-BKH-KrgS.js → diagram-UMYRVEAY-9NdqhGVc.js} +1 -1
- package/dist/assets/{diagram-YEKJPTXX-BugCeBVB.js → diagram-YEKJPTXX-C3J9AGvJ.js} +1 -1
- package/dist/assets/{diagram-ZIFT7M5P-BYARFkzf.js → diagram-ZIFT7M5P-BTWPaT48.js} +1 -1
- package/dist/assets/{ebnfDiagram-VR2GEFS7-CKzxPCV8.js → ebnfDiagram-VR2GEFS7-6PXFyzKG.js} +1 -1
- package/dist/assets/{elk-IJKZMXRS--PWP5h9X.js → elk-IJKZMXRS-Kyo_ClKD.js} +1 -1
- package/dist/assets/{erDiagram-O2IAPWRE-OYgx1l4s.js → erDiagram-O2IAPWRE-CY6f4L3d.js} +1 -1
- package/dist/assets/{file-up-DmgXwNtQ.js → file-up-q6N1oToi.js} +1 -1
- package/dist/assets/{flowDiagram-OXPTDLAJ-Cx9uOAhj.js → flowDiagram-OXPTDLAJ-CIyEI3gW.js} +1 -1
- package/dist/assets/{ganttDiagram-R7TSEDQI-DF4G2mlV.js → ganttDiagram-R7TSEDQI-0uDsU0zP.js} +1 -1
- package/dist/assets/{gitGraphDiagram-XJZIOB7I-D9CUZ9nv.js → gitGraphDiagram-XJZIOB7I-C8WgSPMm.js} +1 -1
- package/dist/assets/{import-name-CKmRlKQK.js → import-name-D-JdaBgz.js} +1 -1
- package/dist/assets/{index-BjI2UFxZ.js → index-CXRLdQFC.js} +1 -1
- package/dist/assets/{index-BvaUdxA7.js → index-DBtvATty.js} +3 -3
- package/dist/assets/{infoDiagram-5W2HQ5XZ-CZW1K3wV.js → infoDiagram-5W2HQ5XZ-vfG8gNz3.js} +1 -1
- package/dist/assets/{ishikawaDiagram-K3B6WC7H-CnK_NQTK.js → ishikawaDiagram-K3B6WC7H-kDpcmOkz.js} +1 -1
- package/dist/assets/{journeyDiagram-COXZFDF6-DSuoKe19.js → journeyDiagram-COXZFDF6-CNQ1ns0p.js} +1 -1
- package/dist/assets/{kanban-definition-P3RFRI5V-DjmRhFSg.js → kanban-definition-P3RFRI5V-b7Gw39SF.js} +1 -1
- package/dist/assets/{mermaid.core-DeRUYgIm.js → mermaid.core-B76WO5rM.js} +4 -4
- package/dist/assets/{mindmap-definition-LZFPQGKD-BJ3VBjfI.js → mindmap-definition-LZFPQGKD-DtR2Z2_c.js} +1 -1
- package/dist/assets/{minimize-BXc-miDU.js → minimize-L5w7-dGg.js} +1 -1
- package/dist/assets/{monitor-15mG3xlc.js → monitor-CTZE2syc.js} +1 -1
- package/dist/assets/{new-bot-82TcBnYq.js → new-bot-Cep8a5it.js} +1 -1
- package/dist/assets/{org-library-BPO6nvGl.js → org-library-OtoLKtxR.js} +1 -1
- package/dist/assets/{package-format-BotZNknA.js → package-format-Tdqu3GAa.js} +1 -1
- package/dist/assets/{pegDiagram-BGZESJAR-BZ-1foJI.js → pegDiagram-BGZESJAR-DyOa8O_6.js} +1 -1
- package/dist/assets/{pieDiagram-CAPJLFHJ-v_kbKYIo.js → pieDiagram-CAPJLFHJ-CWaMQ0jL.js} +1 -1
- package/dist/assets/{quadrantDiagram-GDMTTRAM-fpE5oT7k.js → quadrantDiagram-GDMTTRAM-WW31d2Mf.js} +1 -1
- package/dist/assets/{rail-fintvt10.js → rail-pvuszcdm.js} +1 -1
- package/dist/assets/{railroadDiagram-SM67HX2B-C8JH_pmt.js → railroadDiagram-SM67HX2B-DqD_8LgC.js} +1 -1
- package/dist/assets/{remote-desktop-panel-Dxc33gMR.js → remote-desktop-panel-BLz0nrts.js} +1 -1
- package/dist/assets/{requirementDiagram-X7JNWC4A-DIZkii0D.js → requirementDiagram-X7JNWC4A-BbpAELLg.js} +1 -1
- package/dist/assets/{sankeyDiagram-UM26HJRW-D28LUPgJ.js → sankeyDiagram-UM26HJRW-DfhCSit0.js} +1 -1
- package/dist/assets/{sequenceDiagram-ZO4K6R2Y-By6Qr2OZ.js → sequenceDiagram-ZO4K6R2Y-BWx6HNt_.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-B8ky8h-O.js → sizeCapture-INFHLROL-9Z9mWyEZ.js} +1 -1
- package/dist/assets/{stateDiagram-v2-TBUQTH76-CtuCVgt_.js → stateDiagram-v2-TBUQTH76-C7wdnY0H.js} +1 -1
- package/dist/assets/{styles-Bixj4Mfc.js → styles-DW6_pSlc.js} +2 -2
- package/dist/assets/{styles-DKlhnsr7.css → styles-LX3LEBWb.css} +1 -1
- package/dist/assets/{swimlanes-N4OXWK64-DxwcpFlC.js → swimlanes-N4OXWK64-BdAVZ2Mp.js} +1 -1
- package/dist/assets/swimlanesDiagram-K3J5GTZL-BpuCUF0j.js +8 -0
- package/dist/assets/{team-share-Dl1JG3TI.js → team-share-CjdhSquW.js} +1 -1
- package/dist/assets/{timeline-definition-YOQAKGHF-C76P0vUA.js → timeline-definition-YOQAKGHF-C5RyxpFL.js} +1 -1
- package/dist/assets/{usecaseDiagram-VIAY4XPW-CYHUVqRH.js → usecaseDiagram-VIAY4XPW-CLx4IMzT.js} +1 -1
- package/dist/assets/{vennDiagram-BLWOH2XV-Da7BHd4-.js → vennDiagram-BLWOH2XV-CDdYuSAc.js} +1 -1
- package/dist/assets/{vi-Bu86KxVI.js → vi-CND2A7To.js} +1 -1
- package/dist/assets/{wardleyDiagram-YMQ3BMBF-Ckv9W8Fc.js → wardleyDiagram-YMQ3BMBF-KxnUFn7x.js} +1 -1
- package/dist/assets/{xychartDiagram-TAQBALBS-Dw876alP.js → xychartDiagram-TAQBALBS-DzqYm7Vb.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/rail.html +5 -5
- package/dist-server/index.js +64 -63
- package/dist-server/limixbot.js +22 -22
- package/dist-server/package.json +1 -1
- package/dist-server/pair-cli.js +22 -22
- package/dist-server/server/drivers/claude.js +8 -5
- package/dist-server/server/mcp-oauth-store.js +2 -1
- package/dist-server/server/mcp-oauth.js +26 -12
- package/dist-server/server/shell-timeout-hint.js +3 -2
- package/package.json +1 -1
- package/dist/assets/channel-q-lG3psP.js +0 -1
- package/dist/assets/swimlanesDiagram-K3J5GTZL-B7Xl2xDR.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,t as s,j as t,X as $,a as X}from"./styles-
|
|
1
|
+
import{r as l,t as s,j as t,X as $,a as X}from"./styles-DW6_pSlc.js";import{c as ee,B as te,L as G}from"./PlacesRail-BBWcVP0k.js";import{u as ae,v as F,w as L}from"./App-CT5e2g7D.js";import{suggestedName as H}from"./WebhookTrigger-CcohPlPV.js";import"./monitor-CTZE2syc.js";import"./index-DBtvATty.js";import"./MenuMotion-DnZ3mfiD.js";import"./remote-desktop-DDRRx8uY.js";const N="w-full rounded-xl border border-hairline/60 bg-panel px-3.5 py-2.5 text-[13px] text-ink outline-none placeholder:text-ink-tertiary focus:border-accent/70",m="mb-1.5 block text-[12px] font-medium text-ink-secondary";function de({trigger:a,bots:x,initialBotId:y,onClose:h,onSaved:J}){const{dispatch:K}=ae(),[i,Q]=l.useState(a?.botId??(y&&x.some(e=>e.id===y)?y:x[0]?.id)??""),[r,O]=l.useState(null),[v,B]=l.useState(a?.app??""),[b,k]=l.useState(a?.event??""),[g,U]=l.useState(a?.accountId??""),[I,V]=l.useState(a?.filter??{}),[f,E]=l.useState({}),[u,W]=l.useState(a?.prompt??""),[w,Y]=l.useState(a?.name??""),[P,D]=l.useState(!1),[S,C]=l.useState(""),R=l.useRef(null);ee(R,h),l.useEffect(()=>{if(a||!i)return;let e=!0;return O(null),F.events(i).then(n=>{if(!e)return;O(n);const o=n.apps.find(d=>d.events.length);B(d=>n.apps.some(z=>z.app===d)?d:o?.app??"")}).catch(n=>{e&&C(n instanceof Error?n.message:String(n))}),()=>{e=!1}},[i,a]);const p=r?.apps.find(e=>e.app===v),A=p?.events??[],c=A.find(e=>e.event===b)??(a?void 0:A[0]);l.useEffect(()=>{!a&&c&&c.event!==b&&k(c.event)},[c,b,a]);const q=(c?.configFields??[]).filter(e=>e.required),Z=v==="gmail",M=a?.delivery??c?.delivery,_=async()=>{const e=x.find(o=>o.id===i),n=Object.fromEntries(Object.entries(I).filter(([,o])=>typeof o=="string"&&o.trim()));D(!0),C("");try{const o=a?await F.update(a.id,{name:w.trim()||a.name,prompt:u.trim(),filter:Object.keys(n).length?n:null}):await F.create({botId:i,app:v,event:c?.event??b,prompt:u.trim(),name:w.trim()||H(u,e),...g?{account:g}:{},...Object.keys(n).length?{filter:n}:{},...Object.keys(f).length?{config:f}:{}});J?.(o),h()}catch(o){C(o instanceof Error?o.message:String(o))}finally{D(!1)}},j=(e,n,o)=>t.jsxs("label",{className:"block",children:[t.jsx("span",{className:m,children:n}),t.jsx("input",{value:I[e]??"",onChange:d=>V(z=>({...z,[e]:d.target.value})),placeholder:o,className:N})]},e),T=a?s("automations.editor.app.editTitle"):s("automations.editor.appEvent.title");return t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-5",onMouseDown:e=>e.stopPropagation(),children:t.jsxs("div",{ref:R,role:"dialog","aria-modal":"true","aria-label":T,tabIndex:-1,className:"flex max-h-[90vh] w-full max-w-[560px] flex-col overflow-hidden rounded-2xl border border-hairline/60 bg-panel shadow-2xl",children:[t.jsxs("div",{className:"flex items-start justify-between border-b border-hairline/40 px-5 py-4",children:[t.jsx("div",{className:"text-[17px] font-semibold text-ink",children:T}),t.jsx("button",{type:"button",onClick:h,"aria-label":s("automations.newBox.cancel"),className:"rounded-lg p-2 text-ink-secondary hover:bg-raised hover:text-ink",children:t.jsx($,{size:18})})]}),t.jsxs("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto p-5",children:[!a&&t.jsxs("div",{children:[t.jsx("div",{className:"mb-2 text-[13px] font-medium text-ink",children:s("automations.editor.app.who")}),t.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:x.map(e=>t.jsxs("button",{type:"button",onClick:()=>Q(e.id),className:X("flex min-w-0 items-center gap-2 rounded-xl border px-3 py-2 text-left",i===e.id?"border-accent/70 bg-accent/10":"border-hairline/50 bg-inset hover:bg-raised/60"),children:[t.jsx(te,{bot:e,state:i===e.id?"happy":"idle",size:32,animated:!1}),t.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium text-ink",children:e.name})]},e.id))})]}),!a&&!r&&!S&&t.jsxs("p",{className:"flex items-center gap-2 text-[13px] text-ink-secondary",children:[t.jsx(G,{size:14,className:"animate-spin"}),s("automations.editor.appEvent.loading")]}),!a&&r&&(r.unavailable||!r.apps.some(e=>e.events.length))&&t.jsxs("div",{className:"rounded-xl border border-hairline/45 bg-inset/50 p-3.5 text-[13px] text-ink-secondary",children:[t.jsx("p",{children:r.unavailable??s("automations.editor.appEvent.noApps")}),!r.unavailable&&t.jsx("button",{type:"button",onClick:()=>K({type:"togglePlugins",open:!0,surface:"apps"}),className:"mt-2.5 rounded-lg bg-accent px-3 py-1.5 text-[13px] font-medium text-accent-ink hover:brightness-110",children:s("automations.editor.appEvent.connect")})]}),!a&&r&&p&&t.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[t.jsxs("label",{className:"block",children:[t.jsx("span",{className:m,children:s("automations.editor.appEvent.app")}),t.jsx(L,{value:v,onChange:e=>{B(e.target.value),k(""),E({})},"aria-label":s("automations.editor.appEvent.app"),className:"w-full",children:r.apps.filter(e=>e.events.length).map(e=>t.jsx("option",{value:e.app,children:e.name},e.app))})]}),t.jsxs("label",{className:"block",children:[t.jsx("span",{className:m,children:s("automations.editor.appEvent.event")}),t.jsx(L,{value:c?.event??"",onChange:e=>{k(e.target.value),E({})},"aria-label":s("automations.editor.appEvent.event"),className:"w-full",children:A.map(e=>t.jsx("option",{value:e.event,children:e.name},e.event))})]}),p.accounts.length>1&&t.jsxs("label",{className:"block sm:col-span-2",children:[t.jsx("span",{className:m,children:s("automations.editor.appEvent.account")}),t.jsxs(L,{value:g,onChange:e=>U(e.target.value),"aria-label":s("automations.editor.appEvent.account"),className:"w-full",children:[t.jsx("option",{value:""}),p.accounts.map(e=>t.jsx("option",{value:e.id,children:e.alias??e.id},e.id))]})]}),q.map(e=>t.jsxs("label",{className:"block sm:col-span-2",children:[t.jsx("span",{className:m,children:e.name}),t.jsx("input",{value:f[e.name]??"",onChange:n=>E(o=>({...o,[e.name]:n.target.value})),placeholder:e.description,className:N})]},e.name))]}),(a||p)&&t.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[Z?[j("from",s("automations.editor.appEvent.from"),"acme.com"),j("subject",s("automations.editor.appEvent.subject"),"order"),j("label",s("automations.editor.appEvent.label"),"Customers")]:j("text",s("automations.editor.appEvent.text"),"urgent"),M&&t.jsx("p",{className:"self-end text-[12px] text-ink-secondary sm:col-span-2",children:M==="poll"?s("automations.editor.appEvent.checks"):s("automations.editor.appEvent.instant")})]}),(a||p)&&t.jsxs("label",{className:"block",children:[t.jsx("span",{className:"mb-2 block text-[13px] font-medium text-ink",children:s("automations.editor.app.what")}),t.jsx("textarea",{value:u,onChange:e=>W(e.target.value),rows:3,placeholder:s("automations.editor.appEvent.whatPlaceholder"),className:X(N,"resize-y py-3 leading-relaxed")})]}),(a||p)&&t.jsxs("details",{className:"rounded-xl border border-hairline/45 bg-inset/45 px-4 py-3",children:[t.jsx("summary",{className:"cursor-pointer text-[13px] font-medium text-ink",children:s("automations.more")}),t.jsxs("label",{className:"mt-4 block",children:[t.jsx("span",{className:m,children:s("automations.editor.app.name")}),t.jsx("input",{value:w,onChange:e=>Y(e.target.value),placeholder:H(u,x.find(e=>e.id===i)),className:N})]})]}),S&&t.jsx("div",{role:"alert",className:"rounded-xl border border-danger/30 bg-danger/10 px-3.5 py-3 text-[12px] text-danger",children:S})]}),t.jsxs("div",{className:"flex justify-end gap-2 border-t border-hairline/40 px-5 py-4",children:[t.jsx("button",{type:"button",onClick:h,className:"rounded-xl px-4 py-2 text-[13px] text-ink-secondary hover:bg-raised hover:text-ink",children:s("automations.newBox.cancel")}),t.jsxs("button",{type:"button",disabled:P||!i||!a&&!c||q.some(e=>!f[e.name]?.trim()),onClick:()=>{_()},className:"flex items-center gap-2 rounded-xl bg-accent px-4 py-2 text-[13px] font-medium text-accent-ink hover:brightness-110 disabled:opacity-40",children:[P&&t.jsx(G,{size:14,className:"animate-spin"}),a?s("automations.editor.app.save"):s("automations.editor.app.create")]})]})]})})}export{de as AppEventEditor};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Ae,t as s,l as ee,aF as Vs,j as e,i as De,ae as fe,a as O,r as x,S as tt,ah as Jt,X as st,d as pt}from"./styles-Bixj4Mfc.js";import{fq as Zs,fr as Gs,_ as nt,f3 as Qt,bE as Ys,dq as Xt,C as Js,fs as Qs,ft as Xs,E as es,fu as en,M as ts,eA as tn,p as sn,fv as mt,bu as ut,fw as ss,j as Z,u as B,fx as xt,fy as ht,f4 as ie,fz as nn,fA as an,fB as rn,fC as on,ag as at,af as ns,A as as,S as be,ab as Me,T as is,R as ln,fD as cn,fE as dn,fF as pn,fG as mn,fH as un,fI as gt,fJ as xn,fK as hn,fL as gn,fM as fn,a$ as yn,fN as bn,fO as vn,fP as kn,I as jn,fQ as Oe,bY as Le,fR as wn,aH as M,aN as Q,ek as Nn,dS as Sn,fS as Cn,aI as Ge,cw as Pn,e5 as On,e6 as En,fT as Rn,fU as rs,fV as os,fW as Tn,fX as In,fY as An,fZ as Mn,dV as Ye,aq as ft,f_ as ze,f$ as Ln,g0 as Re,au as Bn,g1 as ls,g2 as yt,aj as Je,g3 as $n,g4 as Fn,g5 as Dn,g6 as cs,g7 as zn,g8 as bt,g9 as Hn,ga as _n,gb as Kn,gc as te,aX as ae,aZ as X,gd as Un,ge as qn,gf as Wn,dc as Vn,aP as Zn,G as Gn,da as ds,ai as Yn,gg as V,aW as me,gh as ue,x as S,gi as Jn,dw as Qn,gj as Be,aY as le,gk as Xn,gl as ea,gm as ta,eo as sa,gn as vt,go as na,gp as aa,gq as ia,gr as ra,gs as oa,gt as la,az as ca,gu as ps,gv as ms,gw as da,gx as pa,gy as ma,gz as ua,gA as xa,gB as ha,gC as ga,gD as fa,gE as ya,gF as us,gG as ba,gH as va,gI as ka,gJ as it,g as ja,B as Qe,gK as wa,gL as Na,gM as Sa,gN as Ca,gO as Pa,gP as Oa,c5 as Ea,gQ as xs,D as kt,gR as Ra,f6 as Ta,gS as jt,gT as Ia,gU as Aa,gV as Ma,cT as wt,bC as La,d9 as Ba,gW as $a,gX as hs,gY as Ce,gZ as Nt,g_ as Fa,aL as He,e7 as Da,g$ as za,aR as Ha,dA as _a,cx as Ka,h0 as Ua,h1 as qa,h2 as Wa,aT as Va}from"./App-DMZROkHu.js";import{v as gs,d as we,a0 as Te,a1 as Za,a2 as Ga,a3 as St,a4 as _e,a5 as Ya,a6 as Ja,a7 as Qa,a8 as Xa,a9 as ei,aa as Ct,ab as ti,ac as si,L as Ee,M as ni,B as Xe,P as Ne,r as fs,ad as ai,$ as ii,u as ys}from"./PlacesRail-B0T5a390.js";import{C as ri}from"./coins-Bn14rFjr.js";import{C as je,a as oi}from"./MenuMotion-D8l5zOOH.js";import{b as se,m as bs,i as et,f as rt,c as ge,d as Pt,e as Ie,o as li,g as ci,h as pe,n as Ke,t as vs,s as ot,j as ks,k as di,l as pi,p as mi,r as js,q as ui,u as xi,w as hi,x as ws,y as Ns,z as Ot,B as gi,C as Ss,R as Et,D as fi,E as yi,F as bi,G as vi,H as ki,J as ji,O as wi,K as Ni,L as Cs,N as Rt,V as Si,P as Ci,M as Pi,A as Oi,a as Ei,S as Ri,I as Ti}from"./VisibilitySection-B0MKCxoj.js";import{s as Ii,r as Ai,a as Mi,R as Li}from"./ComputerFilesPane-DtWsRRX6.js";import{M as Tt}from"./monitor-15mG3xlc.js";import{R as Bi}from"./RoutinesPage-WXSWeFW8.js";import{S as $i}from"./SignedInSites-Bsx2MhaX.js";import"./index-BvaUdxA7.js";import"./org-library-BPO6nvGl.js";import"./package-format-BotZNknA.js";import"./WorksOnGrid-BPqYWeeK.js";import"./ProIntroduction-DDfPJuIt.js";import"./remote-desktop-DDRRx8uY.js";const Fi=[["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M21 12.598V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5",key:"1glfrc"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}]],Di=Ae("calendar-plus",Fi);const zi=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],Hi=Ae("library",zi);const _i=[["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"}]],Ps=Ae("slack",_i);const Ki=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Ui=Ae("tag",Ki),qi=[{id:"overview",label:"Overview",labelKey:"botSettings.sections.overview",icon:Zs,keywords:["summary","status","what it does","won't","prompt","what the model sees"]},{id:"identity",label:"Identity",labelKey:"botSettings.sections.identity",icon:Gs,keywords:["name","title","avatar","blurb","instructions"]},{id:"slack",label:"Slack",icon:Ps,keywords:["slack","slack app","admin","message","direct messages","mentions"]},{id:"soul",label:"Soul",labelKey:"botSettings.sections.soul",icon:nt,keywords:["standing instructions","instructions","persona","rules","soul.md"]},{id:"plugins",label:"Plugins",labelKey:"plugins.botMenu",icon:Qt,keywords:["plugin","attach","gắn"]},{id:"skills",label:"Skills",labelKey:"botSettings.sections.skills",icon:Ys,keywords:["skills","learned","procedures","teach"]},{id:"memory",label:"Memory",labelKey:"botSettings.sections.memory",icon:Xt,keywords:["memory","notes","remember","topics"]},{id:"library",label:"Library",labelKey:"botPanel.tab.library",icon:Hi,keywords:["library","made","pages","apps","files","published"]},{id:"routines",label:"Routines",labelKey:"botSettings.sections.routines",icon:Js,keywords:["schedule","routines","cron","tasks"]},{id:"access",label:"Access",labelKey:"botSettings.sections.access",icon:Qs,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",labelKey:"botSettings.sections.model",icon:Xs,keywords:["engine","model","provider","cli","effort"]},{id:"permissions",label:"Permissions",labelKey:"botSettings.sections.permissions",icon:es,keywords:["auto mode","approve","auto approve","review","routine approvals","coordination","chief of staff","section"]},{id:"voice",label:"Voice & alerts",labelKey:"botSettings.sections.voice",icon:en,keywords:["voice","alerts","notifications","speak"]},{id:"visibility",label:"Who can see it",labelKey:"botSettings.visibility.title",icon:ts,keywords:["visibility","who can see","private","people","admins","members","access","hide"]},{id:"history",label:"History",labelKey:"botSettings.sections.history",icon:tn,keywords:["history","changes","undo","rollback","log"]},{id:"usage",label:"Usage",labelKey:"botSettings.sections.usage",icon:ri,keywords:["tokens","cost","billing"]}],It={completed:"botOverview.routine.last.completed",failed:"botOverview.routine.last.failed",missed:"botOverview.routine.last.missed",cancelled:"botOverview.routine.last.cancelled",running:"botOverview.routine.last.running",queued:"botOverview.routine.last.queued",waiting:"botOverview.routine.last.waiting"};function Wi(t,n=ee()){if(!t||n==="en")return null;if(t.paused)return s("botOverview.routine.paused",{name:t.name});const a=t.lastRun;if(a&&!Object.hasOwn(It,a.status))return null;try{return[s("botOverview.routine.line",{schedule:sn(t.schedule),name:t.name}),...t.nextRunAt!=null?[s("botOverview.routine.next",{time:mt(t.nextRunAt)})]:[],...a?[s(It[a.status],{time:mt(a.at)})]:[]].join(" ")}catch{return null}}const At={"Works in its private workspace.":"botOverview.line.privateWorkspace","Has the built-in browser.":"botOverview.line.browser","Has no connected apps.":"botOverview.line.noApps","Won't act on a schedule.":"botOverview.line.noSchedule","Can talk to the other bot.":"botOverview.line.talksToOne","Talks only to the bots chosen for it.":"botOverview.line.talksToChosen","Cannot initiate contact with other bots.":"botOverview.line.noPeerContact","Command approvals use Ask mode; saved permissions and provider rules still apply.":"botOverview.line.askMode","Command approvals follow the provider's custom configuration.":"botOverview.line.customApprovals","Asks before contacting other bots.":"botOverview.line.asksPeers","Can't use a computer.":"botOverview.line.noComputer","Profile proposal cards require your approval.":"botOverview.line.profileApproval","Connected apps could not be checked.":"botOverview.line.appsUnchecked"},Mt={"Auto; availability is checked when a task starts":"botOverview.preference.auto","cloud computer":"botOverview.preference.cloud","Local VM":"botOverview.preference.vm","this computer":"botOverview.preference.local","browser only":"botOverview.preference.browser"};function Lt(t,n){return!n||n.map(a=>a||"General").join(", ")!==t?t:n.map(a=>a||s("botAccess.teams.general")).join(", ")}const Bt=t=>Object.hasOwn(Mt,t)?s(Mt[t]):t,$t=(t,n,a)=>Number(t)===1?n:a,Vi=[{line:/^Can talk to all (\d+) other bots, in any department\.$/,key:()=>"botOverview.line.talksToAll",params:([,t])=>({count:Number(t)})},{line:/^Also in charge of these departments: (.+)\.$/,key:()=>"botOverview.line.alsoInCharge",params:([,t],n)=>({departments:Lt(t,n)})},{line:/^Can talk to (\d+) other bots? in its (?:section|department)\.$/,key:([,t])=>$t(t,"botOverview.line.peersSectionOne","botOverview.line.peersSectionMany"),params:([,t])=>({count:Number(t)})},{line:/^Can talk to (\d+) other bots? in its allowed (?:teams|departments)\.$/,key:([,t])=>$t(t,"botOverview.line.peersTeamsOne","botOverview.line.peersTeamsMany"),params:([,t])=>({count:Number(t)})},{line:/^Coordinates its (?:section|department) as Chief of Staff\.$/,key:()=>"botOverview.line.chief",params:()=>({role:s("sidebar.bot.chiefOfStaff")})},{line:/^May also coordinate these (?:teams|departments): (.+)\.$/,key:()=>"botOverview.line.alsoTeams",params:([,t],n)=>({teams:Lt(t,n)})}],Zi=t=>ee()!=="en"&&Object.hasOwn(Vs[ee()]??{},t);function Gi(t,n){for(const a of Vi){const o=a.line.exec(t);if(!o)continue;const i=a.key(o);return Zi(i)?s(i,a.params(o,n)):t}return null}function Ue(t,n){if(Object.hasOwn(At,t))return s(At[t]);const a=Gi(t,n);if(a!==null)return a;const o=/^Can use (\d+) connected apps?: (.+)\.$/.exec(t);if(o)return s(o[1]==="1"?"botOverview.line.appsOne":"botOverview.line.appsMany",{count:Number(o[1]),apps:o[2]});const i=ee()==="en"?null:/^Computer preference: (.+), which isn't available on My Cloud\.$/.exec(t);if(i)return s("botOverview.line.computerNotOnCloud",{preference:Bt(i[1])});const l=/^Computer preference: (.+)\.$/.exec(t);if(l)return s("botOverview.line.computer",{preference:Bt(l[1])});const d=/^Works in (.+)\.$/.exec(t);if(d)return s("botOverview.line.folder",{folder:d[1]});const m=/^Knows how to (.+)\.$/.exec(t);if(m)return s("botOverview.line.skill",{skill:m[1]});const r=/^Listens for “(.+)” webhooks\.$/.exec(t);return r?s("botOverview.line.webhook",{name:r[1]}):t}const Ft={name:"approval.applied.field.name",title:"approval.applied.field.title",description:"approval.applied.field.description",soul:"approval.applied.field.soul",cwd:"approval.applied.field.cwd",notifications:"approval.applied.field.notifications",speakReplies:"approval.applied.field.speakReplies"};function Yi(t,n=ee()){const a=/^(\w+): /.exec(t)?.[1];return n==="en"||!a||!Object.hasOwn(Ft,a)?t:`${s(Ft[a])}: ${t.slice(a.length+2)}`}function Ji({data:t,error:n,open:a,onToggle:o}){return e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsxs("button",{type:"button",onClick:o,"aria-expanded":a,className:"flex w-full items-center justify-between gap-3 text-left",children:[e.jsx("span",{className:"text-[15px] font-medium text-ink",children:t?s("botOverview.promptPreviewCount",{bytes:t.totalBytes.toLocaleString(De()),tokens:t.approxTokens.toLocaleString(De())}):s("botOverview.promptPreview")}),e.jsx(fe,{size:16,className:O("shrink-0 text-ink-secondary transition-transform",a&&"rotate-180")})]}),a&&!t&&n&&e.jsx("div",{className:"mt-3 text-[13px] text-ink-secondary",children:s("botOverview.promptError")}),a&&!t&&!n&&e.jsx("div",{className:"mt-3 text-[13px] text-ink-secondary",children:s("botOverview.loading")}),a&&t&&e.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[t.sections.map(i=>e.jsxs("details",{className:"rounded-lg border border-hairline/40 bg-inset px-3 py-2",children:[e.jsxs("summary",{className:"flex cursor-pointer items-center justify-between gap-3 text-[13px] text-ink",children:[e.jsx("span",{children:i.label}),e.jsx("span",{className:"shrink-0 tabular-nums text-ink-secondary",children:s("botOverview.bytes",{count:i.bytes.toLocaleString(De())})})]}),e.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-[12px] leading-relaxed text-ink",children:i.text})]},i.id)),t.note&&e.jsx("div",{className:"text-[11px] text-ink-secondary",children:t.note})]})]})}function Qi({overview:t,refreshError:n,prompt:a,promptError:o,onOpen:i,onSetup:l}){const[d,m]=x.useState(!1);if(!t)return e.jsx("div",{className:"text-[13px] text-ink-secondary",children:s("botOverview.loading")});const c=(t.setup??[]).filter(u=>!u.done),p=(u,k)=>s(`botOverview.setup.${u}`)||k;return e.jsxs("div",{className:"flex flex-col gap-4",children:[n&&e.jsx("div",{className:"rounded-lg bg-inset px-3 py-2 text-[13px] text-ink-secondary",children:s("botOverview.refreshError")}),c.length>0&&e.jsxs("div",{className:"rounded-xl border border-accent/30 bg-accent/[0.06] p-4",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:s("botSetup.ideas")}),e.jsx("p",{className:"mt-1 text-[13px] text-ink-secondary",children:s("botSetup.optional")}),e.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:c.map(u=>e.jsx("li",{children:u.section?e.jsxs("button",{type:"button",onClick:()=>i(u.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:[e.jsx(ut,{"aria-hidden":"true",size:14,className:"shrink-0 text-ink-secondary"}),e.jsx("span",{className:"flex-1",children:p(u.id,u.label)}),e.jsx(je,{size:14,"aria-hidden":"true",className:"shrink-0 text-ink-secondary rtl:-scale-x-100"})]}):e.jsxs("div",{className:"flex items-center gap-2.5 px-1 py-1 text-[13px] text-ink",children:[e.jsx(ut,{"aria-hidden":"true",size:14,className:"shrink-0 text-ink-secondary"}),e.jsx("span",{children:p(u.id,u.label)})]})},u.id))}),l&&e.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[e.jsxs("button",{type:"button",onClick:l,className:"flex items-center gap-1.5 rounded-lg bg-accent px-3 py-2 text-[13px] font-medium text-accent-ink hover:brightness-110",children:[e.jsx(nt,{size:14})," ",s("botSetup.withBot")]}),e.jsx("span",{className:"text-[12px] text-ink-secondary",children:s("botSetup.help")})]})]}),e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:t.who.name}),t.who.title&&e.jsx("div",{className:"mt-0.5 text-[13px] text-ink-secondary",children:t.who.title}),t.who.blurb&&e.jsx("p",{className:"mt-2 text-[13px] leading-relaxed text-ink",children:t.who.blurb}),t.who.soulLead&&e.jsxs("div",{className:"mt-3 rounded-lg bg-inset px-3 py-2.5",children:[e.jsx("p",{className:"text-[13px] leading-relaxed text-ink-secondary",children:t.who.soulLead}),e.jsx("button",{type:"button",onClick:()=>i("soul"),className:"mt-1.5 rounded-md text-[12px] font-medium text-accent-text hover:underline",children:s("botOverview.readAll")})]})]}),e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:s("botOverview.does")}),t.does.length===0?e.jsx("p",{className:"mt-2 text-[13px] text-ink-secondary",children:s("botOverview.doesEmpty")}):e.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] leading-relaxed text-ink",children:t.does.map((u,k)=>e.jsx("li",{children:Wi(t.doesRoutines?.[k])??Ue(u)},k))})]}),e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:s("botOverview.canReach")}),t.reaches.length===0?e.jsx("p",{className:"mt-2 text-[13px] text-ink-secondary",children:s("botOverview.reachEmpty")}):e.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] leading-relaxed text-ink",children:t.reaches.map((u,k)=>e.jsx("li",{children:Ue(u,t.managedSections)},k))})]}),e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:s("botOverview.wont")}),e.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] leading-relaxed text-ink",children:t.wont.map((u,k)=>e.jsx("li",{children:Ue(u,t.managedSections)},k))})]}),e.jsx(Ji,{data:a,error:o,open:d,onToggle:()=>m(u=>!u)}),e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:s("botOverview.recentChanges")}),e.jsxs("button",{type:"button",onClick:()=>i("history"),className:"shrink-0 text-[12px] text-ink-secondary hover:text-ink",children:[s("botOverview.viewAll")," ",e.jsx(je,{size:14,"aria-hidden":"true",className:"inline align-[-2px] rtl:-scale-x-100"})]})]}),t.recent.length===0?e.jsx("p",{className:"mt-2 text-[13px] text-ink-secondary",children:s("botOverview.recentEmpty")}):e.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] text-ink",children:t.recent.map((u,k)=>e.jsxs("li",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"min-w-0 truncate",children:Yi(u.summary)}),e.jsxs("span",{className:"shrink-0 text-[12px] text-ink-secondary",children:["· ",ss(u.at)]})]},k))})]})]})}function Xi({managementUrl:t}){return e.jsxs("div",{className:"flex flex-col gap-3 text-[13px] leading-relaxed text-ink-secondary",children:[e.jsx("p",{children:s("botSlack.body")}),e.jsxs("a",{href:t,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:[s("botSlack.manage")," ",e.jsx(gs,{size:14,"aria-hidden":"true"})]})]})}function er(t){if(!t||typeof t!="object")return null;const{available:n,managementUrl:a}=t;if(n!==!0||typeof a!="string")return null;try{return new URL(a).protocol==="https:"?a:null}catch{return null}}function Os(t){const[n,a]=x.useState(null);return x.useEffect(()=>{const o=new AbortController;return Z(`/api/bots/${encodeURIComponent(t)}/slack-management`,{signal:o.signal,timeoutMs:1e4}).then(i=>{o.signal.aborted||a({botId:t,url:er(i)})}).catch(()=>{o.signal.aborted||a({botId:t,url:null})}),()=>o.abort()},[t]),n?.botId===t?n.url:null}const Dt="/api/limix/plugins";function Es({bot:t}){const{state:n,dispatch:a}=B(),[o,i]=x.useState(),[l,d]=x.useState(""),[m,r]=x.useState(!1),c=ee().startsWith("vi")?"vi":"en";x.useEffect(()=>{if(n.pluginsOpen)return;const u=new AbortController;return Z(Dt,{signal:u.signal}).then(i).catch(k=>{u.signal.aborted||d(xt(k.message))}),()=>u.abort()},[n.pluginsOpen]);async function p(u,k,f){r(!0),d("");try{i(await Z(Dt,{method:"POST",body:JSON.stringify({action:"assign",target:"bot",key:t.id,id:u,sha256:k,enabled:f})}))}catch(v){d(xt(v instanceof Error?v.message:String(v)))}finally{r(!1)}}return e.jsxs("section",{className:"space-y-3",children:[e.jsx("button",{type:"button",className:ht,onClick:()=>a({type:"togglePlugins",open:!0,surface:"library"}),children:s("plugins.openLibrary")}),l&&e.jsx("p",{role:"alert",className:"text-sm text-danger",children:l}),!o&&!l&&e.jsx("p",{role:"status",className:"text-sm text-ink-secondary",children:ie("Đang tải plugin…","Loading plugins…")}),o?.installed.length===0&&e.jsx("p",{className:"text-sm text-ink-secondary",children:ie("Chưa có plugin sẵn sàng để gắn.","No plugins are ready to attach.")}),o?.installed.map(u=>{const f=!Object.hasOwn(u.bots,t.id)?"inherit":String(u.bots[t.id]),v=nn(u,t,o.installed),j=u.manifest?.source&&!u.allowHostExecution;return e.jsxs("article",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-hairline p-3",children:[e.jsx(an,{icon:u.manifest?.icon??rn(u.id,u.name.en,u.name.vi,...u.requiresMcp),compact:!0}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("h3",{className:"break-words text-sm font-semibold",children:[u.name[c]," ",e.jsxs("small",{className:"text-ink-secondary",children:["v",u.version]})]}),e.jsx("p",{className:"text-xs text-ink-secondary",children:j?ie("Cần duyệt quyền dùng Skill từ xa trong kho","Remote Skill execution consent required in the library"):v?ie("Đang gắn","Attached"):ie("Chưa gắn","Detached")})]}),e.jsxs("select",{className:ht,value:f,disabled:m,"aria-label":u.name[c]+" v"+u.version,onChange:N=>{p(u.id,u.sha256,N.target.value==="inherit"?null:N.target.value==="true")},children:[e.jsx("option",{value:"inherit",children:ie("Theo nhóm","Inherit from team")}),e.jsx("option",{value:"true",disabled:!!j,children:ie("Gắn plugin","Attach plugin")}),e.jsx("option",{value:"false",children:ie("Tắt trên bot","Disable for this bot")})]})]},u.sha256)})]})}const oe="rounded-lg bg-control px-3 py-1.5 text-[13px] text-ink hover:bg-raised-hover disabled:opacity-50",qe="rounded-md px-2 py-1 text-[13px] text-ink-secondary hover:bg-control hover:text-ink disabled:opacity-50",re=t=>t instanceof Error?t.message:String(t);function Rs(t){const n=[],a=(i,l,d)=>{i&&n.push(s(i===1?l:d,{count:i}))};a(t.expired,"memory.upkeep.summary.archived.one","memory.upkeep.summary.archived.many"),a(t.duplicates,"memory.upkeep.summary.merged.one","memory.upkeep.summary.merged.many"),a(t.superseded,"memory.upkeep.summary.crossed.one","memory.upkeep.summary.crossed.many"),a(t.organized,"memory.upkeep.summary.filed.one","memory.upkeep.summary.filed.many");const o=n.length?n.join(", "):s("memory.upkeep.summary.none");return o.charAt(0).toUpperCase()+o.slice(1)}function tr(t,n){const a=t.via==="team-setup"?s("memory.journal.actor.teamSetup"):t.actor==="bot"?n:t.actor==="import"?s("memory.journal.actor.import"):t.actor==="upkeep"?s("memory.journal.actor.upkeep"):s("memory.journal.actor.you"),o=ui(t.path),i=t.path===se?o:t.path===xi?s("memory.journal.instructions"):t.path.startsWith("memory/log/")?s("memory.journal.log",{file:o}):s("memory.journal.topic",{file:o}),l=d=>s(d===1?"memory.journal.line.one":"memory.journal.line.many",{count:d});return t.kind==="created"?s("memory.journal.created",{who:a,topic:i,detail:t.added?s("memory.journal.withLines",{lines:l(t.added)}):""}):t.kind==="deleted"?s("memory.journal.deleted",{who:a,topic:i}):t.added&&!t.removed?s("memory.journal.added",{who:a,lines:l(t.added),topic:i}):t.removed&&!t.added?s("memory.journal.removed",{who:a,lines:l(t.removed),topic:i}):s("memory.journal.rewrote",{who:a,lines:l(Math.max(t.added,t.removed)),topic:i})}function Ts({changed:t,stale:n,busy:a,onReviewed:o}){return e.jsxs("div",{role:"status",className:"rounded-xl border border-danger/40 bg-card p-4",children:[e.jsx("p",{className:"text-[13px] leading-relaxed text-ink",children:s(n?"memory.lendingReviewStale":"memory.lendingReview")}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-[12px] text-ink-secondary",children:s("memory.lendingReviewChanged")}),e.jsx("ul",{className:"mt-1 space-y-0.5",children:t.map(i=>e.jsx("li",{className:"break-all font-mono text-[12px] text-ink",children:i},i))})]}),e.jsx("button",{type:"button",className:O(oe,"mt-3"),disabled:a,onClick:o,children:s("memory.lendingReviewed")})]})}function sr({bot:t,active:n=!0,onToggle:a}){const{capabilities:o}=we(),[i,l]=x.useState(null),[d,m]=x.useState(null),[r,c]=x.useState(null),[p,u]=x.useState(null),[k,f]=x.useState(null),[v,j]=x.useState(null),[N,w]=x.useState(null),[b,h]=x.useState(!1),[P,L]=x.useState(null),[D,$]=x.useState(""),[A,H]=x.useState(null),[I,g]=x.useState(!1),[T,F]=x.useState(null),[_,K]=x.useState(!1),[J,Y]=x.useState(!1),{state:U,dispatch:y}=B(),z=on(U.config),[ce,xe]=x.useState(!1),[ye,E]=x.useState(""),q=async C=>{const[R,$e,Ws]=await Promise.all([rt(t.id),ge(t.id),Pt(t.id).catch(()=>null)]);if(l(R),F(R.lendingReview??null),m($e),H(Ws),C){const Fe=await Ie(t.id,C);c({path:Fe.path,text:Fe.text,hash:Fe.hash,dirty:!1,readOnly:C.startsWith("memory/log/")})}};x.useEffect(()=>{if(!n)return;let C=!1;j(null);const R=r?.dirty===!0;return q(R?void 0:r?.path??se).catch($e=>{C||j(re($e))}),()=>{C=!0}},[n,t.id]);const G=async C=>{j(null),u(null);try{const R=await Ie(t.id,C);c({path:R.path,text:R.text,hash:R.hash,dirty:!1,readOnly:C.startsWith("memory/log/")})}catch(R){j(re(R))}},W=async C=>{if(r){h(!0),j(null);try{const R=await ot(t.id,r.path,r.text,C);if(!R.ok){u({path:r.path,current:R.current,currentHash:R.currentHash});return}u(null),f(null),c({...r,text:R.doc.text,hash:R.doc.hash,dirty:!1}),l(R.overview),m(await ge(t.id))}catch(R){j(re(R))}finally{h(!1)}}},de=()=>{!p||!r||(f(r.text),c({...r,text:p.current,hash:p.currentHash,dirty:!1}),u(null))},Se=async C=>{if(window.confirm(s("memory.confirmDelete",{name:C.name}))){j(null);try{const{overview:R}=await ks(t.id,C.path);l(R),m(await ge(t.id)),r?.path===C.path&&c(null)}catch(R){j(re(R))}}},ct=async()=>{const C=di(D);if(!C){j(s("memory.topicNameError"));return}$(""),await G(`memory/${C}`),c(R=>R&&{...R,dirty:!0,text:R.text||nr(C)})},Hs=async C=>{L(C.id),j(null);try{const R=await js(t.id,C.id);l(R.overview),m(await ge(t.id)),r?.path===C.path&&!r.dirty&&c({...r,text:R.text,hash:R.hash}),w(s("memory.restored",{path:C.path}))}catch(R){j(re(R))}finally{L(null)}},dt=async C=>{j(null),w(null);try{await li(t.id,C)}catch(R){j(re(R))}},_s=()=>{const C=t.memoryUpkeep===!1;y({type:"updateBot",botId:t.id,patch:{memoryUpkeep:C}}),H(R=>R&&{...R,enabled:C})},Ks=async()=>{if(!ce){xe(!0),E("");try{const C=await Z("/api/config",{method:"PATCH",body:JSON.stringify({features:{roomMemoryCapture:!z}})});y({type:"configStatus",config:C})}catch(C){E(C instanceof Error?C.message:s("memory.learnFromRooms.error"))}finally{xe(!1)}}},Us=async()=>{g(!0),j(null),w(null);try{const{report:C,overview:R}=await vs(t.id);l(R),m(await ge(t.id)),H(await Pt(t.id)),r&&!r.dirty&&await G(r.path),w(`${Rs(C)}.${C.note?` ${C.note}`:""}`)}catch(C){j(re(C))}finally{g(!1)}},qs=o.host.homeDir;return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:s("memory.title")}),e.jsxs("label",{className:"mt-3 flex items-center gap-2 text-[13px] text-ink",children:[e.jsx("input",{type:"checkbox",checked:t.memoryEnabled!==!1,disabled:t.busy,onChange:C=>a(C.target.checked)}),s("memory.enable")]}),e.jsxs("p",{className:"mt-1 text-[13px] text-ink-secondary",children:[s("memory.enableHelp"),t.busy?` ${s("memory.busyHelp")}`:""]}),e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:s("memory.notesHelp")}),i&&e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-secondary",title:i.workspacePath,children:at(i.workspacePath,qs)}),e.jsx("button",{type:"button",className:oe,onClick:()=>{dt("obsidian")},children:s("memory.openObsidian")}),e.jsxs("button",{type:"button",className:O(oe,"inline-flex items-center gap-1.5"),onClick:()=>{dt("folder")},children:[e.jsx(ns,{size:14}),s("memory.showFileManager")]})]})]}),T&&e.jsx(Ts,{changed:T.changed,stale:_,busy:J,onReviewed:()=>{Y(!0),bs(t.id,T.token).then(()=>{F(null),K(!1)}).catch(C=>{if(C instanceof as&&C.status===409)return K(!0),q();j(re(C))}).finally(()=>Y(!1))}}),i&&e.jsx(ir,{index:i.index}),t.memoryEnabled!==!1&&e.jsx(ar,{enabled:t.memoryUpkeep!==!1,status:A,tidying:I,onToggle:_s,onTidy:()=>{Us()},rooms:{enabled:z,saving:ce,error:ye,onToggle:()=>{Ks()}}}),r&&e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"truncate font-mono text-[13px] text-ink",children:r.path}),r.path!==se&&e.jsx("button",{type:"button",className:qe,onClick:()=>{G(se)},children:s("memory.backToIndex")})]}),p&&e.jsx(Is,{botName:t.name,busy:b,onReload:de,onOverwrite:()=>{W(p.currentHash)}}),e.jsx("textarea",{className:O(et,"mt-2 min-h-[200px] resize-y font-mono text-[13px] leading-relaxed"),value:r.text,readOnly:r.readOnly,placeholder:r.path===se?s("memory.indexPlaceholder"):s("memory.notePlaceholder"),"aria-label":r.path===se?s("memory.botMemory"):s("memory.fileLabel",{path:r.path}),onChange:C=>c({...r,text:C.target.value,dirty:!0})}),r.readOnly?e.jsx("p",{className:"mt-2 text-[12px] text-ink-secondary",children:s("memory.logsReadOnly")}):e.jsxs("div",{className:"mt-2 flex items-center gap-3",children:[e.jsx("button",{type:"button",onClick:()=>{W(r.hash)},disabled:b||!r.dirty,className:oe,children:b?s("memory.saving"):s("memory.save")}),r.dirty&&e.jsx("button",{type:"button",className:qe,disabled:b,onClick:()=>{G(r.path)},children:s("memory.discard")})]}),k!==null&&e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"mb-1 text-[12px] text-ink-secondary",children:s("memory.unsavedDraft")}),e.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:k}),e.jsx("button",{type:"button",className:O(qe,"mt-1"),onClick:()=>f(null),children:s("memory.dismissDraft")})]})]}),i&&e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsx(Ht,{title:s("memory.topicFiles"),hint:s("memory.topicFilesHint"),files:i.topics,selected:r?.path,onOpen:C=>{G(C.path)},onDelete:C=>{Se(C)}}),e.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[e.jsx("input",{className:O(et,"py-1.5 text-[13px]"),value:D,placeholder:s("memory.newTopicPlaceholder"),"aria-label":s("memory.newTopicLabel"),onChange:C=>$(C.target.value),onKeyDown:C=>{C.key==="Enter"&&ct()}}),e.jsx("button",{type:"button",className:oe,disabled:!D.trim(),onClick:()=>{ct()},children:s("memory.newTopic")})]}),i.logs.length>0&&e.jsx("div",{className:"mt-4",children:e.jsx(Ht,{title:s("memory.dailyLogs"),hint:s("memory.dailyLogsHint"),files:i.logs,selected:r?.path,onOpen:C=>{G(C.path)},onDelete:C=>{Se(C)}})})]}),e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:s("memory.changes")}),e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:s("memory.changesHelp")}),e.jsx("div",{className:"mt-3",children:e.jsx(lt,{rows:d,botName:t.name,reverting:P,onRevert:C=>{Hs(C)}})})]}),N&&e.jsx("div",{className:"text-[13px] text-ink-secondary",children:N}),v&&e.jsx("div",{className:"text-[13px] text-danger",children:v})]})}function nr(t){return`---
|
|
1
|
+
import{c as Ae,t as s,l as ee,aF as Vs,j as e,i as De,ae as fe,a as O,r as x,S as tt,ah as Jt,X as st,d as pt}from"./styles-DW6_pSlc.js";import{fq as Zs,fr as Gs,_ as nt,f3 as Qt,bE as Ys,dq as Xt,C as Js,fs as Qs,ft as Xs,E as es,fu as en,M as ts,eA as tn,p as sn,fv as mt,bu as ut,fw as ss,j as Z,u as B,fx as xt,fy as ht,f4 as ie,fz as nn,fA as an,fB as rn,fC as on,ag as at,af as ns,A as as,S as be,ab as Me,T as is,R as ln,fD as cn,fE as dn,fF as pn,fG as mn,fH as un,fI as gt,fJ as xn,fK as hn,fL as gn,fM as fn,a$ as yn,fN as bn,fO as vn,fP as kn,I as jn,fQ as Oe,bY as Le,fR as wn,aH as M,aN as Q,ek as Nn,dS as Sn,fS as Cn,aI as Ge,cw as Pn,e5 as On,e6 as En,fT as Rn,fU as rs,fV as os,fW as Tn,fX as In,fY as An,fZ as Mn,dV as Ye,aq as ft,f_ as ze,f$ as Ln,g0 as Re,au as Bn,g1 as ls,g2 as yt,aj as Je,g3 as $n,g4 as Fn,g5 as Dn,g6 as cs,g7 as zn,g8 as bt,g9 as Hn,ga as _n,gb as Kn,gc as te,aX as ae,aZ as X,gd as Un,ge as qn,gf as Wn,dc as Vn,aP as Zn,G as Gn,da as ds,ai as Yn,gg as V,aW as me,gh as ue,x as S,gi as Jn,dw as Qn,gj as Be,aY as le,gk as Xn,gl as ea,gm as ta,eo as sa,gn as vt,go as na,gp as aa,gq as ia,gr as ra,gs as oa,gt as la,az as ca,gu as ps,gv as ms,gw as da,gx as pa,gy as ma,gz as ua,gA as xa,gB as ha,gC as ga,gD as fa,gE as ya,gF as us,gG as ba,gH as va,gI as ka,gJ as it,g as ja,B as Qe,gK as wa,gL as Na,gM as Sa,gN as Ca,gO as Pa,gP as Oa,c5 as Ea,gQ as xs,D as kt,gR as Ra,f6 as Ta,gS as jt,gT as Ia,gU as Aa,gV as Ma,cT as wt,bC as La,d9 as Ba,gW as $a,gX as hs,gY as Ce,gZ as Nt,g_ as Fa,aL as He,e7 as Da,g$ as za,aR as Ha,dA as _a,cx as Ka,h0 as Ua,h1 as qa,h2 as Wa,aT as Va}from"./App-CT5e2g7D.js";import{v as gs,d as we,a0 as Te,a1 as Za,a2 as Ga,a3 as St,a4 as _e,a5 as Ya,a6 as Ja,a7 as Qa,a8 as Xa,a9 as ei,aa as Ct,ab as ti,ac as si,L as Ee,M as ni,B as Xe,P as Ne,r as fs,ad as ai,$ as ii,u as ys}from"./PlacesRail-BBWcVP0k.js";import{C as ri}from"./coins-MJbwpEBq.js";import{C as je,a as oi}from"./MenuMotion-DnZ3mfiD.js";import{b as se,m as bs,i as et,f as rt,c as ge,d as Pt,e as Ie,o as li,g as ci,h as pe,n as Ke,t as vs,s as ot,j as ks,k as di,l as pi,p as mi,r as js,q as ui,u as xi,w as hi,x as ws,y as Ns,z as Ot,B as gi,C as Ss,R as Et,D as fi,E as yi,F as bi,G as vi,H as ki,J as ji,O as wi,K as Ni,L as Cs,N as Rt,V as Si,P as Ci,M as Pi,A as Oi,a as Ei,S as Ri,I as Ti}from"./VisibilitySection-D9Vq-wjr.js";import{s as Ii,r as Ai,a as Mi,R as Li}from"./ComputerFilesPane-DbPKCGzt.js";import{M as Tt}from"./monitor-CTZE2syc.js";import{R as Bi}from"./RoutinesPage-izgtqLVW.js";import{S as $i}from"./SignedInSites-BXTobVc6.js";import"./index-DBtvATty.js";import"./org-library-OtoLKtxR.js";import"./package-format-Tdqu3GAa.js";import"./WorksOnGrid-BtVis_N0.js";import"./ProIntroduction-DtAG3s5c.js";import"./remote-desktop-DDRRx8uY.js";const Fi=[["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M21 12.598V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5",key:"1glfrc"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}]],Di=Ae("calendar-plus",Fi);const zi=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],Hi=Ae("library",zi);const _i=[["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"}]],Ps=Ae("slack",_i);const Ki=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Ui=Ae("tag",Ki),qi=[{id:"overview",label:"Overview",labelKey:"botSettings.sections.overview",icon:Zs,keywords:["summary","status","what it does","won't","prompt","what the model sees"]},{id:"identity",label:"Identity",labelKey:"botSettings.sections.identity",icon:Gs,keywords:["name","title","avatar","blurb","instructions"]},{id:"slack",label:"Slack",icon:Ps,keywords:["slack","slack app","admin","message","direct messages","mentions"]},{id:"soul",label:"Soul",labelKey:"botSettings.sections.soul",icon:nt,keywords:["standing instructions","instructions","persona","rules","soul.md"]},{id:"plugins",label:"Plugins",labelKey:"plugins.botMenu",icon:Qt,keywords:["plugin","attach","gắn"]},{id:"skills",label:"Skills",labelKey:"botSettings.sections.skills",icon:Ys,keywords:["skills","learned","procedures","teach"]},{id:"memory",label:"Memory",labelKey:"botSettings.sections.memory",icon:Xt,keywords:["memory","notes","remember","topics"]},{id:"library",label:"Library",labelKey:"botPanel.tab.library",icon:Hi,keywords:["library","made","pages","apps","files","published"]},{id:"routines",label:"Routines",labelKey:"botSettings.sections.routines",icon:Js,keywords:["schedule","routines","cron","tasks"]},{id:"access",label:"Access",labelKey:"botSettings.sections.access",icon:Qs,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",labelKey:"botSettings.sections.model",icon:Xs,keywords:["engine","model","provider","cli","effort"]},{id:"permissions",label:"Permissions",labelKey:"botSettings.sections.permissions",icon:es,keywords:["auto mode","approve","auto approve","review","routine approvals","coordination","chief of staff","section"]},{id:"voice",label:"Voice & alerts",labelKey:"botSettings.sections.voice",icon:en,keywords:["voice","alerts","notifications","speak"]},{id:"visibility",label:"Who can see it",labelKey:"botSettings.visibility.title",icon:ts,keywords:["visibility","who can see","private","people","admins","members","access","hide"]},{id:"history",label:"History",labelKey:"botSettings.sections.history",icon:tn,keywords:["history","changes","undo","rollback","log"]},{id:"usage",label:"Usage",labelKey:"botSettings.sections.usage",icon:ri,keywords:["tokens","cost","billing"]}],It={completed:"botOverview.routine.last.completed",failed:"botOverview.routine.last.failed",missed:"botOverview.routine.last.missed",cancelled:"botOverview.routine.last.cancelled",running:"botOverview.routine.last.running",queued:"botOverview.routine.last.queued",waiting:"botOverview.routine.last.waiting"};function Wi(t,n=ee()){if(!t||n==="en")return null;if(t.paused)return s("botOverview.routine.paused",{name:t.name});const a=t.lastRun;if(a&&!Object.hasOwn(It,a.status))return null;try{return[s("botOverview.routine.line",{schedule:sn(t.schedule),name:t.name}),...t.nextRunAt!=null?[s("botOverview.routine.next",{time:mt(t.nextRunAt)})]:[],...a?[s(It[a.status],{time:mt(a.at)})]:[]].join(" ")}catch{return null}}const At={"Works in its private workspace.":"botOverview.line.privateWorkspace","Has the built-in browser.":"botOverview.line.browser","Has no connected apps.":"botOverview.line.noApps","Won't act on a schedule.":"botOverview.line.noSchedule","Can talk to the other bot.":"botOverview.line.talksToOne","Talks only to the bots chosen for it.":"botOverview.line.talksToChosen","Cannot initiate contact with other bots.":"botOverview.line.noPeerContact","Command approvals use Ask mode; saved permissions and provider rules still apply.":"botOverview.line.askMode","Command approvals follow the provider's custom configuration.":"botOverview.line.customApprovals","Asks before contacting other bots.":"botOverview.line.asksPeers","Can't use a computer.":"botOverview.line.noComputer","Profile proposal cards require your approval.":"botOverview.line.profileApproval","Connected apps could not be checked.":"botOverview.line.appsUnchecked"},Mt={"Auto; availability is checked when a task starts":"botOverview.preference.auto","cloud computer":"botOverview.preference.cloud","Local VM":"botOverview.preference.vm","this computer":"botOverview.preference.local","browser only":"botOverview.preference.browser"};function Lt(t,n){return!n||n.map(a=>a||"General").join(", ")!==t?t:n.map(a=>a||s("botAccess.teams.general")).join(", ")}const Bt=t=>Object.hasOwn(Mt,t)?s(Mt[t]):t,$t=(t,n,a)=>Number(t)===1?n:a,Vi=[{line:/^Can talk to all (\d+) other bots, in any department\.$/,key:()=>"botOverview.line.talksToAll",params:([,t])=>({count:Number(t)})},{line:/^Also in charge of these departments: (.+)\.$/,key:()=>"botOverview.line.alsoInCharge",params:([,t],n)=>({departments:Lt(t,n)})},{line:/^Can talk to (\d+) other bots? in its (?:section|department)\.$/,key:([,t])=>$t(t,"botOverview.line.peersSectionOne","botOverview.line.peersSectionMany"),params:([,t])=>({count:Number(t)})},{line:/^Can talk to (\d+) other bots? in its allowed (?:teams|departments)\.$/,key:([,t])=>$t(t,"botOverview.line.peersTeamsOne","botOverview.line.peersTeamsMany"),params:([,t])=>({count:Number(t)})},{line:/^Coordinates its (?:section|department) as Chief of Staff\.$/,key:()=>"botOverview.line.chief",params:()=>({role:s("sidebar.bot.chiefOfStaff")})},{line:/^May also coordinate these (?:teams|departments): (.+)\.$/,key:()=>"botOverview.line.alsoTeams",params:([,t],n)=>({teams:Lt(t,n)})}],Zi=t=>ee()!=="en"&&Object.hasOwn(Vs[ee()]??{},t);function Gi(t,n){for(const a of Vi){const o=a.line.exec(t);if(!o)continue;const i=a.key(o);return Zi(i)?s(i,a.params(o,n)):t}return null}function Ue(t,n){if(Object.hasOwn(At,t))return s(At[t]);const a=Gi(t,n);if(a!==null)return a;const o=/^Can use (\d+) connected apps?: (.+)\.$/.exec(t);if(o)return s(o[1]==="1"?"botOverview.line.appsOne":"botOverview.line.appsMany",{count:Number(o[1]),apps:o[2]});const i=ee()==="en"?null:/^Computer preference: (.+), which isn't available on My Cloud\.$/.exec(t);if(i)return s("botOverview.line.computerNotOnCloud",{preference:Bt(i[1])});const l=/^Computer preference: (.+)\.$/.exec(t);if(l)return s("botOverview.line.computer",{preference:Bt(l[1])});const d=/^Works in (.+)\.$/.exec(t);if(d)return s("botOverview.line.folder",{folder:d[1]});const m=/^Knows how to (.+)\.$/.exec(t);if(m)return s("botOverview.line.skill",{skill:m[1]});const r=/^Listens for “(.+)” webhooks\.$/.exec(t);return r?s("botOverview.line.webhook",{name:r[1]}):t}const Ft={name:"approval.applied.field.name",title:"approval.applied.field.title",description:"approval.applied.field.description",soul:"approval.applied.field.soul",cwd:"approval.applied.field.cwd",notifications:"approval.applied.field.notifications",speakReplies:"approval.applied.field.speakReplies"};function Yi(t,n=ee()){const a=/^(\w+): /.exec(t)?.[1];return n==="en"||!a||!Object.hasOwn(Ft,a)?t:`${s(Ft[a])}: ${t.slice(a.length+2)}`}function Ji({data:t,error:n,open:a,onToggle:o}){return e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsxs("button",{type:"button",onClick:o,"aria-expanded":a,className:"flex w-full items-center justify-between gap-3 text-left",children:[e.jsx("span",{className:"text-[15px] font-medium text-ink",children:t?s("botOverview.promptPreviewCount",{bytes:t.totalBytes.toLocaleString(De()),tokens:t.approxTokens.toLocaleString(De())}):s("botOverview.promptPreview")}),e.jsx(fe,{size:16,className:O("shrink-0 text-ink-secondary transition-transform",a&&"rotate-180")})]}),a&&!t&&n&&e.jsx("div",{className:"mt-3 text-[13px] text-ink-secondary",children:s("botOverview.promptError")}),a&&!t&&!n&&e.jsx("div",{className:"mt-3 text-[13px] text-ink-secondary",children:s("botOverview.loading")}),a&&t&&e.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[t.sections.map(i=>e.jsxs("details",{className:"rounded-lg border border-hairline/40 bg-inset px-3 py-2",children:[e.jsxs("summary",{className:"flex cursor-pointer items-center justify-between gap-3 text-[13px] text-ink",children:[e.jsx("span",{children:i.label}),e.jsx("span",{className:"shrink-0 tabular-nums text-ink-secondary",children:s("botOverview.bytes",{count:i.bytes.toLocaleString(De())})})]}),e.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-[12px] leading-relaxed text-ink",children:i.text})]},i.id)),t.note&&e.jsx("div",{className:"text-[11px] text-ink-secondary",children:t.note})]})]})}function Qi({overview:t,refreshError:n,prompt:a,promptError:o,onOpen:i,onSetup:l}){const[d,m]=x.useState(!1);if(!t)return e.jsx("div",{className:"text-[13px] text-ink-secondary",children:s("botOverview.loading")});const c=(t.setup??[]).filter(u=>!u.done),p=(u,k)=>s(`botOverview.setup.${u}`)||k;return e.jsxs("div",{className:"flex flex-col gap-4",children:[n&&e.jsx("div",{className:"rounded-lg bg-inset px-3 py-2 text-[13px] text-ink-secondary",children:s("botOverview.refreshError")}),c.length>0&&e.jsxs("div",{className:"rounded-xl border border-accent/30 bg-accent/[0.06] p-4",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:s("botSetup.ideas")}),e.jsx("p",{className:"mt-1 text-[13px] text-ink-secondary",children:s("botSetup.optional")}),e.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:c.map(u=>e.jsx("li",{children:u.section?e.jsxs("button",{type:"button",onClick:()=>i(u.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:[e.jsx(ut,{"aria-hidden":"true",size:14,className:"shrink-0 text-ink-secondary"}),e.jsx("span",{className:"flex-1",children:p(u.id,u.label)}),e.jsx(je,{size:14,"aria-hidden":"true",className:"shrink-0 text-ink-secondary rtl:-scale-x-100"})]}):e.jsxs("div",{className:"flex items-center gap-2.5 px-1 py-1 text-[13px] text-ink",children:[e.jsx(ut,{"aria-hidden":"true",size:14,className:"shrink-0 text-ink-secondary"}),e.jsx("span",{children:p(u.id,u.label)})]})},u.id))}),l&&e.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[e.jsxs("button",{type:"button",onClick:l,className:"flex items-center gap-1.5 rounded-lg bg-accent px-3 py-2 text-[13px] font-medium text-accent-ink hover:brightness-110",children:[e.jsx(nt,{size:14})," ",s("botSetup.withBot")]}),e.jsx("span",{className:"text-[12px] text-ink-secondary",children:s("botSetup.help")})]})]}),e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:t.who.name}),t.who.title&&e.jsx("div",{className:"mt-0.5 text-[13px] text-ink-secondary",children:t.who.title}),t.who.blurb&&e.jsx("p",{className:"mt-2 text-[13px] leading-relaxed text-ink",children:t.who.blurb}),t.who.soulLead&&e.jsxs("div",{className:"mt-3 rounded-lg bg-inset px-3 py-2.5",children:[e.jsx("p",{className:"text-[13px] leading-relaxed text-ink-secondary",children:t.who.soulLead}),e.jsx("button",{type:"button",onClick:()=>i("soul"),className:"mt-1.5 rounded-md text-[12px] font-medium text-accent-text hover:underline",children:s("botOverview.readAll")})]})]}),e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:s("botOverview.does")}),t.does.length===0?e.jsx("p",{className:"mt-2 text-[13px] text-ink-secondary",children:s("botOverview.doesEmpty")}):e.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] leading-relaxed text-ink",children:t.does.map((u,k)=>e.jsx("li",{children:Wi(t.doesRoutines?.[k])??Ue(u)},k))})]}),e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:s("botOverview.canReach")}),t.reaches.length===0?e.jsx("p",{className:"mt-2 text-[13px] text-ink-secondary",children:s("botOverview.reachEmpty")}):e.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] leading-relaxed text-ink",children:t.reaches.map((u,k)=>e.jsx("li",{children:Ue(u,t.managedSections)},k))})]}),e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:s("botOverview.wont")}),e.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] leading-relaxed text-ink",children:t.wont.map((u,k)=>e.jsx("li",{children:Ue(u,t.managedSections)},k))})]}),e.jsx(Ji,{data:a,error:o,open:d,onToggle:()=>m(u=>!u)}),e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:s("botOverview.recentChanges")}),e.jsxs("button",{type:"button",onClick:()=>i("history"),className:"shrink-0 text-[12px] text-ink-secondary hover:text-ink",children:[s("botOverview.viewAll")," ",e.jsx(je,{size:14,"aria-hidden":"true",className:"inline align-[-2px] rtl:-scale-x-100"})]})]}),t.recent.length===0?e.jsx("p",{className:"mt-2 text-[13px] text-ink-secondary",children:s("botOverview.recentEmpty")}):e.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] text-ink",children:t.recent.map((u,k)=>e.jsxs("li",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"min-w-0 truncate",children:Yi(u.summary)}),e.jsxs("span",{className:"shrink-0 text-[12px] text-ink-secondary",children:["· ",ss(u.at)]})]},k))})]})]})}function Xi({managementUrl:t}){return e.jsxs("div",{className:"flex flex-col gap-3 text-[13px] leading-relaxed text-ink-secondary",children:[e.jsx("p",{children:s("botSlack.body")}),e.jsxs("a",{href:t,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:[s("botSlack.manage")," ",e.jsx(gs,{size:14,"aria-hidden":"true"})]})]})}function er(t){if(!t||typeof t!="object")return null;const{available:n,managementUrl:a}=t;if(n!==!0||typeof a!="string")return null;try{return new URL(a).protocol==="https:"?a:null}catch{return null}}function Os(t){const[n,a]=x.useState(null);return x.useEffect(()=>{const o=new AbortController;return Z(`/api/bots/${encodeURIComponent(t)}/slack-management`,{signal:o.signal,timeoutMs:1e4}).then(i=>{o.signal.aborted||a({botId:t,url:er(i)})}).catch(()=>{o.signal.aborted||a({botId:t,url:null})}),()=>o.abort()},[t]),n?.botId===t?n.url:null}const Dt="/api/limix/plugins";function Es({bot:t}){const{state:n,dispatch:a}=B(),[o,i]=x.useState(),[l,d]=x.useState(""),[m,r]=x.useState(!1),c=ee().startsWith("vi")?"vi":"en";x.useEffect(()=>{if(n.pluginsOpen)return;const u=new AbortController;return Z(Dt,{signal:u.signal}).then(i).catch(k=>{u.signal.aborted||d(xt(k.message))}),()=>u.abort()},[n.pluginsOpen]);async function p(u,k,f){r(!0),d("");try{i(await Z(Dt,{method:"POST",body:JSON.stringify({action:"assign",target:"bot",key:t.id,id:u,sha256:k,enabled:f})}))}catch(v){d(xt(v instanceof Error?v.message:String(v)))}finally{r(!1)}}return e.jsxs("section",{className:"space-y-3",children:[e.jsx("button",{type:"button",className:ht,onClick:()=>a({type:"togglePlugins",open:!0,surface:"library"}),children:s("plugins.openLibrary")}),l&&e.jsx("p",{role:"alert",className:"text-sm text-danger",children:l}),!o&&!l&&e.jsx("p",{role:"status",className:"text-sm text-ink-secondary",children:ie("Đang tải plugin…","Loading plugins…")}),o?.installed.length===0&&e.jsx("p",{className:"text-sm text-ink-secondary",children:ie("Chưa có plugin sẵn sàng để gắn.","No plugins are ready to attach.")}),o?.installed.map(u=>{const f=!Object.hasOwn(u.bots,t.id)?"inherit":String(u.bots[t.id]),v=nn(u,t,o.installed),j=u.manifest?.source&&!u.allowHostExecution;return e.jsxs("article",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-hairline p-3",children:[e.jsx(an,{icon:u.manifest?.icon??rn(u.id,u.name.en,u.name.vi,...u.requiresMcp),compact:!0}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("h3",{className:"break-words text-sm font-semibold",children:[u.name[c]," ",e.jsxs("small",{className:"text-ink-secondary",children:["v",u.version]})]}),e.jsx("p",{className:"text-xs text-ink-secondary",children:j?ie("Cần duyệt quyền dùng Skill từ xa trong kho","Remote Skill execution consent required in the library"):v?ie("Đang gắn","Attached"):ie("Chưa gắn","Detached")})]}),e.jsxs("select",{className:ht,value:f,disabled:m,"aria-label":u.name[c]+" v"+u.version,onChange:N=>{p(u.id,u.sha256,N.target.value==="inherit"?null:N.target.value==="true")},children:[e.jsx("option",{value:"inherit",children:ie("Theo nhóm","Inherit from team")}),e.jsx("option",{value:"true",disabled:!!j,children:ie("Gắn plugin","Attach plugin")}),e.jsx("option",{value:"false",children:ie("Tắt trên bot","Disable for this bot")})]})]},u.sha256)})]})}const oe="rounded-lg bg-control px-3 py-1.5 text-[13px] text-ink hover:bg-raised-hover disabled:opacity-50",qe="rounded-md px-2 py-1 text-[13px] text-ink-secondary hover:bg-control hover:text-ink disabled:opacity-50",re=t=>t instanceof Error?t.message:String(t);function Rs(t){const n=[],a=(i,l,d)=>{i&&n.push(s(i===1?l:d,{count:i}))};a(t.expired,"memory.upkeep.summary.archived.one","memory.upkeep.summary.archived.many"),a(t.duplicates,"memory.upkeep.summary.merged.one","memory.upkeep.summary.merged.many"),a(t.superseded,"memory.upkeep.summary.crossed.one","memory.upkeep.summary.crossed.many"),a(t.organized,"memory.upkeep.summary.filed.one","memory.upkeep.summary.filed.many");const o=n.length?n.join(", "):s("memory.upkeep.summary.none");return o.charAt(0).toUpperCase()+o.slice(1)}function tr(t,n){const a=t.via==="team-setup"?s("memory.journal.actor.teamSetup"):t.actor==="bot"?n:t.actor==="import"?s("memory.journal.actor.import"):t.actor==="upkeep"?s("memory.journal.actor.upkeep"):s("memory.journal.actor.you"),o=ui(t.path),i=t.path===se?o:t.path===xi?s("memory.journal.instructions"):t.path.startsWith("memory/log/")?s("memory.journal.log",{file:o}):s("memory.journal.topic",{file:o}),l=d=>s(d===1?"memory.journal.line.one":"memory.journal.line.many",{count:d});return t.kind==="created"?s("memory.journal.created",{who:a,topic:i,detail:t.added?s("memory.journal.withLines",{lines:l(t.added)}):""}):t.kind==="deleted"?s("memory.journal.deleted",{who:a,topic:i}):t.added&&!t.removed?s("memory.journal.added",{who:a,lines:l(t.added),topic:i}):t.removed&&!t.added?s("memory.journal.removed",{who:a,lines:l(t.removed),topic:i}):s("memory.journal.rewrote",{who:a,lines:l(Math.max(t.added,t.removed)),topic:i})}function Ts({changed:t,stale:n,busy:a,onReviewed:o}){return e.jsxs("div",{role:"status",className:"rounded-xl border border-danger/40 bg-card p-4",children:[e.jsx("p",{className:"text-[13px] leading-relaxed text-ink",children:s(n?"memory.lendingReviewStale":"memory.lendingReview")}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-[12px] text-ink-secondary",children:s("memory.lendingReviewChanged")}),e.jsx("ul",{className:"mt-1 space-y-0.5",children:t.map(i=>e.jsx("li",{className:"break-all font-mono text-[12px] text-ink",children:i},i))})]}),e.jsx("button",{type:"button",className:O(oe,"mt-3"),disabled:a,onClick:o,children:s("memory.lendingReviewed")})]})}function sr({bot:t,active:n=!0,onToggle:a}){const{capabilities:o}=we(),[i,l]=x.useState(null),[d,m]=x.useState(null),[r,c]=x.useState(null),[p,u]=x.useState(null),[k,f]=x.useState(null),[v,j]=x.useState(null),[N,w]=x.useState(null),[b,h]=x.useState(!1),[P,L]=x.useState(null),[D,$]=x.useState(""),[A,H]=x.useState(null),[I,g]=x.useState(!1),[T,F]=x.useState(null),[_,K]=x.useState(!1),[J,Y]=x.useState(!1),{state:U,dispatch:y}=B(),z=on(U.config),[ce,xe]=x.useState(!1),[ye,E]=x.useState(""),q=async C=>{const[R,$e,Ws]=await Promise.all([rt(t.id),ge(t.id),Pt(t.id).catch(()=>null)]);if(l(R),F(R.lendingReview??null),m($e),H(Ws),C){const Fe=await Ie(t.id,C);c({path:Fe.path,text:Fe.text,hash:Fe.hash,dirty:!1,readOnly:C.startsWith("memory/log/")})}};x.useEffect(()=>{if(!n)return;let C=!1;j(null);const R=r?.dirty===!0;return q(R?void 0:r?.path??se).catch($e=>{C||j(re($e))}),()=>{C=!0}},[n,t.id]);const G=async C=>{j(null),u(null);try{const R=await Ie(t.id,C);c({path:R.path,text:R.text,hash:R.hash,dirty:!1,readOnly:C.startsWith("memory/log/")})}catch(R){j(re(R))}},W=async C=>{if(r){h(!0),j(null);try{const R=await ot(t.id,r.path,r.text,C);if(!R.ok){u({path:r.path,current:R.current,currentHash:R.currentHash});return}u(null),f(null),c({...r,text:R.doc.text,hash:R.doc.hash,dirty:!1}),l(R.overview),m(await ge(t.id))}catch(R){j(re(R))}finally{h(!1)}}},de=()=>{!p||!r||(f(r.text),c({...r,text:p.current,hash:p.currentHash,dirty:!1}),u(null))},Se=async C=>{if(window.confirm(s("memory.confirmDelete",{name:C.name}))){j(null);try{const{overview:R}=await ks(t.id,C.path);l(R),m(await ge(t.id)),r?.path===C.path&&c(null)}catch(R){j(re(R))}}},ct=async()=>{const C=di(D);if(!C){j(s("memory.topicNameError"));return}$(""),await G(`memory/${C}`),c(R=>R&&{...R,dirty:!0,text:R.text||nr(C)})},Hs=async C=>{L(C.id),j(null);try{const R=await js(t.id,C.id);l(R.overview),m(await ge(t.id)),r?.path===C.path&&!r.dirty&&c({...r,text:R.text,hash:R.hash}),w(s("memory.restored",{path:C.path}))}catch(R){j(re(R))}finally{L(null)}},dt=async C=>{j(null),w(null);try{await li(t.id,C)}catch(R){j(re(R))}},_s=()=>{const C=t.memoryUpkeep===!1;y({type:"updateBot",botId:t.id,patch:{memoryUpkeep:C}}),H(R=>R&&{...R,enabled:C})},Ks=async()=>{if(!ce){xe(!0),E("");try{const C=await Z("/api/config",{method:"PATCH",body:JSON.stringify({features:{roomMemoryCapture:!z}})});y({type:"configStatus",config:C})}catch(C){E(C instanceof Error?C.message:s("memory.learnFromRooms.error"))}finally{xe(!1)}}},Us=async()=>{g(!0),j(null),w(null);try{const{report:C,overview:R}=await vs(t.id);l(R),m(await ge(t.id)),H(await Pt(t.id)),r&&!r.dirty&&await G(r.path),w(`${Rs(C)}.${C.note?` ${C.note}`:""}`)}catch(C){j(re(C))}finally{g(!1)}},qs=o.host.homeDir;return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:s("memory.title")}),e.jsxs("label",{className:"mt-3 flex items-center gap-2 text-[13px] text-ink",children:[e.jsx("input",{type:"checkbox",checked:t.memoryEnabled!==!1,disabled:t.busy,onChange:C=>a(C.target.checked)}),s("memory.enable")]}),e.jsxs("p",{className:"mt-1 text-[13px] text-ink-secondary",children:[s("memory.enableHelp"),t.busy?` ${s("memory.busyHelp")}`:""]}),e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:s("memory.notesHelp")}),i&&e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-secondary",title:i.workspacePath,children:at(i.workspacePath,qs)}),e.jsx("button",{type:"button",className:oe,onClick:()=>{dt("obsidian")},children:s("memory.openObsidian")}),e.jsxs("button",{type:"button",className:O(oe,"inline-flex items-center gap-1.5"),onClick:()=>{dt("folder")},children:[e.jsx(ns,{size:14}),s("memory.showFileManager")]})]})]}),T&&e.jsx(Ts,{changed:T.changed,stale:_,busy:J,onReviewed:()=>{Y(!0),bs(t.id,T.token).then(()=>{F(null),K(!1)}).catch(C=>{if(C instanceof as&&C.status===409)return K(!0),q();j(re(C))}).finally(()=>Y(!1))}}),i&&e.jsx(ir,{index:i.index}),t.memoryEnabled!==!1&&e.jsx(ar,{enabled:t.memoryUpkeep!==!1,status:A,tidying:I,onToggle:_s,onTidy:()=>{Us()},rooms:{enabled:z,saving:ce,error:ye,onToggle:()=>{Ks()}}}),r&&e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"truncate font-mono text-[13px] text-ink",children:r.path}),r.path!==se&&e.jsx("button",{type:"button",className:qe,onClick:()=>{G(se)},children:s("memory.backToIndex")})]}),p&&e.jsx(Is,{botName:t.name,busy:b,onReload:de,onOverwrite:()=>{W(p.currentHash)}}),e.jsx("textarea",{className:O(et,"mt-2 min-h-[200px] resize-y font-mono text-[13px] leading-relaxed"),value:r.text,readOnly:r.readOnly,placeholder:r.path===se?s("memory.indexPlaceholder"):s("memory.notePlaceholder"),"aria-label":r.path===se?s("memory.botMemory"):s("memory.fileLabel",{path:r.path}),onChange:C=>c({...r,text:C.target.value,dirty:!0})}),r.readOnly?e.jsx("p",{className:"mt-2 text-[12px] text-ink-secondary",children:s("memory.logsReadOnly")}):e.jsxs("div",{className:"mt-2 flex items-center gap-3",children:[e.jsx("button",{type:"button",onClick:()=>{W(r.hash)},disabled:b||!r.dirty,className:oe,children:b?s("memory.saving"):s("memory.save")}),r.dirty&&e.jsx("button",{type:"button",className:qe,disabled:b,onClick:()=>{G(r.path)},children:s("memory.discard")})]}),k!==null&&e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"mb-1 text-[12px] text-ink-secondary",children:s("memory.unsavedDraft")}),e.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:k}),e.jsx("button",{type:"button",className:O(qe,"mt-1"),onClick:()=>f(null),children:s("memory.dismissDraft")})]})]}),i&&e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsx(Ht,{title:s("memory.topicFiles"),hint:s("memory.topicFilesHint"),files:i.topics,selected:r?.path,onOpen:C=>{G(C.path)},onDelete:C=>{Se(C)}}),e.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[e.jsx("input",{className:O(et,"py-1.5 text-[13px]"),value:D,placeholder:s("memory.newTopicPlaceholder"),"aria-label":s("memory.newTopicLabel"),onChange:C=>$(C.target.value),onKeyDown:C=>{C.key==="Enter"&&ct()}}),e.jsx("button",{type:"button",className:oe,disabled:!D.trim(),onClick:()=>{ct()},children:s("memory.newTopic")})]}),i.logs.length>0&&e.jsx("div",{className:"mt-4",children:e.jsx(Ht,{title:s("memory.dailyLogs"),hint:s("memory.dailyLogsHint"),files:i.logs,selected:r?.path,onOpen:C=>{G(C.path)},onDelete:C=>{Se(C)}})})]}),e.jsxs("div",{className:"rounded-xl bg-card p-4",children:[e.jsx("div",{className:"text-[15px] font-medium text-ink",children:s("memory.changes")}),e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:s("memory.changesHelp")}),e.jsx("div",{className:"mt-3",children:e.jsx(lt,{rows:d,botName:t.name,reverting:P,onRevert:C=>{Hs(C)}})})]}),N&&e.jsx("div",{className:"text-[13px] text-ink-secondary",children:N}),v&&e.jsx("div",{className:"text-[13px] text-danger",children:v})]})}function nr(t){return`---
|
|
2
2
|
title: ${t.replace(/\.md$/,"")}
|
|
3
3
|
description:
|
|
4
4
|
aliases: []
|