@bigduu/lotus 2026.6.23 → 2026.6.26
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/App-CRFTsGMB.js +247 -0
- package/dist/assets/{MetricsService-B8_IszlG.js → MetricsService-DUfJDZyH.js} +1 -1
- package/dist/assets/{SubAgentsPanel-CvhOV-c7.js → SubAgentsPanel-D0X4f9jb.js} +1 -1
- package/dist/assets/{architectureDiagram-3BPJPVTR-2nkyLTJ0.js → architectureDiagram-3BPJPVTR-BFXo-VEz.js} +1 -1
- package/dist/assets/{blockDiagram-GPEHLZMM-CbLwOUHN.js → blockDiagram-GPEHLZMM-BNhzk_gV.js} +1 -1
- package/dist/assets/{c4Diagram-AAUBKEIU-0lmJ5kGt.js → c4Diagram-AAUBKEIU-B5jD-yPL.js} +1 -1
- package/dist/assets/{chunk-2J33WTMH-DWXnR26v.js → chunk-2J33WTMH-Blmsjzju.js} +1 -1
- package/dist/assets/{chunk-4BX2VUAB-BSKwtgCI.js → chunk-4BX2VUAB-2EhOUzZS.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-DwyPltJW.js → chunk-55IACEB6-DOcpt0uI.js} +1 -1
- package/dist/assets/{chunk-727SXJPM-CikvpeHt.js → chunk-727SXJPM-C1NdjGys.js} +1 -1
- package/dist/assets/{chunk-AQP2D5EJ-Bg0KcJ9N.js → chunk-AQP2D5EJ-Djnhb8St.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-COPPULhs.js → chunk-FMBD7UC4-mo0-OzhE.js} +1 -1
- package/dist/assets/{chunk-ND2GUHAM-CmzQr1-Z.js → chunk-ND2GUHAM-l5q6f3Nx.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-CU2pDZqn.js → chunk-QZHKN3VN-BxeMLSqi.js} +1 -1
- package/dist/assets/classDiagram-4FO5ZUOK-VLZhJODR.js +1 -0
- package/dist/assets/classDiagram-v2-Q7XG4LA2-VLZhJODR.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-BXYWHvKa.js → cose-bilkent-S5V4N54A-CSLTCMOd.js} +1 -1
- package/dist/assets/{dagre-BM42HDAG-CQSkfGsK.js → dagre-BM42HDAG-CsBd-Was.js} +1 -1
- package/dist/assets/{diagram-2AECGRRQ-zujFbSpQ.js → diagram-2AECGRRQ-Dn3vtYgI.js} +1 -1
- package/dist/assets/{diagram-5GNKFQAL-Dali70FY.js → diagram-5GNKFQAL-BNMn4TOI.js} +1 -1
- package/dist/assets/{diagram-KO2AKTUF-DghZ87J6.js → diagram-KO2AKTUF-C7W9zoOH.js} +1 -1
- package/dist/assets/{diagram-LMA3HP47-BZ1liN7z.js → diagram-LMA3HP47-DSQE34LA.js} +1 -1
- package/dist/assets/{diagram-OG6HWLK6-0sz-Q2cB.js → diagram-OG6HWLK6-Co9qLJiy.js} +1 -1
- package/dist/assets/{erDiagram-TEJ5UH35-cS2w571Z.js → erDiagram-TEJ5UH35-CL-Zm8qj.js} +1 -1
- package/dist/assets/{flowDiagram-I6XJVG4X-ByZ70eYT.js → flowDiagram-I6XJVG4X-B7MAAL1G.js} +1 -1
- package/dist/assets/{ganttDiagram-6RSMTGT7-Cc5W9w92.js → ganttDiagram-6RSMTGT7-BGoPW8bJ.js} +1 -1
- package/dist/assets/{gitGraphDiagram-PVQCEYII-BqWsLCP5.js → gitGraphDiagram-PVQCEYII-DHpwnfdj.js} +1 -1
- package/dist/assets/{index-mAMrjGkV.js → index-BCDHb7mH.js} +1 -1
- package/dist/assets/{index-CDvXkcTq.js → index-C-QOQwoQ.js} +1 -1
- package/dist/assets/{index-CVmMD6f7.js → index-CCL2vKd8.js} +1 -1
- package/dist/assets/{index-D8x5uRgd.js → index-CYcW9w9D.js} +1 -1
- package/dist/assets/{index-D4WsYCkG.js → index-DKo_9DhU.js} +1 -1
- package/dist/assets/{index-CNsWlj9t.js → index-Dfoq0KBM.js} +1 -1
- package/dist/assets/{index-BH-PfXfq.js → index-Drju2NyR.js} +1 -1
- package/dist/assets/{index-C9ew4UXr.js → index-DyHR2_do.js} +1 -1
- package/dist/assets/{index-CpWNAcB7.js → index-Y2j9ZRvj.js} +1 -1
- package/dist/assets/{index-CIo24N7M.js → index-Z7vs9OcW.js} +1 -1
- package/dist/assets/{index-DWXGLvxt.js → index-kTyuHx74.js} +3 -3
- package/dist/assets/{index-CPHX2yrE.js → index-w5MP8BGs.js} +1 -1
- package/dist/assets/{infoDiagram-5YYISTIA-BeMsPrc2.js → infoDiagram-5YYISTIA-BmTTSAny.js} +1 -1
- package/dist/assets/{ishikawaDiagram-YF4QCWOH-DfyjUZRz.js → ishikawaDiagram-YF4QCWOH-XgjodQZ8.js} +1 -1
- package/dist/assets/{journeyDiagram-JHISSGLW-BYc0Szfd.js → journeyDiagram-JHISSGLW-C2YvnTug.js} +1 -1
- package/dist/assets/{kanban-definition-UN3LZRKU-9llJkvww.js → kanban-definition-UN3LZRKU-JM2pFj8-.js} +1 -1
- package/dist/assets/{main-C7nOqZcu.js → main-E45DhYyG.js} +5 -5
- package/dist/assets/{mindmap-definition-RKZ34NQL-B2c6m9x5.js → mindmap-definition-RKZ34NQL-PPHY1nkx.js} +1 -1
- package/dist/assets/{pieDiagram-4H26LBE5-DRJNdkth.js → pieDiagram-4H26LBE5-NoLuv2k1.js} +1 -1
- package/dist/assets/{quadrantDiagram-W4KKPZXB-CQw9CpXi.js → quadrantDiagram-W4KKPZXB-YYxhnNBQ.js} +1 -1
- package/dist/assets/{requirementDiagram-4Y6WPE33-DJ3ErsTW.js → requirementDiagram-4Y6WPE33-DEyRXHdX.js} +1 -1
- package/dist/assets/{sankeyDiagram-5OEKKPKP-cxVJW8A2.js → sankeyDiagram-5OEKKPKP-Caq1_ucN.js} +1 -1
- package/dist/assets/{sequenceDiagram-3UESZ5HK-D290MmqG.js → sequenceDiagram-3UESZ5HK-CyQsO0Pz.js} +1 -1
- package/dist/assets/{stateDiagram-AJRCARHV-7d2K0Drq.js → stateDiagram-AJRCARHV-BjyVE39q.js} +1 -1
- package/dist/assets/{stateDiagram-v2-BHNVJYJU-BxHUkF3A.js → stateDiagram-v2-BHNVJYJU-5Udk9-FJ.js} +1 -1
- package/dist/assets/{timeline-definition-PNZ67QCA-B5BtKGJa.js → timeline-definition-PNZ67QCA-BGHFS72k.js} +1 -1
- package/dist/assets/{vendor-charts-Co-LohmQ.js → vendor-charts-B0oOokFC.js} +1 -1
- package/dist/assets/{vendor-mermaid-DcRRWl2E.js → vendor-mermaid-Dwc97-kL.js} +3 -3
- package/dist/assets/{vendor-pdf-D7lWmOLr.js → vendor-pdf-Wd0qB6Sw.js} +3 -3
- package/dist/assets/{vennDiagram-CIIHVFJN-gvXAK62J.js → vennDiagram-CIIHVFJN-C5bUcdZY.js} +1 -1
- package/dist/assets/{wardley-L42UT6IY-CVQ-_FMj.js → wardley-L42UT6IY-CrAM_kAt.js} +1 -1
- package/dist/assets/{wardleyDiagram-YWT4CUSO-Dm6VVvnZ.js → wardleyDiagram-YWT4CUSO-Cia6B6z8.js} +1 -1
- package/dist/assets/{xychartDiagram-2RQKCTM6-BxN_uDxy.js → xychartDiagram-2RQKCTM6-NWufVhZP.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +2 -1
- package/dist/assets/App-CT7lFARI.js +0 -247
- package/dist/assets/classDiagram-4FO5ZUOK-DYwK7czf.js +0 -1
- package/dist/assets/classDiagram-v2-Q7XG4LA2-DYwK7czf.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./vendor-markdown-teEfNS9t.js";import{u as g,a as c,i as m}from"./vendor-i18n-Dm-c3D_C.js";import{u as p,g as y,E as T}from"./App-
|
|
1
|
+
import{j as s}from"./vendor-markdown-teEfNS9t.js";import{u as g,a as c,i as m}from"./vendor-i18n-Dm-c3D_C.js";import{u as p,g as y,E as T}from"./App-CRFTsGMB.js";import{t as v,ag as S,ah as R,F as w,W as k,Z as A,ad as I,x as b,G as M}from"./vendor-antd-qu012Od4.js";import"./vendor-mermaid-Dwc97-kL.js";import"./main-E45DhYyG.js";const C=5,D=5,$=5,E=o=>{if(!o)return"";try{const n=Date.now()-new Date(o).getTime();if(n<0)return"";const t=Math.floor(n/1e3);if(t<60)return m.t("chat.home.justNow");const l=Math.floor(t/60);if(l<60)return m.t("chat.home.minutesAgo",{count:l});const i=Math.floor(l/60);if(i<24)return m.t("chat.home.hoursAgo",{count:i});const r=Math.floor(i/24);return r<30?m.t("chat.home.daysAgo",{count:r}):new Date(o).toLocaleDateString()}catch{return""}},P=(o,n)=>n?"is-running":o.lastRunStatus==="error"?"is-error":o.pinned?"is-pinned":"is-idle",x=({chat:o,onOpen:n,textSecondary:t})=>{const{t:l}=g(),i=p(y(o.id)),r=o.config.workspacePath?o.config.workspacePath.split("/").pop()||o.config.workspacePath:null;return s.jsxs("button",{type:"button",className:"lotus-home-session-item",onClick:()=>n(o.id),children:[s.jsx("span",{className:`lotus-home-session-status ${P(o,i)}`}),s.jsxs("span",{className:"lotus-home-session-content",children:[s.jsx("span",{className:"lotus-home-session-title",children:o.title}),s.jsxs("span",{className:"lotus-home-session-meta",style:{color:t},children:[s.jsx("span",{children:E(o.updatedAt)}),r?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"lotus-home-session-meta-sep"}),s.jsxs("span",{children:[s.jsx(A,{style:{marginRight:3}}),r]})]}):null,o.messageCount!=null?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"lotus-home-session-meta-sep"}),s.jsxs("span",{children:[s.jsx(I,{style:{marginRight:3}}),o.messageCount]})]}):null]})]}),i?s.jsx(b,{color:"green",bordered:!1,style:{margin:0,fontSize:11},children:l("chat.home.running")}):null,s.jsx(M,{className:"lotus-home-session-arrow"})]})},L=({onOpenSession:o})=>{const{t:n}=g(),{token:t}=v.useToken(),l=p(e=>e.chats),i=c.useCallback(e=>y(e)(p.getState()),[]),r=c.useMemo(()=>l.filter(e=>i(e.id)).slice(0,D),[l,i]),d=c.useMemo(()=>l.filter(e=>e.pinned&&!i(e.id)).slice(0,$),[l,i]),j=c.useMemo(()=>{const e=new Set(r.map(a=>a.id)),f=new Set(d.map(a=>a.id));return l.filter(a=>a.kind!=="child"&&!e.has(a.id)&&!f.has(a.id)).sort((a,h)=>{const N=a.updatedAt?new Date(a.updatedAt).getTime():a.createdAt;return(h.updatedAt?new Date(h.updatedAt).getTime():h.createdAt)-N}).slice(0,C)},[l,r,d]),u=c.useCallback(e=>{o(e)},[o]);return s.jsx("div",{className:"lotus-home-dashboard",children:s.jsxs("div",{className:"lotus-home-dashboard-inner",children:[s.jsxs("div",{className:"lotus-home-header",children:[s.jsx("span",{className:"lotus-home-header-icon",style:{background:`${t.colorPrimary}15`,color:t.colorPrimary},children:s.jsx(S,{})}),s.jsxs("div",{className:"lotus-home-header-text",children:[s.jsx("h2",{style:{color:t.colorText},children:n("home.title","Welcome to Bodhi")}),s.jsx("p",{style:{color:t.colorTextSecondary},children:n("home.subtitle","Here's an overview of your workspace.")})]})]}),s.jsx("div",{className:"lotus-home-launcher-shell","data-tour-id":"task-templates",children:s.jsx(T,{embedded:!0,layoutMode:"staggered"})}),s.jsxs("div",{className:"lotus-home-secondary-sections",children:[r.length>0?s.jsxs("div",{className:"lotus-home-section",children:[s.jsxs("div",{className:"lotus-home-section-title",style:{color:t.colorTextSecondary},children:[s.jsx(R,{className:"lotus-home-section-icon",style:{color:t.colorSuccess}}),s.jsx("span",{children:n("home.sections.running","Running Now")})]}),s.jsx("div",{className:"lotus-home-session-list",children:r.map(e=>s.jsx(x,{chat:e,onOpen:u,textSecondary:t.colorTextTertiary},e.id))})]}):null,d.length>0?s.jsxs("div",{className:"lotus-home-section",children:[s.jsxs("div",{className:"lotus-home-section-title",style:{color:t.colorTextSecondary},children:[s.jsx(w,{className:"lotus-home-section-icon",style:{color:"var(--lotus-gold)"}}),s.jsx("span",{children:n("home.sections.pinned","Pinned")})]}),s.jsx("div",{className:"lotus-home-session-list",children:d.map(e=>s.jsx(x,{chat:e,onOpen:u,textSecondary:t.colorTextTertiary},e.id))})]}):null,j.length>0?s.jsxs("div",{className:"lotus-home-section",children:[s.jsxs("div",{className:"lotus-home-section-title",style:{color:t.colorTextSecondary},children:[s.jsx(k,{className:"lotus-home-section-icon"}),s.jsx("span",{children:n("home.sections.recent","Recent Sessions")})]}),s.jsx("div",{className:"lotus-home-session-list",children:j.map(e=>s.jsx(x,{chat:e,onOpen:u,textSecondary:t.colorTextTertiary},e.id))})]}):null,l.length===0?s.jsx("div",{className:"lotus-home-empty-hint",style:{color:t.colorTextTertiary},children:n("home.empty","No sessions yet. Create one to get started!")}):null]})]})})};export{L as HomeDashboard,L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./vendor-markdown-teEfNS9t.js";import{z as $,B,D as v}from"./App-
|
|
1
|
+
import{j as a}from"./vendor-markdown-teEfNS9t.js";import{z as $,B,D as v}from"./App-CRFTsGMB.js";import{a as l,u as E}from"./vendor-i18n-Dm-c3D_C.js";import{a0 as T,t as M,x as L,ao as D,ap as K,ah as z,Z as F}from"./vendor-antd-qu012Od4.js";import"./vendor-mermaid-Dwc97-kL.js";import"./main-E45DhYyG.js";const X=({visible:p,searchText:k,onSelect:j,onCancel:g,onAutoComplete:f})=>{const[o,i]=l.useState([]),[c,R]=l.useState([]),[d,u]=l.useState(0),[N,I]=l.useState(!1),S=l.useRef(null),h=l.useRef(null);l.useEffect(()=>{if(!p)return;const s=$.getInstance();(async()=>{I(!0);try{const r=await s.listCommands();B("[CommandSelector]","[CommandSelector] Fetched commands:",r),i(r),u(0)}catch(r){console.error("[CommandSelector] Failed to fetch commands:",r),i([])}finally{I(!1)}})()},[p]),l.useEffect(()=>{const s=o.filter(e=>{var x,y,b,C,w;const r=k.toLowerCase(),n=(e.displayName??"").toLowerCase();return e.name.toLowerCase().includes(r)||n.includes(r)||e.description.toLowerCase().includes(r)||e.type==="mcp"&&[(x=e.metadata)==null?void 0:x.serverId,(y=e.metadata)==null?void 0:y.serverName,(b=e.metadata)==null?void 0:b.originalName].filter(m=>typeof m=="string").some(m=>m.toLowerCase().includes(r))||(((C=e.category)==null?void 0:C.toLowerCase().includes(r))??!1)||(((w=e.tags)==null?void 0:w.some(m=>m.toLowerCase().includes(r)))??!1)});R(s),u(0)},[o,k]),l.useEffect(()=>{if(!h.current||!S.current)return;const s=S.current,e=h.current,r=s.getBoundingClientRect(),n=e.getBoundingClientRect();n.top<r.top?e.scrollIntoView({block:"start",behavior:"smooth"}):n.bottom>r.bottom&&e.scrollIntoView({block:"end",behavior:"smooth"})},[d,c]);const t=l.useCallback(async s=>{try{j({name:s.name,type:s.type,id:s.id})}catch(e){console.error(`[CommandSelector] Failed to select command '${s.name}':`,e)}},[j]);return l.useEffect(()=>{const s=e=>{if(p)switch(e.key){case"ArrowDown":case"n":if(e.key==="n"&&!e.ctrlKey)break;e.preventDefault(),e.stopPropagation(),u(r=>r<c.length-1?r+1:0);break;case"ArrowUp":case"p":if(e.key==="p"&&!e.ctrlKey)break;e.preventDefault(),e.stopPropagation(),u(r=>r>0?r-1:c.length-1);break;case"Enter":e.preventDefault(),e.stopPropagation(),c[d]&&t(c[d]);break;case" ":case"Tab":e.preventDefault(),e.stopPropagation(),c[d]&&f&&f(c[d].name);break;case"Escape":e.preventDefault(),e.stopPropagation(),g();break}};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[p,c,d,g,f,t]),{containerRef:S,selectedItemRef:h,filteredCommands:c,selectedIndex:d,setSelectedIndex:u,isLoading:N,handleCommandSelect:t}},{useToken:P}=M,A={workflow:{color:"blue",icon:a.jsx(F,{}),labelKey:"chat.commandSelector.types.workflow"},skill:{color:"green",icon:a.jsx(z,{}),labelKey:"chat.commandSelector.types.skill"},mcp:{color:"purple",icon:a.jsx(K,{}),labelKey:"chat.commandSelector.types.mcp"},goal:{color:"gold",icon:a.jsx(D,{}),labelKey:"chat.commandSelector.types.goal"}},W=({visible:p,onSelect:k,onCancel:j,searchText:g,onAutoComplete:f})=>{const{token:o}=P(),{t:i}=E(),{containerRef:c,selectedItemRef:R,filteredCommands:d,selectedIndex:u,setSelectedIndex:N,isLoading:I,handleCommandSelect:S}=X({visible:p,searchText:g,onSelect:k,onCancel:j,onAutoComplete:f});if(!p)return null;if(I)return a.jsxs("div",{style:{position:"absolute",bottom:"100%",left:0,right:0,background:o.colorBgContainer,border:`1px solid ${o.colorBorderSecondary}`,borderRadius:o.borderRadiusSM,boxShadow:o.boxShadowSecondary,padding:`${o.paddingSM}px ${o.paddingMD}px`,zIndex:1e3,marginBottom:o.marginXS,textAlign:"center"},children:[a.jsx(T,{size:"small"})," ",i("chat.commandSelector.loading")]});if(d.length===0)return a.jsx("div",{style:{position:"absolute",bottom:"100%",left:0,right:0,background:o.colorBgContainer,border:`1px solid ${o.colorBorderSecondary}`,borderRadius:o.borderRadiusSM,boxShadow:o.boxShadowSecondary,padding:`${o.paddingSM}px ${o.paddingMD}px`,zIndex:1e3,marginBottom:o.marginXS,textAlign:"center",color:o.colorTextSecondary},children:g?i("chat.commandSelector.emptyWithSearch",{search:g}):i("chat.commandSelector.empty")});const h=(t,s)=>{var b,C,w;const e=A[t.type],r=s===u,n=t.type==="mcp"?v(t.name):null,x=t.type==="mcp"?((b=t.metadata)==null?void 0:b.originalName)||(n==null?void 0:n.toolName)||t.displayName||t.name:null,y=t.type==="mcp"&&(((C=t.metadata)==null?void 0:C.serverName)||((w=t.metadata)==null?void 0:w.serverId)||(n==null?void 0:n.serverId))||null;return a.jsxs("div",{ref:r?R:null,className:`command-selector-item ${r?"selected":""}`,onClick:()=>S(t),onMouseEnter:()=>N(s),children:[a.jsxs("div",{className:"command-selector-item-header",children:[a.jsxs("div",{className:"command-selector-item-name",style:{color:o.colorPrimary},children:["/",t.type==="mcp"&&x?x:t.name]}),a.jsxs("div",{style:{display:"flex",gap:o.marginXS},children:[t.type==="mcp"&&y&&a.jsx(L,{color:"processing",children:y}),a.jsxs(L,{color:e.color,children:[e.icon," ",i(e.labelKey)]})]})]}),a.jsx("div",{className:"command-selector-item-description",style:{color:o.colorTextSecondary},children:t.description}),t.type==="mcp"&&y&&a.jsxs("div",{className:"command-selector-item-category",style:{color:o.colorTextTertiary},children:[i("common.server")," ",y]}),t.category&&a.jsxs("div",{className:"command-selector-item-category",style:{color:o.colorTextTertiary},children:[i("common.category")," ",t.category]}),t.tags&&t.tags.length>0&&a.jsx("div",{className:"command-selector-item-tags",children:t.tags.slice(0,3).map(m=>a.jsx(L,{children:m},m))})]},t.id)};return a.jsxs("div",{ref:c,className:"command-selector-container",style:{background:o.colorBgContainer,border:`1px solid ${o.colorBorderSecondary}`,borderRadius:o.borderRadiusSM,boxShadow:o.boxShadowSecondary},children:[a.jsx("div",{style:{padding:`${o.paddingXXS}px ${o.paddingSM}px`,borderBottom:`1px solid ${o.colorBorderSecondary}`,background:o.colorFillQuaternary,fontSize:o.fontSizeSM,color:o.colorTextTertiary},children:i("chat.commandSelector.navigationHint")}),d.map((t,s)=>h(t,s))]})};export{W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-markdown-teEfNS9t.js";import{R as A,u as S,a as N}from"./vendor-i18n-Dm-c3D_C.js";import{u as g,i as T,j as w,k as B}from"./App-
|
|
1
|
+
import{j as e}from"./vendor-markdown-teEfNS9t.js";import{R as A,u as S,a as N}from"./vendor-i18n-Dm-c3D_C.js";import{u as g,i as T,j as w,k as B}from"./App-CRFTsGMB.js";/* empty css */import{A as $,j as b,o as k,B as y,q as F,u as I,t as R}from"./vendor-antd-qu012Od4.js";import"./vendor-mermaid-Dwc97-kL.js";import"./main-E45DhYyG.js";const s={questionCard:"qd-questionCard",questionHeader:"qd-questionHeader",headerLeft:"qd-headerLeft",questionIcon:"qd-questionIcon",questionText:"qd-questionText",questionBody:"qd-questionBody",questionFooter:"qd-questionFooter"},{Text:c}=b,{useToken:z}=R,j=({sessionId:a})=>{const{t:o}=S(),{token:r}=z(),{message:i}=$.useApp(),[n,d]=N.useState(!1),m=g(T(a)),l=g(p=>p.clearPendingChildApproval);if(!m)return null;const{childSessionId:f,requestId:C,toolName:u,permission:h,resource:v}=m,q=async p=>{d(!0);try{(await w.respondToChildApproval(f,C,p)).delivered||i.warning(o("components.approval.childGone")),l(a)}catch(t){console.error("Failed to respond to child approval:",t),B(t)&&t.status===404?(i.warning(o("components.approval.childGone")),l(a)):i.error(o("components.approval.deliverFailed"))}finally{d(!1)}},x=[u?`${o("components.approval.toolName")}: ${u}`:null,h?`${o("components.approval.permission")}: ${h}`:null,v?`${o("components.approval.target")}: ${v}`:null].filter(Boolean).join(" · ");return e.jsxs("div",{className:s.questionCard,style:{background:r.colorBgContainer,borderColor:r.colorBorderSecondary,border:`1px solid ${r.colorBorderSecondary}`},children:[e.jsx("div",{className:s.questionHeader,children:e.jsxs("span",{className:s.headerLeft,children:[e.jsx("span",{className:s.questionIcon,children:"🛡️"}),e.jsx(c,{strong:!0,className:s.questionText,style:{color:r.colorPrimary,whiteSpace:"pre-wrap"},children:o("components.approval.childTitle")})]})}),e.jsxs("div",{className:s.questionBody,children:[e.jsx(c,{style:{color:r.colorText,whiteSpace:"pre-wrap"},children:o("components.approval.childQuestion")}),x&&e.jsx("div",{style:{marginTop:r.marginXXS},children:e.jsx(c,{type:"secondary",style:{fontSize:12,whiteSpace:"pre-wrap"},children:x})}),e.jsx("div",{className:s.questionFooter,children:e.jsxs(k,{size:8,children:[e.jsx(y,{type:"primary",size:"small",icon:e.jsx(F,{}),onClick:()=>void q(!0),loading:n,disabled:n,children:o("components.approval.approve")}),e.jsx(y,{danger:!0,size:"small",icon:e.jsx(I,{}),onClick:()=>void q(!1),loading:n,disabled:n,children:o("components.approval.deny")})]})})]})]})};j.displayName="ChildApprovalDialog";const D=A.memo(j);D.displayName="ChildApprovalDialog";export{D as ChildApprovalDialog,D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./vendor-markdown-teEfNS9t.js";import{u as b,a as x}from"./vendor-i18n-Dm-c3D_C.js";import{u as i}from"./App-
|
|
1
|
+
import{j as t}from"./vendor-markdown-teEfNS9t.js";import{u as b,a as x}from"./vendor-i18n-Dm-c3D_C.js";import{u as i}from"./App-CRFTsGMB.js";import{A as w,a1 as n,B as l,a2 as T,J as c,x as R,p as k,a3 as v,a4 as C,a5 as E,a6 as d}from"./vendor-antd-qu012Od4.js";import"./vendor-mermaid-Dwc97-kL.js";import"./main-E45DhYyG.js";const V=()=>{const{t:s}=b(),{message:a}=w.useApp(),f=i(e=>e.systemPrompts),P=i(e=>e.addSystemPrompt),j=i(e=>e.updateSystemPrompt),M=i(e=>e.deleteSystemPrompt),[h,u]=x.useState(!1),[r,p]=x.useState(null),[o]=n.useForm(),g=(e=null)=>{if(e!=null&&e.isDefault){a.warning(s("settings.systemPromptManager.defaultPromptLocked"));return}p(e),o.setFieldsValue(e||{name:"",description:"",content:""}),u(!0)},y=()=>{u(!1),p(null),o.resetFields()},S=async()=>{if(r!=null&&r.isDefault){a.warning(s("settings.systemPromptManager.defaultPromptLocked"));return}try{const e=await o.validateFields();r?(await j({...r,...e}),a.success(s("settings.systemPromptManager.updateSuccess"))):(await P(e),a.success(s("settings.systemPromptManager.addSuccess"))),y()}catch(e){console.error("Failed to save prompt:",e),a.error(e instanceof Error?e.message:s("settings.systemPromptManager.saveError"))}},I=async e=>{try{await M(e),a.success(s("settings.systemPromptManager.deleteSuccess"))}catch(m){console.error("Failed to delete prompt:",m),a.error(m instanceof Error?m.message:s("settings.systemPromptManager.deleteError"))}};return t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[t.jsx("h2",{children:s("settings.systemPromptManager.title")}),t.jsx(l,{type:"primary",icon:t.jsx(T,{}),onClick:()=>g(),children:s("settings.systemPromptManager.addButton")})]}),t.jsx(c,{itemLayout:"horizontal",dataSource:f,renderItem:e=>t.jsxs(c.Item,{actions:[e.isDefault?null:t.jsx(l,{type:"text",icon:t.jsx(k,{}),onClick:()=>g(e)}),e.isDefault?null:t.jsx(v,{title:s("settings.systemPromptManager.deleteConfirm"),onConfirm:()=>I(e.id),okText:s("common.yes"),cancelText:s("common.no"),children:t.jsx(l,{type:"text",danger:!0,icon:t.jsx(C,{}),"aria-label":s("common.delete")})})],children:[t.jsx(c.Item.Meta,{title:e.name,description:e.description||e.content.substring(0,200)+(e.content.length>200?"...":"")}),e.isDefault&&t.jsx(R,{children:s("settings.systemPromptManager.defaultTag")})]})}),t.jsx(E,{title:s(r?"settings.systemPromptManager.editTitle":"settings.systemPromptManager.addTitle"),open:h,onOk:S,onCancel:y,width:"60%",forceRender:!0,children:t.jsxs(n,{form:o,layout:"vertical",name:"system_prompt_form",children:[t.jsx(n.Item,{name:"name",label:s("settings.systemPromptManager.nameLabel"),rules:[{required:!0,message:s("settings.systemPromptManager.nameRequired")}],children:t.jsx(d,{})}),t.jsx(n.Item,{name:"description",label:s("settings.systemPromptManager.descriptionLabel"),rules:[{required:!1,message:s("settings.systemPromptManager.descriptionRequired")}],children:t.jsx(d.TextArea,{rows:3})}),t.jsx(n.Item,{name:"content",label:s("settings.systemPromptManager.contentLabel"),rules:[{required:!0,message:s("settings.systemPromptManager.contentRequired")}],children:t.jsx(d.TextArea,{rows:10})})]})})]})};export{V as default};
|