@bigduu/lotus 2026.7.13 → 2026.7.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/dist/assets/{ChildApprovalDialog-B8LV5Brg.js → ChildApprovalDialog-C5HJur6N.js} +1 -1
- package/dist/assets/{CommandPalette-Bv7nlRLt.js → CommandPalette-FfqcbB_8.js} +1 -1
- package/dist/assets/{CommandSelector-C3ulsDEO.js → CommandSelector-CVtgnb1S.js} +1 -1
- package/dist/assets/{ContextBar-BZbSoylh.js → ContextBar-aF-cMF-v.js} +1 -1
- package/dist/assets/{HomeDashboard-CgF7UUMa.js → HomeDashboard-Cn7D1iH5.js} +1 -1
- package/dist/assets/{MetricsService-D9UHnvd2.js → MetricsService-5Mg3ubIw.js} +9 -9
- package/dist/assets/{QuestionDialog--OHAcOEw.js → QuestionDialog-Jpq09L2Y.js} +1 -1
- package/dist/assets/{SessionSummaryCard-k8eqS5lA.js → SessionSummaryCard-Mgo0yFRy.js} +1 -1
- package/dist/assets/{SubAgentsPanel-DrzlO9tS.js → SubAgentsPanel-hiuHRWnw.js} +1 -1
- package/dist/assets/{SystemPromptSelector-Cgw6oRAS.js → SystemPromptSelector-Bjo4TvyH.js} +1 -1
- package/dist/assets/SystemSettingsPage-CGKQvgSL.js +22 -0
- package/dist/assets/{TodoList-Bf7mCaiV.js → TodoList-B9UakmAK.js} +1 -1
- package/dist/assets/{WorkspacePathModal-BAca14jc.js → WorkspacePathModal-CPJ0q0X3.js} +1 -1
- package/dist/assets/{architectureDiagram-3BPJPVTR-Cc0X2SOX.js → architectureDiagram-3BPJPVTR-IW6bC1kz.js} +1 -1
- package/dist/assets/{blockDiagram-GPEHLZMM-C0KHavBI.js → blockDiagram-GPEHLZMM-D27KCv1A.js} +1 -1
- package/dist/assets/{c4Diagram-AAUBKEIU-CUf6i_A7.js → c4Diagram-AAUBKEIU-BxJXaN0T.js} +1 -1
- package/dist/assets/{chunk-4BX2VUAB-BJh4D-bi.js → chunk-4BX2VUAB-CjsNjNP8.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-BPX3Wbyh.js → chunk-QZHKN3VN-D46a8lj4.js} +1 -1
- package/dist/assets/{classDiagram-v2-Q7XG4LA2-BJbnmQ0y.js → classDiagram-v2-Q7XG4LA2-DzYQqaYm.js} +1 -1
- package/dist/assets/{cose-bilkent-S5V4N54A-zbmmH2SQ.js → cose-bilkent-S5V4N54A-BNyT3qQZ.js} +1 -1
- package/dist/assets/{dagre-BM42HDAG-D2ARftVi.js → dagre-BM42HDAG-g9CK9aTM.js} +1 -1
- package/dist/assets/{diagram-2AECGRRQ-DS_VIDcC.js → diagram-2AECGRRQ-DlwCcvfb.js} +1 -1
- package/dist/assets/{diagram-5GNKFQAL-DdKodxQe.js → diagram-5GNKFQAL-BnMOpq64.js} +1 -1
- package/dist/assets/{diagram-KO2AKTUF-DyYogOtU.js → diagram-KO2AKTUF-Xo92Y-oH.js} +1 -1
- package/dist/assets/{diagram-LMA3HP47-CRsDsyq7.js → diagram-LMA3HP47-BMn0Li3d.js} +1 -1
- package/dist/assets/{diagram-OG6HWLK6-B8vR2DMt.js → diagram-OG6HWLK6-Cx0nM3_p.js} +1 -1
- package/dist/assets/{erDiagram-TEJ5UH35-Bli7r7qi.js → erDiagram-TEJ5UH35-eeCcFOoF.js} +1 -1
- package/dist/assets/{flowDiagram-I6XJVG4X-CYBm2UVK.js → flowDiagram-I6XJVG4X-B3wdWoM2.js} +1 -1
- package/dist/assets/{ganttDiagram-6RSMTGT7-C1M6PTcZ.js → ganttDiagram-6RSMTGT7-Ca49Kf86.js} +1 -1
- package/dist/assets/{gitGraphDiagram-PVQCEYII-CfzDNeeT.js → gitGraphDiagram-PVQCEYII-DVx4inxa.js} +1 -1
- package/dist/assets/{ishikawaDiagram-YF4QCWOH-CXNXjWYv.js → ishikawaDiagram-YF4QCWOH-CalBKQbT.js} +1 -1
- package/dist/assets/{journeyDiagram-JHISSGLW-k2I2en9e.js → journeyDiagram-JHISSGLW-DPfXWsKn.js} +1 -1
- package/dist/assets/{kanban-definition-UN3LZRKU-fBzcWVq1.js → kanban-definition-UN3LZRKU-D39rX_W5.js} +1 -1
- package/dist/assets/{main-CMBp6TFR.js → main-DojUL22J.js} +5 -5
- package/dist/assets/{mindmap-definition-RKZ34NQL-C0aMOvXZ.js → mindmap-definition-RKZ34NQL-BeBKjxTw.js} +1 -1
- package/dist/assets/{pieDiagram-4H26LBE5-3JdASr15.js → pieDiagram-4H26LBE5-DUDDaR05.js} +1 -1
- package/dist/assets/{quadrantDiagram-W4KKPZXB-DjWz9ih0.js → quadrantDiagram-W4KKPZXB-wt_G4cx1.js} +1 -1
- package/dist/assets/{requirementDiagram-4Y6WPE33-Cuya5SaT.js → requirementDiagram-4Y6WPE33-By_HA1De.js} +1 -1
- package/dist/assets/{sankeyDiagram-5OEKKPKP-DYfSOmpL.js → sankeyDiagram-5OEKKPKP-C8OUyN1Y.js} +1 -1
- package/dist/assets/{sequenceDiagram-3UESZ5HK-B5UJcnmP.js → sequenceDiagram-3UESZ5HK-BZuiQucJ.js} +1 -1
- package/dist/assets/{stateDiagram-AJRCARHV-DZXWrQl1.js → stateDiagram-AJRCARHV-Bkglx2IF.js} +1 -1
- package/dist/assets/{stateDiagram-v2-BHNVJYJU-DVbPbZiG.js → stateDiagram-v2-BHNVJYJU-CvGvypJf.js} +1 -1
- package/dist/assets/{timeline-definition-PNZ67QCA-B40Lgfp8.js → timeline-definition-PNZ67QCA-yysigrdl.js} +1 -1
- package/dist/assets/{vendor-charts-CNLSFcom.js → vendor-charts-ZYVNV69W.js} +1 -1
- package/dist/assets/{vendor-mermaid-GjPwPGd2.js → vendor-mermaid-DzxhYX4t.js} +3 -3
- package/dist/assets/{vendor-pdf-B2zC5nd1.js → vendor-pdf-Dg-txti9.js} +3 -3
- package/dist/assets/{vennDiagram-CIIHVFJN-CZvfEIkq.js → vennDiagram-CIIHVFJN-DsU1lgOg.js} +1 -1
- package/dist/assets/{wardley-L42UT6IY-BiXJ6t8a.js → wardley-L42UT6IY-_C7frzW0.js} +1 -1
- package/dist/assets/{wardleyDiagram-YWT4CUSO-D49vkhGv.js → wardleyDiagram-YWT4CUSO-CnPYSG8f.js} +1 -1
- package/dist/assets/{xychartDiagram-2RQKCTM6-DPMEuY_W.js → xychartDiagram-2RQKCTM6-DT1U3O7p.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/SystemSettingsPage-CBDYfyHt.js +0 -22
package/README.md
CHANGED
|
@@ -106,6 +106,8 @@ Hit `Cmd/Ctrl + K` (bound in `app/MainLayout.tsx` and `shared/components/Command
|
|
|
106
106
|
|
|
107
107
|
`pages/SettingsPage/components/SystemSettingsPage` is a tabbed console, lazy-loaded to keep startup light. Verified tabs: **Providers** (`ProviderSettings`), **Model limits** (`ModelLimitsSettings`), **Prompts** (`SystemPromptManager`), **MCP** (server forms + management), **Workflows**, **Hooks**, **Schedules**, **Sessions**, **Env vars**, **Keyword masking**, **Notifications**, **Mermaid settings**, **Access password**, **Network**, and a `recharts`-powered **Metrics dashboard** (`UnifiedMetricsDashboard` with token charts, memory trends, model distribution, forward-endpoint distribution, and more).
|
|
108
108
|
|
|
109
|
+
Provider instances support **vendor presets**: the create/edit modal has a preset select (DeepSeek, 智谱 GLM, Z.ai, MiniMax, 通义千问 DashScope, Kimi — incl. the Anthropic-protocol variants of DeepSeek/GLM) that prefills the provider type and base URL from `src/shared/constants/providerPresets.ts`, so adding an OpenAI-compatible vendor is pick-and-paste-a-key. The preset itself is never persisted.
|
|
110
|
+
|
|
109
111
|
### Skills · questions · to-dos · Mermaid
|
|
110
112
|
|
|
111
113
|
- **Skill** (`src/components/Skill`): `SkillCard` / `SkillSelector` / `SkillManager` browse agent skills, toggle enable/disable, show license tags.
|
package/README.zh-CN.md
CHANGED
|
@@ -106,6 +106,8 @@ src/
|
|
|
106
106
|
|
|
107
107
|
`pages/SettingsPage/components/SystemSettingsPage` 是一个标签化的控制台,懒加载以保持启动轻量。已验证的标签包括:**Providers**(`ProviderSettings`)、**模型上限**(`ModelLimitsSettings`)、**提示词**(`SystemPromptManager`)、**MCP**(服务器表单与管理)、**工作流**、**Hooks**、**计划任务 / Schedules**、**会话 / Sessions**、**环境变量 / Env Vars**、**关键词脱敏 / Keyword Masking**、**通知 / Notifications**、**Mermaid 设置**、**访问密码 / Access Password**、**网络 / Network**,以及基于 `recharts` 的 **指标仪表盘 / Metrics**(`UnifiedMetricsDashboard`、token 图、内存趋势、模型分布、转发端点分布等)。
|
|
108
108
|
|
|
109
|
+
Provider 实例支持**厂商预设**:创建/编辑弹窗内置预设下拉(DeepSeek、智谱 GLM、Z.ai、MiniMax、通义千问 DashScope、Kimi——含 DeepSeek/GLM 的 Anthropic 协议变体),选中即从 `src/shared/constants/providerPresets.ts` 自动填充提供商类型与 Base URL,接入 OpenAI 兼容厂商只需再粘贴一个 key。预设本身不会被保存。
|
|
110
|
+
|
|
109
111
|
### 技能、追问、待办、Mermaid
|
|
110
112
|
|
|
111
113
|
- **技能 / Skill** (`src/components/Skill`): `SkillCard` / `SkillSelector` / `SkillManager` 浏览智能体技能,开关启用/停用,显示许可证标记。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-markdown-Bz_2-zkk.js";import{R as A,u as S,a as T}from"./vendor-i18n-Dm-c3D_C.js";import{u as g,s as N,a as w,i as B}from"./MetricsService-
|
|
1
|
+
import{j as e}from"./vendor-markdown-Bz_2-zkk.js";import{R as A,u as S,a as T}from"./vendor-i18n-Dm-c3D_C.js";import{u as g,s as N,a as w,i as B}from"./MetricsService-5Mg3ubIw.js";/* empty css */import{A as $,T as b,j as k,B as y,p as F,o as I,t as R}from"./vendor-antd-IzIw5qDM.js";import"./vendor-mermaid-DzxhYX4t.js";import"./main-DojUL22J.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,f=({sessionId:a})=>{const{t:o}=S(),{token:r}=z(),{message:i}=$.useApp(),[n,d]=T.useState(!1),m=g(N(a)),l=g(p=>p.clearPendingChildApproval);if(!m)return null;const{childSessionId:j,requestId:C,toolName:u,permission:h,resource:v}=m,q=async p=>{d(!0);try{(await w.respondToChildApproval(j,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")})]})})]})]})};f.displayName="ChildApprovalDialog";const D=A.memo(f);D.displayName="ChildApprovalDialog";export{D as ChildApprovalDialog,D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as n}from"./vendor-markdown-Bz_2-zkk.js";import{u as V,a as d}from"./vendor-i18n-Dm-c3D_C.js";import{u as h,h as H,x as z,y as q,z as A,A as Q,B as G,D as W,F as Y,G as J}from"./MetricsService-D9UHnvd2.js";import{t as X,A as Z,ag as ee,ah as te,ai as se,aj as ne,ak as oe,al as ae,am as ie,O as le,aa as re,an as de,ao as ce,T as me,N as ue,ap as pe,n as ge}from"./vendor-antd-IzIw5qDM.js";import"./vendor-mermaid-GjPwPGd2.js";import"./main-CMBp6TFR.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),O=z(t=>t.open),C=q(t=>t.toggleTheme),I=q(t=>t.themeMode),K=A(t=>t.sidebar.collapsed),N=A(t=>t.setSidebarCollapsed),T=Q(t=>t.mode),L=Q(t=>t.toggleMode),R=d.useCallback(async()=>{var $,B;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?((B=l.find(w=>w.id==="general_assistant"))==null?void 0:B.content)||l[0].content:""),lastUsedEnhancedPrompt:null}}),{activeLeafId:r,setLeafSessionId:y,setActiveLeafId:U}=A.getState();y(r,m),U(r)},[P,c,l,e]),D=d.useMemo(()=>{const t=fe.filter(s=>!(T==="simple"&&G.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:()=>{O("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:()=>{C()}},{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:()=>{N(!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}=A.getState();W(s).length<4&&r(m,"vertical")}},...t,{id:"toggle-experience-mode",kind:"action",title:T==="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:T==="simple"?"Simple":"Advanced",onSelect:()=>{L()}}]},[R,O,C,I,K,N,T,L,e]),_=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-Bz_2-zkk.js";import{u as V,a as d}from"./vendor-i18n-Dm-c3D_C.js";import{u as h,h as H,x as z,y as q,z as A,A as Q,B as G,D as W,F as Y,G as J}from"./MetricsService-5Mg3ubIw.js";import{t as X,A as Z,ag as ee,ah as te,ai as se,aj as ne,ak as oe,al as ae,am as ie,O as le,aa as re,an as de,ao as ce,T as me,N as ue,ap as pe,n as ge}from"./vendor-antd-IzIw5qDM.js";import"./vendor-mermaid-DzxhYX4t.js";import"./main-DojUL22J.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),O=z(t=>t.open),C=q(t=>t.toggleTheme),I=q(t=>t.themeMode),K=A(t=>t.sidebar.collapsed),N=A(t=>t.setSidebarCollapsed),T=Q(t=>t.mode),L=Q(t=>t.toggleMode),R=d.useCallback(async()=>{var $,B;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?((B=l.find(w=>w.id==="general_assistant"))==null?void 0:B.content)||l[0].content:""),lastUsedEnhancedPrompt:null}}),{activeLeafId:r,setLeafSessionId:y,setActiveLeafId:U}=A.getState();y(r,m),U(r)},[P,c,l,e]),D=d.useMemo(()=>{const t=fe.filter(s=>!(T==="simple"&&G.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:()=>{O("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:()=>{C()}},{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:()=>{N(!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}=A.getState();W(s).length<4&&r(m,"vertical")}},...t,{id:"toggle-experience-mode",kind:"action",title:T==="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:T==="simple"?"Simple":"Advanced",onSelect:()=>{L()}}]},[R,O,C,I,K,N,T,L,e]),_=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-Bz_2-zkk.js";import{C as $,e as v,p as B}from"./MetricsService-
|
|
1
|
+
import{j as a}from"./vendor-markdown-Bz_2-zkk.js";import{C as $,e as v,p as B}from"./MetricsService-5Mg3ubIw.js";import{a as l,u as E}from"./vendor-i18n-Dm-c3D_C.js";import{y as T,t as M,n as L,Q as D,U as K,H as F,w as z}from"./vendor-antd-IzIw5qDM.js";import"./vendor-mermaid-DzxhYX4t.js";import"./main-DojUL22J.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();v("[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(z,{}),labelKey:"chat.commandSelector.types.workflow"},skill:{color:"green",icon:a.jsx(F,{}),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"?B(t.name):null,x=t.type==="mcp"?((b=t.metadata)==null?void 0:b.originalName)||(n==null?void 0:n.toolName)||t.displayName||t.name:null,y=t.type==="mcp"&&(((C=t.metadata)==null?void 0:C.serverName)||((w=t.metadata)==null?void 0:w.serverId)||(n==null?void 0:n.serverId))||null;return a.jsxs("div",{ref:r?R:null,className:`command-selector-item ${r?"selected":""}`,onClick:()=>S(t),onMouseEnter:()=>N(s),children:[a.jsxs("div",{className:"command-selector-item-header",children:[a.jsxs("div",{className:"command-selector-item-name",style:{color:o.colorPrimary},children:["/",t.type==="mcp"&&x?x:t.name]}),a.jsxs("div",{style:{display:"flex",gap:o.marginXS},children:[t.type==="mcp"&&y&&a.jsx(L,{color:"processing",children:y}),a.jsxs(L,{color:e.color,children:[e.icon," ",i(e.labelKey)]})]})]}),a.jsx("div",{className:"command-selector-item-description",style:{color:o.colorTextSecondary},children:t.description}),t.type==="mcp"&&y&&a.jsxs("div",{className:"command-selector-item-category",style:{color:o.colorTextTertiary},children:[i("common.server")," ",y]}),t.category&&a.jsxs("div",{className:"command-selector-item-category",style:{color:o.colorTextTertiary},children:[i("common.category")," ",t.category]}),t.tags&&t.tags.length>0&&a.jsx("div",{className:"command-selector-item-tags",children:t.tags.slice(0,3).map(m=>a.jsx(L,{children:m},m))})]},t.id)};return a.jsxs("div",{ref:c,className:"command-selector-container",style:{background:o.colorBgContainer,border:`1px solid ${o.colorBorderSecondary}`,borderRadius:o.borderRadiusSM,boxShadow:o.boxShadowSecondary},children:[a.jsx("div",{style:{padding:`${o.paddingXXS}px ${o.paddingSM}px`,borderBottom:`1px solid ${o.colorBorderSecondary}`,background:o.colorFillQuaternary,fontSize:o.fontSizeSM,color:o.colorTextTertiary},children:i("chat.commandSelector.navigationHint")}),d.map((t,s)=>h(t,s))]})};export{W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./vendor-markdown-Bz_2-zkk.js";import{u as P,a as T}from"./vendor-i18n-Dm-c3D_C.js";import{u as y,b as V,f as k,c as v}from"./MetricsService-
|
|
1
|
+
import{j as t}from"./vendor-markdown-Bz_2-zkk.js";import{u as P,a as T}from"./vendor-i18n-Dm-c3D_C.js";import{u as y,b as V,f as k,c as v}from"./MetricsService-5Mg3ubIw.js";import{M as w}from"./main-DojUL22J.js";import{F as I,l as n,n as c,w as R,z as S,D as C,G as $,H as E,t as M}from"./vendor-antd-IzIw5qDM.js";import"./vendor-mermaid-DzxhYX4t.js";const{useToken:F}=M,O=l=>{const o=l.replace(/\/$/,"").split("/").filter(Boolean);return o.length<=2?l:`~/${o.slice(-2).join("/")}`},J=({sessionId:l})=>{const{t:o}=P(),{token:x}=F(),e=y(V(l)),f=y(a=>a.systemPrompts),r=e==null?void 0:e.config.workspacePath,i=e==null?void 0:e.config.systemPromptId,s=e==null?void 0:e.config.tokenUsage,B=(e==null?void 0:e.config.compressionEvents)??[],h=(e==null?void 0:e.placement)??null,m=T.useMemo(()=>{if(!i)return null;const a=f.find(N=>N.id===i);return(a==null?void 0:a.name)||i},[i,f]),p=T.useMemo(()=>e!=null&&e.messages?e.messages.filter(a=>a.role==="user"&&"type"in a&&a.type==="file_reference").length:0,[e==null?void 0:e.messages]);if(!e)return null;const g=(s==null?void 0:s.summaryTokens)??0,b=B.length,d=(s==null?void 0:s.promptCachedToolOutputs)??0,u=(s==null?void 0:s.promptCachedToolTokensSaved)??0,j=g>0||b>0,_=d>0||u>0;return h||r||m||p>0||j||_?t.jsx("div",{className:"lotus-context-bar",style:{borderBottomColor:x.colorBorderSecondary,backgroundColor:x.colorBgContainer},children:t.jsxs(I,{align:"center",gap:6,wrap:"wrap",className:"lotus-context-bar__content",children:[t.jsx(w,{placement:h}),r&&t.jsx(n,{title:o("chat.contextBar.workspaceTooltip",{path:r,defaultValue:"Workspace context: {{path}}"}),children:t.jsxs(c,{className:"lotus-context-bar__tag",icon:t.jsx(R,{}),bordered:!1,children:[t.jsx("span",{className:"lotus-context-bar__tag-label",children:o("chat.contextBar.workspace",{defaultValue:"Workspace"})}),O(r)]})}),p>0&&t.jsx(n,{title:o("chat.contextBar.fileRefsTooltip",{count:p,defaultValue:"{{count}} file reference(s) in this session"}),children:t.jsxs(c,{className:"lotus-context-bar__tag",icon:t.jsx(S,{}),bordered:!1,children:[t.jsx("span",{className:"lotus-context-bar__tag-label",children:o("chat.contextBar.files",{defaultValue:"Files"})}),p]})}),m&&t.jsx(n,{title:o("chat.contextBar.promptTooltip",{name:m,defaultValue:"System prompt: {{name}}"}),children:t.jsxs(c,{className:"lotus-context-bar__tag",icon:t.jsx(C,{}),bordered:!1,children:[t.jsx("span",{className:"lotus-context-bar__tag-label",children:o("chat.contextBar.prompt",{defaultValue:"Prompt"})}),m]})}),j&&t.jsx(n,{title:o("chat.contextBar.summaryTooltip",{tokens:k(g),count:b,defaultValue:"Conversation summary contributes {{tokens}} tokens. {{count}} compression event(s) archived older messages."}),children:t.jsx(c,{className:"lotus-context-bar__tag lotus-context-bar__tag--signal",icon:t.jsx($,{}),bordered:!1,color:"gold",children:o("chat.contextBar.summary",{defaultValue:"Summary"})})}),_&&t.jsx(n,{title:o("chat.contextBar.promptCacheTooltip",{count:d,tokens:k(u),defaultValue:"{{count}} tool output(s) were compacted into prompt-side cache notes, saving {{tokens}} tokens."}),children:t.jsxs(c,{className:"lotus-context-bar__tag lotus-context-bar__tag--signal",icon:t.jsx(E,{}),bordered:!1,color:"green",children:[t.jsx("span",{className:"lotus-context-bar__tag-label",children:o("chat.contextBar.promptCache",{defaultValue:"Prompt cache"})}),u>0?v(u):d]})})]})}):null};export{J as ContextBar,J as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./vendor-markdown-Bz_2-zkk.js";import{u as g,a as c,i as m}from"./vendor-i18n-Dm-c3D_C.js";import{u as p,d as y,E as T}from"./MetricsService-
|
|
1
|
+
import{j as s}from"./vendor-markdown-Bz_2-zkk.js";import{u as g,a as c,i as m}from"./vendor-i18n-Dm-c3D_C.js";import{u as p,d as y,E as T}from"./MetricsService-5Mg3ubIw.js";import{t as v,I as S,H as w,J as R,N as k,w as A,O as I,n as b,P as M}from"./vendor-antd-IzIw5qDM.js";import"./vendor-mermaid-DzxhYX4t.js";import"./main-DojUL22J.js";const C=5,D=5,P=5,$=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 a=Math.floor(i/24);return a<30?m.t("chat.home.daysAgo",{count:a}):new Date(o).toLocaleDateString()}catch{return""}},E=(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)),a=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 ${E(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:$(o.updatedAt)}),a?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"lotus-home-session-meta-sep"}),s.jsxs("span",{children:[s.jsx(A,{style:{marginRight:3}}),a]})]}):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"})]})},z=({onOpenSession:o})=>{const{t:n}=g(),{token:t}=v.useToken(),l=p(e=>e.chats),i=c.useCallback(e=>y(e)(p.getState()),[]),a=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,P),[l,i]),j=c.useMemo(()=>{const e=new Set(a.map(r=>r.id)),N=new Set(d.map(r=>r.id));return l.filter(r=>r.kind!=="child"&&!e.has(r.id)&&!N.has(r.id)).sort((r,h)=>{const f=r.updatedAt?new Date(r.updatedAt).getTime():r.createdAt;return(h.updatedAt?new Date(h.updatedAt).getTime():h.createdAt)-f}).slice(0,C)},[l,a,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:[a.length>0?s.jsxs("div",{className:"lotus-home-section",children:[s.jsxs("div",{className:"lotus-home-section-title",style:{color:t.colorTextSecondary},children:[s.jsx(w,{className:"lotus-home-section-icon",style:{color:t.colorSuccess}}),s.jsx("span",{children:n("home.sections.running","Running Now")})]}),s.jsx("div",{className:"lotus-home-session-list",children:a.map(e=>s.jsx(x,{chat:e,onOpen:u,textSecondary:t.colorTextTertiary},e.id))})]}):null,d.length>0?s.jsxs("div",{className:"lotus-home-section",children:[s.jsxs("div",{className:"lotus-home-section-title",style:{color:t.colorTextSecondary},children:[s.jsx(R,{className:"lotus-home-section-icon",style:{color:"var(--lotus-gold)"}}),s.jsx("span",{children:n("home.sections.pinned","Pinned")})]}),s.jsx("div",{className:"lotus-home-session-list",children:d.map(e=>s.jsx(x,{chat:e,onOpen:u,textSecondary:t.colorTextTertiary},e.id))})]}):null,j.length>0?s.jsxs("div",{className:"lotus-home-section",children:[s.jsxs("div",{className:"lotus-home-section-title",style:{color:t.colorTextSecondary},children:[s.jsx(k,{className:"lotus-home-section-icon"}),s.jsx("span",{children:n("home.sections.recent","Recent Sessions")})]}),s.jsx("div",{className:"lotus-home-session-list",children:j.map(e=>s.jsx(x,{chat:e,onOpen:u,textSecondary:t.colorTextTertiary},e.id))})]}):null,l.length===0?s.jsx("div",{className:"lotus-home-empty-hint",style:{color:t.colorTextTertiary},children:n("home.empty","No sessions yet. Create one to get started!")}):null]})]})})};export{z as HomeDashboard,z as default};
|