@bigduu/lotus 2026.6.20 → 2026.6.21

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 (64) hide show
  1. package/dist/assets/{App-CG8bbjSe.js → App-BE03KO2t.js} +9 -9
  2. package/dist/assets/{MetricsService-BY057XSj.js → MetricsService-C_09AaLH.js} +1 -1
  3. package/dist/assets/{SubAgentsPanel-TdCKptD-.js → SubAgentsPanel-Bfdx96WN.js} +1 -1
  4. package/dist/assets/{architectureDiagram-3BPJPVTR-BUvShG40.js → architectureDiagram-3BPJPVTR-CFnNIaH9.js} +1 -1
  5. package/dist/assets/{blockDiagram-GPEHLZMM-omczCfAL.js → blockDiagram-GPEHLZMM-DGU1zBz2.js} +1 -1
  6. package/dist/assets/{c4Diagram-AAUBKEIU-D3loFTFR.js → c4Diagram-AAUBKEIU-DzPdW8pi.js} +1 -1
  7. package/dist/assets/{chunk-2J33WTMH-vXnUzqcL.js → chunk-2J33WTMH-C3gWLOQi.js} +1 -1
  8. package/dist/assets/{chunk-4BX2VUAB-Bduc68-M.js → chunk-4BX2VUAB-DwQ_yJZR.js} +1 -1
  9. package/dist/assets/{chunk-55IACEB6-CQurPzzm.js → chunk-55IACEB6-5KcZ5Mg4.js} +1 -1
  10. package/dist/assets/{chunk-727SXJPM-cr42BARz.js → chunk-727SXJPM-CTyFupuz.js} +1 -1
  11. package/dist/assets/{chunk-AQP2D5EJ-DPgkAB9a.js → chunk-AQP2D5EJ-D3TfocFk.js} +1 -1
  12. package/dist/assets/{chunk-FMBD7UC4-DM2eEyUs.js → chunk-FMBD7UC4-BBYX4gAn.js} +1 -1
  13. package/dist/assets/{chunk-ND2GUHAM-BdiRuLUa.js → chunk-ND2GUHAM-PiVQlHJA.js} +1 -1
  14. package/dist/assets/{chunk-QZHKN3VN-AdFyQtzD.js → chunk-QZHKN3VN-C9UTL9tu.js} +1 -1
  15. package/dist/assets/classDiagram-4FO5ZUOK-MIZ51UHT.js +1 -0
  16. package/dist/assets/classDiagram-v2-Q7XG4LA2-MIZ51UHT.js +1 -0
  17. package/dist/assets/{cose-bilkent-S5V4N54A-COuE4psp.js → cose-bilkent-S5V4N54A-C5-z7pIR.js} +1 -1
  18. package/dist/assets/{dagre-BM42HDAG-Ds00sUTy.js → dagre-BM42HDAG-C2EAYn6-.js} +1 -1
  19. package/dist/assets/{diagram-2AECGRRQ-WL9Y87tr.js → diagram-2AECGRRQ-BZsh3U_K.js} +1 -1
  20. package/dist/assets/{diagram-5GNKFQAL-aBrAL8WM.js → diagram-5GNKFQAL-BfkxTDEq.js} +1 -1
  21. package/dist/assets/{diagram-KO2AKTUF-xncsnLEI.js → diagram-KO2AKTUF-Cu8CoWQf.js} +1 -1
  22. package/dist/assets/{diagram-LMA3HP47-BKxHjemY.js → diagram-LMA3HP47-BdZRMnoP.js} +1 -1
  23. package/dist/assets/{diagram-OG6HWLK6-ByznP8cO.js → diagram-OG6HWLK6-qEwmDizB.js} +1 -1
  24. package/dist/assets/{erDiagram-TEJ5UH35-DU5qPROE.js → erDiagram-TEJ5UH35-By7SLdIO.js} +1 -1
  25. package/dist/assets/{flowDiagram-I6XJVG4X-C2F4XnqL.js → flowDiagram-I6XJVG4X-DY2A79PB.js} +1 -1
  26. package/dist/assets/{ganttDiagram-6RSMTGT7-B1faqJNo.js → ganttDiagram-6RSMTGT7-BCFnbnNO.js} +1 -1
  27. package/dist/assets/{gitGraphDiagram-PVQCEYII-cqui4Qfv.js → gitGraphDiagram-PVQCEYII-Dh0JLNiL.js} +1 -1
  28. package/dist/assets/{index-KM7uqSeO.js → index-B9iUdLip.js} +3 -3
  29. package/dist/assets/{index-2n2SNzxw.js → index-BDpQmQcF.js} +1 -1
  30. package/dist/assets/{index-BqUD7qIk.js → index-BHVwy6LC.js} +1 -1
  31. package/dist/assets/{index-CpTnNqu7.js → index-Btfg18vs.js} +1 -1
  32. package/dist/assets/{index-BW_rAoL5.js → index-BwN42ilc.js} +1 -1
  33. package/dist/assets/{index-BnQF9BCm.js → index-C5LikZFS.js} +1 -1
  34. package/dist/assets/{index-CvJxkeFo.js → index-CuoIA2BI.js} +1 -1
  35. package/dist/assets/{index-DhuMOkuR.js → index-CypAYsxn.js} +1 -1
  36. package/dist/assets/{index-BeelmCtF.js → index-DOE29cJ_.js} +1 -1
  37. package/dist/assets/{index-Xinu8DWx.js → index-DfUeAKyS.js} +1 -1
  38. package/dist/assets/{index-bCpdtLdC.js → index-SYbkHxZ5.js} +1 -1
  39. package/dist/assets/{index-Bf7_I7lH.js → index-ywqu1YSt.js} +1 -1
  40. package/dist/assets/{infoDiagram-5YYISTIA-DOvPDrOE.js → infoDiagram-5YYISTIA-BditIGGi.js} +1 -1
  41. package/dist/assets/{ishikawaDiagram-YF4QCWOH-0k0oYtIK.js → ishikawaDiagram-YF4QCWOH-Cq0ZTw82.js} +1 -1
  42. package/dist/assets/{journeyDiagram-JHISSGLW-C8JpdLIs.js → journeyDiagram-JHISSGLW-Hno4e2_P.js} +1 -1
  43. package/dist/assets/{kanban-definition-UN3LZRKU-BF8B3Of4.js → kanban-definition-UN3LZRKU-SFLCIrsL.js} +1 -1
  44. package/dist/assets/{main-Bae5Z9x6.js → main-DE4q1A6J.js} +3 -3
  45. package/dist/assets/{mindmap-definition-RKZ34NQL-BdYqZgSn.js → mindmap-definition-RKZ34NQL-Dv1i0LBZ.js} +1 -1
  46. package/dist/assets/{pieDiagram-4H26LBE5-DslzBdtA.js → pieDiagram-4H26LBE5-DrzipmnN.js} +1 -1
  47. package/dist/assets/{quadrantDiagram-W4KKPZXB-DjLReYd6.js → quadrantDiagram-W4KKPZXB-CbVG7rYB.js} +1 -1
  48. package/dist/assets/{requirementDiagram-4Y6WPE33-DBNIBpnN.js → requirementDiagram-4Y6WPE33-_teUDEd_.js} +1 -1
  49. package/dist/assets/{sankeyDiagram-5OEKKPKP-DBfwCo3t.js → sankeyDiagram-5OEKKPKP-CCwEIiwo.js} +1 -1
  50. package/dist/assets/{sequenceDiagram-3UESZ5HK-BeokAqv3.js → sequenceDiagram-3UESZ5HK-C8AleVLZ.js} +1 -1
  51. package/dist/assets/{stateDiagram-AJRCARHV-D0_29gC_.js → stateDiagram-AJRCARHV-B-1jeSlx.js} +1 -1
  52. package/dist/assets/{stateDiagram-v2-BHNVJYJU-BmoE01-Q.js → stateDiagram-v2-BHNVJYJU-kXIhlS8W.js} +1 -1
  53. package/dist/assets/{timeline-definition-PNZ67QCA-DLJCAk48.js → timeline-definition-PNZ67QCA-BiDTWxYs.js} +1 -1
  54. package/dist/assets/{vendor-charts-C1qs2RDI.js → vendor-charts-DgNVhh9m.js} +1 -1
  55. package/dist/assets/{vendor-mermaid-Cez766TY.js → vendor-mermaid-B53piAPW.js} +3 -3
  56. package/dist/assets/{vendor-pdf-DhHoqANy.js → vendor-pdf-DVpmGfqI.js} +3 -3
  57. package/dist/assets/{vennDiagram-CIIHVFJN-Z5aH7FvY.js → vennDiagram-CIIHVFJN-DlVqGLxi.js} +1 -1
  58. package/dist/assets/{wardley-L42UT6IY-DFiCK17w.js → wardley-L42UT6IY-Bu1lxJJ1.js} +1 -1
  59. package/dist/assets/{wardleyDiagram-YWT4CUSO-Cd2bS0UW.js → wardleyDiagram-YWT4CUSO-CnWKdyBU.js} +1 -1
  60. package/dist/assets/{xychartDiagram-2RQKCTM6-Dy3zXPjx.js → xychartDiagram-2RQKCTM6-B9yWrLfp.js} +1 -1
  61. package/dist/index.html +2 -2
  62. package/package.json +1 -1
  63. package/dist/assets/classDiagram-4FO5ZUOK-C4wtpAwq.js +0 -1
  64. package/dist/assets/classDiagram-v2-Q7XG4LA2-C4wtpAwq.js +0 -1
