lantern-harness 0.1.34 → 0.1.35
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/CHANGELOG.md +23 -0
- package/README.md +2 -2
- package/builtin/session/lh-nav-groups.mjs +9 -0
- package/cli/server.mjs +2 -0
- package/config/app.defaults.json +2 -1
- package/dist/500.html +72 -9
- package/dist/_astro/Base.DjXU-4S_.css +1 -0
- package/dist/_astro/{Base.astro_astro_type_script_index_0_lang.CuCwv2e7.js → Base.astro_astro_type_script_index_0_lang.CiZNg228.js} +1 -1
- package/dist/_astro/{CaseExecBoard.CTVdi8MV.js → CaseExecBoard.DzNtPCwr.js} +1 -1
- package/dist/_astro/{CaseGenerateApp.BONj-skB.js → CaseGenerateApp.BvRwwxhs.js} +1 -1
- package/dist/_astro/{CasesLibrary.e6nFqhN3.js → CasesLibrary.B9I31b7C.js} +1 -1
- package/dist/_astro/{ChatApp.XcaVtt7c.js → ChatApp.79JSgx7d.js} +2 -2
- package/dist/_astro/ColumnResize.CkE59sGq.js +1 -0
- package/dist/_astro/{DashboardBoard.BaJyXPXA.js → DashboardBoard.BuyuI8WW.js} +1 -1
- package/dist/_astro/{DocsFileBrowser.D2Cff2LP.js → DocsFileBrowser.9WTBumS5.js} +1 -1
- package/dist/_astro/{DocsPager.CnXEnQqa.js → DocsPager.BS20yicJ.js} +1 -1
- package/dist/_astro/{DrawerField.C0MkN-LW.js → DrawerField.CiHAvXHQ.js} +1 -1
- package/dist/_astro/{KnowledgeLibrary.CWxIHa8I.js → KnowledgeLibrary.CQ8ULHI5.js} +1 -1
- package/dist/_astro/LifeKrTasksBoard.BWoB442i.js +1 -0
- package/dist/_astro/LifeKrTodosBoard.rDbG9XcJ.js +1 -0
- package/dist/_astro/LifeObjectivesBoard.DUDQg_RD.js +1 -0
- package/dist/_astro/LifePlanTypeSelect.BtXnXOkz.js +1 -0
- package/dist/_astro/LifeReviewsBoard.p-dp_NXl.js +5 -0
- package/dist/_astro/LifeShared.Di9sdb_T.js +3 -0
- package/dist/_astro/LifeStagesBoard.BSvhzmp_.js +1 -0
- package/dist/_astro/LifeYearCycleSelect.Q4VvLY8X.js +1 -0
- package/dist/_astro/LifeYearPlansBoard.CYN2gZKp.js +1 -0
- package/dist/_astro/MultiSelectDropdown.y8JMbCxO.js +1 -0
- package/dist/_astro/{NavLibraries.CZlA6Z1w.js → NavLibraries.D9EKoN80.js} +1 -1
- package/dist/_astro/{PluginsPage.DOGWQcVc.js → PluginsPage.DE3qbeY5.js} +1 -1
- package/dist/_astro/PluginsPage.r98lZChB.js +1 -0
- package/dist/_astro/{PmBugsBoard.ChL0RBVn.js → PmBugsBoard.Cu1uf0TC.js} +1 -1
- package/dist/_astro/{PmIterationsBoard.hTKVnMgh.js → PmIterationsBoard.RzRKkAH0.js} +1 -1
- package/dist/_astro/{PmProjectDetail.Saj76lNM.js → PmProjectDetail.DH8Z3nHb.js} +1 -1
- package/dist/_astro/{PmProjectsBoard.CCtClGM1.js → PmProjectsBoard.Dokaj4V1.js} +1 -1
- package/dist/_astro/{PmRequirementsBoard.DGXYC1Te.js → PmRequirementsBoard.DET5YIVX.js} +1 -1
- package/dist/_astro/PmRequirementsBoard.i203nmYC.js +1 -0
- package/dist/_astro/{PmShared.BuhrL7Gb.js → PmShared.BJpoEYvk.js} +1 -1
- package/dist/_astro/{PromptsLibrary.C9F9RVpz.js → PromptsLibrary.Dp1S_lHQ.js} +1 -1
- package/dist/_astro/{ReportsPage.BjD8w0zS.js → ReportsPage.C8uufWVb.js} +1 -1
- package/dist/_astro/{ReqAnalysisBoard.JfmIK2Bb.js → ReqAnalysisBoard.B3bhMWmE.js} +1 -1
- package/dist/_astro/{RequirementsLibrary.WxAFCP3X.js → RequirementsLibrary.BnY7_YXU.js} +1 -1
- package/dist/_astro/{SearchableSelect.D3ODywC4.js → SearchableSelect.5SfNLwNW.js} +1 -1
- package/dist/_astro/SelectDropdown.TgxIOKMD.js +1 -0
- package/dist/_astro/{SettingsDialog.BpKHIbID.js → SettingsDialog.BzGBZlo2.js} +1 -1
- package/dist/_astro/{SpaceSwitcher.BCZbiL7o.js → SpaceSwitcher.Cy4UrzbH.js} +1 -1
- package/dist/_astro/TasksBoard.CWkx5cD1.js +1 -0
- package/dist/_astro/{TemplatesLibrary.y_RtSjYC.js → TemplatesLibrary.phzK5kho.js} +1 -1
- package/dist/_astro/{TestStatsBoard.C3vkF9vc.js → TestStatsBoard.Dp1TWEf7.js} +1 -1
- package/dist/_astro/TodosBoard.Bkuw_LDW.js +1 -0
- package/dist/_astro/{UiAutoBoard._og5jRon.js → UiAutoBoard.Cpb_EF46.js} +1 -1
- package/dist/_astro/app-config.C4rpn1Ix.js +1 -0
- package/dist/_astro/app-version.CXqYg1a3.js +1 -0
- package/dist/_astro/{bash-tools.cciCC33C.js → bash-tools.RQcI4_42.js} +1 -1
- package/dist/_astro/{case-gen-run.BSJ0o4Zq.js → case-gen-run.CH0ldlsU.js} +1 -1
- package/dist/_astro/{case-types.CJ5PHz59.js → case-types.CprZTsyX.js} +1 -1
- package/dist/_astro/{hydrate-cache.B7--LFB_.js → hydrate-cache.DI6vqM0o.js} +1 -1
- package/dist/_astro/i18n.BJeTr39S.js +7 -0
- package/dist/_astro/{open-docs-in-session.DQ2_5fkC.js → open-docs-in-session.BdihMTEh.js} +1 -1
- package/dist/_astro/plugins.C0NrHGZv.js +1 -0
- package/dist/_astro/{req-analysis.D-dTIxXF.js → req-analysis.CjhgP3jI.js} +1 -1
- package/dist/_astro/{settings.Cu00if4D.js → settings.NTeTjmxg.js} +2 -2
- package/dist/_astro/{spaces-client.Czm-VPh5.js → spaces-client.CMGNsQJ-.js} +1 -1
- package/dist/_astro/{story-review.CvXvtZ90.js → story-review.BBfB1qYF.js} +1 -1
- package/dist/_astro/tasks.DefXqRfI.js +1 -0
- package/dist/_astro/{view-prefs.SdItxolG.js → view-prefs.8MPl3A7e.js} +1 -1
- package/dist/case-exec/index.html +141 -15
- package/dist/cases/generate/index.html +73 -10
- package/dist/cases/library/index.html +141 -15
- package/dist/dashboard/index.html +141 -15
- package/dist/docs/changelog/index.html +129 -45
- package/dist/docs/install/index.html +77 -9
- package/dist/docs/manual/index.html +137 -14
- package/dist/knowledge/index.html +141 -15
- package/dist/life/kr-tasks/index.html +921 -0
- package/dist/life/kr-todos/index.html +921 -0
- package/dist/life/objectives/index.html +921 -0
- package/dist/life/reviews/index.html +921 -0
- package/dist/life/stages/index.html +921 -0
- package/dist/life/year-plans/index.html +921 -0
- package/dist/plugins/index.html +73 -10
- package/dist/pm/bugs/index.html +141 -15
- package/dist/pm/iterations/index.html +141 -15
- package/dist/pm/projects/detail/index.html +141 -15
- package/dist/pm/projects/index.html +141 -15
- package/dist/pm/requirements/index.html +141 -15
- package/dist/prompts/index.html +141 -15
- package/dist/reports/index.html +141 -15
- package/dist/requirement-analysis/index.html +141 -15
- package/dist/requirements/index.html +141 -15
- package/dist/tasks/index.html +141 -15
- package/dist/templates/index.html +141 -15
- package/dist/test-automation/index.html +141 -15
- package/dist/test-stats/index.html +141 -15
- package/dist/todos/index.html +141 -15
- package/dist/workbench/index.html +73 -10
- package/docs//345/256/211/350/243/205/346/211/213/345/206/214.md +1 -0
- package/docs//346/223/215/344/275/234/346/211/213/345/206/214.md +31 -4
- package/lh-plugins/lh-life.mjs +1130 -0
- package/package.json +1 -1
- package/dist/_astro/Base.huFPH3Mp.css +0 -1
- package/dist/_astro/ColumnResize._Iq05ix_.js +0 -1
- package/dist/_astro/MultiSelectDropdown.BHxW9XLR.js +0 -1
- package/dist/_astro/PluginsPage.Ch3rrYRF.js +0 -1
- package/dist/_astro/PmRequirementsBoard.BNNq671Z.js +0 -1
- package/dist/_astro/SelectDropdown.apWlFGbA.js +0 -1
- package/dist/_astro/TasksBoard.CdWQSwlg.js +0 -1
- package/dist/_astro/TodosBoard.CSupMlTp.js +0 -1
- package/dist/_astro/app-config.Bg6v8zQQ.js +0 -1
- package/dist/_astro/app-version.trTEbNVs.js +0 -1
- package/dist/_astro/i18n.CH6ZNsHf.js +0 -7
- package/dist/_astro/plugins.CVnHeKyf.js +0 -1
- package/dist/_astro/tasks.jfnSAEmg.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as e,t}from"./react.Blvh0GOs.js";import{i as n}from"./app-config.Bg6v8zQQ.js";import{i as r,o as i,s as ee}from"./plugins.CVnHeKyf.js";import{n as a,o,r as s,s as c}from"./view-prefs.SdItxolG.js";import{i as l,n as u,r as d,t as f}from"./dialog.DZHZCe_T.js";import{t as p}from"./jsx-runtime.DUg_B_vD.js";import{t as m}from"./ConfirmDialog.D5qXeML0.js";import{t as h}from"./DatePicker.Bkl71M49.js";import{t as g}from"./SelectDropdown.apWlFGbA.js";import{showToast as _}from"./Toast.BO2NFckG.js";import{c as v,d as y,i as b,l as x,n as S,o as te,t as C}from"./ColumnResize._Iq05ix_.js";import{C as w,F as ne,O as re,a as T,b as E,c as ie,f as ae,g as oe,h as se,i as D,j as O,m as k,n as A,o as ce,p as le,r as j,s as ue,t as M,u as de}from"./tasks.jfnSAEmg.js";import{a as N,l as P,n as F,o as I,r as L,s as R,t as z}from"./DrawerField.C0MkN-LW.js";var B=e(t(),1),V=p(),fe=8e3,H=[{key:`title`,width:280,min:200},{key:`status`,width:104,min:80},{key:`priority`,width:104,min:88},{key:`start`,width:108,min:88},{key:`due`,width:108,min:88},{key:`cycle`,width:76,min:60},{key:`todos`,width:84,min:68},{key:`progress`,width:132,min:104},{key:`note`,width:140,min:88},{key:`filler`,filler:!0},{key:`action`,width:76,min:64}],pe={pool:`bg-stone-100 text-stone-600`,in_progress:`bg-[#e1eaff] text-[#1f4ec2]`,done:`bg-[#d9f5d2] text-[#1d7a12]`,closed:`bg-stone-100 text-stone-400`,cancelled:`bg-stone-100 text-stone-400 line-through`},me={urgent_important:`bg-[#f54a45] text-white`,important:`bg-[#ff8800] text-white`,urgent:`bg-[#f7ba1e] text-stone-800`,normal:`bg-stone-200 text-stone-600`,"":`bg-transparent text-stone-400`},U={pending:`bg-stone-100 text-stone-600`,in_progress:`bg-[#e1eaff] text-[#1f4ec2]`,done:`bg-[#d9f5d2] text-[#1d7a12]`,cancelled:`bg-stone-100 text-stone-400`,overdue:`bg-[#fee4e3] text-[#c02a26]`},he={pool:`bg-stone-400`,in_progress:`bg-[#3370ff]`,done:`bg-[#34c724]`,closed:`bg-stone-300`,cancelled:`bg-stone-300`},ge={urgent_important:`bg-[#f54a45]`,important:`bg-[#ff8800]`,urgent:`bg-[#f7ba1e]`,normal:`bg-stone-300`,"":`border border-stone-300 bg-transparent`},_e=j.map(e=>({value:e,label:D[e]})),ve=[{value:``,label:`未设置`},...M.map(e=>({value:e,label:A[e]}))],ye=[{value:`all`,label:`全部优先级`},...M.map(e=>({value:e,label:A[e]}))],be=[{value:`all`,label:`全部`},{value:`pool`,label:`任务池`},{value:`in_progress`,label:`进行中`},{value:`done`,label:`已完成`},{value:`closed`,label:`已关闭`},{value:`cancelled`,label:`已取消`}],xe=[`all`,`pool`,`in_progress`,`done`,`closed`,`cancelled`],Se=`tasks.status-tab`,Ce=`tasks.priority-filter`,we=`tasks.search`,Te=ye.map(e=>e.value);function W(e){return(0,V.jsxs)(`div`,{"data-tone":e.tone,className:`tw-stat-card flex min-w-0 flex-col gap-1 rounded-xl border px-4 py-3 ${e.tone===`urgent`?`border-red-100 bg-red-50/60`:`border-stone-200 bg-white`}`,children:[(0,V.jsx)(`span`,{className:`text-2xl font-semibold tabular-nums ${e.tone===`urgent`?`text-[#c02a26]`:`text-stone-900`}`,children:e.value}),(0,V.jsx)(`span`,{className:`truncate text-xs text-stone-500`,children:e.label})]})}function Ee(e){let{open:t,task:n,todos:r,onClose:i,onSaved:ee}=e,[a,o]=(0,B.useState)({title:``}),[s,c]=(0,B.useState)(``),[p,m]=(0,B.useState)(!1);(0,B.useEffect)(()=>{t&&(c(``),m(!1),o(n?{title:n.title,status:n.status,priority:n.priority,startDate:n.startDate,dueDate:n.dueDate,note:n.note}:{title:``,status:`pool`,priority:``,startDate:O(),dueDate:O()}))},[t,n]);function g(e){o(t=>({...t,...e}))}let v=k({startDate:a.startDate??``,dueDate:a.dueDate??``}),y=n?r.filter(e=>e.taskId===n.id):[],b=y.filter(e=>e.status===`done`).length,x=y.length?Math.round(b/y.length*100):0;async function S(){let e=(a.title??``).trim();if(!e)c(`请填写任务名称`);else if(a.startDate&&a.dueDate&&a.dueDate<a.startDate)c(`截止日期不能早于开始日期`);else{m(!0),c(``);try{n?await oe(n.id,a):await T([{...a,title:e}],{mode:`manual`}),await ee(),_(n?`已保存任务`:`已新建任务`,`success`),i()}catch(e){let t=e instanceof Error?e.message:String(e);c(t),_(`保存任务失败:${t}`,`error`)}finally{m(!1)}}}return(0,V.jsxs)(d,{open:t,onClose:i,transition:!0,className:`relative z-100`,children:[(0,V.jsx)(f,{transition:!0,className:`tw-dialog-backdrop-anim fixed inset-0 bg-black/25`,"aria-hidden":`true`}),(0,V.jsx)(`div`,{className:`fixed inset-0 flex justify-end`,children:(0,V.jsxs)(l,{transition:!0,className:`tw-drawer-panel-anim flex h-full w-full max-w-[520px] flex-col border-l border-stone-200 bg-white shadow-2xl`,children:[(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-stone-100 px-6 py-4`,children:[(0,V.jsx)(u,{className:`text-base font-semibold text-stone-900`,children:n?`任务详情`:`新建任务`}),(0,V.jsx)(`button`,{type:`button`,onClick:i,"aria-label":`关闭`,className:`flex h-7 w-7 items-center justify-center rounded-md text-stone-400 transition-colors hover:bg-stone-100 hover:text-stone-700`,children:`✕`})]}),(0,V.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-3`,children:[(0,V.jsx)(F,{icon:(0,V.jsx)(P,{}),label:`任务名称`,children:(0,V.jsx)(`input`,{autoFocus:!0,value:a.title,onChange:e=>g({title:e.target.value}),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),S())},placeholder:`请输入内容`,className:z})}),(0,V.jsx)(F,{icon:(0,V.jsx)(R,{}),label:`任务状态`,children:(0,V.jsx)(L,{ariaLabel:`任务状态`,menuMinWidth:140,options:_e,value:a.status??`pool`,onChange:e=>g({status:e}),label:D[a.status??`pool`],optionDotClassName:e=>he[e]})}),(0,V.jsx)(F,{icon:(0,V.jsx)(R,{}),label:`紧急程度`,children:(0,V.jsx)(L,{ariaLabel:`紧急程度`,menuMinWidth:140,options:ve,value:a.priority??``,onChange:e=>g({priority:e}),label:a.priority?A[a.priority]:`未设置`,optionDotClassName:e=>ge[e]})}),(0,V.jsx)(F,{icon:(0,V.jsx)(N,{}),label:`开始日期`,children:(0,V.jsx)(h,{value:a.startDate??``,onChange:e=>g({startDate:e}),className:`${z} tabular-nums`})}),(0,V.jsx)(F,{icon:(0,V.jsx)(N,{}),label:`截止日期`,children:(0,V.jsx)(h,{value:a.dueDate??``,onChange:e=>g({dueDate:e}),className:`${z} tabular-nums`})}),(0,V.jsx)(F,{icon:(0,V.jsx)(I,{}),label:`任务周期`,children:(0,V.jsx)(`div`,{className:`px-2 pt-1.5 text-sm text-stone-500`,children:v===null?`—`:`${v} 天`})}),(0,V.jsx)(F,{icon:(0,V.jsx)(I,{}),label:`待办进度`,children:(0,V.jsx)(`div`,{className:`px-2 pt-1.5 text-sm text-stone-500`,children:y.length?`${b}/${y.length} · ${x}%`:`还没有关联待办`})}),(0,V.jsx)(F,{icon:(0,V.jsx)(P,{}),label:`备注`,children:(0,V.jsx)(`textarea`,{value:a.note??``,onChange:e=>g({note:e.target.value}),rows:4,placeholder:`请输入内容`,className:`w-full resize-y rounded-md border border-transparent bg-transparent px-2 py-1.5 text-sm text-stone-800 outline-none transition-colors hover:border-stone-200 focus:border-[#3370ff] focus:bg-white placeholder:text-stone-400`})}),n&&y.length?(0,V.jsxs)(`div`,{className:`mx-6 mt-2 rounded-lg border border-stone-100 bg-stone-50/60 px-3 py-2`,children:[(0,V.jsx)(`div`,{className:`mb-1.5 text-xs font-medium text-stone-500`,children:`关联待办`}),(0,V.jsx)(`ul`,{className:`space-y-1.5`,children:y.map(e=>{let t=w(e,O());return(0,V.jsxs)(`li`,{className:`flex items-center gap-2 text-sm text-stone-700`,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,V.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${U[t]}`,children:E[t]})]},e.id)})})]}):null,s?(0,V.jsx)(`div`,{className:`mx-6 mt-2 rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700`,children:s}):null]}),(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-stone-100 px-6 py-3`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:i,disabled:p,className:`h-8 rounded-lg border border-stone-200 px-4 text-sm text-stone-600 transition-colors hover:bg-stone-100 disabled:opacity-40`,children:`取消`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>void S(),disabled:p,className:`h-8 rounded-lg bg-[#3370ff] px-4 text-sm font-medium text-white transition-colors hover:bg-[#2b5fd9] disabled:opacity-40`,children:p?`保存中…`:n?`保存`:`新建`})]})]})})]})}function De(){let[e,t]=(0,B.useState)(!1),[l,u]=(0,B.useState)(!0),[d,f]=(0,B.useState)(!0),[p,w]=(0,B.useState)(null),[T,E]=(0,B.useState)([]),[O,j]=(0,B.useState)([]),[M,N]=(0,B.useState)(null),[P,F]=(0,B.useState)(!1),[I,L]=(0,B.useState)(()=>s(we)),[R,z]=(0,B.useState)(()=>a(Se,xe,`all`)),[U,De]=(0,B.useState)(()=>a(Ce,Te,`all`)),[Oe,G]=(0,B.useState)(null),[K,q]=(0,B.useState)(null);function ke(e){o(Se,e),z(e)}function Ae(e){c(we,e),L(e)}function je(e){o(Ce,e),De(e)}let J=(0,B.useRef)(!0),Y=x(`lh:tasks:cols:v1`,H),Me=y(`tasks`);(0,B.useEffect)(()=>(J.current=!0,()=>{J.current=!1}),[]);let X=(0,B.useCallback)(async()=>{try{let[e,t]=await Promise.all([de(),d?re().catch(()=>[]):Promise.resolve([])]);if(!J.current)return;E(e),j(t),N(null)}catch(e){if(!J.current)return;N(e instanceof Error?e.message:String(e))}},[d]);(0,B.useEffect)(()=>{let e=i(e=>{u(!!e.tasks),f(!!e.todos)});return n().then(()=>{u(r(`tasks`)),f(r(`todos`)),t(!0)}),e},[]),(0,B.useEffect)(()=>{e&&l&&(async()=>{let e=await ue();J.current&&(e?(await X(),J.current&&w(!0)):w(!1))})()},[e,l,X]),(0,B.useEffect)(()=>{if(p!==!0)return;let e=window.setInterval(()=>void X(),fe),t=()=>void X();return window.addEventListener(`focus`,t),()=>{window.clearInterval(e),window.removeEventListener(`focus`,t)}},[p,X]);let Ne=(0,B.useMemo)(()=>se(O),[O]),Z=(0,B.useMemo)(()=>le(T),[T]),Pe=(0,B.useMemo)(()=>ie(T,{status:R,priority:U,keyword:I}),[T,R,U,I]),Q=(0,B.useMemo)(()=>ae(Pe),[Pe]);async function $(e,t){E(n=>n.map(n=>n.id===e?{...n,...t}:n));try{let n=await oe(e,t);if(!J.current)return;E(t=>t.map(t=>t.id===e?n:t)),N(null)}catch(e){N(e instanceof Error?e.message:String(e)),await X()}}async function Fe(){let e=K;if(e){q(null),F(!0);try{await ce([e.id]),await Promise.all(O.filter(t=>t.taskId===e.id).map(e=>ne(e.id,{taskId:``,linkedTask:``}).catch(()=>null))),await X(),_(`已删除任务「${e.title}」`,`success`)}catch(e){let t=e instanceof Error?e.message:String(e);N(t),_(`删除任务失败:${t}`,`error`)}finally{J.current&&F(!1)}}}return e?l?p===null?(0,V.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-stone-200 bg-white`,"aria-busy":`true`,"aria-label":`正在连接任务服务`,children:(0,V.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,V.jsx)(`span`,{className:`tw-lib-spin`,"aria-hidden":`true`})})}):p?(0,V.jsxs)(`section`,{className:`flex min-h-0 flex-col gap-4`,children:[(0,V.jsxs)(`div`,{className:`grid shrink-0 grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-7`,children:[(0,V.jsx)(W,{label:`全部任务`,value:Z.total}),(0,V.jsx)(W,{label:`任务池`,value:Z.pool}),(0,V.jsx)(W,{label:`进行中`,value:Z.in_progress}),(0,V.jsx)(W,{label:`已完成`,value:Z.done}),(0,V.jsx)(W,{label:`已关闭`,value:Z.closed}),(0,V.jsx)(W,{label:`已取消`,value:Z.cancelled}),(0,V.jsx)(W,{label:`需要紧急`,value:Z.urgent,tone:`urgent`})]}),(0,V.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-stone-200 bg-white`,children:[(0,V.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-stone-100 px-4 py-3`,children:[(0,V.jsx)(`input`,{value:I,onChange:e=>Ae(e.target.value),placeholder:`搜索任务…`,className:`h-9 w-52 rounded-lg border border-stone-200 px-3 text-sm text-stone-800 outline-none focus:border-[#3370ff]`}),(0,V.jsx)(`div`,{className:`flex items-center gap-0.5 rounded-lg bg-stone-100/80 p-0.5`,children:be.map(e=>(0,V.jsx)(`button`,{type:`button`,onClick:()=>ke(e.value),className:`h-8 rounded-md px-3 text-sm transition-colors ${R===e.value?`bg-white font-medium text-stone-900 shadow-sm`:`text-stone-600 hover:text-stone-900`}`,children:e.label},e.value))}),(0,V.jsx)(g,{flat:!0,className:`w-[136px]`,ariaLabel:`优先级筛选`,options:ye,value:U,onChange:e=>je(e)}),(0,V.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:()=>void X(),"aria-label":`刷新`,className:`flex h-9 w-9 items-center justify-center rounded-lg border border-stone-200 text-stone-500 transition-colors hover:bg-stone-50 hover:text-stone-800`,children:(0,V.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,V.jsx)(`path`,{d:`M21 12a9 9 0 1 1-3-6.7`}),(0,V.jsx)(`path`,{d:`M21 4v5h-5`})]})}),(0,V.jsx)(`button`,{type:`button`,disabled:P,onClick:()=>G({task:null}),className:`h-9 shrink-0 rounded-lg bg-[#3370ff] px-3 text-sm font-medium whitespace-nowrap text-white transition-colors hover:bg-[#2b5fd9] disabled:opacity-40`,children:`+ 新建任务`})]})]}),M?(0,V.jsxs)(`div`,{className:`mx-4 mt-3 flex shrink-0 items-start gap-2 rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700`,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1`,children:M}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>N(null),"aria-label":`关闭`,className:`-mr-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded text-red-700/70 hover:bg-red-100 hover:text-red-900`,children:`✕`})]}):null,(0,V.jsx)(`div`,{ref:Me,className:`tw-scroll-x min-h-0 flex-1 overflow-auto`,children:(0,V.jsxs)(`table`,{className:`tw-task-table tw-sticky-table w-full table-fixed text-sm`,style:Y.tableStyle,children:[(0,V.jsx)(`colgroup`,{children:H.map(e=>(0,V.jsx)(`col`,{style:Y.widthOf(e.key)?{width:Y.widthOf(e.key)}:void 0},e.key))}),(0,V.jsx)(`thead`,{className:`tw-table-head sticky top-0 z-10 text-xs text-stone-500`,children:(0,V.jsxs)(`tr`,{children:[(0,V.jsxs)(`th`,{className:te,children:[`任务描述`,(0,V.jsx)(C,{...Y.resizeProps(`title`)})]}),(0,V.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`任务状态`,(0,V.jsx)(C,{...Y.resizeProps(`status`)})]}),(0,V.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`紧急程度`,(0,V.jsx)(C,{...Y.resizeProps(`priority`)})]}),(0,V.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`开始日期`,(0,V.jsx)(C,{...Y.resizeProps(`start`)})]}),(0,V.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`截止日期`,(0,V.jsx)(C,{...Y.resizeProps(`due`)})]}),(0,V.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`任务周期`,(0,V.jsx)(C,{...Y.resizeProps(`cycle`)})]}),(0,V.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`待办数量`,(0,V.jsx)(C,{...Y.resizeProps(`todos`)})]}),(0,V.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`完成进度`,(0,V.jsx)(C,{...Y.resizeProps(`progress`)})]}),(0,V.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`备注`,(0,V.jsx)(C,{...Y.resizeProps(`note`)})]}),(0,V.jsx)(`th`,{"aria-hidden":`true`}),(0,V.jsx)(`th`,{className:v,children:`操作`})]})}),(0,V.jsxs)(`tbody`,{children:[Q.map(e=>{let t=k(e),n=Ne[e.id]??{total:0,done:0,percent:0};return(0,V.jsxs)(`tr`,{className:`group/row hover:bg-[#f7f8fa]`,children:[(0,V.jsx)(`td`,{className:S,children:(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e.source===`ai`?(0,V.jsx)(`span`,{className:`shrink-0 rounded bg-[#e1eaff] px-1 py-px text-[10px] text-[#1f4ec2]`,children:`AI`}):null,(0,V.jsx)(`button`,{type:`button`,onClick:()=>G({task:e}),className:`min-w-0 truncate rounded-md px-1.5 py-1 text-left text-sm text-stone-800 hover:bg-stone-100`,children:e.title})]})}),(0,V.jsx)(`td`,{className:`px-1.5 py-1 align-middle`,children:(0,V.jsx)(g,{unstyled:!0,hideChevron:!0,centerContent:!0,ariaLabel:`任务状态`,menuMinWidth:120,options:_e,value:e.status,onChange:t=>void $(e.id,{status:t}),triggerClassName:`h-7 max-w-full rounded-md px-2 text-center text-xs font-medium focus:ring-2 focus:ring-[#3370ff]/30 ${pe[e.status]}`,renderTrigger:()=>(0,V.jsx)(`span`,{className:`truncate`,children:D[e.status]}),renderOptionPrefix:e=>(0,V.jsx)(`span`,{className:`h-2 w-2 rounded-full ${he[e.value]}`})})}),(0,V.jsx)(`td`,{className:`px-1.5 py-1 align-middle`,children:(0,V.jsx)(g,{unstyled:!0,hideChevron:!0,centerContent:!0,ariaLabel:`紧急程度`,menuMinWidth:128,options:ve,value:e.priority,onChange:t=>void $(e.id,{priority:t}),triggerClassName:`h-7 max-w-full rounded-md px-2 text-center text-xs font-medium focus:ring-2 focus:ring-[#3370ff]/30 ${me[e.priority]}`,renderTrigger:()=>(0,V.jsx)(`span`,{className:`truncate`,children:e.priority?A[e.priority]:`未设置`}),renderOptionPrefix:e=>(0,V.jsx)(`span`,{className:`h-2 w-2 rounded-full ${ge[e.value]}`})})}),(0,V.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,V.jsx)(h,{value:e.startDate,onChange:t=>void $(e.id,{startDate:t}),placeholder:`选择日期`,className:`h-8 rounded-md px-1.5 text-sm tabular-nums`})}),(0,V.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,V.jsx)(h,{value:e.dueDate,onChange:t=>void $(e.id,{dueDate:t}),placeholder:`选择日期`,className:`h-8 rounded-md px-1.5 text-sm tabular-nums`})}),(0,V.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap text-stone-500 tabular-nums`,children:t===null?`—`:`${t} 天`}),(0,V.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs text-stone-500 tabular-nums`,children:d?n.total?`${n.total} 条`:`0`:(0,V.jsx)(`span`,{className:`whitespace-nowrap text-stone-400`,children:`待办事项未启用`})}),(0,V.jsx)(`td`,{className:`px-2 py-1 align-middle`,children:d?(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`h-1.5 min-w-0 flex-1 overflow-hidden rounded-full bg-stone-100`,children:(0,V.jsx)(`span`,{className:`block h-full rounded-full bg-[#3370ff] transition-[width]`,style:{width:`${n.percent}%`}})}),(0,V.jsxs)(`span`,{className:`w-9 shrink-0 text-right text-xs text-stone-500 tabular-nums`,children:[n.percent,`%`]})]}):(0,V.jsx)(`span`,{className:`whitespace-nowrap text-xs text-stone-400`,children:`待办事项未启用`})}),(0,V.jsx)(`td`,{className:`truncate px-2 py-1 align-middle text-xs text-stone-500`,children:e.note||`—`}),(0,V.jsx)(`td`,{"aria-hidden":`true`}),(0,V.jsx)(`td`,{className:b,children:(0,V.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:()=>G({task:e}),"aria-label":`展开 ${e.title}`,className:`rounded p-1 text-stone-300 transition-colors hover:bg-stone-100 hover:text-stone-600 focus:text-stone-600`,children:(0,V.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,V.jsx)(`path`,{d:`M14 4h6v6`}),(0,V.jsx)(`path`,{d:`M20 4 13 11`}),(0,V.jsx)(`path`,{d:`M10 20H4v-6`}),(0,V.jsx)(`path`,{d:`M4 20l7-7`})]})}),(0,V.jsx)(`button`,{type:`button`,disabled:P,onClick:()=>q(e),"aria-label":`删除 ${e.title}`,className:`tw-icon-danger rounded p-1`,children:(0,V.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,V.jsx)(`path`,{d:`M3 6h18`}),(0,V.jsx)(`path`,{d:`M8 6V4h8v2`}),(0,V.jsx)(`path`,{d:`M19 6l-1 14H6L5 6`}),(0,V.jsx)(`path`,{d:`M10 11v6M14 11v6`})]})})]})})]},e.id)}),Q.length===0?(0,V.jsx)(`tr`,{children:(0,V.jsx)(`td`,{colSpan:11,className:`px-3 py-16 text-center text-sm text-stone-400`,children:T.length===0?`还没有任务`:`没有匹配的任务,试试调整搜索或筛选`})}):null]})]})}),(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-t border-stone-100 px-4 py-2.5 text-xs text-stone-500`,children:[(0,V.jsxs)(`span`,{children:[`共 `,Q.length,` 条`]}),(0,V.jsx)(`span`,{className:`ml-auto text-stone-400`,children:`任务下关联的待办可直接在「待办事项」里维护`})]})]}),(0,V.jsx)(Ee,{open:Oe!==null,task:Oe?.task??null,todos:O,onClose:()=>G(null),onSaved:X}),(0,V.jsx)(m,{open:K!=null,title:`删除任务`,message:`删除「${K?.title??``}」?已关联的待办会保留,但不再挂在该任务下。`,confirmLabel:`删除`,cancelLabel:`取消`,danger:!0,onClose:()=>q(null),onConfirm:()=>void Fe()})]}):(0,V.jsx)(`div`,{className:`tw-lib-notice rounded-xl border border-amber-200 bg-amber-50 px-5 py-8 text-sm text-amber-900`,children:`任务管理需要本地服务,当前未就绪(仅 npm run dev / 本地一体服务可用)。`}):(0,V.jsx)(`div`,{className:`tw-lib-notice rounded-xl border border-amber-200 bg-amber-50 px-5 py-8 text-sm text-amber-900`,children:ee(`tasks`)}):(0,V.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-stone-200 bg-white`,"aria-busy":`true`,"aria-label":`正在读取插件开关`,children:(0,V.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,V.jsx)(`span`,{className:`tw-lib-spin`,"aria-hidden":`true`})})})}export{De as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as e,t}from"./react.Blvh0GOs.js";import{i as n}from"./app-config.Bg6v8zQQ.js";import{i as r,o as i,s as a}from"./plugins.CVnHeKyf.js";import{n as o,o as s,r as c,s as ee}from"./view-prefs.SdItxolG.js";import{i as te,n as ne,r as l,t as re}from"./dialog.DZHZCe_T.js";import{t as u}from"./jsx-runtime.DUg_B_vD.js";import{t as d}from"./ConfirmDialog.D5qXeML0.js";import{n as ie,t as f}from"./DatePicker.Bkl71M49.js";import{t as ae}from"./OverflowHint.pvo2Xc8R.js";import{t as p}from"./SelectDropdown.apWlFGbA.js";import{showToast as m}from"./Toast.BO2NFckG.js";import{a as oe,c as h,d as g,i as se,l as ce,n as _,o as le,r as v,s as ue,t as y}from"./ColumnResize._Iq05ix_.js";import{A as de,C as b,D as x,E as S,F as C,M as fe,N as pe,O as me,P as he,S as ge,T as _e,_ as ve,b as w,f as ye,g as be,j as T,n as E,u as xe,v as D,w as Se,x as Ce,y as O}from"./tasks.jfnSAEmg.js";import{a as we,c as k,i as Te,l as A,n as j,o as M,r as Ee,s as N,t as De}from"./DrawerField.C0MkN-LW.js";var P=e(t(),1),F=u(),Oe=8e3,ke=[{key:`select`,width:32,min:28},{key:`index`,width:36,min:28},{key:`title`,width:300,min:160},{key:`status`,width:104,min:76},{key:`task`,width:156,min:96},{key:`priority`,width:104,min:84},{key:`start`,width:108,min:88},{key:`due`,width:108,min:88},{key:`end`,width:108,min:88},{key:`cycle`,width:64,min:52},{key:`remain`,width:86,min:64},{key:`note`,width:160,min:100},{key:`filler`,filler:!0},{key:`action`,width:88,min:72}],Ae=[`title`,`status`,`priority`,`linkedTask`,`startDate`,`dueDate`,`note`],je={in_progress:`bg-[#3370ff] text-white`,pending:`bg-stone-400 text-white`,done:`bg-[#34c724] text-white`,cancelled:`bg-stone-300 text-stone-600`,overdue:`bg-[#f54a45] text-white`},Me={in_progress:`bg-[#e1eaff] text-[#1f4ec2]`,pending:`bg-stone-100 text-stone-600`,done:`bg-[#d9f5d2] text-[#1d7a12]`,cancelled:`bg-stone-100 text-stone-400`,overdue:`bg-[#fee4e3] text-[#c02a26]`},I={urgent_important:`bg-[#f54a45] text-white`,important:`bg-[#ff8800] text-white`,urgent:`bg-[#f7ba1e] text-stone-800`,normal:`bg-stone-200 text-stone-600`,"":`bg-transparent text-stone-400`},Ne={pending:`bg-stone-400`,in_progress:`bg-[#3370ff]`,done:`bg-[#34c724]`,overdue:`bg-[#f54a45]`,cancelled:`bg-stone-300`},Pe={urgent_important:`bg-[#f54a45]`,important:`bg-[#ff8800]`,urgent:`bg-[#f7ba1e]`,normal:`bg-stone-300`,"":`border border-stone-300 bg-transparent`},L={status:`按状态分组`,priority:`按紧急程度分组`,none:`不分组`},Fe=[`status`,`priority`,`none`],Ie=`todos.group-by`,Le=[`in_progress`,`pending`,`overdue`,`done`,`cancelled`],Re=O.map(e=>({value:e,label:w[e]})),ze=[{value:``,label:`未设置`},...ve.map(e=>({value:e,label:D[e]}))],Be=Object.keys(L).map(e=>({value:e,label:L[e]})),Ve=[{value:`all`,label:`全部紧急程度`},...ve.map(e=>({value:e,label:D[e]}))],He=Ve.map(e=>e.value),Ue=`todos.priority-filter`,We=`todos.search`,Ge=`h-8 w-full min-w-0 truncate rounded-md border border-transparent bg-transparent px-1.5 text-sm text-stone-800 outline-none transition-colors hover:border-stone-200 focus:border-[#3370ff] focus:bg-white placeholder:text-stone-300`;function Ke(e){let{value:t,placeholder:n,muted:r,autoFocus:i,onChange:a,onCommit:o,onCancel:s}=e;return(0,F.jsx)(`input`,{type:`text`,value:t,placeholder:n,autoFocus:i,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),e.currentTarget.blur()):e.key===`Escape`&&(e.preventDefault(),s(),e.currentTarget.blur())},className:`${Ge} ${r&&!t?`text-stone-300`:``}`})}function qe(e){let{value:t,onChange:n,onCommit:r,onCancel:i}=e,[a,o]=(0,P.useState)(!1);return a?(0,F.jsx)(Ke,{value:t,placeholder:`—`,autoFocus:!0,onChange:n,onCommit:()=>{o(!1),r()},onCancel:()=>{o(!1),i()}}):(0,F.jsx)(`button`,{type:`button`,onClick:()=>o(!0),className:`block h-8 w-full min-w-0 truncate rounded-md border border-transparent px-1.5 text-left text-sm leading-8 text-stone-700 transition-colors hover:border-stone-200 focus:border-[#3370ff] focus:outline-none`,children:t||(0,F.jsx)(`span`,{className:`text-stone-300`,children:`—`})})}function Je(e){return(0,F.jsx)(f,{value:e.value,onChange:e.onChange,placeholder:`选择日期`,className:`h-8 rounded-md border border-transparent px-1.5 text-sm text-stone-800 tabular-nums transition-colors hover:border-stone-200 focus:border-[#3370ff] focus:bg-white`})}function Ye(e){let{open:t,item:n,preset:r,tasks:i,tasksOn:a,onClose:o,onSaved:s}=e,[c,ee]=(0,P.useState)({title:``}),[u,d]=(0,P.useState)(``),[oe,h]=(0,P.useState)(!1),[g,se]=(0,P.useState)(!0);(0,P.useEffect)(()=>{t&&(d(``),h(!1),se(!0),ee(n?{title:n.title,status:n.status,statusManual:n.statusManual,priority:n.priority,linkedTask:n.linkedTask,taskId:n.taskId,startDate:n.startDate,dueDate:n.dueDate,note:n.note}:(()=>{let e=T(),t=T(),n=S(e,t)??`in_progress`;return{title:``,status:r?.status??n,statusManual:!!r?.status,priority:r?.priority??``,startDate:e,dueDate:t}})()))},[t,n,r]);let ce=[{value:``,label:`不关联`},...ye(i.filter(e=>e.status!==`closed`&&e.status!==`cancelled`||e.id===n?.taskId)).map(e=>({value:e.id,label:e.title}))];function _(e){ee(t=>{let n={...t,...e};if(`status`in e&&!(`startDate`in e||`dueDate`in e))n.statusManual=!0;else if((`startDate`in e||`dueDate`in e)&&!n.statusManual&&!x(n.status??`pending`)){let e=S(n.startDate??``,n.dueDate??``);e&&(n.status=e)}return n})}let le=fe({startDate:c.startDate??``,dueDate:c.dueDate??``}),v=he({dueDate:c.dueDate??``}),ue=x(c.status??`pending`),y=ue?ie((n&&x(n.status)?n.taskEndDate:``)||T()):``,de=v===null?``:c.status===`done`?`已完成`:c.status===`cancelled`?`已取消`:v<0?`逾期 ${Math.abs(v)} 天`:v===0?`今天截止`:`${v} 天`;async function b(){let e=(c.title??``).trim();if(!e)d(`请填写待办名称`);else if(c.startDate&&c.dueDate&&c.dueDate<c.startDate)d(`截止日期不能早于开始日期`);else{h(!0),d(``);try{let t={...c,title:e};n?await C(n.id,t):await Ce([t],{mode:`manual`}),await s(),m(n?`已保存待办`:`已新建待办`,`success`),o()}catch(e){let t=e instanceof Error?e.message:String(e);d(t),m(`保存待办失败:${t}`,`error`)}finally{h(!1)}}}return(0,F.jsxs)(l,{open:t,onClose:o,transition:!0,className:`relative z-100`,children:[(0,F.jsx)(re,{transition:!0,className:`tw-dialog-backdrop-anim fixed inset-0 bg-black/25`,"aria-hidden":`true`}),(0,F.jsx)(`div`,{className:`fixed inset-0 flex justify-end`,children:(0,F.jsxs)(te,{transition:!0,className:`tw-drawer-panel-anim flex h-full w-full max-w-[520px] flex-col border-l border-stone-200 bg-white shadow-2xl`,children:[(0,F.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-stone-100 px-6 py-4`,children:[(0,F.jsx)(ne,{className:`text-base font-semibold text-stone-900`,children:n?`待办详情`:`新建待办`}),(0,F.jsx)(`button`,{type:`button`,onClick:o,"aria-label":`关闭`,className:`flex h-7 w-7 items-center justify-center rounded-md text-stone-400 transition-colors hover:bg-stone-100 hover:text-stone-700`,children:`✕`})]}),(0,F.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-3`,children:[(0,F.jsx)(j,{icon:(0,F.jsx)(A,{}),label:`待办名称`,children:(0,F.jsx)(`input`,{autoFocus:!0,value:c.title,onChange:e=>_({title:e.target.value}),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),b())},placeholder:`请输入内容`,className:De})}),(0,F.jsx)(j,{icon:(0,F.jsx)(N,{}),label:`待办状态`,children:(0,F.jsx)(Ee,{ariaLabel:`待办状态`,menuMinWidth:140,options:Re,value:c.status??`pending`,onChange:e=>_({status:e}),label:w[c.status??`pending`],optionDotClassName:e=>Ne[e]})}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>se(e=>!e),"aria-expanded":g,className:`flex w-full items-center gap-2 px-6 py-2 text-left text-sm text-stone-600 hover:bg-stone-50`,children:[(0,F.jsx)(`span`,{className:`flex h-4 w-4 items-center justify-center text-stone-400`,children:(0,F.jsx)(k,{})}),(0,F.jsx)(`span`,{children:`任务详情`}),(0,F.jsx)(`span`,{className:`text-stone-400`,children:(0,F.jsx)(Te,{open:g})})]}),g?(0,F.jsxs)(`div`,{className:`ml-[42px] border-l border-stone-100 pl-1`,children:[(0,F.jsx)(j,{icon:(0,F.jsx)(k,{}),label:`所属任务`,children:a?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(p,{flat:!0,searchable:!0,searchPlaceholder:`搜索任务…`,ariaLabel:`所属任务`,menuMinWidth:220,options:ce,value:c.taskId??``,onChange:e=>{let t=i.find(t=>t.id===e);_({taskId:e,linkedTask:t?.title??``,...t?{priority:t.priority}:{}})},renderTrigger:()=>(0,F.jsx)(ae,{text:c.taskId?i.find(e=>e.id===c.taskId)?.title??``:c.linkedTask||`请选择任务`,className:`min-w-0 truncate ${c.taskId||c.linkedTask?`text-stone-800`:`text-stone-400`}`})}),i.length===0?(0,F.jsx)(`p`,{className:`mt-1 px-2 text-xs text-stone-400`,children:`任务管理里还没有任务,可到「任务管理」新建后再关联。`}):null]}):(0,F.jsx)(`div`,{className:`flex h-9 items-center rounded-md bg-stone-50 px-2 text-sm text-stone-400`,children:(0,F.jsx)(`span`,{className:`truncate`,children:c.linkedTask?`${c.linkedTask}(任务管理插件未启用)`:`任务管理插件未启用,无法关联任务`})})}),(0,F.jsx)(j,{icon:(0,F.jsx)(N,{}),label:`重要紧急程度`,children:(()=>{let e=c.taskId?i.find(e=>e.id===c.taskId):void 0;return e?(0,F.jsxs)(`div`,{className:`flex h-9 items-center gap-2 px-2 text-sm`,children:[(0,F.jsx)(`span`,{className:e.priority?`text-stone-800`:`text-stone-400`,children:e.priority?E[e.priority]:`任务未设置`}),(0,F.jsx)(`span`,{className:`text-[11px] text-stone-400`,children:`跟随所属任务`})]}):(0,F.jsx)(Ee,{ariaLabel:`重要紧急程度`,menuMinWidth:140,options:ze,value:c.priority??``,onChange:e=>_({priority:e}),label:c.priority?D[c.priority]:`未设置`,optionDotClassName:e=>Pe[e]})})()}),(0,F.jsx)(j,{icon:(0,F.jsx)(we,{}),label:`结束日期`,children:(0,F.jsxs)(`div`,{className:`flex h-9 items-center px-2 text-sm tabular-nums`,"aria-readonly":`true`,children:[y?(0,F.jsx)(`span`,{className:`text-stone-800`,children:y}):(0,F.jsx)(`span`,{className:`text-stone-400`,children:`待办未完成`}),(0,F.jsx)(`span`,{className:`ml-2 text-[11px] text-stone-400`,children:ue?`按完成日期自动记录`:`状态为已完成 / 已取消时自动记录`})]})})]}):null,(0,F.jsx)(j,{icon:(0,F.jsx)(we,{}),label:`开始日期`,children:(0,F.jsx)(f,{value:c.startDate??``,onChange:e=>_({startDate:e}),className:`${De} tabular-nums`})}),(0,F.jsx)(j,{icon:(0,F.jsx)(we,{}),label:`截止日期`,children:(0,F.jsx)(f,{value:c.dueDate??``,onChange:e=>_({dueDate:e}),className:`${De} tabular-nums`})}),(0,F.jsx)(j,{icon:(0,F.jsx)(M,{}),label:`待办周期`,children:(0,F.jsx)(`div`,{className:`px-2 pt-1.5 text-sm text-stone-500`,children:le===null?`—`:`${le} 天`})}),(0,F.jsx)(j,{icon:(0,F.jsx)(M,{}),label:`剩余天数`,children:(0,F.jsx)(`div`,{className:`px-2 pt-1.5 text-sm text-stone-500`,children:de||`—`})}),(0,F.jsx)(j,{icon:(0,F.jsx)(A,{}),label:`备注`,children:(0,F.jsx)(`textarea`,{value:c.note??``,onChange:e=>_({note:e.target.value}),rows:4,placeholder:`请输入内容`,className:`w-full resize-y rounded-md border border-transparent bg-transparent px-2 py-1.5 text-sm text-stone-800 outline-none transition-colors hover:border-stone-200 focus:border-[#3370ff] focus:bg-white placeholder:text-stone-400`})}),u?(0,F.jsx)(`div`,{className:`mx-6 mt-2 rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700`,children:u}):null]}),(0,F.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-stone-100 px-6 py-3`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:o,disabled:oe,className:`h-8 rounded-lg border border-stone-200 px-4 text-sm text-stone-600 transition-colors hover:bg-stone-100 disabled:opacity-40`,children:`取消`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>void b(),disabled:oe,className:`h-8 rounded-lg bg-[#3370ff] px-4 text-sm font-medium text-white transition-colors hover:bg-[#2b5fd9] disabled:opacity-40`,children:oe?`保存中…`:n?`保存`:`新建`})]})]})})]})}function R(){let[e,t]=(0,P.useState)(!1),[te,ne]=(0,P.useState)(!0),[l,re]=(0,P.useState)(null),[u,E]=(0,P.useState)([]),[O,we]=(0,P.useState)([]),[k,Te]=(0,P.useState)(!1),[A,j]=(0,P.useState)(null),[M,Ee]=(0,P.useState)(!1),[N,De]=(0,P.useState)(()=>c(We)),[L,Ge]=(0,P.useState)(()=>o(Ue,He,`all`)),[R,Xe]=(0,P.useState)(()=>o(Ie,Fe,`status`)),[Ze,Qe]=(0,P.useState)({}),[z,$e]=(0,P.useState)({});function et(e){s(Ie,e),Xe(e)}function tt(e){s(Ue,e),Ge(e)}function nt(e){ee(We,e),De(e)}let[rt,it]=(0,P.useState)({}),[B,V]=(0,P.useState)(null),[H,U]=(0,P.useState)(null),[at,ot]=(0,P.useState)(!1),[st,ct]=(0,P.useState)(null),W=(0,P.useRef)(!0),lt=(0,P.useRef)(!1),G=(0,P.useRef)(!1),K=ce(`lh:todos:cols:v1`,ke),ut=g(`todos`),dt=B!==null,q=(0,P.useRef)(B);q.current=B;let ft=(0,P.useRef)(!1),pt=(0,P.useRef)(async()=>{});pt.current=xt,(0,P.useEffect)(()=>(W.current=!0,()=>{W.current=!1}),[]),(0,P.useEffect)(()=>{if(!dt)return;let e=e=>{let t=e.target;if(!(t instanceof Element)||t.closest(`.tw-new-row`)||t.closest(`.tw-date-panel`)||t.closest(`.tw-select-menu`))return;let n=q.current;if(!n)return;if(n.title.trim()){pt.current();return}let r=T();!n.note.trim()&&!n.taskId&&n.status===n.baseStatus&&n.priority===n.basePriority&&n.startDate===r&&n.dueDate===r&&V(null)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[dt]);let J=(0,P.useCallback)(async()=>{try{let[e,t]=await Promise.all([me(),k?xe().catch(()=>[]):Promise.resolve([])]);if(!W.current)return;let n=t;if(!lt.current&&k){lt.current=!0;let r=new Set(e.filter(e=>e.status===`pending`||e.status===`in_progress`).map(e=>e.taskId).filter(Boolean)),i=t.filter(e=>r.has(e.id)&&(e.status===`pool`||e.status===`done`));if(i.length){let e=await Promise.all(i.map(e=>be(e.id,{status:`in_progress`}).catch(()=>null))),r=new Map(e.filter(e=>!!e).map(e=>[e.id,e]));n=t.map(e=>r.get(e.id)??e)}}E(e),we(n),j(null)}catch(e){if(!W.current)return;j(e instanceof Error?e.message:String(e))}},[k]);(0,P.useEffect)(()=>{let e=i(e=>{ne(!!e.todos),Te(!!e.tasks)});return n().then(()=>{ne(r(`todos`)),Te(r(`tasks`)),t(!0)}),e},[]),(0,P.useEffect)(()=>{e&&te&&(async()=>{let e=await Se();W.current&&(e?(await J(),W.current&&re(!0)):re(!1))})()},[e,te,J]),(0,P.useEffect)(()=>{if(l!==!0)return;let e=window.setInterval(()=>{G.current||J()},Oe),t=()=>{G.current||J()};return window.addEventListener(`focus`,t),()=>{window.clearInterval(e),window.removeEventListener(`focus`,t)}},[l,J]),(0,P.useEffect)(()=>{if(!k||l!==!0||O.length===0)return;let e=u.filter(e=>!e.taskId&&e.linkedTask.trim());if(!e.length)return;let t=!1;return(async()=>{let n=[];for(let t of e){let e=O.find(e=>e.title.trim()===t.linkedTask.trim());if(e)try{n.push(await C(t.id,{taskId:e.id}))}catch{}}!t&&n.length&&E(e=>e.map(e=>n.find(t=>t.id===e.id)??e))})(),()=>{t=!0}},[k,l,u,O]);function mt(e,t,n){it(r=>({...r,[e]:{...r[e],[t]:n}}))}function Y(e){it(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})}let ht=(0,P.useMemo)(()=>[{value:``,label:`不关联`},...ye(O.filter(e=>e.status!==`closed`&&e.status!==`cancelled`)).map(e=>({value:e.id,label:e.title}))],[O]);function gt(e){return e.taskId?O.find(t=>t.id===e.taskId)?.title??e.linkedTask:e.linkedTask}function _t(e){return e.taskId?O.find(t=>t.id===e.taskId):void 0}function vt(e){let t=_t(e);return t?t.priority:e.priority}async function X(e,t){let n=u.find(t=>t.id===e),r={...t};if(t.status!==void 0&&t.startDate===void 0&&t.dueDate===void 0)r.statusManual=!0;else if(n&&!n.statusManual&&!x(n.status)&&(t.startDate!==void 0||t.dueDate!==void 0)&&t.status===void 0){let e=S(t.startDate??n.startDate,t.dueDate??n.dueDate);e&&(r.status=e)}E(t=>t.map(t=>t.id===e?{...t,...r,updatedAt:new Date().toISOString()}:t));try{let t=await C(e,r);if(!W.current)return;E(n=>n.map(n=>n.id===e?t:n)),j(null),r.taskId&&await J()}catch(e){j(e instanceof Error?e.message:String(e)),await J()}}async function yt(e){let t=rt[e],n=u.find(t=>t.id===e);if(!t||!n)return;let r={},i=n;for(let e of Ae){let n=t[e];n!==void 0&&String(i[e]??``)!==String(n)&&(r[e]=n)}if(!Object.keys(r).length)Y(e);else if(typeof r.title==`string`&&!r.title.trim())j(`待办名称不能为空`),Y(e);else try{let t=await C(e,r);if(!W.current)return;E(n=>n.map(n=>n.id===e?t:n)),it(t=>{let n=t[e];if(!n)return t;let i={...n};for(let e of Object.keys(r))String(i[e]??``)===String(r[e]??``)&&delete i[e];if(!Object.keys(i).length){let n={...t};return delete n[e],n}return{...t,[e]:i}}),j(null)}catch(t){j(t instanceof Error?t.message:String(t)),Y(e)}}function bt(e){let t=T(),n=T(),r=!!e.newStatus,i=S(t,n)??`in_progress`,a=e.newStatus??i,o=e.newPriority??``;V({groupKey:e.key,title:``,status:a,statusManual:r,priority:o,taskId:``,startDate:t,dueDate:n,note:``,baseStatus:a,basePriority:o}),Qe(t=>({...t,[e.key]:!1}))}async function xt(){let e=q.current;if(!e||ft.current)return;let t=e.title.trim();if(t){ft.current=!0,ot(!0);try{let n=O.find(t=>t.id===e.taskId);await Ce([{title:t,status:e.status,statusManual:e.statusManual,priority:e.priority,taskId:e.taskId,linkedTask:n?.title??``,startDate:e.startDate,dueDate:e.dueDate,note:e.note}],{mode:`manual`}),q.current===e&&V(null),j(null),await J()}catch(e){j(e instanceof Error?e.message:String(e))}finally{ft.current=!1,W.current&&ot(!1)}}}async function St(){let e=H;if(e){U(null),Ee(!0),j(null);try{await ge(e.map(e=>e.id)),$e({}),await J(),m(e.length>1?`已删除 ${e.length} 条待办`:`已删除待办`,`success`)}catch(e){let t=e instanceof Error?e.message:String(e);j(t),m(`删除待办失败:${t}`,`error`)}finally{W.current&&Ee(!1)}}}let Z=T(),Ct=(0,P.useMemo)(()=>u.map(e=>{let t=e.taskId?O.find(t=>t.id===e.taskId):void 0;return t?{...e,priority:t.priority}:e}),[u,O]),wt=(0,P.useMemo)(()=>_e(Ct,{status:`all`,priority:L,keyword:N,today:Z}),[Ct,L,N,Z]),Q=(0,P.useMemo)(()=>de(wt),[wt]),Tt=(0,P.useMemo)(()=>R===`none`?[{key:`all`,label:`全部待办`,pill:`bg-stone-500 text-white`,items:Q}]:R===`priority`?[...ve,``].map(e=>({key:`priority:${e||`none`}`,label:e?D[e]:`未设置`,pill:e?I[e]:`bg-stone-300 text-stone-600`,items:Q.filter(t=>t.priority===e),newPriority:e})):Le.map(e=>({key:`status:${e}`,label:w[e],pill:je[e],items:Q.filter(t=>b(t,Z)===e),newStatus:e===`overdue`?`pending`:e})),[R,Q,Z]).filter(e=>e.items.length>0||B?.groupKey===e.key&&!!B),Et=Object.keys(z).filter(e=>z[e]),$=(0,P.useMemo)(()=>{let e={total:u.length,pending:0,in_progress:0,done:0,overdue:0};for(let t of u){let n=b(t,Z);n===`overdue`?e.overdue+=1:n===`pending`?e.pending+=1:n===`in_progress`?e.in_progress+=1:n===`done`&&(e.done+=1)}return e},[u,Z]);return e?te?l===null?(0,F.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-stone-200 bg-white`,"aria-busy":`true`,"aria-label":`正在连接待办服务`,children:(0,F.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,F.jsx)(`span`,{className:`tw-lib-spin`,"aria-hidden":`true`})})}):l?(0,F.jsxs)(`section`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-stone-200 bg-white`,children:[(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-3 border-b border-stone-100 px-4 py-3`,children:[(0,F.jsxs)(`div`,{className:`text-sm text-stone-600`,children:[`共 `,(0,F.jsx)(`span`,{className:`font-medium text-stone-800`,children:$.total}),` 条`,(0,F.jsxs)(`span`,{className:`text-stone-400`,children:[` `,`· 待开始 `,$.pending,` · 进行中 `,$.in_progress,` · 已完成 `,$.done,$.overdue?` · 已延期 ${$.overdue}`:``]})]}),(0,F.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(`input`,{value:N,onChange:e=>nt(e.target.value),placeholder:`搜索待办…`,className:`h-9 w-52 rounded-lg border border-stone-200 px-3 text-sm text-stone-800 outline-none focus:border-[#3370ff]`}),(0,F.jsx)(p,{flat:!0,className:`w-[132px]`,ariaLabel:`分组方式`,options:Be,value:R,onChange:e=>et(e)}),(0,F.jsx)(p,{flat:!0,className:`w-[136px]`,ariaLabel:`紧急程度筛选`,options:Ve,value:L,onChange:e=>tt(e)}),(0,F.jsx)(`button`,{type:`button`,disabled:M||Et.length===0,onClick:()=>U(u.filter(e=>z[e.id])),className:`h-9 shrink-0 rounded-lg border border-red-200 px-3 text-sm font-medium whitespace-nowrap text-red-600 hover:bg-red-50 disabled:opacity-40`,children:`批量删除`}),(0,F.jsx)(`button`,{type:`button`,disabled:M,onClick:()=>ct({item:null}),className:`h-9 shrink-0 rounded-lg bg-[#3370ff] px-3 text-sm font-medium whitespace-nowrap text-white hover:bg-[#2b5fd9] disabled:opacity-40`,children:`+ 新建待办`})]})]}),A?(0,F.jsxs)(`div`,{className:`mx-4 mt-3 flex shrink-0 items-start gap-2 rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700`,children:[(0,F.jsx)(`span`,{className:`min-w-0 flex-1`,children:A}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>j(null),"aria-label":`关闭`,className:`-mr-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded text-red-700/70 hover:bg-red-100 hover:text-red-900`,children:`✕`})]}):null,(0,F.jsx)(`div`,{ref:ut,className:`tw-scroll-x min-h-0 flex-1 overflow-auto`,onFocusCapture:()=>{G.current=!0},onBlurCapture:()=>{window.setTimeout(()=>{G.current=!!document.activeElement?.closest(`.tw-todo-table`)},0)},children:(0,F.jsxs)(`table`,{className:`tw-todo-table tw-sticky-table w-full table-fixed text-sm`,style:K.tableStyle,children:[(0,F.jsx)(`colgroup`,{children:ke.map(e=>(0,F.jsx)(`col`,{style:K.widthOf(e.key)?{width:K.widthOf(e.key)}:void 0},e.key))}),(0,F.jsx)(`thead`,{className:`tw-table-head sticky top-0 z-10 text-xs text-stone-500`,children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:oe,children:(0,F.jsx)(`input`,{type:`checkbox`,"aria-label":`全选可见待办`,checked:Q.length>0&&Q.every(e=>z[e.id]),onChange:e=>{let t=e.target.checked;$e(e=>{let n={...e};for(let e of Q)t?n[e.id]=!0:delete n[e.id];return n})}})}),(0,F.jsx)(`th`,{className:ue,style:{"--tw-sticky-left":`32px`},"aria-label":`行号`}),(0,F.jsxs)(`th`,{className:le,style:{"--tw-sticky-left":`68px`},children:[`待办名称`,(0,F.jsx)(y,{...K.resizeProps(`title`)})]}),(0,F.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`待办状态`,(0,F.jsx)(y,{...K.resizeProps(`status`)})]}),(0,F.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`所属任务`,(0,F.jsx)(y,{...K.resizeProps(`task`)})]}),(0,F.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`紧急程度`,(0,F.jsx)(y,{...K.resizeProps(`priority`)})]}),(0,F.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`开始日期`,(0,F.jsx)(y,{...K.resizeProps(`start`)})]}),(0,F.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`截止日期`,(0,F.jsx)(y,{...K.resizeProps(`due`)})]}),(0,F.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`结束日期`,(0,F.jsx)(y,{...K.resizeProps(`end`)})]}),(0,F.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`周期`,(0,F.jsx)(y,{...K.resizeProps(`cycle`)})]}),(0,F.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`剩余`,(0,F.jsx)(y,{...K.resizeProps(`remain`)})]}),(0,F.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`备注`,(0,F.jsx)(y,{...K.resizeProps(`note`)})]}),(0,F.jsx)(`th`,{"aria-hidden":`true`}),(0,F.jsx)(`th`,{className:h,children:`操作`})]})}),Tt.map(e=>{let t=Ze[e.key]===!0;return(0,F.jsxs)(`tbody`,{children:[(0,F.jsx)(`tr`,{className:`bg-white`,children:(0,F.jsx)(`td`,{colSpan:14,className:`px-2 py-0 pt-3 pb-1.5`,children:(0,F.jsxs)(`button`,{type:`button`,onClick:()=>Qe(n=>({...n,[e.key]:!t})),className:`flex items-center gap-2 rounded-md px-1 py-0.5 text-left hover:bg-stone-50`,"aria-expanded":!t,children:[(0,F.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:`text-stone-400 transition-transform ${t?`-rotate-90`:``}`,children:(0,F.jsx)(`path`,{d:`m6 9 6 6 6-6`})}),(0,F.jsx)(`span`,{className:`rounded-md px-2 py-0.5 text-xs font-medium ${e.pill}`,children:e.label}),(0,F.jsxs)(`span`,{className:`text-xs text-stone-400 tabular-nums`,children:[e.items.length,` 条记录`]})]})})}),t?null:e.items.map((e,t)=>{let n=rt[e.id]??{},r={...e,...n},i=b(r,Z),a=fe(r),o=he(r,Z),s=o===null?`—`:r.status===`done`?`已完成`:r.status===`cancelled`?`已取消`:o<0?`逾期 ${Math.abs(o)} 天`:o===0?`今天截止`:`${o} 天`;return(0,F.jsxs)(`tr`,{className:`group/row hover:bg-[#f7f8fa]`,children:[(0,F.jsx)(`td`,{className:_,children:(0,F.jsx)(`input`,{type:`checkbox`,"aria-label":`选择 ${e.title}`,checked:!!z[e.id],onChange:t=>$e(n=>{let r={...n};return t.target.checked?r[e.id]=!0:delete r[e.id],r})})}),(0,F.jsx)(`td`,{className:`${v} text-xs text-stone-400 tabular-nums`,style:{"--tw-sticky-left":`32px`},children:t+1}),(0,F.jsx)(`td`,{className:_,style:{"--tw-sticky-left":`68px`},children:(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[e.source===`ai`?(0,F.jsx)(`span`,{className:`shrink-0 rounded bg-[#e1eaff] px-1 py-px text-[10px] text-[#1f4ec2]`,title:`AI 记录`,children:`AI`}):null,(0,F.jsx)(Ke,{value:r.title,placeholder:`输入待办名称`,onChange:t=>mt(e.id,`title`,t),onCommit:()=>void yt(e.id),onCancel:()=>Y(e.id)})]})}),(0,F.jsx)(`td`,{className:`px-1.5 py-1 align-middle`,children:(0,F.jsx)(p,{unstyled:!0,hideChevron:!0,centerContent:!0,ariaLabel:`待办状态`,menuMinWidth:120,options:Re,value:e.status,onChange:t=>void X(e.id,{status:t}),triggerClassName:`h-7 max-w-full rounded-md px-2 text-center text-xs font-medium focus:ring-2 focus:ring-[#3370ff]/30 ${Me[i]}`,renderTrigger:()=>(0,F.jsx)(`span`,{className:`truncate`,children:w[i]}),renderOptionPrefix:e=>(0,F.jsx)(`span`,{className:`h-2 w-2 rounded-full ${Ne[e.value]}`})})}),(0,F.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:k?(0,F.jsx)(p,{unstyled:!0,searchable:!0,searchPlaceholder:`搜索任务…`,ariaLabel:`所属任务`,menuMinWidth:220,options:ht,value:r.taskId,onChange:t=>{let n=O.find(e=>e.id===t);X(e.id,{taskId:t,linkedTask:n?.title??``,...n?{priority:n.priority}:{}})},triggerClassName:`h-8 w-full rounded-md px-1.5 text-sm hover:border-stone-200`,renderTrigger:()=>(0,F.jsx)(ae,{text:gt(r)||`未关联`,className:`min-w-0 truncate ${gt(r)?`text-stone-800`:`text-stone-300`}`})}):(0,F.jsx)(`span`,{className:`block truncate px-1.5 text-xs text-stone-400`,children:gt(r)?`${gt(r)} · 插件未启用`:`任务管理插件未启用`})}),(0,F.jsx)(`td`,{className:`px-1.5 py-1 align-middle`,children:_t(r)?(0,F.jsx)(`span`,{title:`跟随所属任务的紧急程度`,className:`inline-flex h-7 max-w-full items-center justify-center truncate rounded-md px-2 text-center text-xs font-medium ${I[vt(r)]??`text-stone-300`}`,children:vt(r)?D[vt(r)]:`未设置`}):(0,F.jsx)(p,{unstyled:!0,hideChevron:!0,centerContent:!0,ariaLabel:`紧急程度`,menuMinWidth:128,options:ze,value:e.priority,onChange:t=>void X(e.id,{priority:t}),triggerClassName:`h-7 max-w-full rounded-md px-2 text-center text-xs font-medium focus:ring-2 focus:ring-[#3370ff]/30 ${I[e.priority]}`,renderTrigger:()=>(0,F.jsx)(`span`,{className:`truncate`,children:e.priority?D[e.priority]:`未设置`}),renderOptionPrefix:e=>(0,F.jsx)(`span`,{className:`h-2 w-2 rounded-full ${Pe[e.value]}`})})}),(0,F.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,F.jsx)(Je,{value:r.startDate,onChange:t=>void X(e.id,{startDate:t})})}),(0,F.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,F.jsx)(Je,{value:r.dueDate,onChange:t=>void X(e.id,{dueDate:t})})}),(0,F.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap tabular-nums`,children:pe(r)?(0,F.jsx)(`span`,{className:`text-stone-500`,children:ie(pe(r))}):(0,F.jsx)(`span`,{className:`text-stone-400`,children:`待办未完成`})}),(0,F.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap text-stone-500 tabular-nums`,children:a===null?`—`:`${a} 天`}),(0,F.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap tabular-nums ${o!==null&&o<0&&i!==`done`&&i!==`cancelled`?`font-medium text-[#c02a26]`:`text-stone-500`}`,children:s}),(0,F.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,F.jsx)(qe,{value:r.note,onChange:t=>mt(e.id,`note`,t),onCommit:()=>void yt(e.id),onCancel:()=>Y(e.id)})}),(0,F.jsx)(`td`,{"aria-hidden":`true`}),(0,F.jsx)(`td`,{className:se,children:(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>ct({item:e}),"aria-label":`展开 ${e.title}`,className:`rounded p-1 text-stone-300 transition-colors hover:bg-stone-100 hover:text-stone-600 focus:text-stone-600`,children:(0,F.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`path`,{d:`M14 4h6v6`}),(0,F.jsx)(`path`,{d:`M20 4 13 11`}),(0,F.jsx)(`path`,{d:`M10 20H4v-6`}),(0,F.jsx)(`path`,{d:`M4 20l7-7`})]})}),(0,F.jsx)(`button`,{type:`button`,disabled:M,onClick:()=>U([e]),"aria-label":`删除 ${e.title}`,className:`tw-icon-danger rounded p-1`,children:(0,F.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`path`,{d:`M3 6h18`}),(0,F.jsx)(`path`,{d:`M8 6V4h8v2`}),(0,F.jsx)(`path`,{d:`M19 6l-1 14H6L5 6`}),(0,F.jsx)(`path`,{d:`M10 11v6M14 11v6`})]})})]})})]},e.id)}),t?null:B?.groupKey===e.key?(0,F.jsxs)(`tr`,{className:`tw-new-row`,children:[(0,F.jsx)(`td`,{className:`px-2 py-1 align-middle`}),(0,F.jsx)(`td`,{className:`px-1 py-1 align-middle text-xs text-stone-400 tabular-nums`,children:e.items.length+1}),(0,F.jsx)(`td`,{className:v,children:(0,F.jsx)(`input`,{autoFocus:!0,value:B.title,disabled:at,placeholder:`输入待办名称,回车或点空白处保存`,onChange:e=>V(t=>t&&{...t,title:e.target.value}),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),xt()):e.key===`Escape`&&(e.preventDefault(),V(null))},className:`h-8 w-full truncate rounded-md border border-[#3370ff]/40 bg-white px-2 text-sm text-stone-800 outline-none focus:border-[#3370ff]`})}),(0,F.jsx)(`td`,{className:`px-1.5 py-1 align-middle`,children:(0,F.jsx)(p,{unstyled:!0,hideChevron:!0,centerContent:!0,ariaLabel:`待办状态`,menuMinWidth:120,options:Re,value:B.status,onChange:e=>V(t=>t&&{...t,status:e,statusManual:!0}),triggerClassName:`h-7 max-w-full rounded-md px-2 text-center text-xs font-medium focus:ring-2 focus:ring-[#3370ff]/30 ${Me[B.status]}`,renderTrigger:()=>(0,F.jsx)(`span`,{className:`truncate`,children:w[B.status]})})}),(0,F.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:k?(0,F.jsx)(p,{unstyled:!0,searchable:!0,searchPlaceholder:`搜索任务…`,ariaLabel:`所属任务`,menuMinWidth:220,options:ht,value:B.taskId,onChange:e=>V(t=>{if(!t)return t;let n=O.find(t=>t.id===e);return{...t,taskId:e,...n?{priority:n.priority}:{}}}),triggerClassName:`h-8 w-full rounded-md px-1.5 text-sm hover:border-stone-200`,renderTrigger:()=>{let e=O.find(e=>e.id===B.taskId);return(0,F.jsx)(ae,{text:e?.title||`未关联`,className:`min-w-0 truncate ${e?`text-stone-800`:`text-stone-300`}`})}}):(0,F.jsx)(`span`,{className:`block truncate px-1.5 text-xs text-stone-400`,children:`任务管理插件未启用`})}),(0,F.jsx)(`td`,{className:`px-1.5 py-1 align-middle`,children:(()=>{let e=O.find(e=>e.id===B.taskId);return e?(0,F.jsx)(`span`,{title:`跟随所属任务的紧急程度`,className:`inline-flex h-7 max-w-full items-center justify-center truncate rounded-md px-2 text-center text-xs font-medium ${I[e.priority]??`text-stone-300`}`,children:e.priority?D[e.priority]:`未设置`}):(0,F.jsx)(p,{unstyled:!0,hideChevron:!0,centerContent:!0,ariaLabel:`紧急程度`,menuMinWidth:128,options:ze,value:B.priority,onChange:e=>V(t=>t&&{...t,priority:e}),triggerClassName:`h-7 max-w-full rounded-md px-2 text-center text-xs font-medium focus:ring-2 focus:ring-[#3370ff]/30 ${I[B.priority]}`,renderTrigger:()=>(0,F.jsx)(`span`,{className:`truncate`,children:B.priority?D[B.priority]:`未设置`})})})()}),(0,F.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,F.jsx)(f,{value:B.startDate,onChange:e=>V(t=>{if(!t)return t;let n=e,r={...t,startDate:n};if(!t.statusManual&&!x(t.status)){let e=S(n,t.dueDate);e&&(r.status=e)}return r}),placeholder:`选择日期`,className:`h-8 rounded-md border border-transparent px-1.5 text-sm text-stone-800 tabular-nums transition-colors hover:border-stone-200 focus:border-[#3370ff] focus:bg-white`})}),(0,F.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,F.jsx)(f,{value:B.dueDate,onChange:e=>V(t=>{if(!t)return t;let n=e,r={...t,dueDate:n};if(!t.statusManual&&!x(t.status)){let e=S(t.startDate,n);e&&(r.status=e)}return r}),placeholder:`选择日期`,className:`h-8 rounded-md border border-transparent px-1.5 text-sm text-stone-800 tabular-nums transition-colors hover:border-stone-200 focus:border-[#3370ff] focus:bg-white`})}),(0,F.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap tabular-nums`,children:x(B.status)?(0,F.jsx)(`span`,{className:`text-stone-500`,children:ie(T())}):(0,F.jsx)(`span`,{className:`text-stone-400`,children:`待办未完成`})}),(0,F.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap text-stone-400 tabular-nums`,children:`—`}),(0,F.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap text-stone-400 tabular-nums`,children:`—`}),(0,F.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,F.jsx)(`input`,{value:B.note,disabled:at,placeholder:`—`,onChange:e=>V(t=>t&&{...t,note:e.target.value}),className:`h-8 w-full truncate rounded-md border border-transparent bg-transparent px-1.5 text-sm text-stone-800 outline-none transition-colors placeholder:text-stone-300 hover:border-stone-200 focus:border-[#3370ff] focus:bg-white`})}),(0,F.jsx)(`td`,{"aria-hidden":`true`}),(0,F.jsx)(`td`,{className:`px-1 py-1 align-middle`})]}):(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{className:`px-2 py-0.5`}),(0,F.jsx)(`td`,{className:`px-1 py-0.5`}),(0,F.jsx)(`td`,{className:`px-1 py-0.5`,colSpan:12,children:(0,F.jsxs)(`button`,{type:`button`,disabled:at,onClick:()=>bt(e),className:`flex items-center gap-1 rounded px-1 py-0.5 text-xs text-stone-400 transition-colors hover:bg-stone-100 hover:text-stone-600 disabled:opacity-40`,children:[(0,F.jsx)(`span`,{className:`text-sm leading-none`,children:`+`}),`新增记录`]})})]})]},e.key)}),Tt.length===0?(0,F.jsx)(`tbody`,{children:(0,F.jsx)(`tr`,{children:(0,F.jsx)(`td`,{colSpan:14,className:`px-3 py-16 text-center text-sm text-stone-400`,children:u.length===0?`还没有待办`:`没有匹配的待办,试试调整搜索或筛选`})})}):null]})}),(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-stone-100 px-4 py-2.5 text-xs text-stone-500`,children:[(0,F.jsxs)(`span`,{children:[`共 `,Q.length,` 条`,Et.length?` · 已选 ${Et.length}`:``]}),(0,F.jsx)(`span`,{className:`ml-auto text-stone-400`,children:`点击单元格直接编辑,回车或点空白处保存`})]}),(0,F.jsx)(Ye,{open:st!==null,item:st?.item??null,preset:st?.preset,tasks:O,tasksOn:k,onClose:()=>ct(null),onSaved:J}),(0,F.jsx)(d,{open:H!=null,title:H&&H.length>1?`批量删除`:`删除待办`,message:H&&H.length>1?`确认删除已选中的 ${H.length} 条待办?此操作不可恢复。`:`删除「${H?.[0]?.title??``}」?此操作不可恢复。`,confirmLabel:`删除`,cancelLabel:`取消`,danger:!0,onClose:()=>U(null),onConfirm:()=>void St()})]}):(0,F.jsx)(`div`,{className:`tw-lib-notice rounded-xl border border-amber-200 bg-amber-50 px-5 py-8 text-sm text-amber-900`,children:`待办事项需要本地服务,当前未就绪(仅 npm run dev / 本地一体服务可用)。`}):(0,F.jsx)(`div`,{className:`tw-lib-notice rounded-xl border border-amber-200 bg-amber-50 px-5 py-8 text-sm text-amber-900`,children:a(`todos`)}):(0,F.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-stone-200 bg-white`,"aria-busy":`true`,"aria-label":`正在读取插件开关`,children:(0,F.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,F.jsx)(`span`,{className:`tw-lib-spin`,"aria-hidden":`true`})})})}export{R as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=[{id:`functional`,label:`功能测试`,casesFolder:`功能测试`,templateFolder:`功能测试用例`},{id:`api`,label:`接口测试`,casesFolder:`接口测试`,templateFolder:`接口测试用例`},{id:`performance`,label:`性能测试`,casesFolder:`性能测试`,templateFolder:`性能测试用例`},{id:`automation`,label:`自动化测试`,casesFolder:`自动化测试`,templateFolder:`自动化测试用例`}];function t(){return`ct_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,7)}`}function n(e){let t=e.trim()||`未命名类型`;return{casesFolder:t,templateFolder:`${t}用例`}}function r(e){if(!e||typeof e!=`object`)return null;let r=e,i=String(r.label??``).trim();if(!i)return null;let a=String(r.id??``).trim()||t(),o=n(i);return{id:a,label:i,casesFolder:typeof r.casesFolder==`string`&&r.casesFolder.trim()?r.casesFolder.trim():o.casesFolder,templateFolder:typeof r.templateFolder==`string`&&r.templateFolder.trim()?r.templateFolder.trim():o.templateFolder,...typeof r.promptPath==`string`&&r.promptPath.trim()?{promptPath:r.promptPath.trim()}:{}}}function i(t){if(!Array.isArray(t))return e.map(e=>({...e}));let n=[],i=new Set;for(let e of t){let t=r(e);t&&!i.has(t.id)&&(i.add(t.id),n.push(t))}return n.length?n:e.map(e=>({...e}))}function a(){return t()}var o=[`测试规范`,`方法论`,`环境约定`];function s(e){if(!Array.isArray(e))return[...o];let t=[],n=new Set;for(let r of e){let e=String(r??``).trim();!e||e.length>40||n.has(e)||(n.add(e),t.push(e))}return t.length?t:[...o]}var c=[{id:`case`,label:`用例生成提示词`,hint:`用于编写「用例生成」提示词:指导模型按需求与模板输出可入库用例;须约束 JSON 结构、字段对齐模板、步骤换行与覆盖策略,不要限定固定用例条数。`},{id:`general`,label:`通用提示词`,hint:`用于编写通用测试/工作台提示词:角色、输出风格与约束清晰,可直接作为系统或任务提示词使用。`}];function l(){return`pk_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,7)}`}function u(e){return`生成「${e.trim()||`自定义`}」类提示词:角色、输出风格与约束清晰,可直接作为系统或任务提示词使用。`}function d(e){if(!e||typeof e!=`object`)return null;let t=e,n=String(t.label??``).trim();if(!n)return null;let r=String(t.id??``).trim()||l(),i=typeof t.hint==`string`&&t.hint.trim()?t.hint.trim():u(n);return r===`case`&&i.includes(`「测试用例生成」`)&&(i=c[0].hint),{id:r,label:n,hint:i}}function f(e){if(!Array.isArray(e))return c.map(e=>({...e}));let t=[],n=new Set;for(let r of e){let e=d(r);e&&!n.has(e.id)&&(n.add(e.id),t.push(e))}return t.length?t:c.map(e=>({...e}))}function ee(){return l()}var p=[{id:`dashboard`,href:`dashboard/`,i18n:`nav.dashboard`,plugin:`dashboard`,match:`dashboard`},{id:`tasks`,href:`tasks/`,i18n:`nav.tasks`,plugin:`tasks`,match:`tasks`},{id:`todos`,href:`todos/`,i18n:`nav.todos`,plugin:`todos`,match:`todos`},{id:`projects`,href:`pm/projects/`,i18n:`nav.projects`,plugin:`projects`,match:`pm/projects`},{id:`iterations`,href:`pm/iterations/`,i18n:`nav.iterations`,plugin:`iterations`,match:`pm/iterations`},{id:`pmRequirements`,href:`pm/requirements/`,i18n:`nav.requirementsMgmt`,plugin:`pmRequirements`,match:`pm/requirements`},{id:`bugs`,href:`pm/bugs/`,i18n:`nav.bugs`,plugin:`bugs`,match:`pm/bugs`},{id:`reports`,href:`reports/`,i18n:`nav.reports`,plugin:`reports`,match:`reports`},{id:`testStats`,href:`test-stats/`,i18n:`nav.testStats`,plugin:`testStats`,match:`test-stats`},{id:`caseExec`,href:`case-exec/`,i18n:`nav.caseExec`,plugin:`caseExec`,match:`case-exec`},{id:`uiAuto`,href:`test-automation/`,i18n:`nav.uiAuto`,plugin:`uiAuto`,match:`test-automation`},{id:`reqAnalysis`,href:`requirement-analysis/`,i18n:`nav.reqAnalysis`,plugin:`reqAnalysis`,match:`requirement-analysis`},{id:`cases`,href:`cases/library/`,i18n:`nav.caseManage`,plugin:`cases`,match:`cases`},{id:`prompts`,href:`prompts/`,i18n:`nav.prompts`,plugin:`prompts`,match:`prompts`},{id:`knowledgeLib`,href:`knowledge/`,i18n:`nav.knowledge`,plugin:`knowledgeLib`,match:`knowledge`},{id:`requirements`,href:`requirements/`,i18n:`nav.requirements`,plugin:`requirements`,match:`requirements`},{id:`templates`,href:`templates/`,i18n:`nav.templates`,plugin:`templates`,match:`templates`}],m=[],te=[`prompts`];function ne(e){return te.includes(e)}var h=`check.pencil.book.fileText.layers.list.folder.star.database.target.code.flask.home.clipboard.bug.calendar.chart.globe.link.users.terminal.tag.flag.zap.dashboard.search.settings.bell.clock.mail.message.image.video.download.upload.plus.trash.lock.shield.key.cloud.box.filter.grid.pin.sparkle.rocket.eye.bookmark.archive.refresh.play.map.activity.cpu.briefcase.presentation.copy.save`.split(`.`),g={dashboard:`dashboard`,tasks:`clipboard`,todos:`list`,projects:`folder`,iterations:`calendar`,pmRequirements:`fileText`,bugs:`bug`,reports:`fileText`,testStats:`chart`,caseExec:`target`,uiAuto:`terminal`,reqAnalysis:`fileText`,cases:`check`,prompts:`pencil`,knowledgeLib:`book`,requirements:`fileText`,templates:`layers`};function re(e){return typeof e==`string`&&h.includes(e)}function _(e){let t={...g};if(!e||typeof e!=`object`||Array.isArray(e))return t;for(let n of p){let r=e[n.id];re(r)&&(t[n.id]=r)}return t}var v=new Set(p.map(e=>e.id));function y(e){return typeof e==`string`&&v.has(e)}function ie(e){return p.find(t=>t.id===e)}function ae(e,t=`/`){let n=t.replace(/\/$/,``),r=(n&&e.startsWith(n)?e.slice(n.length):e).replace(/^\/+/,``);return r?p.filter(e=>r===e.match||r.startsWith(`${e.match}/`)).sort((e,t)=>t.match.length-e.match.length)[0]??null:null}function b(e){return`item:${e}`}function x(e){return`group:${e}`}function S(){return`ng_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,7)}`}function C(){return m.map(e=>({id:e.id,name:e.name,items:[...e.items]}))}function w(e,t=!0){if(e==null||!Array.isArray(e))return t?C():[];let n=new Set,r=[],i=new Set;for(let t of e){if(!t||typeof t!=`object`)continue;let e=t,a=String(e.name??``).trim();if(!a)continue;let o=String(e.id??``).trim()||S();i.has(o)&&(o=S());let s=[];if(Array.isArray(e.items))for(let t of e.items)y(t)&&!n.has(t)&&(n.add(t),s.push(t));let c=String(e.parentId??``).trim()||void 0;i.add(o),r.push({id:o,name:a,items:s,parentId:c})}let a=new Set(r.map(e=>e.id)),o=r.map(e=>{let t=e.parentId;return(!t||t===e.id||!a.has(t))&&(t=void 0),t?{...e,parentId:t}:{id:e.id,name:e.name,items:e.items}}),s=new Map(o.map(e=>[e.id,e])),c=o.map(e=>{if(!e.parentId)return e;let t=s.get(e.parentId);if(t?.parentId){let n=t.parentId;return n&&n!==e.id&&a.has(n)?{...e,parentId:n}:{id:e.id,name:e.name,items:e.items}}return e}),l=new Set(c.map(e=>e.parentId).filter(e=>!!e));return c.filter(e=>e.items.length>0||l.has(e.id))}function T(e,t){let n=t.name.trim(),r=t.items.filter((e,t,n)=>y(e)&&n.indexOf(e)===t);if(!n||!r.length)return{groups:e,id:t.id?.trim()||``};let i=t.id?.trim()||S(),a=e.find(e=>e.id===i),o=t.parentId===void 0?a?.parentId:t.parentId.trim()||void 0;if(o===i&&(o=void 0),o){let t=e.find(e=>e.id===o);t?t.parentId&&(o=t.parentId):o=void 0}let s=new Set(r),c=e.filter(e=>e.id!==i).map(e=>({...e,items:e.items.filter(e=>!s.has(e))}));return c.push(o?{id:i,name:n,items:r,parentId:o}:{id:i,name:n,items:r}),{groups:w(c),id:i}}function oe(e,t){return e.filter(e=>e.parentId===t).map(e=>e.id)}function E(e,t){return e.filter(e=>e.parentId===t)}function se(e,t){let n=e.find(e=>e.id===t);if(!n)return e;let r=e.filter(e=>e.id!==t);return n.parentId?r.map(e=>e.id===n.parentId?{...e,items:[...e.items,...n.items]}:e.parentId===t?{...e,parentId:n.parentId}:e):r.map(e=>e.parentId===t?{id:e.id,name:e.name,items:e.items}:e)}function ce(e,t,n){let r=e.find(e=>e.id===t);return!r||!y(n)||r.items.includes(n)?e:T(e,{id:r.id,name:r.name,items:[...r.items,n]}).groups}function le(e,t){let n=e.find(e=>e.items.includes(t))??null;return n?{groups:e.map(e=>e.id===n.id?{...e,items:e.items.filter(e=>e!==t)}:e).filter(e=>e.items.length>0),owner:n}:{groups:e,owner:null}}function ue(e,t,n,r){let i=b(t),a=x(n.id),o=r.some(e=>e.id===n.id),s=e.indexOf(a),c=e.filter(e=>e!==i&&(o||e!==a)),l=s<0?c.length:o?s+1:s;return c.splice(l,0,i),O(c,r)}function de(e){let t=new Map(e.map(e=>[e.id,e])),n=new Map;for(let r of e){let e=r.parentId?t.get(r.parentId)??r:r;for(let t of r.items)n.set(t,e)}let r=new Set,i=[];for(let e of p){let t=n.get(e.id);if(t){if(r.has(t.id))continue;r.add(t.id),i.push({type:`group`,group:t})}else i.push({type:`item`,id:e.id})}return i}function D(e){let t=new Map;for(let n of e){if(!n.parentId)continue;let e=t.get(n.parentId);e?e.push(n):t.set(n.parentId,[n])}let n=[],r=new Set,i=e=>{if(!r.has(e.id)){r.add(e.id),n.push(x(e.id));for(let n of t.get(e.id)??[])i(n)}};for(let t of de(e))t.type===`item`?n.push(b(t.id)):i(t.group);for(let t of e)i(t);return n}function fe(e){let t=new Set,n=new Set;for(let r of e){n.add(x(r.id));for(let e of r.items)t.add(e)}for(let e of p)t.has(e.id)||n.add(b(e.id));return n}function O(e,t){let n=fe(t),r=[],i=new Set;if(Array.isArray(e))for(let t of e)typeof t==`string`&&n.has(t)&&!i.has(t)&&(i.add(t),r.push(t));for(let e of D(t))i.has(e)||r.push(e);return r}function pe(e,t){let n=new Map(e.map(e=>[e.id,e])),r=new Set(e.flatMap(e=>e.items)),i=O(t,e),a=[];for(let e of i)if(e.startsWith(`group:`)){let t=n.get(e.slice(6));t&&!t.parentId&&a.push({type:`group`,group:t})}else if(e.startsWith(`item:`)){let t=e.slice(5);y(t)&&!r.has(t)&&a.push({type:`item`,id:t})}return a}function me(e,t,n){let r=t.find(e=>e.id===n);if(!r)return O(e,t);let i=new Set(r.items.map(e=>b(e))),a=x(n);if(r.parentId){let n=e.filter(e=>e!==a),i=x(r.parentId),o=n.indexOf(i),s=[...n];return o<0?s.push(a):s.splice(o+1,0,a),O(s,t)}let o=[...e],s=o.length;for(let e=0;e<o.length;e++){let t=o[e];if(t===a||i.has(t)){s=o.slice(0,e).filter(e=>e!==a&&!i.has(e)).length;break}}let c=o.filter(e=>e!==a&&!i.has(e));return c.splice(s,0,a),O(c,t)}function he(e,t,n){let r=E(e,t);if(!n?.length||r.length<2)return r;let i=new Map;return n.forEach((e,t)=>{i.has(e)||i.set(e,t)}),r.map((e,t)=>({group:e,i:t,at:i.get(x(e.id))})).sort((e,t)=>{let n=e.at??1/0,r=t.at??1/0;return n===r?e.i-t.i:n-r}).map(e=>e.group)}function ge(e,t,n,r){let i=new Map(t.map(e=>[e.id,e])),a=r.filter(e=>i.get(e)?.parentId===n),o=new Set(a.map(x)),s=e.filter(e=>!o.has(e)),c=x(n),l=s.indexOf(c),u=a.map(x),d=[...s];return l<0?d.push(...u):d.splice(l+1,0,...u),O(d,t)}function _e(e,t){if(!e.startsWith(`group:`))return!1;let n=e.slice(6);return t.some(e=>e.id===n&&!!e.parentId)}function ve(e,t,n,r=[]){if(t.parentId)return O(e,n);let i=x(t.id),a=[...r.map(e=>x(e)),...t.items.map(e=>b(e))],o=e.filter(e=>e!==i);return o.push(...a),O(o,n)}function ye(e,t,n){let r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0||r===i)return[...e];let a=[...e],[o]=a.splice(r,1);return o===void 0?[...e]:(a.splice(i,0,o),a)}var k=`tw.space.active-id`,be=`tw.spaces.list.v1`;function A(e,t){try{return(e===`local`?localStorage:sessionStorage).getItem(t)?.trim()||``}catch{return``}}function j(e,t,n){try{(e===`local`?localStorage:sessionStorage).setItem(t,n)}catch{}}function M(e){let t=String(e||``).trim();t&&(j(`session`,k,t),j(`local`,k,t))}function N(){let e=A(`session`,k);if(e)return e;let t=A(`local`,k);if(t)return t;try{let e=sessionStorage.getItem(be);if(!e)return``;let t=JSON.parse(e);return String(t?.activeId||``).trim()}catch{return``}}function P(e){let t=N();return t?`${e}::${t}`:e}var F=`/__tb_config`,I=`tw.app.config.v1`,L=`tw.app.apikey.v1`,R=`tw.app.model.v1`,z=!1,B=null,V=``,H=``,U=!1,xe={language:`zh-CN`,appearance:`system`,sessionFontSize:14,toolStepDetail:`standard`,busySendBehavior:`queue`,subagentModel:``,allowPrivateWebFetch:!1};function W(){return`p_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,7)}`}function Se(e){if(!e||typeof e!=`object`)return null;let t=String(e.name??``).trim()||`未命名提供商`,n=String(e.baseURL??``).trim(),r=String(e.model??``).trim(),i=String(e.id??``).trim()||W(),a=typeof e.contextWindow==`number`&&Number.isFinite(e.contextWindow)&&e.contextWindow>0?Math.floor(e.contextWindow):void 0;return{id:i,name:t,baseURL:n,model:r,apiKey:typeof e.apiKey==`string`&&e.apiKey.trim()?e.apiKey.trim():void 0,availableModels:Array.isArray(e.availableModels)?e.availableModels.filter(e=>typeof e==`string`):void 0,contextWindow:a,supportsTools:e.supportsTools!==!1,supportsVision:e.supportsVision===!0}}function Ce(e){let t=typeof e.baseURL==`string`?e.baseURL.trim():``,n=typeof e.model==`string`?e.model.trim():``;return!t&&!n&&!e.apiKey?[]:[{id:W(),name:`默认`,baseURL:t||`https://api.deepseek.com/v1`,model:n,apiKey:typeof e.apiKey==`string`&&e.apiKey.trim()?e.apiKey.trim():void 0,availableModels:Array.isArray(e.availableModels)?e.availableModels.filter(e=>typeof e==`string`):void 0}]}function G(e){let t=e?.reasoningEffort===`low`||e?.reasoningEffort===`high`||e?.reasoningEffort===`max`?e.reasoningEffort:`high`,n=[];Array.isArray(e?.providers)&&e.providers.length?n=e.providers.map(e=>Se(e)).filter(e=>!!e):e&&(e.baseURL||e.model||e.apiKey)&&(n=Ce(e));let r=typeof e?.activeId==`string`?e.activeId:``;return n.length&&!n.some(e=>e.id===r)&&(r=n[0].id),n.length||(r=``),{activeId:r,reasoningEffort:t,providers:n}}function K(){return{version:1,model:{activeId:``,reasoningEffort:`high`,providers:[]},access:`readonly`,general:{...xe},plugins:{cases:!1,caseGen:!1,prompts:!0,promptGen:!1,knowledgeLib:!1,knowledgeGen:!1,requirements:!1,templates:!1,knowledge:!1,memory:!1,pluginDev:!1,todos:!1,tasks:!1,projects:!1,iterations:!1,pmRequirements:!1,bugs:!1,reports:!1,testStats:!1,caseExec:!1,dashboard:!1},caseTypes:e.map(e=>({...e})),promptKinds:c.map(e=>({...e})),knowledgeCategories:[...o],navGroups:m.map(e=>({...e,items:[...e.items]})),navIcons:{...g},navOrder:D(m)}}function q(e){let t=K();if(!e||typeof e!=`object`)return t;let n=e.general&&typeof e.general==`object`?e.general:{},r={...t.plugins,...e.plugins??{}},a=w(e.navGroups);return{version:typeof e.version==`number`?e.version:1,model:G(e.model),access:e.access===`readwrite`||e.access===`full`||e.access===`readonly`?e.access:`readonly`,general:{language:n.language===`en`?`en`:`zh-CN`,appearance:n.appearance===`light`||n.appearance===`dark`||n.appearance===`system`?n.appearance:`system`,sessionFontSize:typeof n.sessionFontSize==`number`&&n.sessionFontSize>=12&&n.sessionFontSize<=22?Math.round(n.sessionFontSize):14,toolStepDetail:n.toolStepDetail===`concise`||n.toolStepDetail===`standard`||n.toolStepDetail===`detailed`||n.toolStepDetail===`full`?n.toolStepDetail:`standard`,busySendBehavior:n.busySendBehavior===`interrupt`?`interrupt`:`queue`,subagentModel:typeof n.subagentModel==`string`?n.subagentModel.trim():``,allowPrivateWebFetch:n.allowPrivateWebFetch===!0},plugins:r,caseTypes:i(e.caseTypes),promptKinds:f(e.promptKinds),knowledgeCategories:s(e.knowledgeCategories),navGroups:a,navIcons:_(e.navIcons),navOrder:O(e.navOrder,a)}}function we(){try{let e=localStorage.getItem(R);if(e)return G(JSON.parse(e))}catch{}try{let e=localStorage.getItem(P(I));if(e){let t=JSON.parse(e);if(t?.model)return G(t.model)}}catch{}return null}function Te(e){try{localStorage.setItem(R,JSON.stringify(e))}catch{}}function J(){try{let e=localStorage.getItem(P(I)),t=we();if(!e)return t?q({...K(),model:t}):null;let n=q(JSON.parse(e));return t&&(n.model=t),n}catch{return null}}function Y(e){try{let{model:t,...n}=e;localStorage.setItem(P(I),JSON.stringify(n)),Te(t)}catch{}}function Ee(){try{return localStorage.getItem(L)?.trim()||localStorage.getItem(P(L))?.trim()||``}catch{return``}}function De(e){try{e?localStorage.setItem(L,e):localStorage.removeItem(L),localStorage.removeItem(P(L))}catch{}}function Oe(){try{let e=K(),t=!1,n=localStorage.getItem(`tw-llm-settings`);if(n){let r=JSON.parse(n);e.model=G({providers:[{id:W(),name:r.name||`默认`,baseURL:r.baseURL||``,model:r.model||``,apiKey:r.apiKey,availableModels:r.availableModels}],reasoningEffort:r.reasoningEffort}),e.model.providers[0]&&(e.model.activeId=e.model.providers[0].id),t=!0}let r=localStorage.getItem(`tw-access-level`);(r===`readonly`||r===`readwrite`||r===`full`)&&(e.access=r,t=!0);let i=localStorage.getItem(`tw.general.prefs.v1`);i&&(e.general=q({general:JSON.parse(i)}).general,t=!0);let a=localStorage.getItem(`tw.plugins.enabled.v1`);if(a){let n=JSON.parse(a);e.plugins={...e.plugins,...n},t=!0}return t?e:null}catch{return null}}function X(e){let t=e.model.providers;return t.length?t.find(t=>t.id===e.model.activeId)??t[0]??null:null}function ke(){return z}function Z(){return B||Ae(),B??K()}function Ae(){if(!U&&(U=!0,typeof window<`u`))try{let e=J();e&&(B=e)}catch{}}function je(){return V}function Me(){return[...B?.model.providers??[]]}async function Ne(){try{let e=await fetch(F,{signal:AbortSignal.timeout(2e3)});if(e.ok){let t=await e.json();B=q(t.config),H=String(t.configTarget??``).trim();let n=X(B),r=String(t.apiKey??``).trim();return V=r||n?.apiKey?.trim()||``,r&&n&&!n.apiKey&&(V=r),z=!0,Y(B),B}}catch{}z=!1,H=``;let e=J();return e||=Oe()??K(),B=e,V=X(e)?.apiKey?.trim()||Ee(),Y(B),B}var Q=null;async function $(e){if(Y(e),z)try{await fetch(F,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({config:e,configTarget:H}),keepalive:!0})}catch{}}function Pe(e){let t=B??K(),n=q({...t,...e,model:e.model?{...t.model,...e.model,providers:e.model.providers??t.model.providers}:t.model,general:{...t.general,...e.general??{}},plugins:{...t.plugins,...e.plugins??{}},caseTypes:e.caseTypes??t.caseTypes,promptKinds:e.promptKinds??t.promptKinds,knowledgeCategories:e.knowledgeCategories??t.knowledgeCategories,navGroups:e.navGroups??t.navGroups,navIcons:e.navIcons??t.navIcons,navOrder:e.navOrder??t.navOrder});return B=n,V=X(n)?.apiKey?.trim()||``,Q&&clearTimeout(Q),Q=setTimeout(()=>{Q=null,$(n)},280),n}function Fe(){return Q&&=(clearTimeout(Q),null),$(B??K())}function Ie(e){if(V=e.trim(),z||De(V),!B)return;let t=B.model.providers.map(e=>e.id===B.model.activeId?{...e,apiKey:V||void 0}:e);B=q({...B,model:{...B.model,providers:t}})}function Le(){let e=B;if(!e)return null;let t=X(e);if(!t?.baseURL?.trim()||!t.model?.trim())return null;let n=(t.apiKey||V).trim();return n?{baseURL:t.baseURL.trim(),apiKey:n,model:t.model.trim(),reasoningEffort:e.model.reasoningEffort,availableModels:t.availableModels}:null}function Re(){return W()}export{ge as A,u as B,ne as C,w as D,ae as E,le as F,e as G,f as H,se as I,i as J,n as K,ye as L,ve as M,me as N,_ as O,he as P,T as R,_e as S,E as T,o as U,ee as V,s as W,ce as _,ke as a,ie as b,Ie as c,N as d,M as f,h as g,p as h,Ne as i,ue as j,O as k,Le as l,g as m,je as n,Me as o,P as p,a as q,Z as r,Re as s,Fe as t,Pe as u,pe as v,b as w,x,oe as y,c as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`0.1.34`;export{e as t};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./react.Blvh0GOs.js";import{c as t}from"./settings.Cu00if4D.js";var n=e({applyDomI18n:()=>o,t:()=>a}),r={"nav.home":`我的工作台`,"nav.dashboard":`仪表盘`,"nav.tasks":`任务管理`,"nav.todos":`待办事项`,"nav.projects":`项目列表`,"nav.iterations":`迭代管理`,"nav.requirementsMgmt":`需求管理`,"nav.bugs":`缺陷管理`,"nav.reports":`工作汇报`,"nav.testStats":`测试统计`,"nav.caseExec":`用例执行统计`,"nav.uiAuto":`自动化测试`,"nav.reqAnalysis":`需求分析`,"nav.requirements":`需求文档库`,"nav.caseManage":`用例管理`,"nav.cases":`用例`,"nav.templates":`测试模板库`,"nav.docs":`文档库`,"nav.createGroup":`创建分组`,"nav.createSubgroup":`创建子分组`,"nav.assignGroup":`加入分组`,"nav.more":`更多操作`,"nav.groupActions":`分组操作`,"nav.addSubgroup":`添加子分组`,"nav.addToGroup":`添加到分组`,"nav.chooseIcon":`选择图标`,"nav.leaveGroup":`移出分组`,"nav.currentGroup":`当前`,"nav.noGroups":`还没有分组`,"nav.noOtherGroups":`没有其它分组`,"nav.noAddableItems":`没有可添加的菜单项`,"nav.editGroup":`编辑`,"nav.editGroupTitle":`编辑分组`,"nav.sortMenu":`排序`,"nav.sortMenuTitle":`菜单排序`,"nav.sortHint":`按住拖动调整顺序`,"nav.subgroups":`子分组`,"nav.sortUp":`上移`,"nav.sortDown":`下移`,"nav.done":`完成`,"nav.deleteGroup":`取消分组`,"nav.deleteGroupMsg":`取消分组后,其中的菜单项会在菜单栏平铺显示。`,"nav.deleteSubgroupMsg":`取消子分组后,其中的菜单项会回到上级分组。`,"nav.groupName":`分组名称`,"nav.groupItems":`选择菜单项`,"nav.groupItemsHint":`已加入其他分组的菜单不会列出。`,"nav.groupNameRequired":`请填写分组名称`,"nav.groupItemsRequired":`请至少选择一项`,"nav.groupSave":`保存`,"nav.groupCancel":`取消`,"nav.prompts":`提示词管理`,"nav.knowledge":`知识库管理`,"nav.plugins":`我的插件`,"nav.brand":`Lantern Harness`,"nav.settings":`设置`,"nav.changelog":`变更日志`,"nav.changelogShort":`版本日志`,"nav.helpCenter":`帮助中心`,"docs.nav.title":`文档`,"docs.nav.changelog":`版本日志`,"docs.nav.manual":`操作手册`,"docs.nav.install":`安装手册`,"nav.repo":`GitHub 仓库`,"nav.repoShort":`仓库`,"nav.npm":`npm 包`,"nav.npmShort":`npm`,"nav.site":`炊烟小站`,"nav.siteShort":`小站`,"nav.board":`问题与建议`,"nav.boardShort":`问题与建议`,"space.label":`数据空间`,"space.current":`当前空间`,"space.switchTo":`切换到该空间`,"space.manage":`管理空间`,"space.others":`其他空间`,"space.manageTitle":`空间管理`,"space.manageDesc":`每个数据空间是一份相互隔离的数据目录:需求 / 用例 / 提示词 / 知识库 / 模板、会话与配置互不影响。列表会展示本机已登记的全部空间(含其它数据目录下的),可直接切换。`,"space.listTitle":`全部空间`,"space.newTitle":`新建空间`,"space.newDesc":`新建一份独立的数据目录;默认提示词会随空间一起创建,之后可在「提示词管理」继续修改。`,"space.addNew":`+ 新增空间`,"space.edit":`编辑`,"space.editTitle":`编辑空间`,"space.save":`保存`,"space.cancel":`取消`,"space.loading":`加载中…`,"space.detailFailed":`读取空间信息失败`,"space.updateFailed":`保存失败`,"space.updated":`已保存「{name}」`,"space.publicNameLocked":`公共空间名称不可修改`,"space.switch":`切换`,"space.nameLabel":`空间名称`,"space.namePlaceholder":`输入空间名称`,"space.create":`新建`,"space.promptBriefLabel":`提示词要求`,"space.promptBriefPlaceholder":`描述这个空间里的助手应怎样工作,Enter 或点发送生成提示词;Shift+Enter 换行`,"space.promptGenerate":`生成提示词`,"space.promptGenerating":`生成中…`,"space.promptGeneratingStatus":`正在生成提示词`,"space.promptStop":`停止生成`,"space.promptBodyLabel":`默认提示词`,"space.promptBodyPlaceholder":`将写入该空间的 默认提示词.md`,"space.promptHint":`创建后写入该空间的提示词管理,作为默认提示词。`,"space.promptBriefHint":`这段要求会随空间保存,便于之后重新生成提示词。`,"space.promptEditHint":`保存后覆盖该空间的 默认提示词.md,工作台会立即使用新提示词。`,"space.promptNeedReq":`请先填写提示词要求,再生成。`,"space.promptNeedBody":`请先填写默认提示词。`,"space.promptNeedModel":`请先在设置里配置可用的模型后再生成。`,"space.promptGenEmpty":`模型没有给出可用提示词,请重试或直接手写。`,"space.needName":`请先填写空间名称。`,"space.created":`已创建「{name}」`,"space.createdWithPrompt":`已创建「{name}」,默认提示词已写入该空间的提示词管理`,"space.name":`名称`,"space.location":`位置`,"space.size":`体积`,"space.sizeTitle":`统计各空间占用的磁盘大小`,"space.sizing":`统计中…`,"space.status":`状态`,"space.builtin":`默认`,"space.publicName":`公共空间`,"space.activeTag":`当前`,"space.missing":`目录不存在`,"space.rename":`重命名`,"space.copy":`复制`,"space.export":`导出`,"space.exportContent":`导出内容库`,"space.exportContentTitle":`不含密钥、会话、记忆与缓存,适合分享内容`,"space.exportFull":`导出备份`,"space.exportFullTitle":`含密钥、会话与全部本机状态,适合自己备份`,"space.discover":`扫描文件夹`,"space.discoverTitle":`扫描托管目录,纳入带 .lantern/space.json 清单的空间文件夹;其它文件夹列出来等你确认`,"space.discovering":`扫描中…`,"space.discoverAdded":`已纳入 {n} 个空间`,"space.discoverNone":`没有发现可纳入的空间文件夹`,"space.discoverBackfilled":`并为 {n} 个已有空间补写了 space.json 清单`,"space.discoverSkipped":`跳过 {n} 个(重名、名称非法或缺空间元数据)`,"space.candidatesTitle":`扫描到 {n} 个不是数据空间的文件夹,要纳入吗?`,"space.candidatesHint":`勾选后纳入列表;不会写入空间清单(.lantern/space.json),文件夹内容保持原样。`,"space.candidatesSelectAll":`全选`,"space.candidatesClear":`全不选`,"space.candidatesIgnore":`忽略`,"space.candidatesIgnored":`已忽略,未纳入任何文件夹`,"space.candidatesAdopt":`纳入所选`,"space.candidatesAdopted":`已纳入 {n} 个文件夹`,"space.candidatesRejected":`未纳入:{names}`,"space.removeList":`移出列表`,"space.deleteDisk":`删除数据`,"space.import":`导入`,"space.refresh":`刷新`,"space.empty":`还没有自定义空间,点「+ 新增空间」开始。`,"space.newParentHint":`新建的空间会落在:`,"space.switching":`正在切换…`,"space.reloadHint":`切换后页面会自动重载。`,"space.confirmRemoveTitle":`移出列表`,"space.confirmRemoveMsg":`将从列表中移除「{name}」,磁盘数据保留在:
|
|
2
|
-
{path}
|
|
3
|
-
之后可在管理界面重新纳入。`,"space.confirmDeleteTitle":`删除数据`,"space.confirmDeleteMsg":`将永久删除「{name}」及其全部数据,无法恢复:
|
|
4
|
-
{path}`,"space.confirmCopyTitle":`复制空间`,"space.confirmCopyMsg":`将复制「{name}」的全部内容到新空间,文件较多时可能耗时较久。`,"space.done":`完成`,"space.copyName":`副本名称`,"space.importPick":`选择要导入的 zip 备份`,"space.othersEmpty":`还没有其他空间。可点下方「管理空间」新建或导入。`,"space.busyRuns":`仍有会话在运行,请先停止后再切换空间。`,"space.publicLocked":`公共空间不支持重命名或删除。`,"space.offline":`工作区不可用`,"space.offlineCap":`未连接本地服务`,"settings.general":`通用设置`,"settings.model":`模型`,"settings.builtin":`内置插件`,"settings.builtinDesc":`由平台按会话或全局提供,默认常开,不需要开关。`,"settings.close":`关闭`,"settings.access":`权限`,"settings.accessDesc":`选择新会话的默认权限模式`,"settings.language":`语言`,"settings.appearance":`外观`,"settings.appear.light":`浅色`,"settings.appear.dark":`深色`,"settings.appear.system":`跟随系统`,"settings.fontSize":`字号大小`,"settings.fontSizeDesc":`调整正文与会话内容的字号(不影响侧栏布局)`,"settings.toolSteps":`工作步骤展示`,"settings.toolStepsDesc":`选择希望看到多少工具调用细节`,"settings.busySend":`繁忙时的发送行为`,"settings.busySendDesc":`智能体运行时 Enter 键和发送按钮的行为;Cmd/Ctrl+Enter 使用另一行为`,"settings.busySend.queue":`排队发送`,"settings.busySend.interrupt":`插话发送`,"settings.allowPrivateWebFetch":`允许抓取私网地址`,"settings.allowPrivateWebFetchDesc":`关闭时 web_fetch / 搜索结果会拦截 localhost 与私网 IP(含跳转后解析到私网)`,"settings.allowPrivateWebFetch.off":`禁止(推荐)`,"settings.allowPrivateWebFetch.on":`允许`,"settings.contextWindow":`上下文窗口(tokens)`,"settings.contextWindowPlaceholder":`留空则用内置表`,"settings.contextWindowDesc":`用于压缩阈值与上下文占用提示;留空时按模型名查内置表`,"settings.supportsTools":`支持工具调用`,"settings.supportsVision":`支持视觉(图片)`,"settings.cap.on":`是`,"settings.cap.off":`否`,"settings.subagentModel":`子代理模型`,"settings.subagentModelDesc":`子代理默认跟随主会话模型;可改为当前提供商下的其它模型`,"settings.subagentModel.inherit":`跟随主会话`,"settings.platformVersion":`平台版本`,"settings.updateCheck":`检查更新`,"settings.updateChecking":`检查中`,"settings.updateLatest":`已是最新版本`,"settings.updateAvailable":`有新版本可用`,"settings.updateNow":`更新并重启`,"settings.updateInstalling":`正在安装 v{v},完成后服务会自动重启…`,"settings.updateWorking":`更新中…`,"settings.updateRestarting":`正在重启服务…`,"settings.updateDone":`已更新到 v{v}`,"settings.updateReload":`刷新页面`,"settings.updateFailed":`更新失败`,"settings.updateRetry":`重试`,"settings.updateDevMode":`源码模式不支持页面内更新,请 git pull 后重新构建`,"settings.updateNpxHint":`将通过全局安装后重启(不再使用 npx 缓存)`,"settings.updateUnavailable":`无法检查更新`,"settings.updateCheckedAt":`上次检查 {time}`,"settings.updateLog":`日志:{path}`,"settings.updateTimeout":`等待服务重启超时,请刷新页面确认版本`,"settings.updateConfirm":`更新会停止当前服务、全局安装新版本后自动重启,页面会短暂断开。`,"settings.access.readonly":`仅可查看`,"settings.access.readwrite":`工作区内修改`,"settings.access.full":`完全权限`,"settings.step.concise":`简洁`,"settings.step.standard":`标准`,"settings.step.detailed":`详细`,"settings.step.full":`完全展开`,"settings.modelIntro":`填入各提供商的 API 密钥即可使用其模型。`,"settings.edit":`编辑`,"settings.delete":`删除`,"settings.addProvider":`+ 添加模型提供商`,"settings.back":`返回`,"settings.editProvider":`编辑提供商`,"settings.addProviderTitle":`添加提供商`,"settings.cancel":`取消`,"settings.save":`保存`,"settings.displayName":`显示名称`,"settings.preset":`服务商预设`,"settings.baseUrl":`Base URL`,"settings.apiKey":`API Key`,"settings.modelField":`模型`,"settings.keyHint":`模型保存在本机 ~/.config/lantern-harness/models.json,所有空间共用,不会上传 GitHub。`,"settings.modelPlaceholder":`请输入模型名`,"settings.recognizing":`识别中…`,"settings.recognized":`已识别 {n} 个`,"settings.recognizeFail":`识别失败,可手动填模型名`,"settings.recognizeKeep":`刷新失败,沿用已有列表`,"settings.deleteConfirm":`确定删除该模型提供商?`,"chat.emptyTitle":`提灯的人不问路`,"chat.emptyNoModel":`使用前请先配置模型。`,"chat.configureModel":`配置模型`,"chat.workbench":`我的工作台`,"chat.newSession":`新会话`,"chat.workspace":`工作区`,"tool.running":`工具执行中…`,"tool.callingKind":`正在调用{kind}`,"tool.doneKind":`{kind}完成`,"tool.callingNamed":`正在调用{kind}:{name}`,"tool.doneNamed":`{kind}完成:{name}`,"tool.callingFull":`正在调用{kind}({name})…`,"tool.doneFull":`{kind}已完成({name})`,"tool.kind.kb":`知识库`,"tool.kind.fs":`本地文件`,"tool.kind.memory":`会话记忆`,"tool.kind.webSearch":`网页搜索`,"tool.kind.webFetch":`网页获取`},i={"zh-CN":r,en:{"nav.home":`My Workbench`,"nav.dashboard":`Dashboard`,"nav.tasks":`Tasks`,"nav.todos":`Todos`,"nav.projects":`Projects`,"nav.iterations":`Iterations`,"nav.requirementsMgmt":`Requirements Mgmt`,"nav.bugs":`Bugs`,"nav.reports":`Work Report`,"nav.testStats":`Test Statistics`,"nav.caseExec":`Case Execution`,"nav.uiAuto":`Automation Testing`,"nav.reqAnalysis":`Requirement Analysis`,"nav.requirements":`Requirements`,"nav.caseManage":`Test Cases`,"nav.cases":`Cases`,"nav.templates":`Test Templates`,"nav.docs":`Documents`,"nav.createGroup":`New group`,"nav.createSubgroup":`New subgroup`,"nav.assignGroup":`Join group`,"nav.more":`More actions`,"nav.groupActions":`Group actions`,"nav.addSubgroup":`Add subgroup`,"nav.addToGroup":`Add to group`,"nav.chooseIcon":`Choose icon`,"nav.leaveGroup":`Remove from group`,"nav.currentGroup":`Current`,"nav.noGroups":`No groups yet`,"nav.noOtherGroups":`No other groups`,"nav.noAddableItems":`Nothing to add`,"nav.editGroup":`Edit`,"nav.editGroupTitle":`Edit group`,"nav.sortMenu":`Sort`,"nav.sortMenuTitle":`Sort menu`,"nav.sortHint":`Drag to reorder`,"nav.subgroups":`Subgroups`,"nav.sortUp":`Move up`,"nav.sortDown":`Move down`,"nav.done":`Done`,"nav.deleteGroup":`Ungroup`,"nav.deleteGroupMsg":`Ungrouped items will be shown flat in the menu.`,"nav.deleteSubgroupMsg":`Ungrouping this subgroup returns its items to the parent group.`,"nav.groupName":`Group name`,"nav.groupItems":`Choose menu items`,"nav.groupItemsHint":`Items already in another group are hidden.`,"nav.groupNameRequired":`Enter a group name`,"nav.groupItemsRequired":`Select at least one item`,"nav.groupSave":`Save`,"nav.groupCancel":`Cancel`,"nav.prompts":`Prompts`,"nav.knowledge":`Knowledge Mgmt`,"nav.plugins":`My Plugins`,"nav.brand":`Lantern Harness`,"nav.settings":`Settings`,"nav.changelog":`Changelog`,"nav.changelogShort":`Changelog`,"nav.helpCenter":`Help Center`,"docs.nav.title":`Docs`,"docs.nav.changelog":`Changelog`,"docs.nav.manual":`User Guide`,"docs.nav.install":`Install Guide`,"nav.repo":`GitHub`,"nav.repoShort":`Repo`,"nav.npm":`npm package`,"nav.npmShort":`npm`,"nav.site":`Yycy Docs`,"nav.siteShort":`Site`,"nav.board":`Questions & suggestions`,"nav.boardShort":`Suggestions`,"space.label":`Data space`,"space.current":`Current space`,"space.switchTo":`Switch to this space`,"space.manage":`Manage spaces`,"space.others":`Other spaces`,"space.manageTitle":`Spaces`,"space.manageDesc":`Each data space is a fully isolated data directory: requirements, cases, prompts, knowledge, templates, sessions and config never leak across spaces.`,"space.listTitle":`All spaces`,"space.newTitle":`New space`,"space.newDesc":`Create an isolated data directory. The default prompt is created with the space and can be edited later in Prompt management.`,"space.addNew":`+ New space`,"space.edit":`Edit`,"space.editTitle":`Edit space`,"space.save":`Save`,"space.cancel":`Cancel`,"space.loading":`Loading…`,"space.detailFailed":`Failed to load space info`,"space.updateFailed":`Save failed`,"space.updated":`Saved "{name}"`,"space.publicNameLocked":`The public space name cannot be changed`,"space.switch":`Switch`,"space.nameLabel":`Space name`,"space.namePlaceholder":`Enter a space name`,"space.create":`Create`,"space.promptBriefLabel":`Prompt requirements`,"space.promptBriefPlaceholder":`Describe how the assistant should work. Enter or send to generate; Shift+Enter for a new line`,"space.promptGenerate":`Generate prompt`,"space.promptGenerating":`Generating…`,"space.promptGeneratingStatus":`Generating prompt`,"space.promptStop":`Stop generating`,"space.promptBodyLabel":`Default prompt`,"space.promptBodyPlaceholder":`Saved as 默认提示词.md in this space`,"space.promptHint":`Saved to this space’s Prompt management as the default prompt.`,"space.promptBriefHint":`Saved with the space so you can regenerate the prompt later.`,"space.promptEditHint":`Saving overwrites this space’s 默认提示词.md; the workbench uses it immediately.`,"space.promptNeedReq":`Write prompt requirements before generating.`,"space.promptNeedBody":`Fill in the default prompt first.`,"space.promptNeedModel":`Configure a working model in Settings before generating.`,"space.promptGenEmpty":`The model returned an empty prompt. Retry, or write one yourself.`,"space.needName":`Enter a space name first.`,"space.created":`Created "{name}"`,"space.createdWithPrompt":`Created "{name}". The default prompt is in Prompt management.`,"space.name":`Name`,"space.location":`Location`,"space.size":`Size`,"space.sizeTitle":`Measure disk usage for each space`,"space.sizing":`Measuring…`,"space.status":`Status`,"space.builtin":`Default`,"space.publicName":`Public space`,"space.activeTag":`Active`,"space.missing":`Directory missing`,"space.rename":`Rename`,"space.copy":`Copy`,"space.export":`Export`,"space.exportContent":`Export content`,"space.exportContentTitle":`Excludes keys, sessions, memories and caches — safe to share`,"space.exportFull":`Export backup`,"space.exportFullTitle":`Includes keys, sessions and all local state — for your own backup`,"space.discover":`Scan folder`,"space.discoverTitle":`Scan the managed folder for space folders carrying a .lantern/space.json manifest; other folders are listed for your confirmation`,"space.discovering":`Scanning…`,"space.discoverAdded":`Adopted {n} space(s)`,"space.discoverNone":`No adoptable space folder found`,"space.discoverBackfilled":`Wrote space.json manifests for {n} existing space(s)`,"space.discoverSkipped":`Skipped {n} (name conflict, invalid name, or missing space metadata)`,"space.candidatesTitle":`Found {n} folder(s) that are not spaces. Adopt them?`,"space.candidatesHint":`Checked folders are added to the list. No space manifest (.lantern/space.json) is written; folder contents stay untouched.`,"space.candidatesSelectAll":`Select all`,"space.candidatesClear":`Select none`,"space.candidatesIgnore":`Ignore`,"space.candidatesIgnored":`Ignored — nothing was adopted`,"space.candidatesAdopt":`Adopt selected`,"space.candidatesAdopted":`Adopted {n} folder(s)`,"space.candidatesRejected":`Not adopted: {names}`,"space.removeList":`Unlist`,"space.deleteDisk":`Delete data`,"space.import":`Import`,"space.refresh":`Refresh`,"space.empty":`No custom space yet — click "New space" to start.`,"space.newParentHint":`New spaces are created under:`,"space.switching":`Switching…`,"space.reloadHint":`The page reloads automatically after switching.`,"space.confirmRemoveTitle":`Remove from list`,"space.confirmRemoveMsg":`This removes "{name}" from the list but keeps its data on disk:
|
|
5
|
-
{path}
|
|
6
|
-
It can be added back later.`,"space.confirmDeleteTitle":`Delete data`,"space.confirmDeleteMsg":`This permanently deletes "{name}" and all of its data, with no way to undo:
|
|
7
|
-
{path}`,"space.confirmCopyTitle":`Copy space`,"space.confirmCopyMsg":`All content of "{name}" will be copied into a new space. This can take a while for large spaces.`,"space.done":`Done`,"space.copyName":`New copy name`,"space.importPick":`Choose a zip backup to import`,"space.othersEmpty":`No other spaces yet. Open Manage spaces below to create or import one.`,"space.busyRuns":`A session is still running. Stop it before switching spaces.`,"space.publicLocked":`The built-in public space cannot be renamed or deleted.`,"space.offline":`Workspace unavailable`,"space.offlineCap":`Local service offline`,"settings.general":`General`,"settings.model":`Models`,"settings.builtin":`Built-in`,"settings.builtinDesc":`Provided by the platform per session or globally; always on, no toggle.`,"settings.close":`Close`,"settings.access":`Permissions`,"settings.accessDesc":`Default permission mode for new sessions`,"settings.language":`Language`,"settings.appearance":`Appearance`,"settings.appear.light":`Light`,"settings.appear.dark":`Dark`,"settings.appear.system":`System`,"settings.fontSize":`Font size`,"settings.fontSizeDesc":`Body and session text size (sidebar layout stays fixed)`,"settings.toolSteps":`Tool step detail`,"settings.toolStepsDesc":`How much tool-call detail to show`,"settings.busySend":`Send while busy`,"settings.busySendDesc":`Enter / Send while the agent is running; Cmd/Ctrl+Enter uses the other action`,"settings.busySend.queue":`Queue`,"settings.busySend.interrupt":`Interrupt`,"settings.allowPrivateWebFetch":`Allow private-network fetch`,"settings.allowPrivateWebFetchDesc":`When off, web_fetch and search results block localhost and private IPs (including after redirects)`,"settings.allowPrivateWebFetch.off":`Block (recommended)`,"settings.allowPrivateWebFetch.on":`Allow`,"settings.contextWindow":`Context window (tokens)`,"settings.contextWindowPlaceholder":`Empty = built-in table`,"settings.contextWindowDesc":`Used for compaction threshold and context meter; empty falls back to the built-in model table`,"settings.supportsTools":`Supports tools`,"settings.supportsVision":`Supports vision`,"settings.cap.on":`Yes`,"settings.cap.off":`No`,"settings.subagentModel":`Subagent model`,"settings.subagentModelDesc":`Subagents inherit the main chat model by default; pick another from the active provider`,"settings.subagentModel.inherit":`Follow main chat`,"settings.platformVersion":`Platform version`,"settings.updateCheck":`Check for updates`,"settings.updateChecking":`Checking`,"settings.updateLatest":`Up to date`,"settings.updateAvailable":`Update available`,"settings.updateNow":`Update & restart`,"settings.updateInstalling":`Installing v{v}, the service will restart automatically…`,"settings.updateWorking":`Updating…`,"settings.updateRestarting":`Restarting service…`,"settings.updateDone":`Updated to v{v}`,"settings.updateReload":`Reload page`,"settings.updateFailed":`Update failed`,"settings.updateRetry":`Retry`,"settings.updateDevMode":`Source mode cannot update in-page; run git pull and rebuild`,"settings.updateNpxHint":`Will install globally and restart (stop using the npx cache)`,"settings.updateUnavailable":`Unable to check for updates`,"settings.updateCheckedAt":`Last checked: {time}`,"settings.updateLog":`Log: {path}`,"settings.updateTimeout":`Timed out waiting for restart; reload the page to confirm the version`,"settings.updateConfirm":`Updating stops the current service, installs globally and restarts; the page disconnects briefly.`,"settings.access.readonly":`View only`,"settings.access.readwrite":`Edit in workspace`,"settings.access.full":`Full access`,"settings.step.concise":`Concise`,"settings.step.standard":`Standard`,"settings.step.detailed":`Detailed`,"settings.step.full":`Full`,"settings.modelIntro":`Add each provider’s API key to use its models.`,"settings.edit":`Edit`,"settings.delete":`Delete`,"settings.addProvider":`+ Add model provider`,"settings.back":`Back`,"settings.editProvider":`Edit provider`,"settings.addProviderTitle":`Add provider`,"settings.cancel":`Cancel`,"settings.save":`Save`,"settings.displayName":`Display name`,"settings.preset":`Provider preset`,"settings.baseUrl":`Base URL`,"settings.apiKey":`API Key`,"settings.modelField":`Model`,"settings.keyHint":`Models are saved in ~/.config/lantern-harness/models.json and shared across spaces; never pushed to GitHub.`,"settings.modelPlaceholder":`Enter model id`,"settings.recognizing":`Detecting…`,"settings.recognized":`{n} models found`,"settings.recognizeFail":`Detection failed — enter a model id manually`,"settings.recognizeKeep":`Refresh failed — keeping previous list`,"settings.deleteConfirm":`Delete this model provider?`,"chat.emptyTitle":`Those who carry the lantern do not ask the way.`,"chat.emptyNoModel":`Configure a model to get started.`,"chat.configureModel":`Configure model`,"chat.workbench":`My Workbench`,"chat.newSession":`New chat`,"chat.workspace":`Workspace`,"tool.running":`Running tool…`,"tool.callingKind":`Calling {kind}`,"tool.doneKind":`{kind} done`,"tool.callingNamed":`Calling {kind}: {name}`,"tool.doneNamed":`{kind} done: {name}`,"tool.callingFull":`Calling {kind} ({name})…`,"tool.doneFull":`{kind} finished ({name})`,"tool.kind.kb":`knowledge base`,"tool.kind.fs":`local files`,"tool.kind.memory":`memory`,"tool.kind.webSearch":`web search`,"tool.kind.webFetch":`web fetch`}};function a(e,n,r){let a=i[r??(typeof window<`u`?t().language:`zh-CN`)]?.[e]??i[`zh-CN`][e]??e;if(n)for(let[e,t]of Object.entries(n))a=a.replaceAll(`{${e}}`,String(t));return a}function o(e){if(typeof document>`u`)return;let n=e??t().language;document.documentElement.lang=n===`en`?`en`:`zh-CN`,document.querySelectorAll(`[data-i18n]`).forEach(e=>{let t=e.dataset.i18n;t&&t in r&&(e.textContent=a(t,void 0,n))}),document.querySelectorAll(`[data-i18n-hint]`).forEach(e=>{let t=e.dataset.i18nHint;t&&t in r&&(e.dataset.hint=a(t,void 0,n))})}export{a as n,n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t,u as n}from"./app-config.Bg6v8zQQ.js";var r=[`内置插件`,`测试技能`,`需求管理`,`生成能力`,`记忆与检索`,`待办与效率`,`项目管理`,`仪表盘`,`开发工具`],i=[{id:`cases`,category:`测试技能`,name:`用例管理`,description:`侧栏进入用例库:浏览、搜索、打开与删除用例。关闭后入口隐藏,「生成测试用例」一并关闭;磁盘文件仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`caseGen`,category:`测试技能`,name:`生成测试用例`,description:`在工作台用「/」打开配置:选类型、模板与提示词后生成用例并写入用例库。需同时开启「用例管理」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0,requires:`cases`},{id:`prompts`,category:`内置插件`,name:`提示词管理`,description:`侧栏进入提示词库:浏览、搜索、打开与删除提示词,并维护当前空间的「默认提示词」。每个空间都需要,属于内置能力,常开且没有开关。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!0,alwaysOn:!0},{id:`promptGen`,category:`内置插件`,name:`生成提示词`,description:`用「/」打开配置后对话生成提示词;质检通过后写入提示词库。属于内置能力,默认常开、没有开关。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!0,alwaysOn:!0,hasPanel:!0,requires:`prompts`},{id:`knowledgeLib`,category:`测试技能`,name:`知识库管理`,description:`侧栏进入知识库:浏览、搜索、打开与删除文档。关闭后入口隐藏,「生成知识库」一并关闭;磁盘文件仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`knowledgeGen`,category:`测试技能`,name:`生成知识库`,description:`用「/」打开配置后对话生成规范、方法论或环境约定;质检通过后写入知识库。需同时开启「知识库管理」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0,requires:`knowledgeLib`},{id:`requirements`,category:`需求管理`,name:`需求文档库`,description:`侧栏进入需求文档库:浏览、搜索、上传与整理需求文档。关闭后入口隐藏;磁盘文件仍保留,生成用例时也不再引用。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`templates`,category:`测试技能`,name:`测试模板库`,description:`侧栏进入测试模板库:浏览、上传与整理用例 / 报告模板。关闭后入口隐藏;磁盘文件仍保留,生成用例时不再选用模板。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`knowledge`,category:`记忆与检索`,name:`知识库检索`,description:`工作台输入「@」引用知识库与模板文档;发送后由模型按需读取。关闭后 @ 只列工作区文件。`,version:`1.4.0`,requiresDev:!1,defaultEnabled:!1},{id:`memory`,category:`记忆与检索`,name:`会话记忆`,description:`五轨记忆(用户档案 / 全局事实 / 项目关键 / 项目日志 / 每日):待确认、归档与便签,在工作台「记忆」Tab 管理。`,version:`2.0.0`,requiresDev:!0,defaultEnabled:!1},{id:`todos`,category:`待办与效率`,name:`待办事项`,description:`侧栏进入待办事项:按状态 / 紧急程度筛选、行内改状态与手动维护;工作台会话也能通过工具直接记录与更新同一份待办。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`tasks`,category:`待办与效率`,name:`任务管理`,description:`侧栏进入任务列表:按任务池 / 进行中 / 已完成 / 已关闭 / 已取消跟踪任务,并汇总每个任务下关联待办的数量与完成进度。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`reports`,category:`待办与效率`,name:`工作汇报`,description:`打开后在工作台注入「工作汇报提示词」,并把这份提示词写进提示词管理,方便随时修改;关闭时只停用,提示词文件保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`projects`,category:`项目管理`,name:`项目列表`,description:`侧栏进入项目列表:进度 / 规划 / 归档三种状态的项目卡片,汇总每个项目下的迭代、需求与缺陷数量;支持搜索、归档与删除。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`iterations`,category:`项目管理`,name:`迭代管理`,description:`侧栏进入迭代管理:按项目维护迭代的开始 / 截止日期与状态,按日期流逝算进度并标出逾期。需同时开启「项目列表」。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`projects`},{id:`pmRequirements`,category:`项目管理`,name:`需求管理`,description:`侧栏进入需求管理:按项目 / 迭代维护需求编号、优先级、状态与验收标准;需求挂在项目下,可关联迭代。需同时开启「项目列表」。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`projects`},{id:`bugs`,category:`项目管理`,name:`缺陷管理`,description:`侧栏进入缺陷管理:按项目 / 迭代 / 需求记录缺陷,含严重程度、状态、重现步骤、期望与实际结果;关闭后入口隐藏,数据仍保留。需同时开启「项目列表」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`projects`},{id:`testStats`,category:`测试技能`,name:`测试统计`,description:`侧栏进入测试统计:按统计日期与测试统计维度(功能用例 / 自动化用例 / 接口用例 / 测试报告 / 缺陷统计等)记录统计数量,维度可搜索 / 创建 / 重命名 / 删除,下拉按创建时间倒序。打开开关即在当前空间生成 测试统计/测试统计.json。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`caseExec`,category:`测试技能`,name:`用例执行统计`,description:`侧栏进入用例执行统计:每个项目一张卡片,卡头是项目名称与开始 / 结束日期,并显示该项目的基线、累计已执行与执行率进度条;卡内按统计日期逐行记录用例总数与待执行数量,自动算出已执行用例、当前剩余用例与执行比例(比例按项目累计口径:以该项目第一条记录的用例总数为基线)。项目名称可搜索或直接创建,按创建时间倒序,下拉里可重命名(同步改记录)或删除未被引用的名称;卡头改周期会写穿该项目全部记录。打开开关即在当前空间生成 用例执行统计/用例执行统计.json。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`uiAuto`,category:`测试技能`,name:`自动化测试`,description:`侧栏进入自动化测试:把已有的 Playwright / pytest / Selenium 项目挂进来(系统原生选目录,自动识别框架),一键运行 / 停止用例(先跑全量),实时看日志,查看 HTML 报告与结构化结果。执行的是目标项目自己的测试命令,不会自动安装依赖或联网。打开开关时在「提示词管理」生成「Playwright提示词.md」(已存在不覆盖,生成页优先用它,插件开启期间不可删除)。关闭后入口隐藏,项目记录与报告仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`reqAnalysis`,category:`需求管理`,name:`需求分析`,description:`侧栏进入需求分析:选「需求文档库」里的原始需求,用当前模型拆成结构化用户故事(角色 / 前置 / 主流程 / 替代 / 异常 / 后置 / 验收),可编辑、可导出 Markdown;打开时默认一并开启「用户故事审查」,生成用户故事成功后自动审查。打开开关时在「提示词管理」生成「需求分析提示词.md」和「原文结构提示词.md」(已存在不覆盖,插件开启期间不可删除)。关闭后入口隐藏,已保存的分析仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`storyReview`,category:`需求管理`,name:`用户故事审查`,description:`打开后不新增侧栏入口:在「需求分析」页多出「审查结果」Tab;生成用户故事成功后自动初审,结果页可「重新审查 / 重新全量扫描」。先用固定规则核对覆盖率,再让模型专查场景遗漏与待确认项,缺口可勾选补写、可导出 Markdown。开启「需求分析」时默认一并打开,也可单独关掉。打开开关时在「提示词管理」生成「用户故事审查提示词.md」(已存在不覆盖,插件开启期间不可删除)。关闭后这些入口隐藏,审查结果仍保留在分析里。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!0,requires:`reqAnalysis`,autoEnableWith:`reqAnalysis`},{id:`testPoints`,category:`需求管理`,name:`生成测试点`,description:`打开后不新增侧栏入口:在「需求分析」页里多出「生成测试点」按钮与「测试点」Tab,基于拆好的用户故事按功能 / 边界值 / 异常 / 业务规则 / 非功能五个维度拆测试点,每条标注 P0–P3 优先级;界面与导出按 Ideal「一行一条」需求标题 → 五维 → 测试点归组(列表 / 左右导图 / XMind 向右逻辑图骨架,样式与原文结构导出一致 / Markdown),可下载。开启「需求分析」时默认一并打开,也可单独关掉。打开开关时在「提示词管理」生成「测试点生成提示词.md」(已存在不覆盖,插件开启期间不可删除)。关闭后这些入口隐藏,已生成的测试点仍保留在分析里。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!0,requires:`reqAnalysis`,autoEnableWith:`reqAnalysis`},{id:`caseReview`,category:`测试技能`,name:`用例质量评审`,description:`打开后不新增侧栏入口:在「用例管理」文件行上多出「评审」按钮与评审列,打开抽屉对整份用例做分级质检——逐条判定可用 / 待修改 / 错误无效,五维打分(需求覆盖 / 步骤可执行 / 预期可判定 / 数据与边界 / 规范完整),另给七项量化指标与逐条扣分原因、改进建议;报告可导出 Markdown。开启「用例管理」时默认一并打开,也可单独关掉。打开开关时在「提示词管理」生成「用例质量评审提示词.md」(已存在不覆盖,插件开启期间不可删除)。关闭后入口隐藏,评审结果仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`cases`,autoEnableWith:`cases`},{id:`caseBlindspot`,category:`测试技能`,name:`场景遗漏补全`,description:`打开后不新增侧栏入口:在「用例管理」的评审抽屉里多出「场景补全」Tab,专挖人工最容易漏的场景——非功能 / 安全边界与容错 / 兼容性 / 隐藏业务规则,逐条给出为什么容易漏与建议用例;勾选后跳到这条用例绑定的工作台会话,由模型按文件表头补进原用例文件(写前自动备份)。可根据文件名自动挂上对照需求。开启「用例管理」时默认一并打开,也可单独关掉。打开开关时在「提示词管理」生成「场景遗漏补全提示词.md」(已存在不覆盖,插件开启期间不可删除)。关闭后入口隐藏,探测结果仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`cases`,autoEnableWith:`cases`},{id:`dashboard`,category:`仪表盘`,name:`仪表盘`,description:`侧栏进入仪表盘:把当前空间的待办、任务、项目与测试统计聚合成一页(指标卡、倒计时、今日待办、进行中任务、测试统计柱状图、飞书式待办日历)。首次打开是空白画布,需在「编辑组件」里自行添加卡片;待办 / 任务为表格 + 分页。卡片摆在 12 列自由画布上,按住顶部圆点手柄拖位置、拖右下角把手改宽高,挡住相邻卡片时松手把它们挤开或让位;布局按空间记在浏览器本地。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`pluginDev`,category:`开发工具`,name:`插件开发`,description:`用固定提示词开发扩展插件:先评估形态与范围并用选项确认,确认后才改代码,完成后并入「扩展插件」。需要读写项目源码。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0}];function a(e=i){return r.map(t=>({category:t,items:e.filter(e=>e.category===t)})).filter(e=>e.items.length>0)}var o=`tw-plugins-changed`;function s(){let e={};for(let t of i)e[t.id]=t.defaultEnabled;return e}function c(e,t){let n={...e};if(t&&!m(t.id)?.alwaysOn){if(n[t.id]=t.enabled,t.enabled){let e=m(t.id)?.requires;e&&(n[e]=!0);for(let e of i)e.autoEnableWith===t.id&&(n[e.id]=!0)}else for(let e of i)e.requires===t.id&&(n[e.id]=!1)}for(let e of i)e.alwaysOn&&(n[e.id]=!0);for(let e of i)e.requires&&!n[e.requires]&&(n[e.id]=!1);return n}function l(){let t=s(),n=e().plugins??{};for(let e of i)typeof n[e.id]==`boolean`&&(t[e.id]=n[e.id]);return c(t)}function u(e){return l()[e]}function d(e){let t=s();for(let n of i)typeof e[n.id]==`boolean`&&(t[n.id]=e[n.id]);return c(t)}function f(e,r){if(m(e)?.alwaysOn)return l();let i=c(l(),{id:e,enabled:r});return n({plugins:i}),t(),typeof window<`u`&&window.dispatchEvent(new CustomEvent(o,{detail:i})),i}function p(e){if(typeof window>`u`)return()=>{};let t=t=>{let n=t.detail;e(n??l())};return window.addEventListener(o,t),()=>{window.removeEventListener(o,t)}}function m(e){return i.find(t=>t.id===e)}function h(e){let t=m(e),n=t?.name??e;return t?.requires&&!u(t.requires)?`请先在「我的插件」中启用「${m(t.requires)?.name??t.requires}」`:`请先在「我的插件」中启用「${n}」`}export{l as a,d as c,u as i,f as l,m as n,p as o,a as r,h as s,i as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`/__tb_todos`,t=[`pending`,`in_progress`,`overdue`,`done`,`cancelled`],n=[`urgent_important`,`important`,`urgent`,`normal`],r={pending:`待开始`,in_progress:`进行中`,done:`已完成`,overdue:`已延期`,cancelled:`已取消`},i={urgent_important:`重要紧急`,important:`重要不紧急`,urgent:`紧急不重要`,normal:`普通`,"":`—`},a=new Set(t),o=new Set(n),s=/^\d{4}-\d{2}-\d{2}$/;function c(e,t=2e3){return typeof e==`string`?e.trim().slice(0,t):``}function l(e){let t=c(e,10);return s.test(t)?t:``}function u(e){return typeof e==`string`&&a.has(e)}function d(e){return typeof e==`string`&&o.has(e)}function f(e){return e===`done`||e===`cancelled`}function p(e,t,n=S()){return t&&t<n?`overdue`:e&&e>n?`pending`:e&&e<=n?`in_progress`:t&&t>=n?`pending`:null}function m(e){if(!e||typeof e!=`object`)return null;let t=e,n=c(t.title,200);if(!n)return null;let r={title:n};return u(t.status)&&(r.status=t.status),`statusManual`in t&&(r.statusManual=!!t.statusManual),d(t.priority)&&(r.priority=t.priority),`linkedTask`in t&&(r.linkedTask=c(t.linkedTask,200)),`taskId`in t&&(r.taskId=c(t.taskId,64)),`startDate`in t&&(r.startDate=l(t.startDate)),`dueDate`in t&&(r.dueDate=l(t.dueDate)),`note`in t&&(r.note=c(t.note)),r}function h(e){if(!e||typeof e!=`object`)return null;let t=e,n=c(t.title,200);if(!n)return null;let r=new Date().toISOString(),i=u(t.status)?t.status:`pending`,a=l(t.startDate),o=l(t.dueDate),s=!!t.statusManual,m=i;if(!f(i)&&!s){let e=p(a,o);e&&(m=e)}else!f(i)&&o&&o<S()&&(m=i);return{id:c(t.id,64)||`td_${Math.random().toString(16).slice(2,10)}`,title:n,status:m,statusManual:s,priority:d(t.priority)?t.priority:``,linkedTask:c(t.linkedTask,200),taskId:c(t.taskId,64),startDate:a,dueDate:o,taskEndDate:f(m)?l(t.taskEndDate):``,note:c(t.note),source:t.source===`ai`?`ai`:`manual`,sessionId:c(t.sessionId,120),createdAt:c(t.createdAt,40)||r,updatedAt:c(t.updatedAt,40)||r,doneAt:c(t.doneAt,40)||null}}async function g(t,n,r=``){let i=await fetch(`${e}${r}`,{method:t,headers:n===void 0?void 0:{"Content-Type":`application/json`},body:n===void 0?void 0:JSON.stringify(n)}),a=await i.json().catch(()=>({}));if(!i.ok)throw Error(a.error||`HTTP ${i.status}`);return a}async function _(){try{return(await fetch(`${e}?health=1`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}async function v(){let e=await g(`GET`);return(Array.isArray(e.items)?e.items:[]).map(h).filter(e=>!!e)}async function y(e,t){let n=await g(`POST`,{items:e,...t});return(Array.isArray(n.items)?n.items:[]).map(h).filter(e=>!!e)}async function b(e,t){let n=h((await g(`PUT`,{id:e,...t})).item);if(!n)throw Error(`更新待办失败`);return n}async function x(e){let t=await g(`DELETE`,{ids:e});return Number(t.removed??0)}function S(e=new Date){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function C(e){let[t,n,r]=e.split(`-`).map(Number);return Date.UTC(t,(n??1)-1,r??1)}function w(e,t){return!s.test(e)||!s.test(t)?null:Math.round((C(t)-C(e))/864e5)}function T(e){let t=w(e.startDate,e.dueDate);return t===null?null:t+1}function E(e,t=S()){return w(t,e.dueDate)}function D(e){return f(e.status)?e.taskEndDate:``}function O(e,t=S()){return e.status===`done`||e.status===`cancelled`||e.statusManual?e.status:p(e.startDate??``,e.dueDate??``,t)??e.status}function k(e){return[...e].sort((e,t)=>e.updatedAt===t.updatedAt?e.createdAt<t.createdAt?1:-1:e.updatedAt<t.updatedAt?1:-1)}function A(e,t={}){let n=t.status??`all`,r=t.priority??`all`,i=(t.keyword??``).trim().toLowerCase(),a=t.today??S();return e.filter(e=>!(n!==`all`&&O(e,a)!==n||r!==`all`&&e.priority!==r||i&&!`${e.title} ${e.linkedTask} ${e.note}`.toLowerCase().includes(i)))}var j=`/__tb_tasks`,M=[`pool`,`in_progress`,`done`,`closed`,`cancelled`],N=[`urgent_important`,`important`,`urgent`,`normal`],P={pool:`任务池`,in_progress:`进行中`,done:`已完成`,closed:`已关闭`,cancelled:`已取消`},F={urgent_important:`重要紧急`,important:`重要不紧急`,urgent:`紧急不重要`,normal:`普通`,"":`—`},I=new Set(M),L=new Set(N),R=/^\d{4}-\d{2}-\d{2}$/;function z(e,t=2e3){return typeof e==`string`?e.trim().slice(0,t):``}function B(e){let t=z(e,10);return R.test(t)?t:``}function V(e){return typeof e==`string`&&I.has(e)}function H(e){return typeof e==`string`&&L.has(e)}function U(e){if(!e||typeof e!=`object`)return null;let t=e,n=z(t.title,200);if(!n)return null;let r={title:n};return V(t.status)&&(r.status=t.status),H(t.priority)&&(r.priority=t.priority),`startDate`in t&&(r.startDate=B(t.startDate)),`dueDate`in t&&(r.dueDate=B(t.dueDate)),`note`in t&&(r.note=z(t.note)),r}function W(e){if(!e||typeof e!=`object`)return null;let t=e,n=z(t.title,200);if(!n)return null;let r=new Date().toISOString();return{id:z(t.id,64)||`tk_${Math.random().toString(16).slice(2,10)}`,title:n,status:V(t.status)?t.status:`pool`,priority:H(t.priority)?t.priority:``,startDate:B(t.startDate),dueDate:B(t.dueDate),note:z(t.note),source:t.source===`ai`?`ai`:`manual`,sessionId:z(t.sessionId,120),createdAt:z(t.createdAt,40)||r,updatedAt:z(t.updatedAt,40)||r,doneAt:z(t.doneAt,40)||null}}async function G(e,t){let n=await fetch(j,{method:e,headers:t===void 0?void 0:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t)}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error||`HTTP ${n.status}`);return r}async function K(){try{return(await fetch(`${j}?health=1`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}async function q(){let e=await G(`GET`);return(Array.isArray(e.items)?e.items:[]).map(W).filter(e=>!!e)}async function J(e,t){let n=await G(`POST`,{items:e,...t});return(Array.isArray(n.items)?n.items:[]).map(W).filter(e=>!!e)}async function Y(e,t){let n=W((await G(`PUT`,{id:e,...t})).item);if(!n)throw Error(`更新任务失败`);return n}async function X(e){let t=await G(`DELETE`,{ids:e});return Number(t.removed??0)}function Z(e){let[t,n,r]=e.split(`-`).map(Number);return Date.UTC(t,(n??1)-1,r??1)}function Q(e){return!R.test(e.startDate)||!R.test(e.dueDate)?null:Math.round((Z(e.dueDate)-Z(e.startDate))/864e5)+1}function $(e){let t={};for(let n of e){let e=n.taskId?.trim();if(!e)continue;let r=t[e]??={total:0,done:0,percent:0};r.total+=1,n.status===`done`&&(r.done+=1)}for(let e of Object.values(t))e.percent=e.total?Math.round(e.done/e.total*100):0;return t}function ee(e,t={}){let n=t.status??`all`,r=t.priority??`all`,i=(t.keyword??``).trim().toLowerCase();return e.filter(e=>{if(n===`urgent`){if(e.priority!==`urgent_important`&&e.priority!==`urgent`)return!1}else if(n!==`all`&&e.status!==n)return!1;return!(r!==`all`&&e.priority!==r||i&&!`${e.title} ${e.note}`.toLowerCase().includes(i))})}function te(e){return[...e].sort((e,t)=>{let n=e.updatedAt||e.createdAt,r=t.updatedAt||t.createdAt;return n===r?e.createdAt===t.createdAt?0:e.createdAt<t.createdAt?1:-1:n<r?1:-1})}function ne(e){let t={total:e.length,pool:0,in_progress:0,done:0,closed:0,cancelled:0,urgent:0};for(let n of e)t[n.status]+=1,(n.priority===`urgent_important`||n.priority===`urgent`)&&(t.urgent+=1);return t}export{k as A,O as C,f as D,p as E,b as F,T as M,D as N,v as O,E as P,x as S,A as T,n as _,J as a,r as b,ee as c,U as d,te as f,Y as g,$ as h,P as i,S as j,m as k,H as l,Q as m,F as n,X as o,ne as p,M as r,K as s,N as t,q as u,i as v,_ as w,y as x,t as y};
|