@bigduu/lotus 2026.6.3 → 2026.6.4

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.
Files changed (65) hide show
  1. package/README.md +148 -71
  2. package/README.zh-CN.md +184 -0
  3. package/dist/assets/{App-W1Kf_qp4.js → App-DGiMC-bc.js} +9 -9
  4. package/dist/assets/{MetricsService-CD6PrhIR.js → MetricsService-BwJoJM1I.js} +1 -1
  5. package/dist/assets/{SubAgentsPanel-DK1z7F4I.js → SubAgentsPanel-B7tWf8Y_.js} +1 -1
  6. package/dist/assets/{architectureDiagram-3BPJPVTR-m5clV_D3.js → architectureDiagram-3BPJPVTR-BebuBU7Q.js} +1 -1
  7. package/dist/assets/{blockDiagram-GPEHLZMM-CtzVuvsA.js → blockDiagram-GPEHLZMM-COwJ0V9U.js} +1 -1
  8. package/dist/assets/{c4Diagram-AAUBKEIU-ZdWEf_4Q.js → c4Diagram-AAUBKEIU-Dzi1f7rv.js} +1 -1
  9. package/dist/assets/{chunk-2J33WTMH-DeO3muwK.js → chunk-2J33WTMH-gGTSUslI.js} +1 -1
  10. package/dist/assets/{chunk-4BX2VUAB-BQCEOQJh.js → chunk-4BX2VUAB-Ba2pD5h_.js} +1 -1
  11. package/dist/assets/{chunk-55IACEB6-DXiyRneN.js → chunk-55IACEB6-Bgc2fQut.js} +1 -1
  12. package/dist/assets/{chunk-727SXJPM-C29YUAhR.js → chunk-727SXJPM-BbDzQZvf.js} +1 -1
  13. package/dist/assets/{chunk-AQP2D5EJ-DEmrjkPB.js → chunk-AQP2D5EJ-CNJIXQcJ.js} +1 -1
  14. package/dist/assets/{chunk-FMBD7UC4-D-iTD3Nb.js → chunk-FMBD7UC4-DxIxh6Ds.js} +1 -1
  15. package/dist/assets/{chunk-ND2GUHAM-Cd1xcwBQ.js → chunk-ND2GUHAM-s08Pzboe.js} +1 -1
  16. package/dist/assets/{chunk-QZHKN3VN-CGXe1Q5G.js → chunk-QZHKN3VN-BAzhPVsB.js} +1 -1
  17. package/dist/assets/classDiagram-4FO5ZUOK-DXcpWQD1.js +1 -0
  18. package/dist/assets/classDiagram-v2-Q7XG4LA2-DXcpWQD1.js +1 -0
  19. package/dist/assets/{cose-bilkent-S5V4N54A-De8zo0Tj.js → cose-bilkent-S5V4N54A-_w_xFpmi.js} +1 -1
  20. package/dist/assets/{dagre-BM42HDAG-Ddh9ynKq.js → dagre-BM42HDAG-DBuvyGu5.js} +1 -1
  21. package/dist/assets/{diagram-2AECGRRQ-C1X08pMD.js → diagram-2AECGRRQ-DBhlnTP6.js} +1 -1
  22. package/dist/assets/{diagram-5GNKFQAL-3x5G_-3R.js → diagram-5GNKFQAL-CfeEom2U.js} +1 -1
  23. package/dist/assets/{diagram-KO2AKTUF-B3LBcH_F.js → diagram-KO2AKTUF-BdVfrz_2.js} +1 -1
  24. package/dist/assets/{diagram-LMA3HP47-DTrWMl7o.js → diagram-LMA3HP47-CTH2TNUy.js} +1 -1
  25. package/dist/assets/{diagram-OG6HWLK6-BN3jcrDF.js → diagram-OG6HWLK6-BQM5_eCb.js} +1 -1
  26. package/dist/assets/{erDiagram-TEJ5UH35-Js5zjoj6.js → erDiagram-TEJ5UH35-B-21iS1U.js} +1 -1
  27. package/dist/assets/{flowDiagram-I6XJVG4X-DQRu1AbM.js → flowDiagram-I6XJVG4X-Pvjq-IGZ.js} +1 -1
  28. package/dist/assets/{ganttDiagram-6RSMTGT7-kCuyAcLR.js → ganttDiagram-6RSMTGT7-CsT06Nub.js} +1 -1
  29. package/dist/assets/{gitGraphDiagram-PVQCEYII-DUdINXyz.js → gitGraphDiagram-PVQCEYII-CHvUQAnK.js} +1 -1
  30. package/dist/assets/{index-3W1LV1SA.js → index-B2KftsrY.js} +1 -1
  31. package/dist/assets/{index-BJ3ANmOE.js → index-BLvTnbVM.js} +1 -1
  32. package/dist/assets/{index-Brgf2uQ2.js → index-CGPDORYG.js} +1 -1
  33. package/dist/assets/{index-CiGtwhMP.js → index-CWR9aGNs.js} +1 -1
  34. package/dist/assets/{index-BWbOqwQp.js → index-Czh1rLTB.js} +1 -1
  35. package/dist/assets/{index-DcsLc2YZ.js → index-DUN61Z32.js} +1 -1
  36. package/dist/assets/{index-CvZX-t6A.js → index-DlPD5pVw.js} +1 -1
  37. package/dist/assets/{index-CGYY6DOm.js → index-DsVVUUnV.js} +1 -1
  38. package/dist/assets/{index-a-yHOCrM.js → index-DtdE5mvd.js} +3 -3
  39. package/dist/assets/{index-BCFtep9w.js → index-WsBNH02d.js} +1 -1
  40. package/dist/assets/{index-BzelPcGb.js → index-qH5MzXB_.js} +1 -1
  41. package/dist/assets/{infoDiagram-5YYISTIA-BH60Z_kW.js → infoDiagram-5YYISTIA-DVnYFnCA.js} +1 -1
  42. package/dist/assets/{ishikawaDiagram-YF4QCWOH-DX__2fqL.js → ishikawaDiagram-YF4QCWOH-BilctuFn.js} +1 -1
  43. package/dist/assets/{journeyDiagram-JHISSGLW-Btbf-Yv-.js → journeyDiagram-JHISSGLW-BvpNGUEX.js} +1 -1
  44. package/dist/assets/{kanban-definition-UN3LZRKU-CupC3Y8c.js → kanban-definition-UN3LZRKU-Dq1kXZPB.js} +1 -1
  45. package/dist/assets/{main-DPVz9gTW.js → main-BNHHYyvu.js} +3 -3
  46. package/dist/assets/{mindmap-definition-RKZ34NQL-CVDbvdpU.js → mindmap-definition-RKZ34NQL-BM5Yg_Wt.js} +1 -1
  47. package/dist/assets/{pieDiagram-4H26LBE5-DIBPALXz.js → pieDiagram-4H26LBE5-CxzR0EiZ.js} +1 -1
  48. package/dist/assets/{quadrantDiagram-W4KKPZXB-CgLsRlfY.js → quadrantDiagram-W4KKPZXB-C6qm5TrW.js} +1 -1
  49. package/dist/assets/{requirementDiagram-4Y6WPE33-DuXsETX3.js → requirementDiagram-4Y6WPE33-Bfok6_yJ.js} +1 -1
  50. package/dist/assets/{sankeyDiagram-5OEKKPKP-C0arEfXn.js → sankeyDiagram-5OEKKPKP-CO-kBES5.js} +1 -1
  51. package/dist/assets/{sequenceDiagram-3UESZ5HK-FBSZs6xe.js → sequenceDiagram-3UESZ5HK-BA68KNvF.js} +1 -1
  52. package/dist/assets/{stateDiagram-AJRCARHV-BJ3Io4MV.js → stateDiagram-AJRCARHV-CPFv6QjH.js} +1 -1
  53. package/dist/assets/{stateDiagram-v2-BHNVJYJU-DGyYrZ6l.js → stateDiagram-v2-BHNVJYJU-C6FuGkH6.js} +1 -1
  54. package/dist/assets/{timeline-definition-PNZ67QCA-C3HbQJxG.js → timeline-definition-PNZ67QCA-DqkH57r5.js} +1 -1
  55. package/dist/assets/{vendor-charts-COf182R8.js → vendor-charts-C2gnH3Bq.js} +1 -1
  56. package/dist/assets/{vendor-mermaid-DT6Z2ihp.js → vendor-mermaid-EqIWbuOm.js} +3 -3
  57. package/dist/assets/{vendor-pdf-9vTbgVuO.js → vendor-pdf-BerqhPFN.js} +3 -3
  58. package/dist/assets/{vennDiagram-CIIHVFJN-uaSWNW5M.js → vennDiagram-CIIHVFJN-CakMDBwB.js} +1 -1
  59. package/dist/assets/{wardley-L42UT6IY-HJvlv64_.js → wardley-L42UT6IY-B1oAtJIM.js} +1 -1
  60. package/dist/assets/{wardleyDiagram-YWT4CUSO-WC_DkfK4.js → wardleyDiagram-YWT4CUSO-CxG6z1Fg.js} +1 -1
  61. package/dist/assets/{xychartDiagram-2RQKCTM6-jDKleAT-.js → xychartDiagram-2RQKCTM6-BCpc7XLL.js} +1 -1
  62. package/dist/index.html +2 -2
  63. package/package.json +1 -1
  64. package/dist/assets/classDiagram-4FO5ZUOK-CFu2BDCx.js +0 -1
  65. package/dist/assets/classDiagram-v2-Q7XG4LA2-CFu2BDCx.js +0 -1