@@ -1 +1 @@
1
- import{j as e}from"./vendor-markdown-teEfNS9t.js";import{u as N,a as j}from"./vendor-i18n-Dm-c3D_C.js";import{u as y,w as P,y as T,x as V}from"./App-CG8bbjSe.js";import{Q as v,D as n,x as c,Z as C,am as w,ak as I,an as R,ah as S,t as $}from"./vendor-antd-qu012Od4.js";import"./vendor-mermaid-Cez766TY.js";import"./main-Bae5Z9x6.js";const{useToken:E}=$,F=r=>{const o=r.replace(/\/$/,"").split("/").filter(Boolean);return o.length<=2?r:`~/${o.slice(-2).join("/")}`},q=({sessionId:r})=>{const{t:o}=N(),{token:x}=E(),t=y(P(r)),f=y(a=>a.systemPrompts),l=t==null?void 0:t.config.workspacePath,i=t==null?void 0:t.config.systemPromptId,s=t==null?void 0:t.config.tokenUsage,k=(t==null?void 0:t.config.compressionEvents)??[],m=j.useMemo(()=>{if(!i)return null;const a=f.find(B=>B.id===i);return(a==null?void 0:a.name)||i},[i,f]),p=j.useMemo(()=>t!=null&&t.messages?t.messages.filter(a=>a.role==="user"&&"type"in a&&a.type==="file_reference").length:0,[t==null?void 0:t.messages]);if(!t)return null;const h=(s==null?void 0:s.summaryTokens)??0,g=k.length,d=(s==null?void 0:s.promptCachedToolOutputs)??0,u=(s==null?void 0:s.promptCachedToolTokensSaved)??0,b=h>0||g>0,_=d>0||u>0;return l||m||p>0||b||_?e.jsx("div",{className:"lotus-context-bar",style:{borderBottomColor:x.colorBorderSecondary,backgroundColor:x.colorBgContainer},children:e.jsxs(v,{align:"center",gap:6,wrap:"wrap",className:"lotus-context-bar__content",children:[l&&e.jsx(n,{title:o("chat.contextBar.workspaceTooltip",{path:l,defaultValue:"Workspace context: {{path}}"}),children:e.jsxs(c,{className:"lotus-context-bar__tag",icon:e.jsx(C,{}),bordered:!1,children:[e.jsx("span",{className:"lotus-context-bar__tag-label",children:o("chat.contextBar.workspace",{defaultValue:"Workspace"})}),F(l)]})}),p>0&&e.jsx(n,{title:o("chat.contextBar.fileRefsTooltip",{count:p,defaultValue:"{{count}} file reference(s) in this session"}),children:e.jsxs(c,{className:"lotus-context-bar__tag",icon:e.jsx(w,{}),bordered:!1,children:[e.jsx("span",{className:"lotus-context-bar__tag-label",children:o("chat.contextBar.files",{defaultValue:"Files"})}),p]})}),m&&e.jsx(n,{title:o("chat.contextBar.promptTooltip",{name:m,defaultValue:"System prompt: {{name}}"}),children:e.jsxs(c,{className:"lotus-context-bar__tag",icon:e.jsx(I,{}),bordered:!1,children:[e.jsx("span",{className:"lotus-context-bar__tag-label",children:o("chat.contextBar.prompt",{defaultValue:"Prompt"})}),m]})}),b&&e.jsx(n,{title:o("chat.contextBar.summaryTooltip",{tokens:T(h),count:g,defaultValue:"Conversation summary contributes {{tokens}} tokens. {{count}} compression event(s) archived older messages."}),children:e.jsx(c,{className:"lotus-context-bar__tag lotus-context-bar__tag--signal",icon:e.jsx(R,{}),bordered:!1,color:"gold",children:o("chat.contextBar.summary",{defaultValue:"Summary"})})}),_&&e.jsx(n,{title:o("chat.contextBar.promptCacheTooltip",{count:d,tokens:T(u),defaultValue:"{{count}} tool output(s) were compacted into prompt-side cache notes, saving {{tokens}} tokens."}),children:e.jsxs(c,{className:"lotus-context-bar__tag lotus-context-bar__tag--signal",icon:e.jsx(S,{}),bordered:!1,color:"green",children:[e.jsx("span",{className:"lotus-context-bar__tag-label",children:o("chat.contextBar.promptCache",{defaultValue:"Prompt cache"})}),u>0?V(u):d]})})]})}):null};export{q as ContextBar,q as default};
1
+ import{j as e}from"./vendor-markdown-teEfNS9t.js";import{u as N,a as j}from"./vendor-i18n-Dm-c3D_C.js";import{u as y,w as P,y as T,x as V}from"./App-BE03KO2t.js";import{Q as v,D as n,x as c,Z as C,am as w,ak as I,an as R,ah as S,t as $}from"./vendor-antd-qu012Od4.js";import"./vendor-mermaid-B53piAPW.js";import"./main-DE4q1A6J.js";const{useToken:E}=$,F=r=>{const o=r.replace(/\/$/,"").split("/").filter(Boolean);return o.length<=2?r:`~/${o.slice(-2).join("/")}`},q=({sessionId:r})=>{const{t:o}=N(),{token:x}=E(),t=y(P(r)),f=y(a=>a.systemPrompts),l=t==null?void 0:t.config.workspacePath,i=t==null?void 0:t.config.systemPromptId,s=t==null?void 0:t.config.tokenUsage,k=(t==null?void 0:t.config.compressionEvents)??[],m=j.useMemo(()=>{if(!i)return null;const a=f.find(B=>B.id===i);return(a==null?void 0:a.name)||i},[i,f]),p=j.useMemo(()=>t!=null&&t.messages?t.messages.filter(a=>a.role==="user"&&"type"in a&&a.type==="file_reference").length:0,[t==null?void 0:t.messages]);if(!t)return null;const h=(s==null?void 0:s.summaryTokens)??0,g=k.length,d=(s==null?void 0:s.promptCachedToolOutputs)??0,u=(s==null?void 0:s.promptCachedToolTokensSaved)??0,b=h>0||g>0,_=d>0||u>0;return l||m||p>0||b||_?e.jsx("div",{className:"lotus-context-bar",style:{borderBottomColor:x.colorBorderSecondary,backgroundColor:x.colorBgContainer},children:e.jsxs(v,{align:"center",gap:6,wrap:"wrap",className:"lotus-context-bar__content",children:[l&&e.jsx(n,{title:o("chat.contextBar.workspaceTooltip",{path:l,defaultValue:"Workspace context: {{path}}"}),children:e.jsxs(c,{className:"lotus-context-bar__tag",icon:e.jsx(C,{}),bordered:!1,children:[e.jsx("span",{className:"lotus-context-bar__tag-label",children:o("chat.contextBar.workspace",{defaultValue:"Workspace"})}),F(l)]})}),p>0&&e.jsx(n,{title:o("chat.contextBar.fileRefsTooltip",{count:p,defaultValue:"{{count}} file reference(s) in this session"}),children:e.jsxs(c,{className:"lotus-context-bar__tag",icon:e.jsx(w,{}),bordered:!1,children:[e.jsx("span",{className:"lotus-context-bar__tag-label",children:o("chat.contextBar.files",{defaultValue:"Files"})}),p]})}),m&&e.jsx(n,{title:o("chat.contextBar.promptTooltip",{name:m,defaultValue:"System prompt: {{name}}"}),children:e.jsxs(c,{className:"lotus-context-bar__tag",icon:e.jsx(I,{}),bordered:!1,children:[e.jsx("span",{className:"lotus-context-bar__tag-label",children:o("chat.contextBar.prompt",{defaultValue:"Prompt"})}),m]})}),b&&e.jsx(n,{title:o("chat.contextBar.summaryTooltip",{tokens:T(h),count:g,defaultValue:"Conversation summary contributes {{tokens}} tokens. {{count}} compression event(s) archived older messages."}),children:e.jsx(c,{className:"lotus-context-bar__tag lotus-context-bar__tag--signal",icon:e.jsx(R,{}),bordered:!1,color:"gold",children:o("chat.contextBar.summary",{defaultValue:"Summary"})})}),_&&e.jsx(n,{title:o("chat.contextBar.promptCacheTooltip",{count:d,tokens:T(u),defaultValue:"{{count}} tool output(s) were compacted into prompt-side cache notes, saving {{tokens}} tokens."}),children:e.jsxs(c,{className:"lotus-context-bar__tag lotus-context-bar__tag--signal",icon:e.jsx(S,{}),bordered:!1,color:"green",children:[e.jsx("span",{className:"lotus-context-bar__tag-label",children:o("chat.contextBar.promptCache",{defaultValue:"Prompt cache"})}),u>0?V(u):d]})})]})}):null};export{q as ContextBar,q as default};
@@ -1 +1 @@
1
- import{j as t,M as E,r as F,h as H}from"./vendor-markdown-teEfNS9t.js";import{i as I,u as G,a as p}from"./vendor-i18n-Dm-c3D_C.js";import{o as y,B as v,U as X,j as B,J as Y,n as A,x as f,aq as q,ar as J,as as N,at as O,a5 as U,Y as K,N as Q,t as V}from"./vendor-antd-qu012Od4.js";import{F as W,u as z,G as Z}from"./App-CG8bbjSe.js";import"./vendor-mermaid-Cez766TY.js";import"./main-Bae5Z9x6.js";const _=({buttons:r,className:e,style:g,size:l="middle",align:n="right"})=>{const h={className:e,style:{width:"100%",justifyContent:n==="left"?"flex-start":n==="center"?"center":"flex-end",...g}};return t.jsx(y,{...h,children:r.map(a=>t.jsx(v,{type:a.type||"default",disabled:a.disabled,loading:a.loading,danger:a.danger,onClick:a.onClick,size:l,icon:a.icon,children:a.text},a.key))})},k=(r,e)=>({key:"cancel",text:e||I.t("common.cancel"),type:"default",onClick:r}),ee=(r,e)=>({key:"ok",text:(e==null?void 0:e.text)||I.t("common.ok"),type:"primary",disabled:e==null?void 0:e.disabled,loading:e==null?void 0:e.loading,onClick:r}),{Text:b,Paragraph:te}=B,re=({content:r,token:e,showGradient:g,onClick:l})=>t.jsx(X,{size:"small",style:{marginLeft:e.marginLG,marginTop:e.marginXS,backgroundColor:e.colorBgLayout,borderColor:e.colorBorderSecondary},styles:{body:{padding:e.paddingMD}},onClick:l,children:t.jsxs("div",{style:{maxHeight:"60vh",overflowY:"auto",position:"relative",paddingRight:e.paddingXS},children:[t.jsx(E,{remarkPlugins:[F],components:{p:({children:n})=>t.jsx(te,{style:{marginBottom:e.marginSM},children:n}),ol:({children:n})=>t.jsx("ol",{style:{marginBottom:e.marginSM,paddingLeft:e.paddingLG},children:n}),ul:({children:n})=>t.jsx("ul",{style:{marginBottom:e.marginSM,paddingLeft:e.paddingLG},children:n}),li:({children:n})=>t.jsx("li",{style:{marginBottom:e.marginXS},children:n}),h1:({children:n})=>t.jsx(b,{strong:!0,style:{fontSize:e.fontSizeHeading3,marginBottom:e.marginSM,display:"block"},children:n}),h2:({children:n})=>t.jsx(b,{strong:!0,style:{fontSize:e.fontSizeHeading4,marginBottom:e.marginSM,display:"block"},children:n}),code:({inline:n,className:h,children:a,...i})=>{const o=/language-(\w+)/.exec(h||"");return n?t.jsx("code",{className:h,style:{backgroundColor:e.colorFillTertiary,padding:"0 4px",borderRadius:e.borderRadiusSM,fontSize:e.fontSizeSM},...i,children:a}):t.jsx(H,{style:W,language:(o==null?void 0:o[1])||"text",PreTag:"div",wrapLongLines:!0,children:String(a).replace(/\n$/,"")})}},children:r||"No content available."}),g?t.jsx("div",{style:{position:"sticky",bottom:0,height:48,background:`linear-gradient(180deg, transparent, ${e.colorBgLayout})`,pointerEvents:"none",marginTop:-48}}):null]})}),{Text:L,Paragraph:se}=B,ne=({prompt:r,token:e,isSelected:g,isExpanded:l,onSelect:n,onToggleExpand:h,onCopy:a})=>{const{t:i}=G(),o=r.content||"",{nonEmptyLineCount:j,wordCount:u,characterCount:P,showGradient:x}=p.useMemo(()=>{const S=(o?o.split(/\r?\n/):[]).filter(w=>w.trim().length>0).length,C=o.trim()?o.trim().split(/\s+/).filter(Boolean).length:0,m=o.length;return{nonEmptyLineCount:S,wordCount:C,characterCount:m,showGradient:!l&&m>600}},[o,l]);return t.jsx(Y.Item,{style:{cursor:"pointer",padding:e.paddingMD,borderRadius:e.borderRadius,border:g?`2px solid ${e.colorPrimary}`:`1px solid ${e.colorBorderSecondary}`,marginBottom:e.marginXS,backgroundColor:g?e.colorPrimaryBg:e.colorBgContainer,transition:"all 0.2s ease"},onClick:()=>n(r.id),children:t.jsxs(y,{direction:"vertical",style:{width:"100%"},size:e.marginSM,children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",width:"100%",gap:e.marginSM},children:[t.jsxs(y,{align:"start",children:[t.jsx(A,{checked:g,onChange:()=>n(r.id),onClick:c=>c.stopPropagation()}),t.jsxs("div",{children:[t.jsx(L,{strong:!0,children:r.name||r.id}),t.jsx("div",{children:t.jsx(L,{code:!0,style:{fontSize:e.fontSizeSM,color:e.colorTextSecondary},children:r.id})})]}),r.isDefault?t.jsx(f,{color:"warning",children:i("chat.systemPromptSelector.defaultTag")}):null]}),t.jsxs(y,{size:"small",children:[t.jsx(v,{type:"text",size:"small",icon:l?t.jsx(q,{}):t.jsx(J,{}),onClick:c=>{c.stopPropagation(),h(r.id)},children:i(l?"chat.systemPromptSelector.hide":"chat.systemPromptSelector.preview")}),t.jsx(v,{type:"text",size:"small",icon:t.jsx(N,{}),onClick:c=>a(c,r),children:i("chat.systemPromptSelector.copy")})]})]}),r.description?t.jsx(L,{type:"secondary",style:{marginLeft:e.marginLG,fontSize:e.fontSizeSM},children:r.description}):null,t.jsxs(y,{size:"small",wrap:!0,style:{marginLeft:e.marginLG},children:[t.jsx(f,{color:"processing",children:i("chat.systemPromptSelector.lines",{count:j})}),t.jsx(f,{color:"purple",children:i("chat.systemPromptSelector.words",{count:u})}),t.jsx(f,{color:"success",children:i("chat.systemPromptSelector.chars",{count:P})})]}),l?t.jsx(re,{content:o,token:e,showGradient:x,onClick:c=>c.stopPropagation()}):t.jsx(se,{type:"secondary",ellipsis:{rows:3},style:{marginLeft:e.marginLG,marginBottom:0,color:e.colorTextSecondary},children:o||i("chat.systemPromptSelector.noContent")})]})},r.id)},{Text:ae}=B,{useToken:ie}=V,he=({open:r,onClose:e,onSelect:g,prompts:l,title:n,showCancelButton:h=!0})=>{const{t:a}=G(),{token:i}=ie(),[o,j]=O.useMessage(),u=z(s=>s.lastSelectedPromptId),P=z(s=>s.setLastSelectedPromptId),[x,c]=p.useState(null),[S,C]=p.useState(null),m=p.useMemo(()=>l.filter(s=>s.id&&s.id.trim()!==""),[l]),w=async(s,d)=>{s.stopPropagation();const M=d.content??"";try{await Z(M),o.success(a("success.promptCopied",{name:d.name}))}catch(D){console.error("[SystemPromptSelector] Failed to copy prompt:",D),o.error(a("error.copyPromptFailed"))}},R=n??a("chat.prompt.selectorTitle");p.useEffect(()=>{if(r){const s=m.find(M=>M.isDefault),d=u||(s==null?void 0:s.id)||(m.length>0?m[0].id:null);c(d)}},[r,u,m.length]);const $=s=>{c(s.id),P(s.id),g(s),e()},T=()=>{e()};return t.jsxs(t.Fragment,{children:[j,t.jsxs(U,{title:t.jsxs(y,{children:[t.jsx(Q,{}),R]}),open:r,onCancel:T,width:700,footer:t.jsx(_,{buttons:[...h?[k(T)]:[],ee(()=>{const s=m.find(d=>d.id===x);s&&$(s)},{text:a("chat.prompt.createButton"),disabled:!x})]}),styles:{body:{maxHeight:"70vh",overflowY:"auto",padding:i.paddingMD}},children:[t.jsx("div",{style:{marginBottom:i.marginMD},children:t.jsx(ae,{type:"secondary",style:{fontSize:i.fontSizeSM},children:a("chat.prompt.helperText")})}),m.length===0?t.jsx(K,{description:a("chat.prompt.emptyDescription"),style:{margin:i.marginLG}}):t.jsx("div",{children:m.map(s=>t.jsx(ne,{prompt:s,token:i,isSelected:x===s.id,isExpanded:S===s.id,onSelect:d=>c(d),onToggleExpand:d=>C(S===d?null:d),onCopy:w},s.id))})]})]})};export{he as default};
1
+ import{j as t,M as E,r as F,h as H}from"./vendor-markdown-teEfNS9t.js";import{i as I,u as G,a as p}from"./vendor-i18n-Dm-c3D_C.js";import{o as y,B as v,U as X,j as B,J as Y,n as A,x as f,aq as q,ar as J,as as N,at as O,a5 as U,Y as K,N as Q,t as V}from"./vendor-antd-qu012Od4.js";import{F as W,u as z,G as Z}from"./App-BE03KO2t.js";import"./vendor-mermaid-B53piAPW.js";import"./main-DE4q1A6J.js";const _=({buttons:r,className:e,style:g,size:l="middle",align:n="right"})=>{const h={className:e,style:{width:"100%",justifyContent:n==="left"?"flex-start":n==="center"?"center":"flex-end",...g}};return t.jsx(y,{...h,children:r.map(a=>t.jsx(v,{type:a.type||"default",disabled:a.disabled,loading:a.loading,danger:a.danger,onClick:a.onClick,size:l,icon:a.icon,children:a.text},a.key))})},k=(r,e)=>({key:"cancel",text:e||I.t("common.cancel"),type:"default",onClick:r}),ee=(r,e)=>({key:"ok",text:(e==null?void 0:e.text)||I.t("common.ok"),type:"primary",disabled:e==null?void 0:e.disabled,loading:e==null?void 0:e.loading,onClick:r}),{Text:b,Paragraph:te}=B,re=({content:r,token:e,showGradient:g,onClick:l})=>t.jsx(X,{size:"small",style:{marginLeft:e.marginLG,marginTop:e.marginXS,backgroundColor:e.colorBgLayout,borderColor:e.colorBorderSecondary},styles:{body:{padding:e.paddingMD}},onClick:l,children:t.jsxs("div",{style:{maxHeight:"60vh",overflowY:"auto",position:"relative",paddingRight:e.paddingXS},children:[t.jsx(E,{remarkPlugins:[F],components:{p:({children:n})=>t.jsx(te,{style:{marginBottom:e.marginSM},children:n}),ol:({children:n})=>t.jsx("ol",{style:{marginBottom:e.marginSM,paddingLeft:e.paddingLG},children:n}),ul:({children:n})=>t.jsx("ul",{style:{marginBottom:e.marginSM,paddingLeft:e.paddingLG},children:n}),li:({children:n})=>t.jsx("li",{style:{marginBottom:e.marginXS},children:n}),h1:({children:n})=>t.jsx(b,{strong:!0,style:{fontSize:e.fontSizeHeading3,marginBottom:e.marginSM,display:"block"},children:n}),h2:({children:n})=>t.jsx(b,{strong:!0,style:{fontSize:e.fontSizeHeading4,marginBottom:e.marginSM,display:"block"},children:n}),code:({inline:n,className:h,children:a,...i})=>{const o=/language-(\w+)/.exec(h||"");return n?t.jsx("code",{className:h,style:{backgroundColor:e.colorFillTertiary,padding:"0 4px",borderRadius:e.borderRadiusSM,fontSize:e.fontSizeSM},...i,children:a}):t.jsx(H,{style:W,language:(o==null?void 0:o[1])||"text",PreTag:"div",wrapLongLines:!0,children:String(a).replace(/\n$/,"")})}},children:r||"No content available."}),g?t.jsx("div",{style:{position:"sticky",bottom:0,height:48,background:`linear-gradient(180deg, transparent, ${e.colorBgLayout})`,pointerEvents:"none",marginTop:-48}}):null]})}),{Text:L,Paragraph:se}=B,ne=({prompt:r,token:e,isSelected:g,isExpanded:l,onSelect:n,onToggleExpand:h,onCopy:a})=>{const{t:i}=G(),o=r.content||"",{nonEmptyLineCount:j,wordCount:u,characterCount:P,showGradient:x}=p.useMemo(()=>{const S=(o?o.split(/\r?\n/):[]).filter(w=>w.trim().length>0).length,C=o.trim()?o.trim().split(/\s+/).filter(Boolean).length:0,m=o.length;return{nonEmptyLineCount:S,wordCount:C,characterCount:m,showGradient:!l&&m>600}},[o,l]);return t.jsx(Y.Item,{style:{cursor:"pointer",padding:e.paddingMD,borderRadius:e.borderRadius,border:g?`2px solid ${e.colorPrimary}`:`1px solid ${e.colorBorderSecondary}`,marginBottom:e.marginXS,backgroundColor:g?e.colorPrimaryBg:e.colorBgContainer,transition:"all 0.2s ease"},onClick:()=>n(r.id),children:t.jsxs(y,{direction:"vertical",style:{width:"100%"},size:e.marginSM,children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",width:"100%",gap:e.marginSM},children:[t.jsxs(y,{align:"start",children:[t.jsx(A,{checked:g,onChange:()=>n(r.id),onClick:c=>c.stopPropagation()}),t.jsxs("div",{children:[t.jsx(L,{strong:!0,children:r.name||r.id}),t.jsx("div",{children:t.jsx(L,{code:!0,style:{fontSize:e.fontSizeSM,color:e.colorTextSecondary},children:r.id})})]}),r.isDefault?t.jsx(f,{color:"warning",children:i("chat.systemPromptSelector.defaultTag")}):null]}),t.jsxs(y,{size:"small",children:[t.jsx(v,{type:"text",size:"small",icon:l?t.jsx(q,{}):t.jsx(J,{}),onClick:c=>{c.stopPropagation(),h(r.id)},children:i(l?"chat.systemPromptSelector.hide":"chat.systemPromptSelector.preview")}),t.jsx(v,{type:"text",size:"small",icon:t.jsx(N,{}),onClick:c=>a(c,r),children:i("chat.systemPromptSelector.copy")})]})]}),r.description?t.jsx(L,{type:"secondary",style:{marginLeft:e.marginLG,fontSize:e.fontSizeSM},children:r.description}):null,t.jsxs(y,{size:"small",wrap:!0,style:{marginLeft:e.marginLG},children:[t.jsx(f,{color:"processing",children:i("chat.systemPromptSelector.lines",{count:j})}),t.jsx(f,{color:"purple",children:i("chat.systemPromptSelector.words",{count:u})}),t.jsx(f,{color:"success",children:i("chat.systemPromptSelector.chars",{count:P})})]}),l?t.jsx(re,{content:o,token:e,showGradient:x,onClick:c=>c.stopPropagation()}):t.jsx(se,{type:"secondary",ellipsis:{rows:3},style:{marginLeft:e.marginLG,marginBottom:0,color:e.colorTextSecondary},children:o||i("chat.systemPromptSelector.noContent")})]})},r.id)},{Text:ae}=B,{useToken:ie}=V,he=({open:r,onClose:e,onSelect:g,prompts:l,title:n,showCancelButton:h=!0})=>{const{t:a}=G(),{token:i}=ie(),[o,j]=O.useMessage(),u=z(s=>s.lastSelectedPromptId),P=z(s=>s.setLastSelectedPromptId),[x,c]=p.useState(null),[S,C]=p.useState(null),m=p.useMemo(()=>l.filter(s=>s.id&&s.id.trim()!==""),[l]),w=async(s,d)=>{s.stopPropagation();const M=d.content??"";try{await Z(M),o.success(a("success.promptCopied",{name:d.name}))}catch(D){console.error("[SystemPromptSelector] Failed to copy prompt:",D),o.error(a("error.copyPromptFailed"))}},R=n??a("chat.prompt.selectorTitle");p.useEffect(()=>{if(r){const s=m.find(M=>M.isDefault),d=u||(s==null?void 0:s.id)||(m.length>0?m[0].id:null);c(d)}},[r,u,m.length]);const $=s=>{c(s.id),P(s.id),g(s),e()},T=()=>{e()};return t.jsxs(t.Fragment,{children:[j,t.jsxs(U,{title:t.jsxs(y,{children:[t.jsx(Q,{}),R]}),open:r,onCancel:T,width:700,footer:t.jsx(_,{buttons:[...h?[k(T)]:[],ee(()=>{const s=m.find(d=>d.id===x);s&&$(s)},{text:a("chat.prompt.createButton"),disabled:!x})]}),styles:{body:{maxHeight:"70vh",overflowY:"auto",padding:i.paddingMD}},children:[t.jsx("div",{style:{marginBottom:i.marginMD},children:t.jsx(ae,{type:"secondary",style:{fontSize:i.fontSizeSM},children:a("chat.prompt.helperText")})}),m.length===0?t.jsx(K,{description:a("chat.prompt.emptyDescription"),style:{margin:i.marginLG}}):t.jsx("div",{children:m.map(s=>t.jsx(ne,{prompt:s,token:i,isSelected:x===s.id,isExpanded:S===s.id,onSelect:d=>c(d),onToggleExpand:d=>C(S===d?null:d),onCopy:w},s.id))})]})]})};export{he as default};
@@ -1 +1 @@
1
- import{j as s}from"./vendor-markdown-teEfNS9t.js";import{u as M,a as S}from"./vendor-i18n-Dm-c3D_C.js";import{u as w,w as I,x as b,y as T,I as W}from"./App-CG8bbjSe.js";import{m as A}from"./MetricsService-BY057XSj.js";import{t as B,ai as D,ad as $,aj as R,X as _,D as v,ak as k,k as F,al as L,W as z,x as O}from"./vendor-antd-qu012Od4.js";import"./vendor-mermaid-Cez766TY.js";import"./main-Bae5Z9x6.js";const N=new Map,P=new Set(["Write","Edit","apply_patch","NotebookEdit"]),H=l=>{const n=l.match(/(?:file_path|Wrote file|Edited file)[:\s]*["']?([^\s"',]+)/i);if(n){const o=n[1];return o.split("/").pop()||o}return null},K=(l,n)=>{const o=n-l;if(o<0)return"";const e=Math.floor(o/1e3);if(e<60)return`${e}s`;const i=Math.floor(e/60);return i<60?`${i}m ${e%60}s`:`${Math.floor(i/60)}h ${i%60}m`},U=l=>{var p,j;let n=0,o=0,e=0,i=0,y=!1,x=0,d="";const h=new Set;let u=0,t=0;for(const a of l){const c=a.createdAt?new Date(a.createdAt).getTime():0;if(c>0&&(u===0||c<u)&&(u=c),c>t&&(t=c),a.isCompressed){y=!0,x++;continue}if(a.role==="user"&&!("type"in a&&a.type==="file_reference")&&n++,a.role==="assistant"){if("type"in a&&a.type==="tool_call"&&(e+=((p=a.toolCalls)==null?void 0:p.length)??0),"type"in a&&a.type==="tool_result"){const m=a;if(m.isError&&i++,P.has(m.toolName)){const f=H(((j=m.result)==null?void 0:j.result)??"");f&&h.add(f)}}if("type"in a&&a.type==="text"){o++;const m=a.content||"";m.length>0&&m.length>30&&(d=m.slice(0,300))}}}return{messageCount:l.length,userMessageCount:n,assistantMessageCount:o,toolCallCount:e,toolErrorCount:i,fileChanges:Array.from(h).slice(0,10),lastAssistantExcerpt:d,hasCompression:y,compressionCount:x,duration:u>0&&t>u?K(u,t):""}},Z=({sessionId:l,compact:n=!1})=>{const{t:o}=M(),{token:e}=B.useToken(),[i,y]=S.useState(!1),[x,d]=S.useState(()=>N.get(l)),h=w(I(l)),u=h==null?void 0:h.messages,t=S.useMemo(()=>!u||u.length===0?null:U(u),[u]);if(S.useEffect(()=>{let r=!1;const g=N.get(l);return g!==void 0?(d(g),()=>{r=!0}):(d(void 0),A.getSessionDetail(l).then(C=>{if(r)return;const E=(C==null?void 0:C.session)??null;N.set(l,E),d(E)},()=>{r||(N.set(l,null),d(null))}),()=>{r=!0})},[l]),!t||t.messageCount<3)return null;const p=t.fileChanges.length>0,j=t.lastAssistantExcerpt.length>0,a=n&&p?t.fileChanges:[],c=x==null?void 0:x.total_token_usage,m=c?b(c.total_tokens):null,f=c?s.jsxs("div",{style:{minWidth:180},children:[s.jsx("div",{style:{fontWeight:600,marginBottom:4},children:o("sessionSummary.totalTokens","Total tokens")}),s.jsxs("div",{children:[o("sessionSummary.promptTokens","Prompt"),":"," ",T(c.prompt_tokens)]}),s.jsxs("div",{children:[o("sessionSummary.completionTokens","Completion"),":"," ",T(c.completion_tokens)]}),s.jsxs("div",{children:[o("sessionSummary.totalTokens","Total tokens"),":"," ",T(c.total_tokens)]})]}):null;return s.jsxs("div",{className:`lotus-session-summary ${n?"lotus-session-summary--compact":""}`,style:{borderColor:e.colorBorderSecondary,background:`${e.colorBgElevated}`},children:[s.jsxs("div",{className:"lotus-session-summary-header",onClick:()=>y(r=>!r),role:"button",tabIndex:0,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),y(g=>!g))},"aria-expanded":i,children:[s.jsx("span",{className:"lotus-session-summary-header-icon",style:{color:e.colorPrimary},children:s.jsx(D,{})}),s.jsx("span",{className:"lotus-session-summary-header-title",style:{color:e.colorText},children:o("sessionSummary.title","Session Summary")}),!i&&s.jsxs("span",{className:"lotus-session-summary-stats",children:[s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx($,{className:"lotus-session-summary-stat-icon"}),s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.messageCount})]}),t.toolCallCount>0&&s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx(R,{className:"lotus-session-summary-stat-icon"}),s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.toolCallCount})]}),p&&s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx(_,{className:"lotus-session-summary-stat-icon"}),s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.fileChanges.length})]}),m&&s.jsx(v,{title:f,children:s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx(k,{className:"lotus-session-summary-stat-icon"}),s.jsx("span",{className:"lotus-session-summary-stat-value",children:m})]})})]}),s.jsx("span",{className:`lotus-session-summary-toggle ${i?"is-expanded":""}`,style:{color:e.colorTextTertiary},children:s.jsx(F,{})})]}),i&&s.jsxs("div",{className:"lotus-session-summary-body",children:[s.jsxs("div",{className:"lotus-session-summary-stats",children:[s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx($,{className:"lotus-session-summary-stat-icon"}),s.jsxs("span",{children:[s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.messageCount})," ",o("sessionSummary.messages","messages")]})]}),s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx("span",{className:"lotus-session-summary-stat-icon",children:"👤"}),s.jsxs("span",{children:[s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.userMessageCount})," ",o("sessionSummary.userTurns","user")]})]}),s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx("span",{className:"lotus-session-summary-stat-icon",children:"🤖"}),s.jsxs("span",{children:[s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.assistantMessageCount})," ",o("sessionSummary.assistantTurns","assistant")]})]}),t.toolCallCount>0&&s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx(R,{className:"lotus-session-summary-stat-icon"}),s.jsxs("span",{children:[s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.toolCallCount})," ",o("sessionSummary.toolCalls","tool calls")]})]}),t.toolErrorCount>0&&s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:"#ff4d4f"},children:[s.jsx(L,{className:"lotus-session-summary-stat-icon"}),s.jsxs("span",{children:[s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.toolErrorCount})," ",o("sessionSummary.errors","errors")]})]}),t.duration&&s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx(z,{className:"lotus-session-summary-stat-icon"}),s.jsx("span",{children:t.duration})]}),t.hasCompression&&s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx(k,{className:"lotus-session-summary-stat-icon"}),s.jsxs("span",{children:[s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.compressionCount})," ",o("sessionSummary.compressions","compressions")]})]}),m&&s.jsx(v,{title:f,children:s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx(k,{className:"lotus-session-summary-stat-icon"}),s.jsxs("span",{children:[s.jsx("span",{className:"lotus-session-summary-stat-value",children:m})," ",o("sessionSummary.totalTokens","total tokens")]})]})})]}),p&&s.jsxs("div",{children:[s.jsx("div",{style:{fontSize:n?10:11,fontWeight:600,color:e.colorTextSecondary,marginBottom:n?2:4,textTransform:"uppercase",letterSpacing:.3},children:o("sessionSummary.filesChanged","Files Changed")}),n?s.jsx(W,{items:a,style:{lineHeight:1.4,wordBreak:"break-word",whiteSpace:"normal"}}):s.jsx("div",{className:"lotus-session-summary-files",children:t.fileChanges.map(r=>s.jsx(v,{title:r,children:s.jsxs(O,{bordered:!1,className:"lotus-session-summary-file-tag",children:[s.jsx(_,{style:{marginRight:4}}),r]})},r))})]}),j&&s.jsxs("div",{children:[s.jsx("div",{style:{fontSize:n?10:11,fontWeight:600,color:e.colorTextSecondary,marginBottom:n?2:4,textTransform:"uppercase",letterSpacing:.3},children:o("sessionSummary.lastResponse","Latest Response")}),s.jsx("div",{className:"lotus-session-summary-conclusion",style:{color:e.colorTextSecondary},children:t.lastAssistantExcerpt})]})]})]})};export{Z as SessionSummaryCard,Z as default};
1
+ import{j as s}from"./vendor-markdown-teEfNS9t.js";import{u as M,a as S}from"./vendor-i18n-Dm-c3D_C.js";import{u as w,w as I,x as b,y as T,I as W}from"./App-BE03KO2t.js";import{m as A}from"./MetricsService-C_09AaLH.js";import{t as B,ai as D,ad as $,aj as R,X as _,D as v,ak as k,k as F,al as L,W as z,x as O}from"./vendor-antd-qu012Od4.js";import"./vendor-mermaid-B53piAPW.js";import"./main-DE4q1A6J.js";const N=new Map,P=new Set(["Write","Edit","apply_patch","NotebookEdit"]),H=l=>{const n=l.match(/(?:file_path|Wrote file|Edited file)[:\s]*["']?([^\s"',]+)/i);if(n){const o=n[1];return o.split("/").pop()||o}return null},K=(l,n)=>{const o=n-l;if(o<0)return"";const e=Math.floor(o/1e3);if(e<60)return`${e}s`;const i=Math.floor(e/60);return i<60?`${i}m ${e%60}s`:`${Math.floor(i/60)}h ${i%60}m`},U=l=>{var p,j;let n=0,o=0,e=0,i=0,y=!1,x=0,d="";const h=new Set;let u=0,t=0;for(const a of l){const c=a.createdAt?new Date(a.createdAt).getTime():0;if(c>0&&(u===0||c<u)&&(u=c),c>t&&(t=c),a.isCompressed){y=!0,x++;continue}if(a.role==="user"&&!("type"in a&&a.type==="file_reference")&&n++,a.role==="assistant"){if("type"in a&&a.type==="tool_call"&&(e+=((p=a.toolCalls)==null?void 0:p.length)??0),"type"in a&&a.type==="tool_result"){const m=a;if(m.isError&&i++,P.has(m.toolName)){const f=H(((j=m.result)==null?void 0:j.result)??"");f&&h.add(f)}}if("type"in a&&a.type==="text"){o++;const m=a.content||"";m.length>0&&m.length>30&&(d=m.slice(0,300))}}}return{messageCount:l.length,userMessageCount:n,assistantMessageCount:o,toolCallCount:e,toolErrorCount:i,fileChanges:Array.from(h).slice(0,10),lastAssistantExcerpt:d,hasCompression:y,compressionCount:x,duration:u>0&&t>u?K(u,t):""}},Z=({sessionId:l,compact:n=!1})=>{const{t:o}=M(),{token:e}=B.useToken(),[i,y]=S.useState(!1),[x,d]=S.useState(()=>N.get(l)),h=w(I(l)),u=h==null?void 0:h.messages,t=S.useMemo(()=>!u||u.length===0?null:U(u),[u]);if(S.useEffect(()=>{let r=!1;const g=N.get(l);return g!==void 0?(d(g),()=>{r=!0}):(d(void 0),A.getSessionDetail(l).then(C=>{if(r)return;const E=(C==null?void 0:C.session)??null;N.set(l,E),d(E)},()=>{r||(N.set(l,null),d(null))}),()=>{r=!0})},[l]),!t||t.messageCount<3)return null;const p=t.fileChanges.length>0,j=t.lastAssistantExcerpt.length>0,a=n&&p?t.fileChanges:[],c=x==null?void 0:x.total_token_usage,m=c?b(c.total_tokens):null,f=c?s.jsxs("div",{style:{minWidth:180},children:[s.jsx("div",{style:{fontWeight:600,marginBottom:4},children:o("sessionSummary.totalTokens","Total tokens")}),s.jsxs("div",{children:[o("sessionSummary.promptTokens","Prompt"),":"," ",T(c.prompt_tokens)]}),s.jsxs("div",{children:[o("sessionSummary.completionTokens","Completion"),":"," ",T(c.completion_tokens)]}),s.jsxs("div",{children:[o("sessionSummary.totalTokens","Total tokens"),":"," ",T(c.total_tokens)]})]}):null;return s.jsxs("div",{className:`lotus-session-summary ${n?"lotus-session-summary--compact":""}`,style:{borderColor:e.colorBorderSecondary,background:`${e.colorBgElevated}`},children:[s.jsxs("div",{className:"lotus-session-summary-header",onClick:()=>y(r=>!r),role:"button",tabIndex:0,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),y(g=>!g))},"aria-expanded":i,children:[s.jsx("span",{className:"lotus-session-summary-header-icon",style:{color:e.colorPrimary},children:s.jsx(D,{})}),s.jsx("span",{className:"lotus-session-summary-header-title",style:{color:e.colorText},children:o("sessionSummary.title","Session Summary")}),!i&&s.jsxs("span",{className:"lotus-session-summary-stats",children:[s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx($,{className:"lotus-session-summary-stat-icon"}),s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.messageCount})]}),t.toolCallCount>0&&s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx(R,{className:"lotus-session-summary-stat-icon"}),s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.toolCallCount})]}),p&&s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx(_,{className:"lotus-session-summary-stat-icon"}),s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.fileChanges.length})]}),m&&s.jsx(v,{title:f,children:s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx(k,{className:"lotus-session-summary-stat-icon"}),s.jsx("span",{className:"lotus-session-summary-stat-value",children:m})]})})]}),s.jsx("span",{className:`lotus-session-summary-toggle ${i?"is-expanded":""}`,style:{color:e.colorTextTertiary},children:s.jsx(F,{})})]}),i&&s.jsxs("div",{className:"lotus-session-summary-body",children:[s.jsxs("div",{className:"lotus-session-summary-stats",children:[s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx($,{className:"lotus-session-summary-stat-icon"}),s.jsxs("span",{children:[s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.messageCount})," ",o("sessionSummary.messages","messages")]})]}),s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx("span",{className:"lotus-session-summary-stat-icon",children:"👤"}),s.jsxs("span",{children:[s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.userMessageCount})," ",o("sessionSummary.userTurns","user")]})]}),s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx("span",{className:"lotus-session-summary-stat-icon",children:"🤖"}),s.jsxs("span",{children:[s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.assistantMessageCount})," ",o("sessionSummary.assistantTurns","assistant")]})]}),t.toolCallCount>0&&s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx(R,{className:"lotus-session-summary-stat-icon"}),s.jsxs("span",{children:[s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.toolCallCount})," ",o("sessionSummary.toolCalls","tool calls")]})]}),t.toolErrorCount>0&&s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:"#ff4d4f"},children:[s.jsx(L,{className:"lotus-session-summary-stat-icon"}),s.jsxs("span",{children:[s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.toolErrorCount})," ",o("sessionSummary.errors","errors")]})]}),t.duration&&s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx(z,{className:"lotus-session-summary-stat-icon"}),s.jsx("span",{children:t.duration})]}),t.hasCompression&&s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx(k,{className:"lotus-session-summary-stat-icon"}),s.jsxs("span",{children:[s.jsx("span",{className:"lotus-session-summary-stat-value",children:t.compressionCount})," ",o("sessionSummary.compressions","compressions")]})]}),m&&s.jsx(v,{title:f,children:s.jsxs("span",{className:"lotus-session-summary-stat",style:{color:e.colorTextSecondary},children:[s.jsx(k,{className:"lotus-session-summary-stat-icon"}),s.jsxs("span",{children:[s.jsx("span",{className:"lotus-session-summary-stat-value",children:m})," ",o("sessionSummary.totalTokens","total tokens")]})]})})]}),p&&s.jsxs("div",{children:[s.jsx("div",{style:{fontSize:n?10:11,fontWeight:600,color:e.colorTextSecondary,marginBottom:n?2:4,textTransform:"uppercase",letterSpacing:.3},children:o("sessionSummary.filesChanged","Files Changed")}),n?s.jsx(W,{items:a,style:{lineHeight:1.4,wordBreak:"break-word",whiteSpace:"normal"}}):s.jsx("div",{className:"lotus-session-summary-files",children:t.fileChanges.map(r=>s.jsx(v,{title:r,children:s.jsxs(O,{bordered:!1,className:"lotus-session-summary-file-tag",children:[s.jsx(_,{style:{marginRight:4}}),r]})},r))})]}),j&&s.jsxs("div",{children:[s.jsx("div",{style:{fontSize:n?10:11,fontWeight:600,color:e.colorTextSecondary,marginBottom:n?2:4,textTransform:"uppercase",letterSpacing:.3},children:o("sessionSummary.lastResponse","Latest Response")}),s.jsx("div",{className:"lotus-session-summary-conclusion",style:{color:e.colorTextSecondary},children:t.lastAssistantExcerpt})]})]})]})};export{Z as SessionSummaryCard,Z 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-CG8bbjSe.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-Cez766TY.js";import"./main-Bae5Z9x6.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};
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-BE03KO2t.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-B53piAPW.js";import"./main-DE4q1A6J.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};
@@ -1 +1 @@
1
- var te=Object.defineProperty;var se=(i,t,s)=>t in i?te(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s;var D=(i,t,s)=>se(i,typeof t!="symbol"?t+"":t,s);import{j as e}from"./vendor-markdown-teEfNS9t.js";import{u as C,a as o,i as q}from"./vendor-i18n-Dm-c3D_C.js";import{S as L,H as ae}from"./App-CG8bbjSe.js";import{A as O,t as U,j as V,a5 as Z,o as k,B as T,ay as N,az as re,q as ie,aA as J,U as ne,a0 as Y,Y as B,J as W,Z as E,Q as M,aB as K,aC as ce,z as oe,V as le,I as $,a6 as de,aD as he}from"./vendor-antd-qu012Od4.js";import"./main-Bae5Z9x6.js";import"./vendor-mermaid-Cez766TY.js";const pe=({visible:i,onClose:t,onSelect:s})=>{const{t:c}=C(),{message:r}=O.useApp(),{token:a}=U.useToken(),{Text:n}=V,[u,j]=o.useState(!1),[l,m]=o.useState(""),[g,I]=o.useState(),[b,w]=o.useState([]),[v,f]=o.useState([]);o.useEffect(()=>{i&&y()},[i]);const y=async d=>{j(!0);try{const p=await L.browseFolder(d);m(p.current_path),I(p.parent_path),w(p.folders)}catch(p){console.error(c("chat.folderBrowser.readFolderError"),p),r.error(c("chat.folderBrowser.readFolderError"))}finally{j(!1)}},x=d=>{f([...v,l]),y(d.path)},z=()=>{g&&(f(v.slice(0,-1)),y(g))},R=()=>{f([]),y()},P=()=>{s(l),t()},S=()=>{if(!l)return[];const d=l.split(/[/\\]/).filter(Boolean);return l.startsWith("/")&&d.unshift("/"),d},_=d=>{const F=S().slice(0,d+1).join("/"),H=(l.startsWith("/"),F);y(H)};return e.jsx(Z,{title:c("chat.folderBrowser.title"),open:i,onCancel:t,width:700,footer:null,children:e.jsxs(k,{direction:"vertical",size:"middle",style:{width:"100%"},children:[e.jsxs(k,{children:[e.jsx(T,{icon:e.jsx(N,{}),onClick:R,size:"small",children:c("common.home")}),e.jsx(T,{icon:e.jsx(re,{}),onClick:z,disabled:!g,size:"small",children:c("common.parentDirectory")}),e.jsx(T,{type:"primary",icon:e.jsx(ie,{}),onClick:P,size:"small",children:c("chat.folderBrowser.selectCurrent")})]}),e.jsx(J,{children:S().map((d,p)=>e.jsx(J.Item,{children:e.jsx(T,{type:"link",size:"small",onClick:()=>_(p),style:{padding:0},children:d==="/"?e.jsx(N,{}):d})},S().slice(0,p+1).join("/")))}),e.jsxs(ne,{size:"small",styles:{body:{padding:a.paddingXS}},children:[e.jsx(n,{type:"secondary",style:{fontSize:12},children:c("common.currentPath")})," ",e.jsx(n,{code:!0,children:l})]}),e.jsx(Y,{spinning:u,children:b.length===0&&!u?e.jsx(B,{image:B.PRESENTED_IMAGE_SIMPLE,description:e.jsx(n,{type:"secondary",children:c("chat.folderBrowser.emptyFolder")})}):e.jsx(W,{dataSource:b,style:{maxHeight:400,overflowY:"auto"},renderItem:d=>e.jsx(W.Item,{style:{padding:0},children:e.jsx(T,{type:"text",icon:e.jsx(E,{}),onClick:()=>x(d),style:{width:"100%",textAlign:"left",padding:`${a.paddingXS}px ${a.paddingSM}px`},children:d.name})})})}),e.jsx(n,{type:"secondary",style:{fontSize:12},children:c("chat.folderBrowser.tip")})]})})};class ue{constructor(t={}){D(this,"cache",new Map);D(this,"pendingValidations",new Map);D(this,"options");this.options={debounceMs:t.debounceMs??300,cacheTimeoutMs:t.cacheTimeoutMs??5*60*1e3,maxRetries:t.maxRetries??3}}async validateWorkspace(t){if(!t||t.trim().length===0)return{path:"",is_valid:!1,error_message:q.t("chat.workspace.errorEnterPath")};const s=t.trim(),c=this.getCachedResult(s);if(c)return c;const r=this.pendingValidations.get(s);if(r)return r;const a=this.performValidation(s);this.pendingValidations.set(s,a);try{const n=await a;return this.setCachedResult(s,n),n}finally{this.pendingValidations.delete(s)}}validateWorkspaceDebounced(t,s){const r=setTimeout(async()=>{try{const a=await this.validateWorkspace(t);s(a)}catch(a){const n={path:t,is_valid:!1,error_message:a instanceof Error?a.message:q.t("chat.workspace.checkDescription")};s(n)}},this.options.debounceMs);return()=>{clearTimeout(r)}}clearCache(){this.cache.clear()}getCachedResult(t){const s=this.cache.get(t);return s?Date.now()-s.timestamp>this.options.cacheTimeoutMs?(this.cache.delete(t),null):s.result:null}setCachedResult(t,s){this.cache.set(t,{result:s,timestamp:Date.now()})}async performValidation(t,s=0){try{return await ae.post("workspace/validate",{path:t})}catch(c){if(s<this.options.maxRetries&&this.isRetryableError(c))return await this.delay(Math.pow(2,s)*1e3),this.performValidation(t,s+1);throw c}}isRetryableError(t){return t instanceof Error?t.message.includes("Failed to fetch")||t.message.includes("HTTP error! status: 5"):!1}delay(t){return new Promise(s=>setTimeout(s,t))}async validateMultiplePaths(t){const c=[];for(let r=0;r<t.length;r+=5){const a=t.slice(r,r+5),n=await Promise.all(a.map(u=>this.validateWorkspace(u)));c.push(...n),r+5<t.length&&await this.delay(100)}return c}}const ge=new ue,me=({value:i="",onChange:t,showRecentWorkspaces:s,showSuggestions:c,onValidationChange:r})=>{const{message:a}=O.useApp(),{t:n}=C(),[u,j]=o.useState(i),[l,m]=o.useState({isValidating:!1,result:null}),[g,I]=o.useState([]),[b,w]=o.useState(!1),[v,f]=o.useState([]),[y,x]=o.useState(!1),[z,R]=o.useState(!1),P=o.useRef(null),S=o.useRef(null);o.useEffect(()=>{j(i)},[i]);const _=o.useCallback(async()=>{x(!0);try{const h=await L.getRecentWorkspaces();I(h.slice(0,5))}catch(h){console.error("Failed to load recent workspaces:",h),I([])}finally{x(!1)}},[]),d=o.useCallback(async()=>{R(!0);try{const h=await L.getPathSuggestions();f(h.suggestions.slice(0,8))}catch(h){console.error("Failed to load suggestions:",h),f([])}finally{R(!1)}},[]);o.useEffect(()=>{s&&_(),c&&d();const h=P.current,A=S.current;return()=>{h&&h.abort(),A&&A()}},[s,c,_,d]);const p=o.useCallback(h=>{j(h),t&&t(h),P.current&&P.current.abort(),S.current&&S.current(),h.trim()?(m({isValidating:!0,result:null}),S.current=ge.validateWorkspaceDebounced(h.trim(),A=>{m({isValidating:!1,result:A}),r&&r(A)})):(m({isValidating:!1,result:null}),r&&r(null))},[t,r]),F=o.useCallback(()=>{w(!0)},[]),H=o.useCallback(h=>{p(h),a.success(n("chat.workspace.folderSelected"))},[p,a,n]),ee=o.useCallback(h=>{p(h)},[p]);return{path:u,validationStatus:l,recentWorkspaces:g,suggestions:v,isLoadingRecent:y,isLoadingSuggestions:z,folderBrowserVisible:b,setFolderBrowserVisible:w,handlePathChange:p,handleBrowseClick:F,handleFolderSelect:H,handleWorkspaceSelect:ee}},{Text:X}=V,xe=({show:i,isLoading:t,recentWorkspaces:s,onSelect:c,token:r})=>{const{t:a}=C();return i?e.jsxs(M,{vertical:!0,gap:r.marginXS,style:{marginTop:r.marginMD},children:[e.jsxs(k,{style:{paddingInline:r.paddingSM},children:[e.jsx(K,{}),e.jsx(X,{strong:!0,children:a("chat.workspace.recentTitle")})]}),t?e.jsx(M,{justify:"center",style:{padding:r.paddingSM},children:e.jsx(Y,{size:"small"})}):s.length===0?e.jsx(B,{description:a("chat.workspace.noRecentWorkspaces"),image:B.PRESENTED_IMAGE_SIMPLE,style:{padding:r.paddingSM}}):e.jsx(W,{size:"small",dataSource:s,style:{paddingInline:r.paddingSM},renderItem:n=>e.jsx(W.Item,{style:{padding:0},children:e.jsx(T,{type:"text",onClick:()=>c(n.path),style:{width:"100%",textAlign:"left",padding:`${r.paddingXS}px 0`,height:"auto"},children:e.jsxs(M,{justify:"space-between",align:"center",style:{width:"100%"},children:[e.jsxs(k,{children:[e.jsx(E,{style:{color:r.colorWarning}}),e.jsx(X,{strong:!0,children:n.workspace_name||n.path.split("/").pop()||a("chat.workspace.defaultWorkspaceName")})]}),e.jsx(X,{type:"secondary",ellipsis:{tooltip:n.path},style:{fontSize:12,maxWidth:"55%",textAlign:"right"},children:n.path})]})})})})]}):null},{Text:G}=V,fe=(i,t)=>{switch(i.suggestion_type){case"home":return e.jsx(N,{style:{color:t.colorPrimary}});case"documents":case"desktop":case"downloads":return e.jsx(E,{style:{color:t.colorSuccess}});case"recent":return e.jsx(K,{style:{color:t.colorWarning}});default:return e.jsx(E,{})}},ye=({show:i,isLoading:t,suggestions:s,onSelect:c,token:r})=>{const{t:a}=C();return i?e.jsxs(M,{vertical:!0,gap:r.marginXS,style:{marginTop:r.marginMD},children:[e.jsxs(k,{style:{paddingInline:r.paddingSM},children:[e.jsx(E,{}),e.jsx(G,{strong:!0,children:a("chat.workspace.suggestedTitle")})]}),t?e.jsx(M,{justify:"center",style:{padding:r.paddingSM},children:e.jsx(Y,{size:"small"})}):s.length===0?e.jsx(B,{description:a("chat.workspace.noSuggestions"),image:B.PRESENTED_IMAGE_SIMPLE,style:{padding:r.paddingSM}}):e.jsx(W,{size:"small",dataSource:s,style:{paddingInline:r.paddingSM},renderItem:n=>e.jsx(W.Item,{style:{padding:0},children:e.jsx(T,{type:"text",onClick:()=>c(n.path),style:{width:"100%",textAlign:"left",padding:`${r.paddingXS}px 0`,height:"auto"},children:e.jsxs(M,{justify:"space-between",align:"center",style:{width:"100%"},children:[e.jsxs(k,{children:[fe(n,r),e.jsx(G,{strong:!0,children:n.name})]}),e.jsx(G,{type:"secondary",ellipsis:{tooltip:n.path},style:{fontSize:12,maxWidth:"55%",textAlign:"right"},children:n.path})]})})})})]}):null},je=({isValidating:i,result:t,token:s})=>i?e.jsx(ce,{style:{color:s.colorPrimary}}):t?t.is_valid?e.jsx(oe,{style:{color:s.colorSuccess}}):e.jsx(le,{style:{color:s.colorError}}):null,{Text:Q}=V,we=({result:i,token:t})=>{const{t:s}=C();return i?e.jsx("div",{style:{marginTop:t.marginXS},children:i.is_valid?e.jsx($,{type:"success",message:e.jsxs(k,{children:[e.jsx("span",{children:s("chat.workspace.validWorkspace")}),i.workspace_name&&e.jsxs(Q,{type:"secondary",children:["(",i.workspace_name,")"]}),i.file_count!==void 0&&e.jsx(Q,{type:"secondary",children:s("chat.workspace.fileCount",{count:i.file_count})})]}),showIcon:!0}):e.jsx($,{type:"error",message:i.error_message||s("validation.invalidPath"),showIcon:!0})}):null},{Text:Se}=V,ke=({value:i="",onChange:t,placeholder:s,disabled:c=!1,allowBrowse:r=!0,showRecentWorkspaces:a=!0,showSuggestions:n=!0,onValidationChange:u,className:j,style:l})=>{const{t:m}=C(),{token:g}=U.useToken(),I=s??m("chat.workspace.placeholder"),{path:b,validationStatus:w,recentWorkspaces:v,suggestions:f,isLoadingRecent:y,isLoadingSuggestions:x,folderBrowserVisible:z,setFolderBrowserVisible:R,handlePathChange:P,handleBrowseClick:S,handleFolderSelect:_,handleWorkspaceSelect:d}=me({value:i,onChange:t,showRecentWorkspaces:a,showSuggestions:n,onValidationChange:u});return e.jsxs("div",{className:j,style:l,children:[e.jsx(de,{value:b,onChange:p=>P(p.target.value),placeholder:I,disabled:c,size:"middle",style:{width:"100%"},suffix:e.jsx(je,{isValidating:w.isValidating,result:w.result,token:g}),addonBefore:e.jsxs(k,{children:[e.jsx(E,{}),e.jsx(Se,{children:m("chat.workspace.label")})]}),addonAfter:r?e.jsx(T,{"aria-label":m("chat.workspace.browseFolder"),title:m("chat.workspace.browseFolder"),icon:e.jsx(E,{}),onClick:S,disabled:c,type:"text",size:"middle",style:{display:"inline-flex",alignItems:"center"}}):void 0}),e.jsx(we,{result:w.result,token:g}),(a||n)&&e.jsxs(e.Fragment,{children:[e.jsx(he,{style:{margin:"16px 0 12px 0"}}),e.jsx(xe,{show:a,isLoading:y,recentWorkspaces:v,onSelect:d,token:g}),e.jsx(ye,{show:n,isLoading:x,suggestions:f,onSelect:d,token:g})]}),e.jsx(pe,{visible:z,onClose:()=>R(!1),onSelect:_})]})},{Title:Ie}=V,_e=({open:i,initialPath:t="",loading:s=!1,onSubmit:c,onCancel:r})=>{const{t:a}=C(),{message:n}=O.useApp(),[u,j]=o.useState(t),[l,m]=o.useState(null),[g,I]=o.useState(!1);o.useEffect(()=>{i&&(j(t),m(null))},[i,t]);const b=x=>{j(x)},w=x=>{m(x)},v=async()=>{if(!u.trim()){n.error(a("chat.workspace.errorEnterPath"));return}l&&!l.is_valid?Z.confirm({title:a("chat.workspace.invalidTitle"),content:e.jsxs("div",{children:[e.jsx("p",{children:a("chat.workspace.issuesDetected")}),e.jsx("p",{children:l.error_message||a("chat.workspace.invalidTitle")}),e.jsx("p",{children:a("chat.workspace.confirmSaveInvalid")})]}),okText:a("common.saveAnyway"),cancelText:a("common.cancel"),onOk:()=>f()}):f()},f=async()=>{I(!0);try{l!=null&&l.is_valid&&await L.addRecentWorkspace(u.trim(),{workspace_name:l.workspace_name}),c(u.trim())}catch(x){console.error("Failed to save workspace path:",x),n.error(a("chat.workspace.errorSaveFailed"))}finally{I(!1)}},y=!u.trim()||s||g;return e.jsx(Z,{open:i,title:e.jsx(k,{children:e.jsx(Ie,{level:4,style:{margin:0},children:a("chat.workspace.modalTitle")})}),okText:a("common.save"),cancelText:a("common.cancel"),onOk:v,onCancel:r,okButtonProps:{disabled:y,loading:g||s},width:600,destroyOnClose:!0,children:e.jsxs(k,{direction:"vertical",size:"middle",style:{width:"100%"},children:[e.jsx($,{message:a("chat.workspace.descriptionTitle"),description:e.jsxs("div",{children:[e.jsx("p",{children:a("chat.workspace.descriptionP1")}),e.jsx("p",{children:a("chat.workspace.descriptionP2")})]}),type:"info",showIcon:!0}),e.jsx(ke,{value:u,onChange:b,onValidationChange:w,placeholder:a("chat.workspace.placeholder"),disabled:g,allowBrowse:!0,showRecentWorkspaces:!0,showSuggestions:!0}),l&&!l.is_valid&&e.jsx($,{message:a("chat.workspace.checkTitle"),description:l.error_message||a("chat.workspace.checkDescription"),type:"warning",showIcon:!0})]})})};export{_e as default};
1
+ var te=Object.defineProperty;var se=(i,t,s)=>t in i?te(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s;var D=(i,t,s)=>se(i,typeof t!="symbol"?t+"":t,s);import{j as e}from"./vendor-markdown-teEfNS9t.js";import{u as C,a as o,i as q}from"./vendor-i18n-Dm-c3D_C.js";import{S as L,H as ae}from"./App-BE03KO2t.js";import{A as O,t as U,j as V,a5 as Z,o as k,B as T,ay as N,az as re,q as ie,aA as J,U as ne,a0 as Y,Y as B,J as W,Z as E,Q as M,aB as K,aC as ce,z as oe,V as le,I as $,a6 as de,aD as he}from"./vendor-antd-qu012Od4.js";import"./main-DE4q1A6J.js";import"./vendor-mermaid-B53piAPW.js";const pe=({visible:i,onClose:t,onSelect:s})=>{const{t:c}=C(),{message:r}=O.useApp(),{token:a}=U.useToken(),{Text:n}=V,[u,j]=o.useState(!1),[l,m]=o.useState(""),[g,I]=o.useState(),[b,w]=o.useState([]),[v,f]=o.useState([]);o.useEffect(()=>{i&&y()},[i]);const y=async d=>{j(!0);try{const p=await L.browseFolder(d);m(p.current_path),I(p.parent_path),w(p.folders)}catch(p){console.error(c("chat.folderBrowser.readFolderError"),p),r.error(c("chat.folderBrowser.readFolderError"))}finally{j(!1)}},x=d=>{f([...v,l]),y(d.path)},z=()=>{g&&(f(v.slice(0,-1)),y(g))},R=()=>{f([]),y()},P=()=>{s(l),t()},S=()=>{if(!l)return[];const d=l.split(/[/\\]/).filter(Boolean);return l.startsWith("/")&&d.unshift("/"),d},_=d=>{const F=S().slice(0,d+1).join("/"),H=(l.startsWith("/"),F);y(H)};return e.jsx(Z,{title:c("chat.folderBrowser.title"),open:i,onCancel:t,width:700,footer:null,children:e.jsxs(k,{direction:"vertical",size:"middle",style:{width:"100%"},children:[e.jsxs(k,{children:[e.jsx(T,{icon:e.jsx(N,{}),onClick:R,size:"small",children:c("common.home")}),e.jsx(T,{icon:e.jsx(re,{}),onClick:z,disabled:!g,size:"small",children:c("common.parentDirectory")}),e.jsx(T,{type:"primary",icon:e.jsx(ie,{}),onClick:P,size:"small",children:c("chat.folderBrowser.selectCurrent")})]}),e.jsx(J,{children:S().map((d,p)=>e.jsx(J.Item,{children:e.jsx(T,{type:"link",size:"small",onClick:()=>_(p),style:{padding:0},children:d==="/"?e.jsx(N,{}):d})},S().slice(0,p+1).join("/")))}),e.jsxs(ne,{size:"small",styles:{body:{padding:a.paddingXS}},children:[e.jsx(n,{type:"secondary",style:{fontSize:12},children:c("common.currentPath")})," ",e.jsx(n,{code:!0,children:l})]}),e.jsx(Y,{spinning:u,children:b.length===0&&!u?e.jsx(B,{image:B.PRESENTED_IMAGE_SIMPLE,description:e.jsx(n,{type:"secondary",children:c("chat.folderBrowser.emptyFolder")})}):e.jsx(W,{dataSource:b,style:{maxHeight:400,overflowY:"auto"},renderItem:d=>e.jsx(W.Item,{style:{padding:0},children:e.jsx(T,{type:"text",icon:e.jsx(E,{}),onClick:()=>x(d),style:{width:"100%",textAlign:"left",padding:`${a.paddingXS}px ${a.paddingSM}px`},children:d.name})})})}),e.jsx(n,{type:"secondary",style:{fontSize:12},children:c("chat.folderBrowser.tip")})]})})};class ue{constructor(t={}){D(this,"cache",new Map);D(this,"pendingValidations",new Map);D(this,"options");this.options={debounceMs:t.debounceMs??300,cacheTimeoutMs:t.cacheTimeoutMs??5*60*1e3,maxRetries:t.maxRetries??3}}async validateWorkspace(t){if(!t||t.trim().length===0)return{path:"",is_valid:!1,error_message:q.t("chat.workspace.errorEnterPath")};const s=t.trim(),c=this.getCachedResult(s);if(c)return c;const r=this.pendingValidations.get(s);if(r)return r;const a=this.performValidation(s);this.pendingValidations.set(s,a);try{const n=await a;return this.setCachedResult(s,n),n}finally{this.pendingValidations.delete(s)}}validateWorkspaceDebounced(t,s){const r=setTimeout(async()=>{try{const a=await this.validateWorkspace(t);s(a)}catch(a){const n={path:t,is_valid:!1,error_message:a instanceof Error?a.message:q.t("chat.workspace.checkDescription")};s(n)}},this.options.debounceMs);return()=>{clearTimeout(r)}}clearCache(){this.cache.clear()}getCachedResult(t){const s=this.cache.get(t);return s?Date.now()-s.timestamp>this.options.cacheTimeoutMs?(this.cache.delete(t),null):s.result:null}setCachedResult(t,s){this.cache.set(t,{result:s,timestamp:Date.now()})}async performValidation(t,s=0){try{return await ae.post("workspace/validate",{path:t})}catch(c){if(s<this.options.maxRetries&&this.isRetryableError(c))return await this.delay(Math.pow(2,s)*1e3),this.performValidation(t,s+1);throw c}}isRetryableError(t){return t instanceof Error?t.message.includes("Failed to fetch")||t.message.includes("HTTP error! status: 5"):!1}delay(t){return new Promise(s=>setTimeout(s,t))}async validateMultiplePaths(t){const c=[];for(let r=0;r<t.length;r+=5){const a=t.slice(r,r+5),n=await Promise.all(a.map(u=>this.validateWorkspace(u)));c.push(...n),r+5<t.length&&await this.delay(100)}return c}}const ge=new ue,me=({value:i="",onChange:t,showRecentWorkspaces:s,showSuggestions:c,onValidationChange:r})=>{const{message:a}=O.useApp(),{t:n}=C(),[u,j]=o.useState(i),[l,m]=o.useState({isValidating:!1,result:null}),[g,I]=o.useState([]),[b,w]=o.useState(!1),[v,f]=o.useState([]),[y,x]=o.useState(!1),[z,R]=o.useState(!1),P=o.useRef(null),S=o.useRef(null);o.useEffect(()=>{j(i)},[i]);const _=o.useCallback(async()=>{x(!0);try{const h=await L.getRecentWorkspaces();I(h.slice(0,5))}catch(h){console.error("Failed to load recent workspaces:",h),I([])}finally{x(!1)}},[]),d=o.useCallback(async()=>{R(!0);try{const h=await L.getPathSuggestions();f(h.suggestions.slice(0,8))}catch(h){console.error("Failed to load suggestions:",h),f([])}finally{R(!1)}},[]);o.useEffect(()=>{s&&_(),c&&d();const h=P.current,A=S.current;return()=>{h&&h.abort(),A&&A()}},[s,c,_,d]);const p=o.useCallback(h=>{j(h),t&&t(h),P.current&&P.current.abort(),S.current&&S.current(),h.trim()?(m({isValidating:!0,result:null}),S.current=ge.validateWorkspaceDebounced(h.trim(),A=>{m({isValidating:!1,result:A}),r&&r(A)})):(m({isValidating:!1,result:null}),r&&r(null))},[t,r]),F=o.useCallback(()=>{w(!0)},[]),H=o.useCallback(h=>{p(h),a.success(n("chat.workspace.folderSelected"))},[p,a,n]),ee=o.useCallback(h=>{p(h)},[p]);return{path:u,validationStatus:l,recentWorkspaces:g,suggestions:v,isLoadingRecent:y,isLoadingSuggestions:z,folderBrowserVisible:b,setFolderBrowserVisible:w,handlePathChange:p,handleBrowseClick:F,handleFolderSelect:H,handleWorkspaceSelect:ee}},{Text:X}=V,xe=({show:i,isLoading:t,recentWorkspaces:s,onSelect:c,token:r})=>{const{t:a}=C();return i?e.jsxs(M,{vertical:!0,gap:r.marginXS,style:{marginTop:r.marginMD},children:[e.jsxs(k,{style:{paddingInline:r.paddingSM},children:[e.jsx(K,{}),e.jsx(X,{strong:!0,children:a("chat.workspace.recentTitle")})]}),t?e.jsx(M,{justify:"center",style:{padding:r.paddingSM},children:e.jsx(Y,{size:"small"})}):s.length===0?e.jsx(B,{description:a("chat.workspace.noRecentWorkspaces"),image:B.PRESENTED_IMAGE_SIMPLE,style:{padding:r.paddingSM}}):e.jsx(W,{size:"small",dataSource:s,style:{paddingInline:r.paddingSM},renderItem:n=>e.jsx(W.Item,{style:{padding:0},children:e.jsx(T,{type:"text",onClick:()=>c(n.path),style:{width:"100%",textAlign:"left",padding:`${r.paddingXS}px 0`,height:"auto"},children:e.jsxs(M,{justify:"space-between",align:"center",style:{width:"100%"},children:[e.jsxs(k,{children:[e.jsx(E,{style:{color:r.colorWarning}}),e.jsx(X,{strong:!0,children:n.workspace_name||n.path.split("/").pop()||a("chat.workspace.defaultWorkspaceName")})]}),e.jsx(X,{type:"secondary",ellipsis:{tooltip:n.path},style:{fontSize:12,maxWidth:"55%",textAlign:"right"},children:n.path})]})})})})]}):null},{Text:G}=V,fe=(i,t)=>{switch(i.suggestion_type){case"home":return e.jsx(N,{style:{color:t.colorPrimary}});case"documents":case"desktop":case"downloads":return e.jsx(E,{style:{color:t.colorSuccess}});case"recent":return e.jsx(K,{style:{color:t.colorWarning}});default:return e.jsx(E,{})}},ye=({show:i,isLoading:t,suggestions:s,onSelect:c,token:r})=>{const{t:a}=C();return i?e.jsxs(M,{vertical:!0,gap:r.marginXS,style:{marginTop:r.marginMD},children:[e.jsxs(k,{style:{paddingInline:r.paddingSM},children:[e.jsx(E,{}),e.jsx(G,{strong:!0,children:a("chat.workspace.suggestedTitle")})]}),t?e.jsx(M,{justify:"center",style:{padding:r.paddingSM},children:e.jsx(Y,{size:"small"})}):s.length===0?e.jsx(B,{description:a("chat.workspace.noSuggestions"),image:B.PRESENTED_IMAGE_SIMPLE,style:{padding:r.paddingSM}}):e.jsx(W,{size:"small",dataSource:s,style:{paddingInline:r.paddingSM},renderItem:n=>e.jsx(W.Item,{style:{padding:0},children:e.jsx(T,{type:"text",onClick:()=>c(n.path),style:{width:"100%",textAlign:"left",padding:`${r.paddingXS}px 0`,height:"auto"},children:e.jsxs(M,{justify:"space-between",align:"center",style:{width:"100%"},children:[e.jsxs(k,{children:[fe(n,r),e.jsx(G,{strong:!0,children:n.name})]}),e.jsx(G,{type:"secondary",ellipsis:{tooltip:n.path},style:{fontSize:12,maxWidth:"55%",textAlign:"right"},children:n.path})]})})})})]}):null},je=({isValidating:i,result:t,token:s})=>i?e.jsx(ce,{style:{color:s.colorPrimary}}):t?t.is_valid?e.jsx(oe,{style:{color:s.colorSuccess}}):e.jsx(le,{style:{color:s.colorError}}):null,{Text:Q}=V,we=({result:i,token:t})=>{const{t:s}=C();return i?e.jsx("div",{style:{marginTop:t.marginXS},children:i.is_valid?e.jsx($,{type:"success",message:e.jsxs(k,{children:[e.jsx("span",{children:s("chat.workspace.validWorkspace")}),i.workspace_name&&e.jsxs(Q,{type:"secondary",children:["(",i.workspace_name,")"]}),i.file_count!==void 0&&e.jsx(Q,{type:"secondary",children:s("chat.workspace.fileCount",{count:i.file_count})})]}),showIcon:!0}):e.jsx($,{type:"error",message:i.error_message||s("validation.invalidPath"),showIcon:!0})}):null},{Text:Se}=V,ke=({value:i="",onChange:t,placeholder:s,disabled:c=!1,allowBrowse:r=!0,showRecentWorkspaces:a=!0,showSuggestions:n=!0,onValidationChange:u,className:j,style:l})=>{const{t:m}=C(),{token:g}=U.useToken(),I=s??m("chat.workspace.placeholder"),{path:b,validationStatus:w,recentWorkspaces:v,suggestions:f,isLoadingRecent:y,isLoadingSuggestions:x,folderBrowserVisible:z,setFolderBrowserVisible:R,handlePathChange:P,handleBrowseClick:S,handleFolderSelect:_,handleWorkspaceSelect:d}=me({value:i,onChange:t,showRecentWorkspaces:a,showSuggestions:n,onValidationChange:u});return e.jsxs("div",{className:j,style:l,children:[e.jsx(de,{value:b,onChange:p=>P(p.target.value),placeholder:I,disabled:c,size:"middle",style:{width:"100%"},suffix:e.jsx(je,{isValidating:w.isValidating,result:w.result,token:g}),addonBefore:e.jsxs(k,{children:[e.jsx(E,{}),e.jsx(Se,{children:m("chat.workspace.label")})]}),addonAfter:r?e.jsx(T,{"aria-label":m("chat.workspace.browseFolder"),title:m("chat.workspace.browseFolder"),icon:e.jsx(E,{}),onClick:S,disabled:c,type:"text",size:"middle",style:{display:"inline-flex",alignItems:"center"}}):void 0}),e.jsx(we,{result:w.result,token:g}),(a||n)&&e.jsxs(e.Fragment,{children:[e.jsx(he,{style:{margin:"16px 0 12px 0"}}),e.jsx(xe,{show:a,isLoading:y,recentWorkspaces:v,onSelect:d,token:g}),e.jsx(ye,{show:n,isLoading:x,suggestions:f,onSelect:d,token:g})]}),e.jsx(pe,{visible:z,onClose:()=>R(!1),onSelect:_})]})},{Title:Ie}=V,_e=({open:i,initialPath:t="",loading:s=!1,onSubmit:c,onCancel:r})=>{const{t:a}=C(),{message:n}=O.useApp(),[u,j]=o.useState(t),[l,m]=o.useState(null),[g,I]=o.useState(!1);o.useEffect(()=>{i&&(j(t),m(null))},[i,t]);const b=x=>{j(x)},w=x=>{m(x)},v=async()=>{if(!u.trim()){n.error(a("chat.workspace.errorEnterPath"));return}l&&!l.is_valid?Z.confirm({title:a("chat.workspace.invalidTitle"),content:e.jsxs("div",{children:[e.jsx("p",{children:a("chat.workspace.issuesDetected")}),e.jsx("p",{children:l.error_message||a("chat.workspace.invalidTitle")}),e.jsx("p",{children:a("chat.workspace.confirmSaveInvalid")})]}),okText:a("common.saveAnyway"),cancelText:a("common.cancel"),onOk:()=>f()}):f()},f=async()=>{I(!0);try{l!=null&&l.is_valid&&await L.addRecentWorkspace(u.trim(),{workspace_name:l.workspace_name}),c(u.trim())}catch(x){console.error("Failed to save workspace path:",x),n.error(a("chat.workspace.errorSaveFailed"))}finally{I(!1)}},y=!u.trim()||s||g;return e.jsx(Z,{open:i,title:e.jsx(k,{children:e.jsx(Ie,{level:4,style:{margin:0},children:a("chat.workspace.modalTitle")})}),okText:a("common.save"),cancelText:a("common.cancel"),onOk:v,onCancel:r,okButtonProps:{disabled:y,loading:g||s},width:600,destroyOnClose:!0,children:e.jsxs(k,{direction:"vertical",size:"middle",style:{width:"100%"},children:[e.jsx($,{message:a("chat.workspace.descriptionTitle"),description:e.jsxs("div",{children:[e.jsx("p",{children:a("chat.workspace.descriptionP1")}),e.jsx("p",{children:a("chat.workspace.descriptionP2")})]}),type:"info",showIcon:!0}),e.jsx(ke,{value:u,onChange:b,onValidationChange:w,placeholder:a("chat.workspace.placeholder"),disabled:g,allowBrowse:!0,showRecentWorkspaces:!0,showSuggestions:!0}),l&&!l.is_valid&&e.jsx($,{message:a("chat.workspace.checkTitle"),description:l.error_message||a("chat.workspace.checkDescription"),type:"warning",showIcon:!0})]})})};export{_e 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-CG8bbjSe.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-Cez766TY.js";import"./main-Bae5Z9x6.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
+ 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-BE03KO2t.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-B53piAPW.js";import"./main-DE4q1A6J.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 o}from"./vendor-markdown-teEfNS9t.js";import{u as O,R as Q,a as B}from"./vendor-i18n-Dm-c3D_C.js";import{u as y,I as w}from"./App-CG8bbjSe.js";import{t as G,o as h,v as J,j as U,w as v,x as f,y as V,z as F,D as I,E as q,F as Y,G as Z,k as oo,H as X,I as so,P as eo,J as E,N as to,O as no,Q as ro,U as lo,V as io,W as ao}from"./vendor-antd-qu012Od4.js";import"./vendor-mermaid-Cez766TY.js";import"./main-Bae5Z9x6.js";const{Text:p}=U,co=a=>({pending:{icon:o.jsx(ao,{}),color:a.colorTextTertiary,textKey:"components.todoList.status.pending",tagColor:"default"},in_progress:{icon:o.jsx(v,{spin:!0}),color:a.colorPrimary,textKey:"components.todoList.status.inProgress",tagColor:"processing"},completed:{icon:o.jsx(F,{}),color:a.colorSuccess,textKey:"components.todoList.status.completed",tagColor:"success"},blocked:{icon:o.jsx(io,{}),color:a.colorError,textKey:"components.todoList.status.blocked",tagColor:"error"}}),fo=({sessionId:a,initialCollapsed:K=!0,compact:t=!1})=>{const{t:n}=O(),{token:e}=G.useToken(),W=Q.useMemo(()=>co(e),[e]),g=y(s=>s.chats.find(c=>c.id===a)),j=(g==null?void 0:g.kind)==="child"&&(g.parentSessionId||g.rootSessionId)||a,l=y(s=>s.taskLists[j]),H=y(s=>s.activeItems[j]),x=y(s=>s.evaluationStates[j]),[r,R]=B.useState(K),[i,A]=B.useState(!1),m=(x==null?void 0:x.isEvaluating)||!1,S=(x==null?void 0:x.reasoning)||null,T=l?{session_id:l.session_id,title:l.title,items:l.items,progress:{completed:l.items.filter(s=>s.status==="completed").length,total:l.items.length,percentage:l.items.length>0?Math.round(l.items.filter(s=>s.status==="completed").length/l.items.length*100):0}}:null;if(!T)return null;const C=()=>{i||R(!r)},D=s=>{s.stopPropagation(),A(!i),i||R(!1)},{title:M,items:N,progress:d}=T,L=d.percentage===100,_=o.jsxs(h,{onClick:C,style:{cursor:"pointer",width:"100%"},size:t?6:8,children:[o.jsx(J,{style:{color:e.colorPrimary}}),o.jsx(p,{strong:!0,style:{fontSize:t?14:15},children:M||n("components.todoList.title")}),m&&(t?o.jsx(w,{nowrap:!0,items:[o.jsxs(o.Fragment,{children:[o.jsx(v,{spin:!0,style:{color:e.colorPrimary,marginRight:4}}),n("components.todoList.evaluating")]})]}):o.jsx(f,{icon:o.jsx(v,{spin:!0}),color:"processing",children:n("components.todoList.evaluating")})),!r&&d.total>0&&o.jsx(V,{count:`${d.completed}/${d.total}`,style:{backgroundColor:L?e.colorSuccess:e.colorPrimary}})]}),k=o.jsxs(h,{size:t?6:8,children:[d.total>0&&r&&o.jsxs(p,{type:"secondary",style:{fontSize:t?12:13},children:[d.completed,"/",d.total,L&&o.jsx(F,{style:{color:e.colorSuccess,marginLeft:4}})]}),o.jsx(I,{title:n(i?"components.todoList.unpin":"components.todoList.pin"),children:o.jsx("span",{onClick:D,style:{cursor:"pointer",color:i?e.colorPrimary:e.colorTextSecondary,fontSize:t?14:16},children:i?o.jsx(q,{}):o.jsx(Y,{})})}),!i&&o.jsx("span",{onClick:C,style:{cursor:"pointer",color:e.colorTextSecondary,fontSize:12,transform:r?"rotate(-90deg)":void 0,transition:"transform 0.2s"},children:r?o.jsx(Z,{}):o.jsx(oo,{})})]}),b=r?null:o.jsxs(o.Fragment,{children:[S?t?o.jsxs(p,{type:"secondary",style:{display:"block",marginBottom:e.marginXS,fontSize:12,paddingLeft:e.paddingXS,borderLeft:`2px solid ${e.colorPrimaryBorder}`,lineHeight:1.45},children:[o.jsx(X,{style:{marginRight:6}}),S]}):o.jsx(so,{icon:o.jsx(X,{}),message:n("components.todoList.llmEvaluation"),description:S,type:"info",showIcon:!0,style:{marginBottom:16}}):null,d.total>0&&o.jsx("div",{style:{marginBottom:t?e.marginXS:16},children:o.jsx(eo,{percent:d.percentage,size:"small",status:L?"success":"active",format:s=>o.jsxs(p,{type:"secondary",children:[s,"%"]})})}),o.jsx(E,{size:"small",split:!1,dataSource:N,renderItem:s=>{var z,P;const c=W[s.status],u=H===s.id,$=n(c.textKey);return o.jsx(E.Item,{style:{padding:t?"6px 0":"12px 0",borderLeft:u?`3px solid ${e.colorPrimary}`:"3px solid transparent",paddingLeft:u?t?8:12:t?10:15,backgroundColor:t?"transparent":u?e.colorPrimaryBg:"transparent",borderRadius:t?0:4,marginBottom:t?0:4},children:o.jsx("div",{style:{width:"100%"},children:o.jsxs(h,{align:"start",style:{width:"100%"},size:t?6:8,children:[o.jsx(I,{title:$,children:o.jsx("span",{style:{color:c.color,fontSize:t?14:16},children:c.icon})}),o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsx(p,{style:{textDecoration:s.status==="completed"?"line-through":"none",color:s.status==="completed"?e.colorTextSecondary:e.colorText,fontWeight:u?500:400,fontSize:t?13:void 0},children:s.description}),o.jsx("div",{style:{marginTop:t?3:4},children:t?o.jsx(w,{block:!0,items:[o.jsx("span",{style:{color:c.color},children:$}),s.tool_calls_count!==void 0&&s.tool_calls_count>0?`${s.tool_calls_count} ${n("components.todoList.tools")}`:null,((z=s.depends_on)==null?void 0:z.length)>0?`${s.depends_on.length} ${n("components.todoList.dependencies")}`:null]}):o.jsxs(h,{size:t?6:8,wrap:!0,children:[o.jsx(f,{color:c.tagColor,children:$}),s.tool_calls_count!==void 0&&s.tool_calls_count>0&&o.jsxs(f,{icon:o.jsx(to,{}),color:"processing",children:[s.tool_calls_count," ",n("components.todoList.tools")]}),((P=s.depends_on)==null?void 0:P.length)>0&&o.jsx(I,{title:n("components.todoList.dependsOn",{deps:s.depends_on.join(", ")}),children:o.jsxs(f,{icon:o.jsx(no,{}),children:[s.depends_on.length," ",n("components.todoList.dependencies")]})})]})}),s.status==="completed"&&s.summary&&o.jsx(p,{type:"secondary",style:t?{display:"block",marginTop:4,fontSize:12,paddingLeft:e.paddingXS,borderLeft:`2px solid ${e.colorSuccessBorder}`,color:e.colorSuccess,lineHeight:1.45}:{display:"block",marginTop:6,fontSize:12,padding:"4px 8px",backgroundColor:e.colorSuccessBg,borderRadius:4,color:e.colorSuccess},children:s.summary}),s.notes&&o.jsx(p,{type:"secondary",style:t?{display:"block",marginTop:4,fontSize:12,paddingLeft:e.paddingXS,borderLeft:`2px solid ${e.colorBorderSecondary}`,lineHeight:1.45}:{display:"block",marginTop:6,fontSize:12,padding:"4px 8px",backgroundColor:e.colorFillQuaternary,borderRadius:4},children:s.notes})]})]})})})}})]});return t?o.jsxs("section",{"data-testid":"todo-list-panel",style:{width:"100%",minWidth:0,marginBottom:e.marginXS,overflow:"hidden",opacity:r&&!i?.9:1},children:[o.jsxs(ro,{align:"center",justify:"space-between",gap:e.marginXS,style:{padding:`${e.paddingXXS??2}px 0 ${e.paddingXS}px`,borderBottom:r?void 0:`1px solid ${m?e.colorPrimaryBorder:e.colorBorderSecondary}`},children:[o.jsx("div",{style:{flex:1,minWidth:0},children:_}),o.jsx("div",{style:{flex:"0 0 auto"},children:k})]}),b?o.jsx("div",{style:{padding:`0 0 ${e.paddingXS}px`},children:b}):null]}):o.jsx(lo,{size:"small",className:"lotus-settings-card",style:{marginBottom:16,borderRadius:8,boxShadow:m?`0 0 0 2px ${e.colorPrimaryBorder}`:"0 2px 8px rgba(0, 0, 0, 0.06)",opacity:r&&!i?.9:1},styles:{body:{padding:r?"12px 16px":16}},title:_,extra:k,children:b})};export{fo as TodoList,fo as default};
1
+ import{j as o}from"./vendor-markdown-teEfNS9t.js";import{u as O,R as Q,a as B}from"./vendor-i18n-Dm-c3D_C.js";import{u as y,I as w}from"./App-BE03KO2t.js";import{t as G,o as h,v as J,j as U,w as v,x as f,y as V,z as F,D as I,E as q,F as Y,G as Z,k as oo,H as X,I as so,P as eo,J as E,N as to,O as no,Q as ro,U as lo,V as io,W as ao}from"./vendor-antd-qu012Od4.js";import"./vendor-mermaid-B53piAPW.js";import"./main-DE4q1A6J.js";const{Text:p}=U,co=a=>({pending:{icon:o.jsx(ao,{}),color:a.colorTextTertiary,textKey:"components.todoList.status.pending",tagColor:"default"},in_progress:{icon:o.jsx(v,{spin:!0}),color:a.colorPrimary,textKey:"components.todoList.status.inProgress",tagColor:"processing"},completed:{icon:o.jsx(F,{}),color:a.colorSuccess,textKey:"components.todoList.status.completed",tagColor:"success"},blocked:{icon:o.jsx(io,{}),color:a.colorError,textKey:"components.todoList.status.blocked",tagColor:"error"}}),fo=({sessionId:a,initialCollapsed:K=!0,compact:t=!1})=>{const{t:n}=O(),{token:e}=G.useToken(),W=Q.useMemo(()=>co(e),[e]),g=y(s=>s.chats.find(c=>c.id===a)),j=(g==null?void 0:g.kind)==="child"&&(g.parentSessionId||g.rootSessionId)||a,l=y(s=>s.taskLists[j]),H=y(s=>s.activeItems[j]),x=y(s=>s.evaluationStates[j]),[r,R]=B.useState(K),[i,A]=B.useState(!1),m=(x==null?void 0:x.isEvaluating)||!1,S=(x==null?void 0:x.reasoning)||null,T=l?{session_id:l.session_id,title:l.title,items:l.items,progress:{completed:l.items.filter(s=>s.status==="completed").length,total:l.items.length,percentage:l.items.length>0?Math.round(l.items.filter(s=>s.status==="completed").length/l.items.length*100):0}}:null;if(!T)return null;const C=()=>{i||R(!r)},D=s=>{s.stopPropagation(),A(!i),i||R(!1)},{title:M,items:N,progress:d}=T,L=d.percentage===100,_=o.jsxs(h,{onClick:C,style:{cursor:"pointer",width:"100%"},size:t?6:8,children:[o.jsx(J,{style:{color:e.colorPrimary}}),o.jsx(p,{strong:!0,style:{fontSize:t?14:15},children:M||n("components.todoList.title")}),m&&(t?o.jsx(w,{nowrap:!0,items:[o.jsxs(o.Fragment,{children:[o.jsx(v,{spin:!0,style:{color:e.colorPrimary,marginRight:4}}),n("components.todoList.evaluating")]})]}):o.jsx(f,{icon:o.jsx(v,{spin:!0}),color:"processing",children:n("components.todoList.evaluating")})),!r&&d.total>0&&o.jsx(V,{count:`${d.completed}/${d.total}`,style:{backgroundColor:L?e.colorSuccess:e.colorPrimary}})]}),k=o.jsxs(h,{size:t?6:8,children:[d.total>0&&r&&o.jsxs(p,{type:"secondary",style:{fontSize:t?12:13},children:[d.completed,"/",d.total,L&&o.jsx(F,{style:{color:e.colorSuccess,marginLeft:4}})]}),o.jsx(I,{title:n(i?"components.todoList.unpin":"components.todoList.pin"),children:o.jsx("span",{onClick:D,style:{cursor:"pointer",color:i?e.colorPrimary:e.colorTextSecondary,fontSize:t?14:16},children:i?o.jsx(q,{}):o.jsx(Y,{})})}),!i&&o.jsx("span",{onClick:C,style:{cursor:"pointer",color:e.colorTextSecondary,fontSize:12,transform:r?"rotate(-90deg)":void 0,transition:"transform 0.2s"},children:r?o.jsx(Z,{}):o.jsx(oo,{})})]}),b=r?null:o.jsxs(o.Fragment,{children:[S?t?o.jsxs(p,{type:"secondary",style:{display:"block",marginBottom:e.marginXS,fontSize:12,paddingLeft:e.paddingXS,borderLeft:`2px solid ${e.colorPrimaryBorder}`,lineHeight:1.45},children:[o.jsx(X,{style:{marginRight:6}}),S]}):o.jsx(so,{icon:o.jsx(X,{}),message:n("components.todoList.llmEvaluation"),description:S,type:"info",showIcon:!0,style:{marginBottom:16}}):null,d.total>0&&o.jsx("div",{style:{marginBottom:t?e.marginXS:16},children:o.jsx(eo,{percent:d.percentage,size:"small",status:L?"success":"active",format:s=>o.jsxs(p,{type:"secondary",children:[s,"%"]})})}),o.jsx(E,{size:"small",split:!1,dataSource:N,renderItem:s=>{var z,P;const c=W[s.status],u=H===s.id,$=n(c.textKey);return o.jsx(E.Item,{style:{padding:t?"6px 0":"12px 0",borderLeft:u?`3px solid ${e.colorPrimary}`:"3px solid transparent",paddingLeft:u?t?8:12:t?10:15,backgroundColor:t?"transparent":u?e.colorPrimaryBg:"transparent",borderRadius:t?0:4,marginBottom:t?0:4},children:o.jsx("div",{style:{width:"100%"},children:o.jsxs(h,{align:"start",style:{width:"100%"},size:t?6:8,children:[o.jsx(I,{title:$,children:o.jsx("span",{style:{color:c.color,fontSize:t?14:16},children:c.icon})}),o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsx(p,{style:{textDecoration:s.status==="completed"?"line-through":"none",color:s.status==="completed"?e.colorTextSecondary:e.colorText,fontWeight:u?500:400,fontSize:t?13:void 0},children:s.description}),o.jsx("div",{style:{marginTop:t?3:4},children:t?o.jsx(w,{block:!0,items:[o.jsx("span",{style:{color:c.color},children:$}),s.tool_calls_count!==void 0&&s.tool_calls_count>0?`${s.tool_calls_count} ${n("components.todoList.tools")}`:null,((z=s.depends_on)==null?void 0:z.length)>0?`${s.depends_on.length} ${n("components.todoList.dependencies")}`:null]}):o.jsxs(h,{size:t?6:8,wrap:!0,children:[o.jsx(f,{color:c.tagColor,children:$}),s.tool_calls_count!==void 0&&s.tool_calls_count>0&&o.jsxs(f,{icon:o.jsx(to,{}),color:"processing",children:[s.tool_calls_count," ",n("components.todoList.tools")]}),((P=s.depends_on)==null?void 0:P.length)>0&&o.jsx(I,{title:n("components.todoList.dependsOn",{deps:s.depends_on.join(", ")}),children:o.jsxs(f,{icon:o.jsx(no,{}),children:[s.depends_on.length," ",n("components.todoList.dependencies")]})})]})}),s.status==="completed"&&s.summary&&o.jsx(p,{type:"secondary",style:t?{display:"block",marginTop:4,fontSize:12,paddingLeft:e.paddingXS,borderLeft:`2px solid ${e.colorSuccessBorder}`,color:e.colorSuccess,lineHeight:1.45}:{display:"block",marginTop:6,fontSize:12,padding:"4px 8px",backgroundColor:e.colorSuccessBg,borderRadius:4,color:e.colorSuccess},children:s.summary}),s.notes&&o.jsx(p,{type:"secondary",style:t?{display:"block",marginTop:4,fontSize:12,paddingLeft:e.paddingXS,borderLeft:`2px solid ${e.colorBorderSecondary}`,lineHeight:1.45}:{display:"block",marginTop:6,fontSize:12,padding:"4px 8px",backgroundColor:e.colorFillQuaternary,borderRadius:4},children:s.notes})]})]})})})}})]});return t?o.jsxs("section",{"data-testid":"todo-list-panel",style:{width:"100%",minWidth:0,marginBottom:e.marginXS,overflow:"hidden",opacity:r&&!i?.9:1},children:[o.jsxs(ro,{align:"center",justify:"space-between",gap:e.marginXS,style:{padding:`${e.paddingXXS??2}px 0 ${e.paddingXS}px`,borderBottom:r?void 0:`1px solid ${m?e.colorPrimaryBorder:e.colorBorderSecondary}`},children:[o.jsx("div",{style:{flex:1,minWidth:0},children:_}),o.jsx("div",{style:{flex:"0 0 auto"},children:k})]}),b?o.jsx("div",{style:{padding:`0 0 ${e.paddingXS}px`},children:b}):null]}):o.jsx(lo,{size:"small",className:"lotus-settings-card",style:{marginBottom:16,borderRadius:8,boxShadow:m?`0 0 0 2px ${e.colorPrimaryBorder}`:"0 2px 8px rgba(0, 0, 0, 0.06)",opacity:r&&!i?.9:1},styles:{body:{padding:r?"12px 16px":16}},title:_,extra:k,children:b})};export{fo as TodoList,fo as default};
@@ -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-CG8bbjSe.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-Cez766TY.js";import"./main-Bae5Z9x6.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
+ 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-BE03KO2t.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-B53piAPW.js";import"./main-DE4q1A6J.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,4 +1,4 @@
1
- import{j as i}from"./vendor-markdown-teEfNS9t.js";import{R as ye,u as ve,a as r}from"./vendor-i18n-Dm-c3D_C.js";import{u as T,b as xe,s as Ee,c as he,d as j,r as qe,e as Ce,f as Se,g as Re,a as Y,h as A,C as L}from"./App-CG8bbjSe.js";/* empty css */import{A as we,j as ke,B as Z,k as be,l as Te,n as F,o as ee,p as je,t as De}from"./vendor-antd-qu012Od4.js";import"./vendor-mermaid-Cez766TY.js";import"./main-Bae5Z9x6.js";const a={questionCard:"qd-questionCard",questionHeader:"qd-questionHeader",headerLeft:"qd-headerLeft",questionIcon:"qd-questionIcon",questionText:"qd-questionText",collapseBtn:"qd-collapseBtn",questionBody:"qd-questionBody",optionsGroup:"qd-optionsGroup",optionItem:"qd-optionItem",customHint:"qd-customHint",questionFooter:"qd-questionFooter"},{Text:D}=ke,{useToken:Ne}=De,Be=n=>{const f=(n||"").replace(/\\r\\n/g,`
1
+ import{j as i}from"./vendor-markdown-teEfNS9t.js";import{R as ye,u as ve,a as r}from"./vendor-i18n-Dm-c3D_C.js";import{u as T,b as xe,s as Ee,c as he,d as j,r as qe,e as Ce,f as Se,g as Re,a as Y,h as A,C as L}from"./App-BE03KO2t.js";/* empty css */import{A as we,j as ke,B as Z,k as be,l as Te,n as F,o as ee,p as je,t as De}from"./vendor-antd-qu012Od4.js";import"./vendor-mermaid-B53piAPW.js";import"./main-DE4q1A6J.js";const a={questionCard:"qd-questionCard",questionHeader:"qd-questionHeader",headerLeft:"qd-headerLeft",questionIcon:"qd-questionIcon",questionText:"qd-questionText",collapseBtn:"qd-collapseBtn",questionBody:"qd-questionBody",optionsGroup:"qd-optionsGroup",optionItem:"qd-optionItem",customHint:"qd-customHint",questionFooter:"qd-questionFooter"},{Text:D}=ke,{useToken:Ne}=De,Be=n=>{const f=(n||"").replace(/\\r\\n/g,`
2
2
  `).replace(/\\n/g,`
3
3
  `).replace(/\r\n?/g,`
4
4
  `).trim();return f?f.includes(`
@@ -1 +1 @@
1
- import{j as n}from"./vendor-markdown-teEfNS9t.js";import{u as V,a as d}from"./vendor-i18n-Dm-c3D_C.js";import{u as h,b as H,l as W,m as B,n as T,o as Q,A as z,p as G,q as Y,t as J}from"./App-CG8bbjSe.js";import{t as X,A as Z,a7 as ee,a2 as te,a8 as se,a9 as ne,aa as oe,ab as ae,ac as ie,ad as le,a5 as re,ae as de,a6 as ce,j as me,W as ue,af as pe,x as ge}from"./vendor-antd-qu012Od4.js";import"./vendor-mermaid-Cez766TY.js";import"./main-Bae5Z9x6.js";const be=(()=>{let e=null,o=[],a=new Map;return i=>{if(i===e)return o;const p=i.map(c=>{const l=a.get(c.id),g={id:c.id,title:c.title,kind:c.kind,pinned:c.pinned,updatedAt:c.updatedAt,workspacePath:c.config.workspacePath};return l&&l.title===g.title&&l.kind===g.kind&&l.pinned===g.pinned&&l.updatedAt===g.updatedAt&&l.workspacePath===g.workspacePath?l:g}),P=p.length===o.length&&p.every((c,l)=>c===o[l]);return e=i,a=new Map(p.map(c=>[c.id,c])),P?o:(o=p,p)}})(),fe=[{id:"settings-provider",tabKey:"provider",titleKey:"commandPalette.actions.openProviderSettings",fallbackTitle:"Open Provider Settings",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"AI",keywords:["api","key","openai","anthropic","gemini","model"]},{id:"settings-model-limits",tabKey:"model-limits",titleKey:"commandPalette.actions.openModelLimits",fallbackTitle:"Open Model Limits",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"AI",keywords:["token","context","window","budget","limit"]},{id:"settings-prompts",tabKey:"prompts",titleKey:"commandPalette.actions.openPrompts",fallbackTitle:"Open System Prompts",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"AI",keywords:["system","prompt","persona","instruction"]},{id:"settings-skills",tabKey:"skills",titleKey:"commandPalette.actions.openSkills",fallbackTitle:"Open Skills",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"Tools",keywords:["skill","capability","plugin"]},{id:"settings-mcp",tabKey:"mcp",titleKey:"commandPalette.actions.openMcpSettings",fallbackTitle:"Open MCP Settings",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"Tools",keywords:["mcp","server","tool","external"]},{id:"settings-workflows",tabKey:"workflows",titleKey:"commandPalette.actions.openWorkflowSettings",fallbackTitle:"Open Workflow Settings",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"Tools",keywords:["workflow","automation","template"]},{id:"settings-hooks",tabKey:"hooks",titleKey:"commandPalette.actions.openHooks",fallbackTitle:"Open Hooks",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"Tools",keywords:["hook","event","trigger","callback"]},{id:"settings-schedules",tabKey:"schedules",titleKey:"commandPalette.actions.openSchedulesSettings",fallbackTitle:"Open Schedules",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"Ops",keywords:["schedule","cron","recurring","timer","automated"]},{id:"settings-sessions",tabKey:"sessions",titleKey:"commandPalette.actions.openSessionsSettings",fallbackTitle:"Open Session Monitor",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"Monitor",keywords:["session","monitor","cleanup","history"]},{id:"settings-metrics",tabKey:"metrics",titleKey:"commandPalette.actions.openMetrics",fallbackTitle:"Open Metrics Dashboard",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"Monitor",keywords:["metrics","dashboard","analytics","usage","stats"]},{id:"settings-masking",tabKey:"masking",titleKey:"commandPalette.actions.openMasking",fallbackTitle:"Open Keyword Masking",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"Security & privacy",badge:"Security",keywords:["mask","redact","privacy","keyword","sensitive"]},{id:"settings-env",tabKey:"env-vars",titleKey:"commandPalette.actions.openEnvVars",fallbackTitle:"Open Environment Variables",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"System",keywords:["env","environment","variable","config"]},{id:"settings-config",tabKey:"config",titleKey:"commandPalette.actions.openConfig",fallbackTitle:"Open Configuration",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"System",keywords:["config","json","bamboo","data","path"]},{id:"settings-app",tabKey:"app",titleKey:"commandPalette.actions.openAppSettings",fallbackTitle:"Open App Settings",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"System",keywords:["app","application","reset","theme","language"]}],ye=(e,o)=>{const a=[e.title,e.id,e.kind||"root"];return e.pinned&&a.push("pinned","pin"),o&&a.push("running","processing"),e.workspacePath&&a.push(e.workspacePath),e.updatedAt&&a.push(e.updatedAt),a.filter(Boolean)},ke=(e,o,a)=>{const i=[];if(e.kind==="child"?i.push(o):i.push(a),e.workspacePath&&i.push(e.workspacePath),e.updatedAt)try{i.push(new Date(e.updatedAt).toLocaleString())}catch{i.push(e.updatedAt)}return i.join(" • ")},Se=(e,o)=>{const a=o.trim().toLowerCase();return a?e.filter(i=>[i.title,i.subtitle||"",...i.keywords].join(" ").toLowerCase().includes(a)):e},we=e=>{if(!(e instanceof HTMLElement))return!1;const o=e.tagName.toLowerCase();return e.isContentEditable?!0:o==="input"||o==="textarea"||o==="select"},v="__LOTUS_COMMAND_PALETTE_FORCE_OPEN__",ve=()=>{const{t:e}=V(),{token:o}=X.useToken(),a=typeof document<"u"&&document.body.getAttribute("data-vdi-safe")==="true",{message:i}=Z.useApp(),p=h(t=>be(t.chats)),P=h(t=>t.addChat),c=h(t=>t.lastSelectedPromptId),l=h(t=>t.systemPrompts),g=h(H(t=>Object.entries(t.executionBySession).filter(([,s])=>J(s.phase)).map(([s])=>s).sort())),[b,f]=d.useState(()=>typeof window>"u"?!1:window[v]?(delete window[v],!0):!1),[j,x]=d.useState(""),[k,S]=d.useState(0),E=d.useRef(null),M=d.useRef(null),C=W(t=>t.open),O=B(t=>t.toggleTheme),I=B(t=>t.themeMode),K=T(t=>t.sidebar.collapsed),L=T(t=>t.setSidebarCollapsed),A=Q(t=>t.mode),N=Q(t=>t.toggleMode),R=d.useCallback(async()=>{var $,q;const t=l.find(w=>w.id===c),s=(t==null?void 0:t.id)||(l.length>0?(($=l.find(w=>w.id==="general_assistant"))==null?void 0:$.id)||l[0].id:""),m=await P({title:e("chat.sidebar.newSession"),createdAt:Date.now(),messages:[],config:{systemPromptId:s,baseSystemPrompt:(t==null?void 0:t.content)||(l.length>0?((q=l.find(w=>w.id==="general_assistant"))==null?void 0:q.content)||l[0].content:""),lastUsedEnhancedPrompt:null}}),{activeLeafId:r,setLeafSessionId:y,setActiveLeafId:U}=T.getState();y(r,m),U(r)},[P,c,l,e]),_=d.useMemo(()=>{const t=fe.filter(s=>!(A==="simple"&&z.has(s.tabKey))).map(s=>({id:s.id,kind:"action",title:e(s.titleKey,s.fallbackTitle),subtitle:e(s.subtitleKey||"commandPalette.groups.settings",s.fallbackSubtitle||"System settings"),keywords:[s.tabKey,s.badge||"","settings","config",...s.keywords||[]],icon:n.jsx(ee,{}),badge:s.badge,onSelect:()=>{C("chat",s.tabKey)}}));return[{id:"new-session",kind:"action",title:e("commandPalette.actions.newSession","Create New Session"),subtitle:e("commandPalette.groups.quickActions","Quick actions"),keywords:["new","create","session","chat","conversation"],icon:n.jsx(te,{}),badge:e("commandPalette.badges.quickAction","Action"),onSelect:async()=>{await R()}},{id:"toggle-theme",kind:"action",title:I==="dark"?e("commandPalette.actions.switchToLight","Switch to Light Mode"):e("commandPalette.actions.switchToDark","Switch to Dark Mode"),subtitle:e("commandPalette.groups.quickActions","Quick actions"),keywords:["theme","dark","light","mode","appearance","toggle","color"],icon:n.jsx(se,{}),badge:I==="dark"?"☀️":"🌙",onSelect:()=>{O()}},{id:"toggle-sidebar",kind:"action",title:K?e("commandPalette.actions.showSidebar","Show Sidebar"):e("commandPalette.actions.hideSidebar","Hide Sidebar"),subtitle:e("commandPalette.groups.quickActions","Quick actions"),keywords:["sidebar","toggle","hide","show","panel","menu"],icon:K?n.jsx(ne,{}):n.jsx(oe,{}),badge:"Layout",onSelect:()=>{L(!K)}},{id:"split-pane",kind:"action",title:e("commandPalette.actions.splitPane","Split Pane"),subtitle:e("commandPalette.groups.quickActions","Quick actions"),keywords:["split","pane","multi","dual","side","layout"],icon:n.jsx(ae,{}),badge:"Layout",onSelect:()=>{const{tree:s,activeLeafId:m,splitLeaf:r}=T.getState();G(s).length<4&&r(m,"vertical")}},...t,{id:"toggle-experience-mode",kind:"action",title:A==="simple"?e("commandPalette.actions.switchToAdvanced","Switch to Advanced Mode"):e("commandPalette.actions.switchToSimple","Switch to Simple Mode"),subtitle:e("commandPalette.groups.quickActions","Quick actions"),keywords:["mode","simple","advanced","beginner","expert","experience","complexity"],icon:n.jsx(ie,{}),badge:A==="simple"?"Simple":"Advanced",onSelect:()=>{N()}}]},[R,C,O,I,K,L,A,N,e]),D=d.useMemo(()=>{if(!b)return[];const t=new Set(g);return p.map(s=>{const m=t.has(s.id);return{id:`session-${s.id}`,kind:"session",title:s.title,subtitle:ke(s,e("commandPalette.badges.childSession","Child session"),e("commandPalette.badges.rootSession","Session")),keywords:ye(s,m),icon:n.jsx(le,{}),badge:s.pinned?e("commandPalette.badges.pinned","Pinned"):m?e("commandPalette.badges.running","Running"):s.kind==="child"?e("commandPalette.badges.child","Child"):void 0,onSelect:()=>{Y(s.id)}}})},[b,g,p,e]),F=d.useMemo(()=>[..._,...D],[_,D]),u=d.useMemo(()=>Se(F,j).slice(0,40),[F,j]);return d.useEffect(()=>{S(t=>u.length===0?0:Math.min(t,u.length-1))},[u.length]),d.useEffect(()=>{if(!b)return;const t=window.setTimeout(()=>{var s,m;(s=E.current)==null||s.focus(),(m=E.current)==null||m.select()},0);return()=>window.clearTimeout(t)},[b]),d.useEffect(()=>{if(typeof window>"u")return;const t=s=>{if((s.metaKey||s.ctrlKey)&&s.key.toLowerCase()==="k"){s.preventDefault(),f(r=>!r);return}if(b){if(s.key==="Escape"){s.preventDefault(),f(!1);return}if(!(we(s.target)&&s.key!=="ArrowUp"&&s.key!=="ArrowDown"&&s.key!=="Enter")){if(s.key==="ArrowDown"){s.preventDefault(),S(r=>u.length===0?0:(r+1)%u.length);return}if(s.key==="ArrowUp"){s.preventDefault(),S(r=>u.length===0?0:r===0?u.length-1:r-1);return}if(s.key==="Enter"){const r=u[k];if(!r)return;s.preventDefault(),(async()=>{try{await r.onSelect(),f(!1),x("")}catch(y){console.error("[CommandPalette] action failed",y),i.error(y instanceof Error?y.message:e("commandPalette.errors.actionFailed","Command failed"))}})()}}}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[u,i,b,k,e]),d.useEffect(()=>{b||(x(""),S(0))},[b]),d.useEffect(()=>{typeof window>"u"||!window[v]||(delete window[v],f(!0))},[]),d.useEffect(()=>{const t=M.current;if(!t)return;const s=t.querySelector(`[data-command-index="${k}"]`);s==null||s.scrollIntoView({block:"nearest"})},[k]),n.jsx(re,{open:b,onCancel:()=>f(!1),footer:null,centered:!0,width:680,destroyOnClose:!0,className:"lotus-command-palette-modal",title:null,closable:!1,styles:{content:{padding:12,borderRadius:o.borderRadiusLG,overflow:"hidden",background:o.colorBgElevated,backdropFilter:a?"none":"blur(18px)",WebkitBackdropFilter:a?"none":"blur(18px)"},body:{padding:0},mask:{backdropFilter:a?"none":"blur(6px)",WebkitBackdropFilter:a?"none":"blur(6px)"}},children:n.jsxs("div",{className:"lotus-command-palette-shell",children:[n.jsxs("div",{className:"lotus-command-palette-search",children:[n.jsx(de,{style:{color:o.colorTextTertiary,fontSize:16}}),n.jsx(ce,{ref:E,value:j,onChange:t=>x(t.target.value),variant:"borderless",placeholder:e("commandPalette.searchPlaceholder","Search sessions, settings, and actions"),"aria-label":e("commandPalette.searchPlaceholder","Search sessions, settings, and actions"),suffix:n.jsx(me.Text,{type:"secondary",style:{fontSize:12},children:"⌘K"})})]}),n.jsxs("div",{className:"lotus-command-palette-hint",children:[n.jsx(ue,{}),n.jsx("span",{children:e("commandPalette.navigationHint","Use ↑↓ to navigate, Enter to open, and Esc to close.")})]}),n.jsx("div",{ref:M,className:"lotus-command-palette-list",role:"listbox",children:u.length===0?n.jsxs("div",{className:"lotus-command-palette-empty",children:[n.jsx(pe,{}),n.jsx("span",{children:e("commandPalette.empty","No matching commands")})]}):u.map((t,s)=>{const m=s===k;return n.jsxs("button",{type:"button",className:`lotus-command-palette-item ${m?"is-selected":""}`,"data-command-index":s,onMouseEnter:()=>S(s),onClick:()=>{(async()=>{try{await t.onSelect(),f(!1),x("")}catch(r){console.error("[CommandPalette] action failed",r),i.error(r instanceof Error?r.message:e("commandPalette.errors.actionFailed","Command failed"))}})()},children:[n.jsx("span",{className:"lotus-command-palette-item-icon",children:t.icon}),n.jsxs("span",{className:"lotus-command-palette-item-content",children:[n.jsxs("span",{className:"lotus-command-palette-item-title-row",children:[n.jsx("span",{className:"lotus-command-palette-item-title",children:t.title}),t.badge?n.jsx(ge,{bordered:!1,children:t.badge}):null]}),t.subtitle?n.jsx("span",{className:"lotus-command-palette-item-subtitle",children:t.subtitle}):null]})]},t.id)})})]})})};export{ve as CommandPalette,ve as default};
1
+ import{j as n}from"./vendor-markdown-teEfNS9t.js";import{u as V,a as d}from"./vendor-i18n-Dm-c3D_C.js";import{u as h,b as H,l as W,m as B,n as T,o as Q,A as z,p as G,q as Y,t as J}from"./App-BE03KO2t.js";import{t as X,A as Z,a7 as ee,a2 as te,a8 as se,a9 as ne,aa as oe,ab as ae,ac as ie,ad as le,a5 as re,ae as de,a6 as ce,j as me,W as ue,af as pe,x as ge}from"./vendor-antd-qu012Od4.js";import"./vendor-mermaid-B53piAPW.js";import"./main-DE4q1A6J.js";const be=(()=>{let e=null,o=[],a=new Map;return i=>{if(i===e)return o;const p=i.map(c=>{const l=a.get(c.id),g={id:c.id,title:c.title,kind:c.kind,pinned:c.pinned,updatedAt:c.updatedAt,workspacePath:c.config.workspacePath};return l&&l.title===g.title&&l.kind===g.kind&&l.pinned===g.pinned&&l.updatedAt===g.updatedAt&&l.workspacePath===g.workspacePath?l:g}),P=p.length===o.length&&p.every((c,l)=>c===o[l]);return e=i,a=new Map(p.map(c=>[c.id,c])),P?o:(o=p,p)}})(),fe=[{id:"settings-provider",tabKey:"provider",titleKey:"commandPalette.actions.openProviderSettings",fallbackTitle:"Open Provider Settings",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"AI",keywords:["api","key","openai","anthropic","gemini","model"]},{id:"settings-model-limits",tabKey:"model-limits",titleKey:"commandPalette.actions.openModelLimits",fallbackTitle:"Open Model Limits",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"AI",keywords:["token","context","window","budget","limit"]},{id:"settings-prompts",tabKey:"prompts",titleKey:"commandPalette.actions.openPrompts",fallbackTitle:"Open System Prompts",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"AI",keywords:["system","prompt","persona","instruction"]},{id:"settings-skills",tabKey:"skills",titleKey:"commandPalette.actions.openSkills",fallbackTitle:"Open Skills",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"Tools",keywords:["skill","capability","plugin"]},{id:"settings-mcp",tabKey:"mcp",titleKey:"commandPalette.actions.openMcpSettings",fallbackTitle:"Open MCP Settings",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"Tools",keywords:["mcp","server","tool","external"]},{id:"settings-workflows",tabKey:"workflows",titleKey:"commandPalette.actions.openWorkflowSettings",fallbackTitle:"Open Workflow Settings",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"Tools",keywords:["workflow","automation","template"]},{id:"settings-hooks",tabKey:"hooks",titleKey:"commandPalette.actions.openHooks",fallbackTitle:"Open Hooks",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"Tools",keywords:["hook","event","trigger","callback"]},{id:"settings-schedules",tabKey:"schedules",titleKey:"commandPalette.actions.openSchedulesSettings",fallbackTitle:"Open Schedules",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"Ops",keywords:["schedule","cron","recurring","timer","automated"]},{id:"settings-sessions",tabKey:"sessions",titleKey:"commandPalette.actions.openSessionsSettings",fallbackTitle:"Open Session Monitor",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"Monitor",keywords:["session","monitor","cleanup","history"]},{id:"settings-metrics",tabKey:"metrics",titleKey:"commandPalette.actions.openMetrics",fallbackTitle:"Open Metrics Dashboard",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"Monitor",keywords:["metrics","dashboard","analytics","usage","stats"]},{id:"settings-masking",tabKey:"masking",titleKey:"commandPalette.actions.openMasking",fallbackTitle:"Open Keyword Masking",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"Security & privacy",badge:"Security",keywords:["mask","redact","privacy","keyword","sensitive"]},{id:"settings-env",tabKey:"env-vars",titleKey:"commandPalette.actions.openEnvVars",fallbackTitle:"Open Environment Variables",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"System",keywords:["env","environment","variable","config"]},{id:"settings-config",tabKey:"config",titleKey:"commandPalette.actions.openConfig",fallbackTitle:"Open Configuration",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"System",keywords:["config","json","bamboo","data","path"]},{id:"settings-app",tabKey:"app",titleKey:"commandPalette.actions.openAppSettings",fallbackTitle:"Open App Settings",subtitleKey:"commandPalette.groups.settings",fallbackSubtitle:"System settings",badge:"System",keywords:["app","application","reset","theme","language"]}],ye=(e,o)=>{const a=[e.title,e.id,e.kind||"root"];return e.pinned&&a.push("pinned","pin"),o&&a.push("running","processing"),e.workspacePath&&a.push(e.workspacePath),e.updatedAt&&a.push(e.updatedAt),a.filter(Boolean)},ke=(e,o,a)=>{const i=[];if(e.kind==="child"?i.push(o):i.push(a),e.workspacePath&&i.push(e.workspacePath),e.updatedAt)try{i.push(new Date(e.updatedAt).toLocaleString())}catch{i.push(e.updatedAt)}return i.join(" • ")},Se=(e,o)=>{const a=o.trim().toLowerCase();return a?e.filter(i=>[i.title,i.subtitle||"",...i.keywords].join(" ").toLowerCase().includes(a)):e},we=e=>{if(!(e instanceof HTMLElement))return!1;const o=e.tagName.toLowerCase();return e.isContentEditable?!0:o==="input"||o==="textarea"||o==="select"},v="__LOTUS_COMMAND_PALETTE_FORCE_OPEN__",ve=()=>{const{t:e}=V(),{token:o}=X.useToken(),a=typeof document<"u"&&document.body.getAttribute("data-vdi-safe")==="true",{message:i}=Z.useApp(),p=h(t=>be(t.chats)),P=h(t=>t.addChat),c=h(t=>t.lastSelectedPromptId),l=h(t=>t.systemPrompts),g=h(H(t=>Object.entries(t.executionBySession).filter(([,s])=>J(s.phase)).map(([s])=>s).sort())),[b,f]=d.useState(()=>typeof window>"u"?!1:window[v]?(delete window[v],!0):!1),[j,x]=d.useState(""),[k,S]=d.useState(0),E=d.useRef(null),M=d.useRef(null),C=W(t=>t.open),O=B(t=>t.toggleTheme),I=B(t=>t.themeMode),K=T(t=>t.sidebar.collapsed),L=T(t=>t.setSidebarCollapsed),A=Q(t=>t.mode),N=Q(t=>t.toggleMode),R=d.useCallback(async()=>{var $,q;const t=l.find(w=>w.id===c),s=(t==null?void 0:t.id)||(l.length>0?(($=l.find(w=>w.id==="general_assistant"))==null?void 0:$.id)||l[0].id:""),m=await P({title:e("chat.sidebar.newSession"),createdAt:Date.now(),messages:[],config:{systemPromptId:s,baseSystemPrompt:(t==null?void 0:t.content)||(l.length>0?((q=l.find(w=>w.id==="general_assistant"))==null?void 0:q.content)||l[0].content:""),lastUsedEnhancedPrompt:null}}),{activeLeafId:r,setLeafSessionId:y,setActiveLeafId:U}=T.getState();y(r,m),U(r)},[P,c,l,e]),_=d.useMemo(()=>{const t=fe.filter(s=>!(A==="simple"&&z.has(s.tabKey))).map(s=>({id:s.id,kind:"action",title:e(s.titleKey,s.fallbackTitle),subtitle:e(s.subtitleKey||"commandPalette.groups.settings",s.fallbackSubtitle||"System settings"),keywords:[s.tabKey,s.badge||"","settings","config",...s.keywords||[]],icon:n.jsx(ee,{}),badge:s.badge,onSelect:()=>{C("chat",s.tabKey)}}));return[{id:"new-session",kind:"action",title:e("commandPalette.actions.newSession","Create New Session"),subtitle:e("commandPalette.groups.quickActions","Quick actions"),keywords:["new","create","session","chat","conversation"],icon:n.jsx(te,{}),badge:e("commandPalette.badges.quickAction","Action"),onSelect:async()=>{await R()}},{id:"toggle-theme",kind:"action",title:I==="dark"?e("commandPalette.actions.switchToLight","Switch to Light Mode"):e("commandPalette.actions.switchToDark","Switch to Dark Mode"),subtitle:e("commandPalette.groups.quickActions","Quick actions"),keywords:["theme","dark","light","mode","appearance","toggle","color"],icon:n.jsx(se,{}),badge:I==="dark"?"☀️":"🌙",onSelect:()=>{O()}},{id:"toggle-sidebar",kind:"action",title:K?e("commandPalette.actions.showSidebar","Show Sidebar"):e("commandPalette.actions.hideSidebar","Hide Sidebar"),subtitle:e("commandPalette.groups.quickActions","Quick actions"),keywords:["sidebar","toggle","hide","show","panel","menu"],icon:K?n.jsx(ne,{}):n.jsx(oe,{}),badge:"Layout",onSelect:()=>{L(!K)}},{id:"split-pane",kind:"action",title:e("commandPalette.actions.splitPane","Split Pane"),subtitle:e("commandPalette.groups.quickActions","Quick actions"),keywords:["split","pane","multi","dual","side","layout"],icon:n.jsx(ae,{}),badge:"Layout",onSelect:()=>{const{tree:s,activeLeafId:m,splitLeaf:r}=T.getState();G(s).length<4&&r(m,"vertical")}},...t,{id:"toggle-experience-mode",kind:"action",title:A==="simple"?e("commandPalette.actions.switchToAdvanced","Switch to Advanced Mode"):e("commandPalette.actions.switchToSimple","Switch to Simple Mode"),subtitle:e("commandPalette.groups.quickActions","Quick actions"),keywords:["mode","simple","advanced","beginner","expert","experience","complexity"],icon:n.jsx(ie,{}),badge:A==="simple"?"Simple":"Advanced",onSelect:()=>{N()}}]},[R,C,O,I,K,L,A,N,e]),D=d.useMemo(()=>{if(!b)return[];const t=new Set(g);return p.map(s=>{const m=t.has(s.id);return{id:`session-${s.id}`,kind:"session",title:s.title,subtitle:ke(s,e("commandPalette.badges.childSession","Child session"),e("commandPalette.badges.rootSession","Session")),keywords:ye(s,m),icon:n.jsx(le,{}),badge:s.pinned?e("commandPalette.badges.pinned","Pinned"):m?e("commandPalette.badges.running","Running"):s.kind==="child"?e("commandPalette.badges.child","Child"):void 0,onSelect:()=>{Y(s.id)}}})},[b,g,p,e]),F=d.useMemo(()=>[..._,...D],[_,D]),u=d.useMemo(()=>Se(F,j).slice(0,40),[F,j]);return d.useEffect(()=>{S(t=>u.length===0?0:Math.min(t,u.length-1))},[u.length]),d.useEffect(()=>{if(!b)return;const t=window.setTimeout(()=>{var s,m;(s=E.current)==null||s.focus(),(m=E.current)==null||m.select()},0);return()=>window.clearTimeout(t)},[b]),d.useEffect(()=>{if(typeof window>"u")return;const t=s=>{if((s.metaKey||s.ctrlKey)&&s.key.toLowerCase()==="k"){s.preventDefault(),f(r=>!r);return}if(b){if(s.key==="Escape"){s.preventDefault(),f(!1);return}if(!(we(s.target)&&s.key!=="ArrowUp"&&s.key!=="ArrowDown"&&s.key!=="Enter")){if(s.key==="ArrowDown"){s.preventDefault(),S(r=>u.length===0?0:(r+1)%u.length);return}if(s.key==="ArrowUp"){s.preventDefault(),S(r=>u.length===0?0:r===0?u.length-1:r-1);return}if(s.key==="Enter"){const r=u[k];if(!r)return;s.preventDefault(),(async()=>{try{await r.onSelect(),f(!1),x("")}catch(y){console.error("[CommandPalette] action failed",y),i.error(y instanceof Error?y.message:e("commandPalette.errors.actionFailed","Command failed"))}})()}}}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[u,i,b,k,e]),d.useEffect(()=>{b||(x(""),S(0))},[b]),d.useEffect(()=>{typeof window>"u"||!window[v]||(delete window[v],f(!0))},[]),d.useEffect(()=>{const t=M.current;if(!t)return;const s=t.querySelector(`[data-command-index="${k}"]`);s==null||s.scrollIntoView({block:"nearest"})},[k]),n.jsx(re,{open:b,onCancel:()=>f(!1),footer:null,centered:!0,width:680,destroyOnClose:!0,className:"lotus-command-palette-modal",title:null,closable:!1,styles:{content:{padding:12,borderRadius:o.borderRadiusLG,overflow:"hidden",background:o.colorBgElevated,backdropFilter:a?"none":"blur(18px)",WebkitBackdropFilter:a?"none":"blur(18px)"},body:{padding:0},mask:{backdropFilter:a?"none":"blur(6px)",WebkitBackdropFilter:a?"none":"blur(6px)"}},children:n.jsxs("div",{className:"lotus-command-palette-shell",children:[n.jsxs("div",{className:"lotus-command-palette-search",children:[n.jsx(de,{style:{color:o.colorTextTertiary,fontSize:16}}),n.jsx(ce,{ref:E,value:j,onChange:t=>x(t.target.value),variant:"borderless",placeholder:e("commandPalette.searchPlaceholder","Search sessions, settings, and actions"),"aria-label":e("commandPalette.searchPlaceholder","Search sessions, settings, and actions"),suffix:n.jsx(me.Text,{type:"secondary",style:{fontSize:12},children:"⌘K"})})]}),n.jsxs("div",{className:"lotus-command-palette-hint",children:[n.jsx(ue,{}),n.jsx("span",{children:e("commandPalette.navigationHint","Use ↑↓ to navigate, Enter to open, and Esc to close.")})]}),n.jsx("div",{ref:M,className:"lotus-command-palette-list",role:"listbox",children:u.length===0?n.jsxs("div",{className:"lotus-command-palette-empty",children:[n.jsx(pe,{}),n.jsx("span",{children:e("commandPalette.empty","No matching commands")})]}):u.map((t,s)=>{const m=s===k;return n.jsxs("button",{type:"button",className:`lotus-command-palette-item ${m?"is-selected":""}`,"data-command-index":s,onMouseEnter:()=>S(s),onClick:()=>{(async()=>{try{await t.onSelect(),f(!1),x("")}catch(r){console.error("[CommandPalette] action failed",r),i.error(r instanceof Error?r.message:e("commandPalette.errors.actionFailed","Command failed"))}})()},children:[n.jsx("span",{className:"lotus-command-palette-item-icon",children:t.icon}),n.jsxs("span",{className:"lotus-command-palette-item-content",children:[n.jsxs("span",{className:"lotus-command-palette-item-title-row",children:[n.jsx("span",{className:"lotus-command-palette-item-title",children:t.title}),t.badge?n.jsx(ge,{bordered:!1,children:t.badge}):null]}),t.subtitle?n.jsx("span",{className:"lotus-command-palette-item-subtitle",children:t.subtitle}):null]})]},t.id)})})]})})};export{ve as CommandPalette,ve as default};
@@ -1 +1 @@
1
- import{j as a}from"./vendor-markdown-teEfNS9t.js";import{z as $,B,D as v}from"./App-CG8bbjSe.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-Cez766TY.js";import"./main-Bae5Z9x6.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
+ import{j as a}from"./vendor-markdown-teEfNS9t.js";import{z as $,B,D as v}from"./App-BE03KO2t.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-B53piAPW.js";import"./main-DE4q1A6J.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,2 +1,2 @@
1
- import{a8 as e,ab as s,aF as n,ac as i}from"./vendor-mermaid-Cez766TY.js";import{p}from"./wardley-L42UT6IY-DFiCK17w.js";import"./vendor-antd-qu012Od4.js";import"./vendor-i18n-Dm-c3D_C.js";var g={parse:e(async r=>{const a=await p("info",r);s.debug(a)},"parse")},v={version:"11.15.0"},d=e(()=>v.version,"getVersion"),m={getVersion:d},c=e((r,a,o)=>{s.debug(`rendering info diagram
1
+ import{a8 as e,ab as s,aF as n,ac as i}from"./vendor-mermaid-B53piAPW.js";import{p}from"./wardley-L42UT6IY-Bu1lxJJ1.js";import"./vendor-antd-qu012Od4.js";import"./vendor-i18n-Dm-c3D_C.js";var g={parse:e(async r=>{const a=await p("info",r);s.debug(a)},"parse")},v={version:"11.15.0"},d=e(()=>v.version,"getVersion"),m={getVersion:d},c=e((r,a,o)=>{s.debug(`rendering info diagram
2
2
  `+r);const t=n(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),f={draw:c},w={parser:g,db:m,renderer:f};export{w as diagram};
@@ -1,4 +1,4 @@
1
- import{a8 as o,a9 as ot,aG as ut,aF as dt,ba as yt,av as ft,ai as pt,ao as it,a6 as gt,a7 as kt,a5 as mt,a4 as wt,ap as _t,ac as bt}from"./vendor-mermaid-Cez766TY.js";import"./vendor-antd-qu012Od4.js";import"./vendor-i18n-Dm-c3D_C.js";var tt=function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(C.yy[W]=this.yy[W]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||b.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,F,B,q,H={},X,V,et,Y;;){if(F=i[i.length-1],this.defaultActions[F]?B=this.defaultActions[F]:((A===null||typeof A>"u")&&(A=z()),B=v[F]&&v[F][A]),typeof B>"u"||!B.length||!B[0]){var Q="";Y=[];for(X in v[F])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
1
+ import{a8 as o,a9 as ot,aG as ut,aF as dt,ba as yt,av as ft,ai as pt,ao as it,a6 as gt,a7 as kt,a5 as mt,a4 as wt,ap as _t,ac as bt}from"./vendor-mermaid-B53piAPW.js";import"./vendor-antd-qu012Od4.js";import"./vendor-i18n-Dm-c3D_C.js";var tt=function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(C.yy[W]=this.yy[W]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||b.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,F,B,q,H={},X,V,et,Y;;){if(F=i[i.length-1],this.defaultActions[F]?B=this.defaultActions[F]:((A===null||typeof A>"u")&&(A=z()),B=v[F]&&v[F][A]),typeof B>"u"||!B.length||!B[0]){var Q="";Y=[];for(X in v[F])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
2
2
  `+b.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:T,expected:Y})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+A);switch(B[0]){case 1:i.push(A),p.push(b.yytext),n.push(b.yylloc),i.push(B[1]),A=null,S=b.yyleng,w=b.yytext,I=b.yylineno,T=b.yylloc;break;case 2:if(V=this.productions_[B[1]][1],H.$=p[p.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),q=this.performAction.apply(H,[w,S,I,C.yy,B[1],p,n].concat(R)),typeof q<"u")return q;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[B[1]][0]),p.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{g as gt}from"./chunk-FMBD7UC4-DM2eEyUs.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-BdiRuLUa.js";import{a5 as _t,a4 as vt,a6 as bt,a7 as wt,ap as Tt,ao as St,a8 as s,a9 as R,aa as X,ac as $t,av as Mt,aH as it}from"./vendor-mermaid-Cez766TY.js";import"./vendor-antd-qu012Od4.js";import"./vendor-i18n-Dm-c3D_C.js";var U=function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
1
+ import{g as gt}from"./chunk-FMBD7UC4-BBYX4gAn.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-PiVQlHJA.js";import{a5 as _t,a4 as vt,a6 as bt,a7 as wt,ap as Tt,ao as St,a8 as s,a9 as R,aa as X,ac as $t,av as Mt,aH as it}from"./vendor-mermaid-B53piAPW.js";import"./vendor-antd-qu012Od4.js";import"./vendor-i18n-Dm-c3D_C.js";var U=function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{a8 as c,ab as te,a9 as W,aF as fe,aZ as ye,a_ as be,a$ as me,aW as _e,aD as Y,af as G,aq as ke,ar as Ee,aT as Se,aU as le,aV as ce}from"./vendor-mermaid-Cez766TY.js";import{g as Ne}from"./chunk-FMBD7UC4-DM2eEyUs.js";import"./vendor-antd-qu012Od4.js";import"./vendor-i18n-Dm-c3D_C.js";var $=function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],U=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:U}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:U}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,q)&&(T.yy[q]=this.yy[q]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var J=m.yylloc;e.push(J);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Z,F={},X,I,oe,K;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Q="";K=[];for(X in B[R])this.terminals_[X]&&X>ue&&K.push("'"+this.terminals_[X]+"'");m.showPosition?Q="Parse error on line "+(z+1)+`:
1
+ import{a8 as c,ab as te,a9 as W,aF as fe,aZ as ye,a_ as be,a$ as me,aW as _e,aD as Y,af as G,aq as ke,ar as Ee,aT as Se,aU as le,aV as ce}from"./vendor-mermaid-B53piAPW.js";import{g as Ne}from"./chunk-FMBD7UC4-BBYX4gAn.js";import"./vendor-antd-qu012Od4.js";import"./vendor-i18n-Dm-c3D_C.js";var $=function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],U=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:U}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:U}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,q)&&(T.yy[q]=this.yy[q]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var J=m.yylloc;e.push(J);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Z,F={},X,I,oe,K;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Q="";K=[];for(X in B[R])this.terminals_[X]&&X>ue&&K.push("'"+this.terminals_[X]+"'");m.showPosition?Q="Parse error on line "+(z+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+K.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Q="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Q,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:J,expected:K})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,J=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],F.$=u[u.length-I],F._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(F._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Z=this.performAction.apply(F,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Z<"u")return Z;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(F.$),e.push(F._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`