@@ -1 +1 @@
1
- import{j as t}from"./vendor-markdown-CR3QKQo2.js";import{u as b,a as x}from"./vendor-i18n-Dm-c3D_C.js";import{u as i}from"./App-W1Kf_qp4.js";import{X as w,Y as n,N as l,Z as T,z as c,o as R,$ as k,a0 as v,a1 as C,a2 as E,a3 as d}from"./vendor-antd-BV9fXfUG.js";import"./vendor-mermaid-DT6Z2ihp.js";import"./main-DPVz9gTW.js";const V=()=>{const{t:s}=b(),{message:r}=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),[a,p]=x.useState(null),[o]=n.useForm(),g=(e=null)=>{if(e!=null&&e.isDefault){r.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(a!=null&&a.isDefault){r.warning(s("settings.systemPromptManager.defaultPromptLocked"));return}try{const e=await o.validateFields();a?(await j({...a,...e}),r.success(s("settings.systemPromptManager.updateSuccess"))):(await P(e),r.success(s("settings.systemPromptManager.addSuccess"))),y()}catch(e){console.error("Failed to save prompt:",e),r.error(e instanceof Error?e.message:s("settings.systemPromptManager.saveError"))}},I=async e=>{try{await M(e),r.success(s("settings.systemPromptManager.deleteSuccess"))}catch(m){console.error("Failed to delete prompt:",m),r.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(a?"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};
1
+ import{j as t}from"./vendor-markdown-CR3QKQo2.js";import{u as b,a as x}from"./vendor-i18n-Dm-c3D_C.js";import{u as i}from"./App-DGiMC-bc.js";import{X as w,Y as n,N as l,Z as T,z as c,o as R,$ as k,a0 as v,a1 as C,a2 as E,a3 as d}from"./vendor-antd-BV9fXfUG.js";import"./vendor-mermaid-EqIWbuOm.js";import"./main-BNHHYyvu.js";const V=()=>{const{t:s}=b(),{message:r}=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),[a,p]=x.useState(null),[o]=n.useForm(),g=(e=null)=>{if(e!=null&&e.isDefault){r.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(a!=null&&a.isDefault){r.warning(s("settings.systemPromptManager.defaultPromptLocked"));return}try{const e=await o.validateFields();a?(await j({...a,...e}),r.success(s("settings.systemPromptManager.updateSuccess"))):(await P(e),r.success(s("settings.systemPromptManager.addSuccess"))),y()}catch(e){console.error("Failed to save prompt:",e),r.error(e instanceof Error?e.message:s("settings.systemPromptManager.saveError"))}},I=async e=>{try{await M(e),r.success(s("settings.systemPromptManager.deleteSuccess"))}catch(m){console.error("Failed to delete prompt:",m),r.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(a?"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};
@@ -1 +1 @@
1
- import{j as s}from"./vendor-markdown-CR3QKQo2.js";import{u as g,a as c,i as m}from"./vendor-i18n-Dm-c3D_C.js";import{u as p,s as y,E as T}from"./App-W1Kf_qp4.js";import{t as v,ad as S,ae as w,v as R,I as k,U as A,aa as I,o as b,w as M}from"./vendor-antd-BV9fXfUG.js";import"./vendor-mermaid-DT6Z2ihp.js";import"./main-DPVz9gTW.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 a=Math.floor(l/60);if(a<24)return m.t("chat.home.hoursAgo",{count:a});const r=Math.floor(a/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(),a=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,a)}`}),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]})]}),a?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"})]})},U=({onOpenSession:o})=>{const{t:n}=g(),{token:t}=v.useToken(),l=p(e=>e.chats),a=c.useCallback(e=>y(e)(p.getState()),[]),r=c.useMemo(()=>l.filter(e=>a(e.id)).slice(0,D),[l,a]),d=c.useMemo(()=>l.filter(e=>e.pinned&&!a(e.id)).slice(0,$),[l,a]),j=c.useMemo(()=>{const e=new Set(r.map(i=>i.id)),f=new Set(d.map(i=>i.id));return l.filter(i=>i.kind!=="child"&&!e.has(i.id)&&!f.has(i.id)).sort((i,h)=>{const N=i.updatedAt?new Date(i.updatedAt).getTime():i.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(w,{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(R,{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{U as HomeDashboard,U as default};
1
+ import{j as s}from"./vendor-markdown-CR3QKQo2.js";import{u as g,a as c,i as m}from"./vendor-i18n-Dm-c3D_C.js";import{u as p,s as y,E as T}from"./App-DGiMC-bc.js";import{t as v,ad as S,ae as w,v as R,I as k,U as A,aa as I,o as b,w as M}from"./vendor-antd-BV9fXfUG.js";import"./vendor-mermaid-EqIWbuOm.js";import"./main-BNHHYyvu.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 a=Math.floor(l/60);if(a<24)return m.t("chat.home.hoursAgo",{count:a});const r=Math.floor(a/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(),a=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,a)}`}),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]})]}),a?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"})]})},U=({onOpenSession:o})=>{const{t:n}=g(),{token:t}=v.useToken(),l=p(e=>e.chats),a=c.useCallback(e=>y(e)(p.getState()),[]),r=c.useMemo(()=>l.filter(e=>a(e.id)).slice(0,D),[l,a]),d=c.useMemo(()=>l.filter(e=>e.pinned&&!a(e.id)).slice(0,$),[l,a]),j=c.useMemo(()=>{const e=new Set(r.map(i=>i.id)),f=new Set(d.map(i=>i.id));return l.filter(i=>i.kind!=="child"&&!e.has(i.id)&&!f.has(i.id)).sort((i,h)=>{const N=i.updatedAt?new Date(i.updatedAt).getTime():i.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(w,{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(R,{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{U as HomeDashboard,U as default};