lantern-harness 0.1.25 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/500.html +4 -4
  3. package/dist/_astro/Base.Bilfw8As.css +1 -0
  4. package/dist/_astro/{Base.astro_astro_type_script_index_0_lang.Cb6ggViJ.js → Base.astro_astro_type_script_index_0_lang.DR-2Adek.js} +1 -1
  5. package/dist/_astro/{CasesLibrary.e3vlOqSQ.js → CasesLibrary.BkQY421S.js} +1 -1
  6. package/dist/_astro/ChatApp.B1Iz_eeB.js +226 -0
  7. package/dist/_astro/{DashboardBoard.CmxqpmzI.js → DashboardBoard.DAUPgVh3.js} +2 -2
  8. package/dist/_astro/{PluginsPage.D5LXPMns.js → PluginsPage.DVmq__wo.js} +1 -1
  9. package/dist/_astro/PluginsPage.Dkg77HkX.js +1 -0
  10. package/dist/_astro/PmBugsBoard.DVhrHxD2.js +1 -0
  11. package/dist/_astro/PmIterationsBoard.BQPHdbpp.js +1 -0
  12. package/dist/_astro/{PmProjectDetail.O44fnczN.js → PmProjectDetail.DZmqbZLO.js} +1 -1
  13. package/dist/_astro/PmProjectsBoard.tk8cI-lO.js +1 -0
  14. package/dist/_astro/PmRequirementsBoard.BjC9CEFr.js +1 -0
  15. package/dist/_astro/PmRequirementsBoard.CtuavIey.js +1 -0
  16. package/dist/_astro/{PmShared.Bwphj4KH.js → PmShared.DRYCFoRc.js} +1 -1
  17. package/dist/_astro/{PromptsLibrary.Dv5OABdK.js → PromptsLibrary.CCOJ1NTA.js} +1 -1
  18. package/dist/_astro/{ReqAnalysisBoard.nUp89z1s.js → ReqAnalysisBoard.Bq0xvh5g.js} +1 -1
  19. package/dist/_astro/{SettingsDialog.D3f4EOwl.js → SettingsDialog.CR3Iv-ml.js} +1 -1
  20. package/dist/_astro/SlideOverDrawer.C1IVOc_8.js +1 -0
  21. package/dist/_astro/TasksBoard.Uj4XWtWz.js +1 -0
  22. package/dist/_astro/TodosBoard.BkszTn-p.js +1 -0
  23. package/dist/_astro/{UiAutoBoard.BRMCH1zB.js → UiAutoBoard.DegcBc_3.js} +1 -1
  24. package/dist/_astro/app-version.rNBCZA_9.js +1 -0
  25. package/dist/_astro/{pm.pMOkNqqK.js → pm.BXmOiFfW.js} +1 -1
  26. package/dist/_astro/{story-review.BvgXBApZ.js → story-review.DEsnv8KP.js} +1 -1
  27. package/dist/_astro/tasks.jfnSAEmg.js +1 -0
  28. package/dist/case-exec/index.html +4 -4
  29. package/dist/cases/generate/index.html +4 -4
  30. package/dist/cases/library/index.html +5 -5
  31. package/dist/dashboard/index.html +5 -5
  32. package/dist/docs/changelog/index.html +34 -5
  33. package/dist/docs/install/index.html +4 -4
  34. package/dist/docs/manual/index.html +10 -10
  35. package/dist/knowledge/index.html +4 -4
  36. package/dist/plugins/index.html +5 -5
  37. package/dist/pm/bugs/index.html +5 -5
  38. package/dist/pm/iterations/index.html +5 -5
  39. package/dist/pm/projects/detail/index.html +5 -5
  40. package/dist/pm/projects/index.html +5 -5
  41. package/dist/pm/requirements/index.html +5 -5
  42. package/dist/prompts/index.html +5 -5
  43. package/dist/reports/index.html +4 -4
  44. package/dist/requirement-analysis/index.html +5 -5
  45. package/dist/requirements/index.html +4 -4
  46. package/dist/tasks/index.html +5 -5
  47. package/dist/templates/index.html +4 -4
  48. package/dist/test-automation/index.html +5 -5
  49. package/dist/test-stats/index.html +4 -4
  50. package/dist/todos/index.html +5 -5
  51. package/dist/workbench/index.html +5 -5
  52. package/docs//346/223/215/344/275/234/346/211/213/345/206/214.md +6 -6
  53. package/lh-plugins/lh-pm.mjs +6 -2
  54. package/lh-plugins/lh-todos.mjs +59 -18
  55. package/package.json +1 -1
  56. package/dist/_astro/Base.COYvzmy5.css +0 -1
  57. package/dist/_astro/ChatApp.CECImcJo.js +0 -226
  58. package/dist/_astro/PluginsPage.B6dsHB44.js +0 -1
  59. package/dist/_astro/PmBugsBoard.B6w50MHD.js +0 -1
  60. package/dist/_astro/PmIterationsBoard.Dk7JheCU.js +0 -1
  61. package/dist/_astro/PmProjectsBoard.qgj9HAj8.js +0 -1
  62. package/dist/_astro/PmRequirementsBoard.BKY3h4CQ.js +0 -1
  63. package/dist/_astro/PmRequirementsBoard.DTL_RFxq.js +0 -1
  64. package/dist/_astro/SlideOverDrawer.CpQu7VMQ.js +0 -1
  65. package/dist/_astro/TasksBoard.rwdPWLAh.js +0 -1
  66. package/dist/_astro/TodosBoard.CrZMl6Ei.js +0 -1
  67. package/dist/_astro/app-version.BPkgRlbu.js +0 -1
  68. package/dist/_astro/tasks.BNBkrFC3.js +0 -1
@@ -0,0 +1 @@
1
+ import{s as e,t}from"./react.Blvh0GOs.js";import{t as n}from"./react-dom.DLW9pGCF.js";import{t as r}from"./jsx-runtime.DUg_B_vD.js";var i=e(t(),1),a=e(n(),1),o=r(),s=280;function c({open:e,onClose:t,title:n,closeAriaLabel:r=`关闭面板`,widthClass:c=`max-w-md`,escDisabled:l=!1,bodyClassName:u,children:d,footer:f}){let[p,m]=(0,i.useState)(e),[h,g]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{if(e){m(!0);let e=window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>g(!0))});return()=>window.cancelAnimationFrame(e)}g(!1);let t=window.setTimeout(()=>m(!1),s);return()=>window.clearTimeout(t)},[e]),(0,i.useEffect)(()=>{if(!e||l)return;function n(e){e.key===`Escape`&&(document.querySelector(`[aria-haspopup="listbox"][aria-expanded="true"]`)||document.querySelector(`[data-pm-image-preview]`)||(e.preventDefault(),e.stopPropagation(),t()))}return window.addEventListener(`keydown`,n,!0),()=>window.removeEventListener(`keydown`,n,!0)},[e,t,l]),!p)return null;let _=(0,o.jsxs)(`div`,{className:`fixed inset-0 z-60 flex justify-end`,role:`dialog`,"aria-modal":`true`,children:[(0,o.jsx)(`button`,{type:`button`,className:`absolute inset-0 bg-stone-900/30 transition-opacity duration-[280ms] ease-out ${h?`opacity-100`:`opacity-0`}`,"aria-label":r,onClick:t}),(0,o.jsxs)(`aside`,{className:`tw-slide-over relative w-full ${c} h-full shadow-2xl border-l border-stone-200 flex flex-col transition-[translate] duration-[280ms] ease-[cubic-bezier(0.32,0.72,0,1)] will-change-[translate] ${h?`translate-x-0`:`translate-x-full`}`,children:[(0,o.jsxs)(`header`,{className:`shrink-0 h-12 px-4 border-b border-stone-100 flex items-center gap-2`,children:[(0,o.jsx)(`h2`,{className:`tw-slide-over-title text-sm font-semibold text-stone-800 flex-1`,children:n}),(0,o.jsx)(`button`,{type:`button`,onClick:t,className:`tw-icon-btn w-8 h-8 rounded-lg`,"data-hint":`关闭(Esc)`,children:`✕`})]}),(0,o.jsx)(`div`,{className:`flex-1 min-h-0 overflow-y-auto p-4 ${u??`space-y-4`}`.trim(),children:d}),f]})]});return typeof document>`u`?_:(0,a.createPortal)(_,document.body)}export{c as t};
@@ -0,0 +1 @@
1
+ import{s as e,t}from"./react.Blvh0GOs.js";import{i as n}from"./app-config.DAIyT--R.js";import{i as r,o as i,s as a}from"./plugins.Di6uuouN.js";import{n as o,o as s,r as c,s as l}from"./view-prefs.DkS1ldnh.js";import{i as u,n as d,r as f,t as p}from"./dialog.DZHZCe_T.js";import{t as m}from"./jsx-runtime.DUg_B_vD.js";import{t as h}from"./ConfirmDialog.D5qXeML0.js";import{c as g,d as _,i as v,l as y,n as ee,o as b,t as x}from"./ColumnResize.BgYkV9Iy.js";import{t as S}from"./DatePicker.Bkl71M49.js";import{t as C}from"./SelectDropdown.apWlFGbA.js";import{showToast as w}from"./Toast.BO2NFckG.js";import{C as T,F as te,O as ne,a as E,b as D,c as re,f as ie,g as ae,h as oe,i as O,j as k,m as se,n as A,o as ce,p as le,r as ue,s as de,t as j,u as fe}from"./tasks.jfnSAEmg.js";import{a as M,l as N,n as P,o as F,r as I,s as L,t as R}from"./DrawerField.C0MkN-LW.js";var z=e(t(),1),B=m(),pe=8e3,V=[{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}],me={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`},he={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`},H={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]`},U={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=ue.map(e=>({value:e,label:O[e]})),ve=[{value:``,label:`未设置`},...j.map(e=>({value:e,label:A[e]}))],ye=[{value:`all`,label:`全部优先级`},...j.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,B.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,B.jsx)(`span`,{className:`text-2xl font-semibold tabular-nums ${e.tone===`urgent`?`text-[#c02a26]`:`text-stone-900`}`,children:e.value}),(0,B.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:a}=e,[o,s]=(0,z.useState)({title:``}),[c,l]=(0,z.useState)(``),[m,h]=(0,z.useState)(!1);(0,z.useEffect)(()=>{t&&(l(``),h(!1),s(n?{title:n.title,status:n.status,priority:n.priority,startDate:n.startDate,dueDate:n.dueDate,note:n.note}:{title:``,status:`pool`,priority:``,startDate:k(),dueDate:k()}))},[t,n]);function g(e){s(t=>({...t,...e}))}let _=se({startDate:o.startDate??``,dueDate:o.dueDate??``}),v=n?r.filter(e=>e.taskId===n.id):[],y=v.filter(e=>e.status===`done`).length,ee=v.length?Math.round(y/v.length*100):0;async function b(){let e=(o.title??``).trim();if(!e)l(`请填写任务名称`);else if(o.startDate&&o.dueDate&&o.dueDate<o.startDate)l(`截止日期不能早于开始日期`);else{h(!0),l(``);try{n?await ae(n.id,o):await E([{...o,title:e}],{mode:`manual`}),await a(),w(n?`已保存任务`:`已新建任务`,`success`),i()}catch(e){let t=e instanceof Error?e.message:String(e);l(t),w(`保存任务失败:${t}`,`error`)}finally{h(!1)}}}return(0,B.jsxs)(f,{open:t,onClose:i,transition:!0,className:`relative z-100`,children:[(0,B.jsx)(p,{transition:!0,className:`tw-dialog-backdrop-anim fixed inset-0 bg-black/25`,"aria-hidden":`true`}),(0,B.jsx)(`div`,{className:`fixed inset-0 flex justify-end`,children:(0,B.jsxs)(u,{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,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-stone-100 px-6 py-4`,children:[(0,B.jsx)(d,{className:`text-base font-semibold text-stone-900`,children:n?`任务详情`:`新建任务`}),(0,B.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,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-3`,children:[(0,B.jsx)(P,{icon:(0,B.jsx)(N,{}),label:`任务名称`,children:(0,B.jsx)(`input`,{autoFocus:!0,value:o.title,onChange:e=>g({title:e.target.value}),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),b())},placeholder:`请输入内容`,className:R})}),(0,B.jsx)(P,{icon:(0,B.jsx)(L,{}),label:`任务状态`,children:(0,B.jsx)(I,{ariaLabel:`任务状态`,menuMinWidth:140,options:_e,value:o.status??`pool`,onChange:e=>g({status:e}),label:O[o.status??`pool`],optionDotClassName:e=>U[e]})}),(0,B.jsx)(P,{icon:(0,B.jsx)(L,{}),label:`紧急程度`,children:(0,B.jsx)(I,{ariaLabel:`紧急程度`,menuMinWidth:140,options:ve,value:o.priority??``,onChange:e=>g({priority:e}),label:o.priority?A[o.priority]:`未设置`,optionDotClassName:e=>ge[e]})}),(0,B.jsx)(P,{icon:(0,B.jsx)(M,{}),label:`开始日期`,children:(0,B.jsx)(S,{value:o.startDate??``,onChange:e=>g({startDate:e}),className:`${R} tabular-nums`})}),(0,B.jsx)(P,{icon:(0,B.jsx)(M,{}),label:`截止日期`,children:(0,B.jsx)(S,{value:o.dueDate??``,onChange:e=>g({dueDate:e}),className:`${R} tabular-nums`})}),(0,B.jsx)(P,{icon:(0,B.jsx)(F,{}),label:`任务周期`,children:(0,B.jsx)(`div`,{className:`px-2 pt-1.5 text-sm text-stone-500`,children:_===null?`—`:`${_} 天`})}),(0,B.jsx)(P,{icon:(0,B.jsx)(F,{}),label:`待办进度`,children:(0,B.jsx)(`div`,{className:`px-2 pt-1.5 text-sm text-stone-500`,children:v.length?`${y}/${v.length} · ${ee}%`:`还没有关联待办`})}),(0,B.jsx)(P,{icon:(0,B.jsx)(N,{}),label:`备注`,children:(0,B.jsx)(`textarea`,{value:o.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&&v.length?(0,B.jsxs)(`div`,{className:`mx-6 mt-2 rounded-lg border border-stone-100 bg-stone-50/60 px-3 py-2`,children:[(0,B.jsx)(`div`,{className:`mb-1.5 text-xs font-medium text-stone-500`,children:`关联待办`}),(0,B.jsx)(`ul`,{className:`space-y-1.5`,children:v.map(e=>{let t=T(e,k());return(0,B.jsxs)(`li`,{className:`flex items-center gap-2 text-sm text-stone-700`,children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,B.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${H[t]}`,children:D[t]})]},e.id)})})]}):null,c?(0,B.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:c}):null]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-stone-100 px-6 py-3`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:i,disabled:m,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,B.jsx)(`button`,{type:`button`,onClick:()=>void b(),disabled:m,className:`h-8 rounded-lg bg-[#3370ff] px-4 text-sm font-medium text-white transition-colors hover:bg-[#2b5fd9] disabled:opacity-40`,children:m?`保存中…`:n?`保存`:`新建`})]})]})})]})}function De(){let[e,t]=(0,z.useState)(!1),[u,d]=(0,z.useState)(!0),[f,p]=(0,z.useState)(!0),[m,T]=(0,z.useState)(null),[E,D]=(0,z.useState)([]),[k,ue]=(0,z.useState)([]),[j,M]=(0,z.useState)(null),[N,P]=(0,z.useState)(!1),[F,I]=(0,z.useState)(()=>c(we)),[L,R]=(0,z.useState)(()=>o(Se,xe,`all`)),[H,De]=(0,z.useState)(()=>o(Ce,Te,`all`)),[Oe,G]=(0,z.useState)(null),[K,q]=(0,z.useState)(null);function ke(e){s(Se,e),R(e)}function Ae(e){l(we,e),I(e)}function je(e){s(Ce,e),De(e)}let J=(0,z.useRef)(!0),Y=y(`lh:tasks:cols:v1`,V),Me=_(`tasks`);(0,z.useEffect)(()=>(J.current=!0,()=>{J.current=!1}),[]);let X=(0,z.useCallback)(async()=>{try{let[e,t]=await Promise.all([fe(),f?ne().catch(()=>[]):Promise.resolve([])]);if(!J.current)return;D(e),ue(t),M(null)}catch(e){if(!J.current)return;M(e instanceof Error?e.message:String(e))}},[f]);(0,z.useEffect)(()=>{let e=i(e=>{d(!!e.tasks),p(!!e.todos)});return n().then(()=>{d(r(`tasks`)),p(r(`todos`)),t(!0)}),e},[]),(0,z.useEffect)(()=>{e&&u&&(async()=>{let e=await de();J.current&&(e?(await X(),J.current&&T(!0)):T(!1))})()},[e,u,X]),(0,z.useEffect)(()=>{if(m!==!0)return;let e=window.setInterval(()=>void X(),pe),t=()=>void X();return window.addEventListener(`focus`,t),()=>{window.clearInterval(e),window.removeEventListener(`focus`,t)}},[m,X]);let Ne=(0,z.useMemo)(()=>oe(k),[k]),Z=(0,z.useMemo)(()=>le(E),[E]),Pe=(0,z.useMemo)(()=>re(E,{status:L,priority:H,keyword:F}),[E,L,H,F]),Q=(0,z.useMemo)(()=>ie(Pe),[Pe]);async function $(e,t){D(n=>n.map(n=>n.id===e?{...n,...t}:n));try{let n=await ae(e,t);if(!J.current)return;D(t=>t.map(t=>t.id===e?n:t)),M(null)}catch(e){M(e instanceof Error?e.message:String(e)),await X()}}async function Fe(){let e=K;if(e){q(null),P(!0);try{await ce([e.id]),await Promise.all(k.filter(t=>t.taskId===e.id).map(e=>te(e.id,{taskId:``,linkedTask:``}).catch(()=>null))),await X(),w(`已删除任务「${e.title}」`,`success`)}catch(e){let t=e instanceof Error?e.message:String(e);M(t),w(`删除任务失败:${t}`,`error`)}finally{J.current&&P(!1)}}}return e?u?m===null?(0,B.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,B.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,B.jsx)(`span`,{className:`tw-lib-spin`,"aria-hidden":`true`})})}):m?(0,B.jsxs)(`section`,{className:`flex min-h-0 flex-col gap-4`,children:[(0,B.jsxs)(`div`,{className:`grid shrink-0 grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-7`,children:[(0,B.jsx)(W,{label:`全部任务`,value:Z.total}),(0,B.jsx)(W,{label:`任务池`,value:Z.pool}),(0,B.jsx)(W,{label:`进行中`,value:Z.in_progress}),(0,B.jsx)(W,{label:`已完成`,value:Z.done}),(0,B.jsx)(W,{label:`已关闭`,value:Z.closed}),(0,B.jsx)(W,{label:`已取消`,value:Z.cancelled}),(0,B.jsx)(W,{label:`需要紧急`,value:Z.urgent,tone:`urgent`})]}),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-stone-200 bg-white`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-stone-100 px-4 py-3`,children:[(0,B.jsx)(`input`,{value:F,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,B.jsx)(`div`,{className:`flex items-center gap-0.5 rounded-lg bg-stone-100/80 p-0.5`,children:be.map(e=>(0,B.jsx)(`button`,{type:`button`,onClick:()=>ke(e.value),className:`h-8 rounded-md px-3 text-sm transition-colors ${L===e.value?`bg-white font-medium text-stone-900 shadow-sm`:`text-stone-600 hover:text-stone-900`}`,children:e.label},e.value))}),(0,B.jsx)(C,{flat:!0,className:`w-[136px]`,ariaLabel:`优先级筛选`,options:ye,value:H,onChange:e=>je(e)}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.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,B.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,B.jsx)(`path`,{d:`M21 12a9 9 0 1 1-3-6.7`}),(0,B.jsx)(`path`,{d:`M21 4v5h-5`})]})}),(0,B.jsx)(`button`,{type:`button`,disabled:N,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:`+ 新建任务`})]})]}),j?(0,B.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,B.jsx)(`span`,{className:`min-w-0 flex-1`,children:j}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>M(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,B.jsx)(`div`,{ref:Me,className:`tw-scroll-x min-h-0 flex-1 overflow-auto`,children:(0,B.jsxs)(`table`,{className:`tw-task-table tw-sticky-table w-full table-fixed text-sm`,style:Y.tableStyle,children:[(0,B.jsx)(`colgroup`,{children:V.map(e=>(0,B.jsx)(`col`,{style:Y.widthOf(e.key)?{width:Y.widthOf(e.key)}:void 0},e.key))}),(0,B.jsx)(`thead`,{className:`tw-table-head sticky top-0 z-10 text-xs text-stone-500`,children:(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`th`,{className:b,children:[`任务描述`,(0,B.jsx)(x,{...Y.resizeProps(`title`)})]}),(0,B.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`任务状态`,(0,B.jsx)(x,{...Y.resizeProps(`status`)})]}),(0,B.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`紧急程度`,(0,B.jsx)(x,{...Y.resizeProps(`priority`)})]}),(0,B.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`开始日期`,(0,B.jsx)(x,{...Y.resizeProps(`start`)})]}),(0,B.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`截止日期`,(0,B.jsx)(x,{...Y.resizeProps(`due`)})]}),(0,B.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`任务周期`,(0,B.jsx)(x,{...Y.resizeProps(`cycle`)})]}),(0,B.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`待办数量`,(0,B.jsx)(x,{...Y.resizeProps(`todos`)})]}),(0,B.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`完成进度`,(0,B.jsx)(x,{...Y.resizeProps(`progress`)})]}),(0,B.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`备注`,(0,B.jsx)(x,{...Y.resizeProps(`note`)})]}),(0,B.jsx)(`th`,{"aria-hidden":`true`}),(0,B.jsx)(`th`,{className:g,children:`操作`})]})}),(0,B.jsxs)(`tbody`,{children:[Q.map(e=>{let t=se(e),n=Ne[e.id]??{total:0,done:0,percent:0};return(0,B.jsxs)(`tr`,{className:`group/row hover:bg-[#f7f8fa]`,children:[(0,B.jsx)(`td`,{className:ee,children:(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e.source===`ai`?(0,B.jsx)(`span`,{className:`shrink-0 rounded bg-[#e1eaff] px-1 py-px text-[10px] text-[#1f4ec2]`,children:`AI`}):null,(0,B.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,B.jsx)(`td`,{className:`px-1.5 py-1 align-middle`,children:(0,B.jsx)(C,{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 ${me[e.status]}`,renderTrigger:()=>(0,B.jsx)(`span`,{className:`truncate`,children:O[e.status]}),renderOptionPrefix:e=>(0,B.jsx)(`span`,{className:`h-2 w-2 rounded-full ${U[e.value]}`})})}),(0,B.jsx)(`td`,{className:`px-1.5 py-1 align-middle`,children:(0,B.jsx)(C,{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 ${he[e.priority]}`,renderTrigger:()=>(0,B.jsx)(`span`,{className:`truncate`,children:e.priority?A[e.priority]:`未设置`}),renderOptionPrefix:e=>(0,B.jsx)(`span`,{className:`h-2 w-2 rounded-full ${ge[e.value]}`})})}),(0,B.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,B.jsx)(S,{value:e.startDate,onChange:t=>void $(e.id,{startDate:t}),placeholder:`选择日期`,className:`h-8 rounded-md px-1.5 text-sm tabular-nums`})}),(0,B.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,B.jsx)(S,{value:e.dueDate,onChange:t=>void $(e.id,{dueDate:t}),placeholder:`选择日期`,className:`h-8 rounded-md px-1.5 text-sm tabular-nums`})}),(0,B.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap text-stone-500 tabular-nums`,children:t===null?`—`:`${t} 天`}),(0,B.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs text-stone-500 tabular-nums`,children:f?n.total?`${n.total} 条`:`0`:(0,B.jsx)(`span`,{className:`whitespace-nowrap text-stone-400`,children:`待办事项未启用`})}),(0,B.jsx)(`td`,{className:`px-2 py-1 align-middle`,children:f?(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`h-1.5 min-w-0 flex-1 overflow-hidden rounded-full bg-stone-100`,children:(0,B.jsx)(`span`,{className:`block h-full rounded-full bg-[#3370ff] transition-[width]`,style:{width:`${n.percent}%`}})}),(0,B.jsxs)(`span`,{className:`w-9 shrink-0 text-right text-xs text-stone-500 tabular-nums`,children:[n.percent,`%`]})]}):(0,B.jsx)(`span`,{className:`whitespace-nowrap text-xs text-stone-400`,children:`待办事项未启用`})}),(0,B.jsx)(`td`,{className:`truncate px-2 py-1 align-middle text-xs text-stone-500`,children:e.note||`—`}),(0,B.jsx)(`td`,{"aria-hidden":`true`}),(0,B.jsx)(`td`,{className:v,children:(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[(0,B.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,B.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,B.jsx)(`path`,{d:`M14 4h6v6`}),(0,B.jsx)(`path`,{d:`M20 4 13 11`}),(0,B.jsx)(`path`,{d:`M10 20H4v-6`}),(0,B.jsx)(`path`,{d:`M4 20l7-7`})]})}),(0,B.jsx)(`button`,{type:`button`,disabled:N,onClick:()=>q(e),"aria-label":`删除 ${e.title}`,className:`tw-icon-danger rounded p-1`,children:(0,B.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,B.jsx)(`path`,{d:`M3 6h18`}),(0,B.jsx)(`path`,{d:`M8 6V4h8v2`}),(0,B.jsx)(`path`,{d:`M19 6l-1 14H6L5 6`}),(0,B.jsx)(`path`,{d:`M10 11v6M14 11v6`})]})})]})})]},e.id)}),Q.length===0?(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{colSpan:11,className:`px-3 py-16 text-center text-sm text-stone-400`,children:E.length===0?`还没有任务`:`没有匹配的任务,试试调整搜索或筛选`})}):null]})]})}),(0,B.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,B.jsxs)(`span`,{children:[`共 `,Q.length,` 条`]}),(0,B.jsx)(`span`,{className:`ml-auto text-stone-400`,children:`任务下关联的待办可直接在「待办事项」里维护`})]})]}),(0,B.jsx)(Ee,{open:Oe!==null,task:Oe?.task??null,todos:k,onClose:()=>G(null),onSaved:X}),(0,B.jsx)(h,{open:K!=null,title:`删除任务`,message:`删除「${K?.title??``}」?已关联的待办会保留,但不再挂在该任务下。`,confirmLabel:`删除`,cancelLabel:`取消`,danger:!0,onClose:()=>q(null),onConfirm:()=>void Fe()})]}):(0,B.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,B.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(`tasks`)}):(0,B.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,B.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,B.jsx)(`span`,{className:`tw-lib-spin`,"aria-hidden":`true`})})})}export{De as default};
@@ -0,0 +1 @@
1
+ import{s as e,t}from"./react.Blvh0GOs.js";import{i as n}from"./app-config.DAIyT--R.js";import{i as r,o as i,s as a}from"./plugins.Di6uuouN.js";import{n as o,o as s,r as c,s as ee}from"./view-prefs.DkS1ldnh.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{a as f,c as p,d as m,i as ie,l as ae,n as h,o as oe,r as g,s as se,t as _}from"./ColumnResize.BgYkV9Iy.js";import{n as ce,t as v}from"./DatePicker.Bkl71M49.js";import{t as le}from"./OverflowHint.pvo2Xc8R.js";import{t as y}from"./SelectDropdown.apWlFGbA.js";import{showToast as b}from"./Toast.BO2NFckG.js";import{A as ue,C as x,D as S,E as C,F as w,M as de,N as fe,O as pe,P as me,S as he,T as ge,_ as _e,b as T,f as ve,g as ye,j as E,n as D,u as be,v as O,w as xe,x as Se,y as k}from"./tasks.jfnSAEmg.js";import{a as Ce,c as A,i as we,l as j,n as M,o as N,r as Te,s as P,t as Ee}from"./DrawerField.C0MkN-LW.js";var F=e(t(),1),I=u(),De=8e3,Oe=[{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}],ke=[`title`,`status`,`priority`,`linkedTask`,`startDate`,`dueDate`,`note`],Ae={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`},je={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]`},L={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`},Me={pending:`bg-stone-400`,in_progress:`bg-[#3370ff]`,done:`bg-[#34c724]`,overdue:`bg-[#f54a45]`,cancelled:`bg-stone-300`},Ne={urgent_important:`bg-[#f54a45]`,important:`bg-[#ff8800]`,urgent:`bg-[#f7ba1e]`,normal:`bg-stone-300`,"":`border border-stone-300 bg-transparent`},R={status:`按状态分组`,priority:`按紧急程度分组`,none:`不分组`},Pe=[`status`,`priority`,`none`],Fe=`todos.group-by`,Ie=[`in_progress`,`pending`,`overdue`,`done`,`cancelled`],Le=k.map(e=>({value:e,label:T[e]})),Re=[{value:``,label:`未设置`},..._e.map(e=>({value:e,label:O[e]}))],ze=Object.keys(R).map(e=>({value:e,label:R[e]})),Be=[{value:`all`,label:`全部紧急程度`},..._e.map(e=>({value:e,label:O[e]}))],Ve=Be.map(e=>e.value),He=`todos.priority-filter`,Ue=`todos.search`,We=`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 Ge(e){let{value:t,placeholder:n,muted:r,autoFocus:i,onChange:a,onCommit:o,onCancel:s}=e;return(0,I.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:`${We} ${r&&!t?`text-stone-300`:``}`})}function Ke(e){let{value:t,onChange:n,onCommit:r,onCancel:i}=e,[a,o]=(0,F.useState)(!1);return a?(0,I.jsx)(Ge,{value:t,placeholder:`—`,autoFocus:!0,onChange:n,onCommit:()=>{o(!1),r()},onCancel:()=>{o(!1),i()}}):(0,I.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,I.jsx)(`span`,{className:`text-stone-300`,children:`—`})})}function qe(e){return(0,I.jsx)(v,{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 Je(e){let{open:t,item:n,preset:r,tasks:i,tasksOn:a,onClose:o,onSaved:s}=e,[c,ee]=(0,F.useState)({title:``}),[u,d]=(0,F.useState)(``),[f,p]=(0,F.useState)(!1),[m,ie]=(0,F.useState)(!0);(0,F.useEffect)(()=>{t&&(d(``),p(!1),ie(!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=E(),t=E(),n=C(e,t)??`in_progress`;return{title:``,status:r?.status??n,statusManual:!!r?.status,priority:r?.priority??``,startDate:e,dueDate:t}})()))},[t,n,r]);let ae=[{value:``,label:`不关联`},...ve(i.filter(e=>e.status!==`closed`&&e.status!==`cancelled`||e.id===n?.taskId)).map(e=>({value:e.id,label:e.title}))];function h(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&&!S(n.status??`pending`)){let e=C(n.startDate??``,n.dueDate??``);e&&(n.status=e)}return n})}let oe=de({startDate:c.startDate??``,dueDate:c.dueDate??``}),g=me({dueDate:c.dueDate??``}),se=S(c.status??`pending`),_=se?ce((n&&S(n.status)?n.taskEndDate:``)||E()):``,ue=g===null?``:c.status===`done`?`已完成`:c.status===`cancelled`?`已取消`:g<0?`逾期 ${Math.abs(g)} 天`:g===0?`今天截止`:`${g} 天`;async function x(){let e=(c.title??``).trim();if(!e)d(`请填写待办名称`);else if(c.startDate&&c.dueDate&&c.dueDate<c.startDate)d(`截止日期不能早于开始日期`);else{p(!0),d(``);try{let t={...c,title:e};n?await w(n.id,t):await Se([t],{mode:`manual`}),await s(),b(n?`已保存待办`:`已新建待办`,`success`),o()}catch(e){let t=e instanceof Error?e.message:String(e);d(t),b(`保存待办失败:${t}`,`error`)}finally{p(!1)}}}return(0,I.jsxs)(l,{open:t,onClose:o,transition:!0,className:`relative z-100`,children:[(0,I.jsx)(re,{transition:!0,className:`tw-dialog-backdrop-anim fixed inset-0 bg-black/25`,"aria-hidden":`true`}),(0,I.jsx)(`div`,{className:`fixed inset-0 flex justify-end`,children:(0,I.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,I.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-stone-100 px-6 py-4`,children:[(0,I.jsx)(ne,{className:`text-base font-semibold text-stone-900`,children:n?`待办详情`:`新建待办`}),(0,I.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,I.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-3`,children:[(0,I.jsx)(M,{icon:(0,I.jsx)(j,{}),label:`待办名称`,children:(0,I.jsx)(`input`,{autoFocus:!0,value:c.title,onChange:e=>h({title:e.target.value}),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),x())},placeholder:`请输入内容`,className:Ee})}),(0,I.jsx)(M,{icon:(0,I.jsx)(P,{}),label:`待办状态`,children:(0,I.jsx)(Te,{ariaLabel:`待办状态`,menuMinWidth:140,options:Le,value:c.status??`pending`,onChange:e=>h({status:e}),label:T[c.status??`pending`],optionDotClassName:e=>Me[e]})}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>ie(e=>!e),"aria-expanded":m,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,I.jsx)(`span`,{className:`flex h-4 w-4 items-center justify-center text-stone-400`,children:(0,I.jsx)(A,{})}),(0,I.jsx)(`span`,{children:`任务详情`}),(0,I.jsx)(`span`,{className:`text-stone-400`,children:(0,I.jsx)(we,{open:m})})]}),m?(0,I.jsxs)(`div`,{className:`ml-[42px] border-l border-stone-100 pl-1`,children:[(0,I.jsx)(M,{icon:(0,I.jsx)(A,{}),label:`所属任务`,children:a?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(y,{flat:!0,searchable:!0,searchPlaceholder:`搜索任务…`,ariaLabel:`所属任务`,menuMinWidth:220,options:ae,value:c.taskId??``,onChange:e=>{let t=i.find(t=>t.id===e);h({taskId:e,linkedTask:t?.title??``,...t?{priority:t.priority}:{}})},renderTrigger:()=>(0,I.jsx)(le,{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,I.jsx)(`p`,{className:`mt-1 px-2 text-xs text-stone-400`,children:`任务管理里还没有任务,可到「任务管理」新建后再关联。`}):null]}):(0,I.jsx)(`div`,{className:`flex h-9 items-center rounded-md bg-stone-50 px-2 text-sm text-stone-400`,children:(0,I.jsx)(`span`,{className:`truncate`,children:c.linkedTask?`${c.linkedTask}(任务管理插件未启用)`:`任务管理插件未启用,无法关联任务`})})}),(0,I.jsx)(M,{icon:(0,I.jsx)(P,{}),label:`重要紧急程度`,children:(()=>{let e=c.taskId?i.find(e=>e.id===c.taskId):void 0;return e?(0,I.jsxs)(`div`,{className:`flex h-9 items-center gap-2 px-2 text-sm`,children:[(0,I.jsx)(`span`,{className:e.priority?`text-stone-800`:`text-stone-400`,children:e.priority?D[e.priority]:`任务未设置`}),(0,I.jsx)(`span`,{className:`text-[11px] text-stone-400`,children:`跟随所属任务`})]}):(0,I.jsx)(Te,{ariaLabel:`重要紧急程度`,menuMinWidth:140,options:Re,value:c.priority??``,onChange:e=>h({priority:e}),label:c.priority?O[c.priority]:`未设置`,optionDotClassName:e=>Ne[e]})})()}),(0,I.jsx)(M,{icon:(0,I.jsx)(Ce,{}),label:`结束日期`,children:(0,I.jsxs)(`div`,{className:`flex h-9 items-center px-2 text-sm tabular-nums`,"aria-readonly":`true`,children:[_?(0,I.jsx)(`span`,{className:`text-stone-800`,children:_}):(0,I.jsx)(`span`,{className:`text-stone-400`,children:`待办未完成`}),(0,I.jsx)(`span`,{className:`ml-2 text-[11px] text-stone-400`,children:se?`按完成日期自动记录`:`状态为已完成 / 已取消时自动记录`})]})})]}):null,(0,I.jsx)(M,{icon:(0,I.jsx)(Ce,{}),label:`开始日期`,children:(0,I.jsx)(v,{value:c.startDate??``,onChange:e=>h({startDate:e}),className:`${Ee} tabular-nums`})}),(0,I.jsx)(M,{icon:(0,I.jsx)(Ce,{}),label:`截止日期`,children:(0,I.jsx)(v,{value:c.dueDate??``,onChange:e=>h({dueDate:e}),className:`${Ee} tabular-nums`})}),(0,I.jsx)(M,{icon:(0,I.jsx)(N,{}),label:`待办周期`,children:(0,I.jsx)(`div`,{className:`px-2 pt-1.5 text-sm text-stone-500`,children:oe===null?`—`:`${oe} 天`})}),(0,I.jsx)(M,{icon:(0,I.jsx)(N,{}),label:`剩余天数`,children:(0,I.jsx)(`div`,{className:`px-2 pt-1.5 text-sm text-stone-500`,children:ue||`—`})}),(0,I.jsx)(M,{icon:(0,I.jsx)(j,{}),label:`备注`,children:(0,I.jsx)(`textarea`,{value:c.note??``,onChange:e=>h({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,I.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,I.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-stone-100 px-6 py-3`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:o,disabled:f,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,I.jsx)(`button`,{type:`button`,onClick:()=>void x(),disabled:f,className:`h-8 rounded-lg bg-[#3370ff] px-4 text-sm font-medium text-white transition-colors hover:bg-[#2b5fd9] disabled:opacity-40`,children:f?`保存中…`:n?`保存`:`新建`})]})]})})]})}function z(){let[e,t]=(0,F.useState)(!1),[te,ne]=(0,F.useState)(!0),[l,re]=(0,F.useState)(null),[u,D]=(0,F.useState)([]),[k,Ce]=(0,F.useState)([]),[A,we]=(0,F.useState)(!1),[j,M]=(0,F.useState)(null),[N,Te]=(0,F.useState)(!1),[P,Ee]=(0,F.useState)(()=>c(Ue)),[R,We]=(0,F.useState)(()=>o(He,Ve,`all`)),[z,Ye]=(0,F.useState)(()=>o(Fe,Pe,`status`)),[Xe,Ze]=(0,F.useState)({}),[B,Qe]=(0,F.useState)({});function $e(e){s(Fe,e),Ye(e)}function et(e){s(He,e),We(e)}function tt(e){ee(Ue,e),Ee(e)}let[nt,rt]=(0,F.useState)({}),[V,H]=(0,F.useState)(null),[U,W]=(0,F.useState)(null),[it,at]=(0,F.useState)(!1),[ot,st]=(0,F.useState)(null),G=(0,F.useRef)(!0),ct=(0,F.useRef)(!1),K=(0,F.useRef)(!1),q=ae(`lh:todos:cols:v1`,Oe),lt=m(`todos`),ut=V!==null,dt=(0,F.useRef)(V);dt.current=V;let ft=(0,F.useRef)(!1),pt=(0,F.useRef)(async()=>{});pt.current=xt,(0,F.useEffect)(()=>(G.current=!0,()=>{G.current=!1}),[]),(0,F.useEffect)(()=>{if(!ut)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=dt.current;if(!n)return;if(n.title.trim()){pt.current();return}let r=E();!n.note.trim()&&!n.taskId&&n.status===n.baseStatus&&n.priority===n.basePriority&&n.startDate===r&&n.dueDate===r&&H(null)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[ut]);let J=(0,F.useCallback)(async()=>{try{let[e,t]=await Promise.all([pe(),A?be().catch(()=>[]):Promise.resolve([])]);if(!G.current)return;let n=t;if(!ct.current&&A){ct.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=>ye(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)}}D(e),Ce(n),M(null)}catch(e){if(!G.current)return;M(e instanceof Error?e.message:String(e))}},[A]);(0,F.useEffect)(()=>{let e=i(e=>{ne(!!e.todos),we(!!e.tasks)});return n().then(()=>{ne(r(`todos`)),we(r(`tasks`)),t(!0)}),e},[]),(0,F.useEffect)(()=>{e&&te&&(async()=>{let e=await xe();G.current&&(e?(await J(),G.current&&re(!0)):re(!1))})()},[e,te,J]),(0,F.useEffect)(()=>{if(l!==!0)return;let e=window.setInterval(()=>{K.current||J()},De),t=()=>{K.current||J()};return window.addEventListener(`focus`,t),()=>{window.clearInterval(e),window.removeEventListener(`focus`,t)}},[l,J]),(0,F.useEffect)(()=>{if(!A||l!==!0||k.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=k.find(e=>e.title.trim()===t.linkedTask.trim());if(e)try{n.push(await w(t.id,{taskId:e.id}))}catch{}}!t&&n.length&&D(e=>e.map(e=>n.find(t=>t.id===e.id)??e))})(),()=>{t=!0}},[A,l,u,k]);function mt(e,t,n){rt(r=>({...r,[e]:{...r[e],[t]:n}}))}function Y(e){rt(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})}let ht=(0,F.useMemo)(()=>[{value:``,label:`不关联`},...ve(k.filter(e=>e.status!==`closed`&&e.status!==`cancelled`)).map(e=>({value:e.id,label:e.title}))],[k]);function gt(e){return e.taskId?k.find(t=>t.id===e.taskId)?.title??e.linkedTask:e.linkedTask}function _t(e){return e.taskId?k.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&&!S(n.status)&&(t.startDate!==void 0||t.dueDate!==void 0)&&t.status===void 0){let e=C(t.startDate??n.startDate,t.dueDate??n.dueDate);e&&(r.status=e)}D(t=>t.map(t=>t.id===e?{...t,...r,updatedAt:new Date().toISOString()}:t));try{let t=await w(e,r);if(!G.current)return;D(n=>n.map(n=>n.id===e?t:n)),M(null),r.taskId&&await J()}catch(e){M(e instanceof Error?e.message:String(e)),await J()}}async function yt(e){let t=nt[e],n=u.find(t=>t.id===e);if(!t||!n)return;let r={},i=n;for(let e of ke){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())M(`待办名称不能为空`),Y(e);else try{let t=await w(e,r);if(!G.current)return;D(n=>n.map(n=>n.id===e?t:n)),rt(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}}),M(null)}catch(t){M(t instanceof Error?t.message:String(t)),Y(e)}}function bt(e){let t=E(),n=E(),r=!!e.newStatus,i=C(t,n)??`in_progress`,a=e.newStatus??i,o=e.newPriority??``;H({groupKey:e.key,title:``,status:a,statusManual:r,priority:o,taskId:``,startDate:t,dueDate:n,note:``,baseStatus:a,basePriority:o}),Ze(t=>({...t,[e.key]:!1}))}async function xt(){let e=dt.current;if(!e||ft.current)return;let t=e.title.trim();if(t){ft.current=!0,at(!0);try{let n=k.find(t=>t.id===e.taskId);await Se([{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`}),dt.current===e&&H(null),M(null),await J()}catch(e){M(e instanceof Error?e.message:String(e))}finally{ft.current=!1,G.current&&at(!1)}}}async function St(){let e=U;if(e){W(null),Te(!0),M(null);try{await he(e.map(e=>e.id)),Qe({}),await J(),b(e.length>1?`已删除 ${e.length} 条待办`:`已删除待办`,`success`)}catch(e){let t=e instanceof Error?e.message:String(e);M(t),b(`删除待办失败:${t}`,`error`)}finally{G.current&&Te(!1)}}}let Z=E(),Ct=(0,F.useMemo)(()=>u.map(e=>{let t=e.taskId?k.find(t=>t.id===e.taskId):void 0;return t?{...e,priority:t.priority}:e}),[u,k]),wt=(0,F.useMemo)(()=>ge(Ct,{status:`all`,priority:R,keyword:P,today:Z}),[Ct,R,P,Z]),Q=(0,F.useMemo)(()=>ue(wt),[wt]),Tt=(0,F.useMemo)(()=>z===`none`?[{key:`all`,label:`全部待办`,pill:`bg-stone-500 text-white`,items:Q}]:z===`priority`?[..._e,``].map(e=>({key:`priority:${e||`none`}`,label:e?O[e]:`未设置`,pill:e?L[e]:`bg-stone-300 text-stone-600`,items:Q.filter(t=>t.priority===e),newPriority:e})):Ie.map(e=>({key:`status:${e}`,label:T[e],pill:Ae[e],items:Q.filter(t=>x(t,Z)===e),newStatus:e===`overdue`?`pending`:e})),[z,Q,Z]).filter(e=>e.items.length>0||V?.groupKey===e.key&&!!V),Et=Object.keys(B).filter(e=>B[e]),$=(0,F.useMemo)(()=>{let e={total:u.length,pending:0,in_progress:0,done:0,overdue:0};for(let t of u){let n=x(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,I.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,I.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,I.jsx)(`span`,{className:`tw-lib-spin`,"aria-hidden":`true`})})}):l?(0,I.jsxs)(`section`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-stone-200 bg-white`,children:[(0,I.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-3 border-b border-stone-100 px-4 py-3`,children:[(0,I.jsxs)(`div`,{className:`text-sm text-stone-600`,children:[`共 `,(0,I.jsx)(`span`,{className:`font-medium text-stone-800`,children:$.total}),` 条`,(0,I.jsxs)(`span`,{className:`text-stone-400`,children:[` `,`· 待开始 `,$.pending,` · 进行中 `,$.in_progress,` · 已完成 `,$.done,$.overdue?` · 已延期 ${$.overdue}`:``]})]}),(0,I.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(`input`,{value:P,onChange:e=>tt(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,I.jsx)(y,{flat:!0,className:`w-[132px]`,ariaLabel:`分组方式`,options:ze,value:z,onChange:e=>$e(e)}),(0,I.jsx)(y,{flat:!0,className:`w-[136px]`,ariaLabel:`紧急程度筛选`,options:Be,value:R,onChange:e=>et(e)}),(0,I.jsx)(`button`,{type:`button`,disabled:N||Et.length===0,onClick:()=>W(u.filter(e=>B[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,I.jsx)(`button`,{type:`button`,disabled:N,onClick:()=>st({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:`+ 新建待办`})]})]}),j?(0,I.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,I.jsx)(`span`,{className:`min-w-0 flex-1`,children:j}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>M(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,I.jsx)(`div`,{ref:lt,className:`tw-scroll-x min-h-0 flex-1 overflow-auto`,onFocusCapture:()=>{K.current=!0},onBlurCapture:()=>{window.setTimeout(()=>{K.current=!!document.activeElement?.closest(`.tw-todo-table`)},0)},children:(0,I.jsxs)(`table`,{className:`tw-todo-table tw-sticky-table w-full table-fixed text-sm`,style:q.tableStyle,children:[(0,I.jsx)(`colgroup`,{children:Oe.map(e=>(0,I.jsx)(`col`,{style:q.widthOf(e.key)?{width:q.widthOf(e.key)}:void 0},e.key))}),(0,I.jsx)(`thead`,{className:`tw-table-head sticky top-0 z-10 text-xs text-stone-500`,children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{className:f,children:(0,I.jsx)(`input`,{type:`checkbox`,"aria-label":`全选可见待办`,checked:Q.length>0&&Q.every(e=>B[e.id]),onChange:e=>{let t=e.target.checked;Qe(e=>{let n={...e};for(let e of Q)t?n[e.id]=!0:delete n[e.id];return n})}})}),(0,I.jsx)(`th`,{className:se,style:{"--tw-sticky-left":`32px`},"aria-label":`行号`}),(0,I.jsxs)(`th`,{className:oe,style:{"--tw-sticky-left":`68px`},children:[`待办名称`,(0,I.jsx)(_,{...q.resizeProps(`title`)})]}),(0,I.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`待办状态`,(0,I.jsx)(_,{...q.resizeProps(`status`)})]}),(0,I.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`所属任务`,(0,I.jsx)(_,{...q.resizeProps(`task`)})]}),(0,I.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`紧急程度`,(0,I.jsx)(_,{...q.resizeProps(`priority`)})]}),(0,I.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`开始日期`,(0,I.jsx)(_,{...q.resizeProps(`start`)})]}),(0,I.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`截止日期`,(0,I.jsx)(_,{...q.resizeProps(`due`)})]}),(0,I.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`结束日期`,(0,I.jsx)(_,{...q.resizeProps(`end`)})]}),(0,I.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`周期`,(0,I.jsx)(_,{...q.resizeProps(`cycle`)})]}),(0,I.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`剩余`,(0,I.jsx)(_,{...q.resizeProps(`remain`)})]}),(0,I.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`备注`,(0,I.jsx)(_,{...q.resizeProps(`note`)})]}),(0,I.jsx)(`th`,{"aria-hidden":`true`}),(0,I.jsx)(`th`,{className:p,children:`操作`})]})}),Tt.map(e=>{let t=Xe[e.key]===!0;return(0,I.jsxs)(`tbody`,{children:[(0,I.jsx)(`tr`,{className:`bg-white`,children:(0,I.jsx)(`td`,{colSpan:14,className:`px-2 py-0 pt-3 pb-1.5`,children:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>Ze(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,I.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,I.jsx)(`path`,{d:`m6 9 6 6 6-6`})}),(0,I.jsx)(`span`,{className:`rounded-md px-2 py-0.5 text-xs font-medium ${e.pill}`,children:e.label}),(0,I.jsxs)(`span`,{className:`text-xs text-stone-400 tabular-nums`,children:[e.items.length,` 条记录`]})]})})}),t?null:e.items.map((e,t)=>{let n=nt[e.id]??{},r={...e,...n},i=x(r,Z),a=de(r),o=me(r,Z),s=o===null?`—`:r.status===`done`?`已完成`:r.status===`cancelled`?`已取消`:o<0?`逾期 ${Math.abs(o)} 天`:o===0?`今天截止`:`${o} 天`;return(0,I.jsxs)(`tr`,{className:`group/row hover:bg-[#f7f8fa]`,children:[(0,I.jsx)(`td`,{className:h,children:(0,I.jsx)(`input`,{type:`checkbox`,"aria-label":`选择 ${e.title}`,checked:!!B[e.id],onChange:t=>Qe(n=>{let r={...n};return t.target.checked?r[e.id]=!0:delete r[e.id],r})})}),(0,I.jsx)(`td`,{className:`${g} text-xs text-stone-400 tabular-nums`,style:{"--tw-sticky-left":`32px`},children:t+1}),(0,I.jsx)(`td`,{className:h,style:{"--tw-sticky-left":`68px`},children:(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[e.source===`ai`?(0,I.jsx)(`span`,{className:`shrink-0 rounded bg-[#e1eaff] px-1 py-px text-[10px] text-[#1f4ec2]`,title:`AI 记录`,children:`AI`}):null,(0,I.jsx)(Ge,{value:r.title,placeholder:`输入待办名称`,onChange:t=>mt(e.id,`title`,t),onCommit:()=>void yt(e.id),onCancel:()=>Y(e.id)})]})}),(0,I.jsx)(`td`,{className:`px-1.5 py-1 align-middle`,children:(0,I.jsx)(y,{unstyled:!0,hideChevron:!0,centerContent:!0,ariaLabel:`待办状态`,menuMinWidth:120,options:Le,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 ${je[i]}`,renderTrigger:()=>(0,I.jsx)(`span`,{className:`truncate`,children:T[i]}),renderOptionPrefix:e=>(0,I.jsx)(`span`,{className:`h-2 w-2 rounded-full ${Me[e.value]}`})})}),(0,I.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:A?(0,I.jsx)(y,{unstyled:!0,searchable:!0,searchPlaceholder:`搜索任务…`,ariaLabel:`所属任务`,menuMinWidth:220,options:ht,value:r.taskId,onChange:t=>{let n=k.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,I.jsx)(le,{text:gt(r)||`未关联`,className:`min-w-0 truncate ${gt(r)?`text-stone-800`:`text-stone-300`}`})}):(0,I.jsx)(`span`,{className:`block truncate px-1.5 text-xs text-stone-400`,children:gt(r)?`${gt(r)} · 插件未启用`:`任务管理插件未启用`})}),(0,I.jsx)(`td`,{className:`px-1.5 py-1 align-middle`,children:_t(r)?(0,I.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 ${L[vt(r)]??`text-stone-300`}`,children:vt(r)?O[vt(r)]:`未设置`}):(0,I.jsx)(y,{unstyled:!0,hideChevron:!0,centerContent:!0,ariaLabel:`紧急程度`,menuMinWidth:128,options:Re,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 ${L[e.priority]}`,renderTrigger:()=>(0,I.jsx)(`span`,{className:`truncate`,children:e.priority?O[e.priority]:`未设置`}),renderOptionPrefix:e=>(0,I.jsx)(`span`,{className:`h-2 w-2 rounded-full ${Ne[e.value]}`})})}),(0,I.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,I.jsx)(qe,{value:r.startDate,onChange:t=>void X(e.id,{startDate:t})})}),(0,I.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,I.jsx)(qe,{value:r.dueDate,onChange:t=>void X(e.id,{dueDate:t})})}),(0,I.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap tabular-nums`,children:fe(r)?(0,I.jsx)(`span`,{className:`text-stone-500`,children:ce(fe(r))}):(0,I.jsx)(`span`,{className:`text-stone-400`,children:`待办未完成`})}),(0,I.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap text-stone-500 tabular-nums`,children:a===null?`—`:`${a} 天`}),(0,I.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,I.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,I.jsx)(Ke,{value:r.note,onChange:t=>mt(e.id,`note`,t),onCommit:()=>void yt(e.id),onCancel:()=>Y(e.id)})}),(0,I.jsx)(`td`,{"aria-hidden":`true`}),(0,I.jsx)(`td`,{className:ie,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>st({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,I.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,I.jsx)(`path`,{d:`M14 4h6v6`}),(0,I.jsx)(`path`,{d:`M20 4 13 11`}),(0,I.jsx)(`path`,{d:`M10 20H4v-6`}),(0,I.jsx)(`path`,{d:`M4 20l7-7`})]})}),(0,I.jsx)(`button`,{type:`button`,disabled:N,onClick:()=>W([e]),"aria-label":`删除 ${e.title}`,className:`tw-icon-danger rounded p-1`,children:(0,I.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,I.jsx)(`path`,{d:`M3 6h18`}),(0,I.jsx)(`path`,{d:`M8 6V4h8v2`}),(0,I.jsx)(`path`,{d:`M19 6l-1 14H6L5 6`}),(0,I.jsx)(`path`,{d:`M10 11v6M14 11v6`})]})})]})})]},e.id)}),t?null:V?.groupKey===e.key?(0,I.jsxs)(`tr`,{className:`tw-new-row`,children:[(0,I.jsx)(`td`,{className:`px-2 py-1 align-middle`}),(0,I.jsx)(`td`,{className:`px-1 py-1 align-middle text-xs text-stone-400 tabular-nums`,children:e.items.length+1}),(0,I.jsx)(`td`,{className:g,children:(0,I.jsx)(`input`,{autoFocus:!0,value:V.title,disabled:it,placeholder:`输入待办名称,回车或点空白处保存`,onChange:e=>H(t=>t&&{...t,title:e.target.value}),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),xt()):e.key===`Escape`&&(e.preventDefault(),H(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,I.jsx)(`td`,{className:`px-1.5 py-1 align-middle`,children:(0,I.jsx)(y,{unstyled:!0,hideChevron:!0,centerContent:!0,ariaLabel:`待办状态`,menuMinWidth:120,options:Le,value:V.status,onChange:e=>H(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 ${je[V.status]}`,renderTrigger:()=>(0,I.jsx)(`span`,{className:`truncate`,children:T[V.status]})})}),(0,I.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:A?(0,I.jsx)(y,{unstyled:!0,searchable:!0,searchPlaceholder:`搜索任务…`,ariaLabel:`所属任务`,menuMinWidth:220,options:ht,value:V.taskId,onChange:e=>H(t=>{if(!t)return t;let n=k.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=k.find(e=>e.id===V.taskId);return(0,I.jsx)(le,{text:e?.title||`未关联`,className:`min-w-0 truncate ${e?`text-stone-800`:`text-stone-300`}`})}}):(0,I.jsx)(`span`,{className:`block truncate px-1.5 text-xs text-stone-400`,children:`任务管理插件未启用`})}),(0,I.jsx)(`td`,{className:`px-1.5 py-1 align-middle`,children:(()=>{let e=k.find(e=>e.id===V.taskId);return e?(0,I.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 ${L[e.priority]??`text-stone-300`}`,children:e.priority?O[e.priority]:`未设置`}):(0,I.jsx)(y,{unstyled:!0,hideChevron:!0,centerContent:!0,ariaLabel:`紧急程度`,menuMinWidth:128,options:Re,value:V.priority,onChange:e=>H(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 ${L[V.priority]}`,renderTrigger:()=>(0,I.jsx)(`span`,{className:`truncate`,children:V.priority?O[V.priority]:`未设置`})})})()}),(0,I.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,I.jsx)(v,{value:V.startDate,onChange:e=>H(t=>{if(!t)return t;let n=e,r={...t,startDate:n};if(!t.statusManual&&!S(t.status)){let e=C(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,I.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,I.jsx)(v,{value:V.dueDate,onChange:e=>H(t=>{if(!t)return t;let n=e,r={...t,dueDate:n};if(!t.statusManual&&!S(t.status)){let e=C(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,I.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap tabular-nums`,children:S(V.status)?(0,I.jsx)(`span`,{className:`text-stone-500`,children:ce(E())}):(0,I.jsx)(`span`,{className:`text-stone-400`,children:`待办未完成`})}),(0,I.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap text-stone-400 tabular-nums`,children:`—`}),(0,I.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap text-stone-400 tabular-nums`,children:`—`}),(0,I.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,I.jsx)(`input`,{value:V.note,disabled:it,placeholder:`—`,onChange:e=>H(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,I.jsx)(`td`,{"aria-hidden":`true`}),(0,I.jsx)(`td`,{className:`px-1 py-1 align-middle`})]}):(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`td`,{className:`px-2 py-0.5`}),(0,I.jsx)(`td`,{className:`px-1 py-0.5`}),(0,I.jsx)(`td`,{className:`px-1 py-0.5`,colSpan:12,children:(0,I.jsxs)(`button`,{type:`button`,disabled:it,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,I.jsx)(`span`,{className:`text-sm leading-none`,children:`+`}),`新增记录`]})})]})]},e.key)}),Tt.length===0?(0,I.jsx)(`tbody`,{children:(0,I.jsx)(`tr`,{children:(0,I.jsx)(`td`,{colSpan:14,className:`px-3 py-16 text-center text-sm text-stone-400`,children:u.length===0?`还没有待办`:`没有匹配的待办,试试调整搜索或筛选`})})}):null]})}),(0,I.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,I.jsxs)(`span`,{children:[`共 `,Q.length,` 条`,Et.length?` · 已选 ${Et.length}`:``]}),(0,I.jsx)(`span`,{className:`ml-auto text-stone-400`,children:`点击单元格直接编辑,回车或点空白处保存`})]}),(0,I.jsx)(Je,{open:ot!==null,item:ot?.item??null,preset:ot?.preset,tasks:k,tasksOn:A,onClose:()=>st(null),onSaved:J}),(0,I.jsx)(d,{open:U!=null,title:U&&U.length>1?`批量删除`:`删除待办`,message:U&&U.length>1?`确认删除已选中的 ${U.length} 条待办?此操作不可恢复。`:`删除「${U?.[0]?.title??``}」?此操作不可恢复。`,confirmLabel:`删除`,cancelLabel:`取消`,danger:!0,onClose:()=>W(null),onConfirm:()=>void St()})]}):(0,I.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,I.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,I.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,I.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,I.jsx)(`span`,{className:`tw-lib-spin`,"aria-hidden":`true`})})})}export{z as default};
@@ -1,4 +1,4 @@
1
- import{s as e,t}from"./react.Blvh0GOs.js";import{i as n}from"./app-config.DAIyT--R.js";import{a as r,r as i,s as a,t as o}from"./view-prefs.DkS1ldnh.js";import{i as s,n as c,r as l,t as u}from"./dialog.DZHZCe_T.js";import{i as ee,n as d,r as te,t as f}from"./menu.Dnrpz489.js";import{t as ne}from"./jsx-runtime.DUg_B_vD.js";import{t as re}from"./ConfirmDialog.D5qXeML0.js";import{t as p}from"./OverflowHint.pvo2Xc8R.js";import{t as ie}from"./SelectDropdown.apWlFGbA.js";import{showToast as ae}from"./Toast.BO2NFckG.js";import{c as oe}from"./project-docs.DAw9bzgk.js";import{s as se}from"./llm.DyweO-KK.js";import{u as ce}from"./prompts-meta.C_MeYq8G.js";import{m as le,p as ue,u as de}from"./settings.DbhUT6Ao.js";import{S as fe,d as pe,g as m,k as h,l as me,m as he}from"./PmShared.Bwphj4KH.js";import{n as ge,t as g}from"./PromptMountDialog.CpTT6L0a.js";import{a as _e,n as ve,r as _,t as ye}from"./ui-auto-prompt.l_EXfDs5.js";import{S as be,_ as xe,a as Se,b as Ce,c as we,d as Te,f as Ee,h as De,i as Oe,l as ke,m as v,n as y,o as Ae,p as je,r as b,t as x,u as S,v as Me,x as Ne,y as Pe}from"./ui-auto.BmC9JJ_X.js";import{t as Fe}from"./hydrate-cache.C0F0L04c.js";var C=e(t(),1),Ie=`${y}/agent`;async function w(e,t){let n=await fetch(`${Ie}${e}`,{...t,headers:{"Content-Type":`application/json`,...t?.headers??{}}}),r=await n.text(),i=null;try{i=r?JSON.parse(r):null}catch{i=null}if(!n.ok){let e=(i&&typeof i==`object`&&`error`in i?String(i.error):``)||r.slice(0,300)||`请求失败(${n.status})`;throw Error(e)}return i??{}}async function Le(e){return w(`/prepare`,{method:`POST`,body:JSON.stringify(e)})}async function Re(e,t){return w(`/open`,{method:`POST`,body:JSON.stringify({sessionId:e,url:t})})}async function T(e,t={}){return w(`/snapshot`,{method:`POST`,body:JSON.stringify({sessionId:e,...t})})}async function E(e,t){return w(`/action`,{method:`POST`,body:JSON.stringify({sessionId:e,...t})})}async function D(e,t={}){return w(`/wait`,{method:`POST`,body:JSON.stringify({sessionId:e,...t})})}async function ze(e){return w(`/console`,{method:`POST`,body:JSON.stringify({sessionId:e})})}async function Be(e){return w(`/network`,{method:`POST`,body:JSON.stringify({sessionId:e})})}async function Ve(e,t,n){return w(`/probe`,{method:`POST`,body:JSON.stringify({sessionId:e,ref:t,stepId:n})})}async function He(e,t){return w(`/screenshot`,{method:`POST`,body:JSON.stringify({sessionId:e,label:t})})}async function Ue(e){await w(`/close`,{method:`POST`,body:JSON.stringify({sessionId:e})})}async function O(e){return w(`/save`,{method:`POST`,body:JSON.stringify(e)})}async function We(e,t,n={}){return w(`/emit`,{method:`POST`,body:JSON.stringify({ir:e,target:t,...n})})}async function k(e,t,n){return w(`/verify`,{method:`POST`,body:JSON.stringify({sessionId:e,ir:t,target:n,timeoutMs:18e4})})}async function Ge(e){return w(`/write`,{method:`POST`,body:JSON.stringify(e)})}async function Ke(e){return w(`/sessions?projectId=${encodeURIComponent(e)}`)}async function A(e){return w(`/session?id=${encodeURIComponent(e)}`)}async function qe(e,t){return w(`/debug`,{method:`POST`,body:JSON.stringify({sessionId:e,mode:t})})}async function Je(e){return w(`/debug/stop`,{method:`POST`,body:JSON.stringify({sessionId:e})})}async function Ye(e){return w(`/changes?sessionId=${encodeURIComponent(e)}`)}async function Xe(e){return w(`/reveal`,{method:`POST`,body:JSON.stringify(e)})}var j=null;async function Ze(e=!1){return(!j||e)&&(j=w(`/apps`).then(e=>({apps:e.apps??[],defaultId:e.defaultId??``})).catch(e=>{throw j=null,e})),j}async function Qe(e,t){return w(`/run-file`,{method:`POST`,body:JSON.stringify({sessionId:e,path:t,timeoutMs:18e4})})}async function $e(e){return w(`/draft/clean`,{method:`POST`,body:JSON.stringify({sessionId:e})})}var M={type:`string`,description:`快照里的 ref,例如 d1-e12。页面导航后会失效。`},et={type:`function`,function:{name:`ui_plan_steps`,description:`提交整份步骤计划(人可读的动作 + 目标描述,不含定位器)。这一步只做测试设计,不会打开浏览器。`,parameters:{type:`object`,properties:{title:{type:`string`,description:`用例标题,中文即可`},steps:{type:`array`,description:`按执行顺序排列的计划步骤`,items:{type:`object`,properties:{action:{type:`string`,enum:[`goto`,`click`,`fill`,`select`,`press`,`hover`,`expect`,`expectUrl`,`wait`],description:`测试动作;不要写「截图」——截图是探索时给人看的,不是测试步骤`},target:{type:`string`,description:`给人看的目标描述,例如「右上角的登录按钮」「用户名输入框」`},value:{type:`string`,description:"输入内容 / 选项;账号密码等占位数据写成 ${ENV_NAME}"},url:{type:`string`,description:`goto / expectUrl 的地址,相对路径即可`},note:{type:`string`,description:`补充说明,例如断言什么结果`}},required:[`action`,`target`]}}},required:[`steps`]}}},tt=[et],nt=[et,{type:`function`,function:{name:`ui_browser_open`,description:`在浏览器里打开一个地址(相对地址会用 baseURL 拼接),返回页面快照。`,parameters:{type:`object`,properties:{url:{type:`string`,description:`绝对地址或 / 开头的相对地址`}},required:[`url`]}}},{type:`function`,function:{name:`ui_browser_snapshot`,description:`重新获取当前页面快照。页面变化较大、或 ref 不确定时用。`,parameters:{type:`object`,properties:{depth:{type:`number`,description:`快照深度,默认 6,越大越啰嗦`},targetRef:{type:`string`,description:`只看某个元素的子树`}}}}},{type:`function`,function:{name:`ui_browser_click`,description:`点击一个元素。成功后会自动返回新快照。`,parameters:{type:`object`,properties:{ref:M,note:{type:`string`,description:`这一步在做什么`}},required:[`ref`]}}},{type:`function`,function:{name:`ui_browser_fill`,description:`填写输入框(会先清空已有内容)。`,parameters:{type:`object`,properties:{ref:M,text:{type:`string`,description:"要填入的内容;占位数据用 ${ENV_NAME} 表示环境变量"},note:{type:`string`}},required:[`ref`,`text`]}}},{type:`function`,function:{name:`ui_browser_select`,description:`选择下拉框选项(按 value 或可见文本)。`,parameters:{type:`object`,properties:{ref:M,value:{type:`string`},note:{type:`string`}},required:[`ref`,`value`]}}},{type:`function`,function:{name:`ui_browser_press`,description:`按一个键,例如 Enter / Tab / Escape。`,parameters:{type:`object`,properties:{key:{type:`string`},ref:{type:`string`}},required:[`key`]}}},{type:`function`,function:{name:`ui_browser_hover`,description:`悬停到元素上(用于展开菜单)。`,parameters:{type:`object`,properties:{ref:M,note:{type:`string`}},required:[`ref`]}}},{type:`function`,function:{name:`ui_browser_back`,description:`浏览器后退一步。`,parameters:{type:`object`,properties:{}}}},{type:`function`,function:{name:`ui_browser_wait`,description:`等待:给 text 时等到页面出现该文案(比死等毫秒可靠),否则等待指定毫秒。返回等待后的快照。`,parameters:{type:`object`,properties:{text:{type:`string`,description:`要等待出现的可见文案`},ms:{type:`number`,description:`没有 text 时等待的毫秒数`},timeout:{type:`number`,description:`等待 text 的超时毫秒数,默认 15000`}}}}},{type:`function`,function:{name:`ui_browser_screenshot`,description:`截一张当前页面图,给用户看(模型看不到图片内容)。`,parameters:{type:`object`,properties:{label:{type:`string`,description:`截图标签,例如 after-login`}}}}},{type:`function`,function:{name:`ui_browser_console`,description:`读取浏览器控制台里的 error / warning / pageerror(排查偶发失败用)。`,parameters:{type:`object`,properties:{}}}},{type:`function`,function:{name:`ui_browser_network`,description:`读取最近的失败请求(状态码 ≥ 400 或请求失败),用来判断是不是接口挂了。`,parameters:{type:`object`,properties:{}}}},{type:`function`,function:{name:`ui_locator_probe`,description:`把一个 ref 转成可写进脚本的定位器,并校验唯一性。写步骤之前,对每个要操作的元素都调用一次。`,parameters:{type:`object`,properties:{ref:M,stepId:{type:`string`,description:`可选:左侧计划里的步骤 id(如 p2)。传了会把定位器回填到该步骤。`}},required:[`ref`]}}},{type:`function`,function:{name:`ui_test_set_steps`,description:`提交 / 替换整份测试步骤(IR)。每次提交都会刷新右侧代码预览。先探索、再提交,不要凭想象写定位器。`,parameters:{type:`object`,properties:{title:{type:`string`,description:`用例标题,中文即可`},steps:{type:`array`,description:`按执行顺序排列的步骤`,items:{type:`object`,properties:{action:{type:`string`,enum:[`goto`,`click`,`fill`,`select`,`press`,`hover`,`expect`,`expectUrl`,`wait`,`screenshot`]},locator:{type:`object`,description:`定位器。首选 ui_locator_probe 给出的 recommended,不要自己拼长 CSS`,properties:{kind:{type:`string`,enum:[`testid`,`role`,`label`,`placeholder`,`text`,`attr`,`css`]},role:{type:`string`},name:{type:`string`},value:{type:`string`},attr:{type:`string`},exact:{type:`boolean`},nth:{type:`number`,description:`同名元素有多个时取第几个(0 = 第一个)。用 ui_locator_probe 返回的 nth,不要自己猜`}},required:[`kind`]},url:{type:`string`},value:{type:`string`,description:`输入内容 / 选项值 / 截图名`},key:{type:`string`},text:{type:`string`,description:`expect 时要断言的文本`},state:{type:`string`,enum:[`visible`,`hidden`]},ms:{type:`number`},note:{type:`string`},planStepId:{type:`string`,description:`可选:对应左侧计划步骤 id,便于逐条勾掉计划`}},required:[`action`]}}},required:[`steps`]}}},{type:`function`,function:{name:`ui_test_get_steps`,description:`读取当前已提交的步骤,改之前先看一眼。`,parameters:{type:`object`,properties:{}}}},{type:`function`,function:{name:`ui_test_verify`,description:`在临时目录试跑当前步骤对应的脚本,返回是否通过和日志尾部。`,parameters:{type:`object`,properties:{}}}}],rt=`浏览器已被关闭,这一轮探索已结束`;function it(e){if(!e||!e.includes(`error`))return!1;let t;try{t=JSON.parse(e)}catch{return!1}if(!t||typeof t!=`object`)return!1;let n=String(t.error??``);return n.includes(`浏览器已被关闭`)||n.includes(`浏览器进程已退出`)||n.includes(`Target page, context or browser has been closed`)}var N=(e,t)=>e.length>t?`${e.slice(0,t)}…(已截断)`:e;async function at(e,t,n){let r={};try{r=JSON.parse(t||`{}`)}catch{return JSON.stringify({error:`工具参数不是合法 JSON`})}let i=n.sessionId,a=e=>typeof r[e]==`string`?String(r[e]):``;try{if(e===`ui_plan_steps`){let e=Array.isArray(r.steps)?r.steps:[];if(!e.length){let e=await A(i).then(e=>e.session.plan??[]).catch(()=>[]);return JSON.stringify({ok:!0,stepCount:e.length,plan:e.map(e=>({id:e.id,action:e.action,target:e.target})),note:`没有提交新步骤,计划保持不变。`})}let t=(await O({sessionId:i,title:a(`title`)||void 0,plan:e,mergePlan:!0})).session.plan??[];return n.onPlan?.(t),JSON.stringify({ok:!0,stepCount:t.length,plan:t.map(e=>({id:e.id,action:e.action,target:e.target})),note:`计划已保存,用户可以在左侧调整。接下来开始探索:逐个 probe 并回填定位器。`})}if(e===`ui_browser_open`){let e=await Re(i,a(`url`));return JSON.stringify({url:e.url,title:e.title,elements:e.count,truncated:e.truncated,snapshot:N(e.snapshot,12e3)})}if(e===`ui_browser_snapshot`){let e=await T(i,{depth:Number(r.depth)||void 0,targetRef:a(`targetRef`)||void 0});return JSON.stringify({url:e.url,title:e.title,elements:e.count,truncated:e.truncated,snapshot:N(e.snapshot,12e3)})}if(e===`ui_browser_click`||e===`ui_browser_fill`||e===`ui_browser_select`||e===`ui_browser_hover`){let t=await E(i,{action:e.replace(`ui_browser_`,``),ref:a(`ref`),text:a(`text`),value:a(`value`),note:a(`note`)});return JSON.stringify({ok:!0,action:t.action,url:t.url,snapshot:N(t.snapshot,9e3)})}if(e===`ui_browser_press`){let e=await E(i,{action:`press`,ref:a(`ref`),key:a(`key`)});return JSON.stringify({ok:!0,url:e.url,snapshot:N(e.snapshot,9e3)})}if(e===`ui_browser_back`){let e=await E(i,{action:`back`});return JSON.stringify({ok:!0,url:e.url,snapshot:N(e.snapshot,9e3)})}if(e===`ui_browser_wait`){let e=await D(i,{text:a(`text`)||void 0,ms:Number(r.ms)||void 0,timeout:Number(r.timeout)||void 0});return JSON.stringify({ok:!0,action:e.action,url:e.url,snapshot:N(e.snapshot,9e3)})}if(e===`ui_browser_screenshot`){let e=await He(i,a(`label`)||`snapshot`);return n.onShot?.(e.url),JSON.stringify({ok:!0,url:e.url,note:`截图已显示在面板里;你看不到图片内容,需要判断结构请用快照。`})}if(e===`ui_browser_console`){let e=(await ze(i)).messages??[];return JSON.stringify(e.length?{count:e.length,messages:e.slice(-20)}:{count:0})}if(e===`ui_browser_network`){let e=(await Be(i)).requests??[];return JSON.stringify(e.length?{count:e.length,requests:e.slice(-20)}:{count:0})}if(e===`ui_locator_probe`){let e=a(`ref`);if(!e)return JSON.stringify({error:`缺少 ref`});let t=a(`stepId`),r=await Ve(i,e,t||void 0);return t&&r.plan&&n.onPlan?.(r.plan),JSON.stringify({ref:r.ref,element:r.element,confidence:r.confidence,recommended:r.recommended,fragile:!!r.fragile,warning:r.warning??``,candidates:r.candidates.slice(0,3),boundStep:r.planStep?{id:r.planStep.id,status:r.planStep.status}:void 0,note:r.confidence===`high`?`定位器唯一且指向同一元素,可以写进步骤`:r.recommended?`能用但不稳:${r.warning||`同名元素较多`}。照抄 recommended(含 nth),并补一条结果断言`:`没有唯一候选:换一个更具体的元素,或改成对结果文案的 expect`})}if(e===`ui_test_set_steps`){let e=Array.isArray(r.steps)?r.steps:[],t={title:a(`title`)||`未命名流程`,target:n.target,steps:e},o=await O({sessionId:i,title:t.title,ir:t}),s=o.session.ir??t,c=t.steps.length-s.steps.length;return n.onIr?.(s),n.onCode?.(o.code,o.suggestedPath),JSON.stringify({ok:!0,title:s.title,stepCount:s.steps.length,previewPath:o.suggestedPath,note:c?`步骤已保存,但有 ${c} 步被丢掉(动作不支持或没带 locator)。用 ui_test_get_steps 核对后重新提交;不要自己试跑,试跑由用户确认代码后手动发起。`:`步骤已保存,右侧代码预览已刷新。不要自己试跑:试跑由用户确认代码后手动发起。`})}if(e===`ui_test_get_steps`){let e=await A(i);return JSON.stringify({title:e.session.ir?.title??``,steps:e.session.ir?.steps??[],suggestedPath:e.suggestedPath})}if(e===`ui_test_verify`){let e=await k(i),t=String(e.log??``);return typeof e.code==`string`&&n.onCode?.(e.code,e.suggestedPath??``),JSON.stringify({passed:!!e.passed,exitCode:e.exitCode??null,timedOut:!!e.timedOut,durationMs:e.durationMs??0,draftPath:e.draftPath??``,tracePath:e.tracePath??``,log:N(t.slice(-4e3),4e3),note:e.passed?`试跑通过。草稿留在 .lantern-ai 里,用户可以直接看 trace / 用 Playwright UI 调试,确认后再写入项目。`:`试跑失败:只改步骤 IR(定位器 / 等待 / 断言)。草稿和 trace 会保留,用户能打开看现场;如果是功能本身不符合预期,不要为了跑绿改断言。`})}return JSON.stringify({error:`未知工具:${e}`})}catch(e){return JSON.stringify({error:e instanceof Error?e.message:String(e)})}}function ot(e){return e?.length?e.map((e,t)=>{let n=[`${t+1}. [${e.id}] ${e.action}`];return e.target&&n.push(`目标:${e.target}`),e.url&&n.push(`url=${e.url}`),e.value&&n.push(`值=${e.value}`),e.locator&&n.push(`已绑定 ${P(e.locator)}`),n.join(` · `)}).join(`
1
+ import{s as e,t}from"./react.Blvh0GOs.js";import{i as n}from"./app-config.DAIyT--R.js";import{a as r,r as i,s as a,t as o}from"./view-prefs.DkS1ldnh.js";import{i as s,n as c,r as l,t as u}from"./dialog.DZHZCe_T.js";import{i as ee,n as d,r as te,t as f}from"./menu.Dnrpz489.js";import{t as ne}from"./jsx-runtime.DUg_B_vD.js";import{t as re}from"./ConfirmDialog.D5qXeML0.js";import{t as p}from"./OverflowHint.pvo2Xc8R.js";import{t as ie}from"./SelectDropdown.apWlFGbA.js";import{showToast as ae}from"./Toast.BO2NFckG.js";import{c as oe}from"./project-docs.DAw9bzgk.js";import{s as se}from"./llm.DyweO-KK.js";import{u as ce}from"./prompts-meta.C_MeYq8G.js";import{m as le,p as ue,u as de}from"./settings.DbhUT6Ao.js";import{S as fe,d as pe,g as m,k as h,l as me,m as he}from"./PmShared.DRYCFoRc.js";import{n as ge,t as g}from"./PromptMountDialog.CpTT6L0a.js";import{a as _e,n as ve,r as _,t as ye}from"./ui-auto-prompt.l_EXfDs5.js";import{S as be,_ as xe,a as Se,b as Ce,c as we,d as Te,f as Ee,h as De,i as Oe,l as ke,m as v,n as y,o as Ae,p as je,r as b,t as x,u as S,v as Me,x as Ne,y as Pe}from"./ui-auto.BmC9JJ_X.js";import{t as Fe}from"./hydrate-cache.C0F0L04c.js";var C=e(t(),1),Ie=`${y}/agent`;async function w(e,t){let n=await fetch(`${Ie}${e}`,{...t,headers:{"Content-Type":`application/json`,...t?.headers??{}}}),r=await n.text(),i=null;try{i=r?JSON.parse(r):null}catch{i=null}if(!n.ok){let e=(i&&typeof i==`object`&&`error`in i?String(i.error):``)||r.slice(0,300)||`请求失败(${n.status})`;throw Error(e)}return i??{}}async function Le(e){return w(`/prepare`,{method:`POST`,body:JSON.stringify(e)})}async function Re(e,t){return w(`/open`,{method:`POST`,body:JSON.stringify({sessionId:e,url:t})})}async function T(e,t={}){return w(`/snapshot`,{method:`POST`,body:JSON.stringify({sessionId:e,...t})})}async function E(e,t){return w(`/action`,{method:`POST`,body:JSON.stringify({sessionId:e,...t})})}async function D(e,t={}){return w(`/wait`,{method:`POST`,body:JSON.stringify({sessionId:e,...t})})}async function ze(e){return w(`/console`,{method:`POST`,body:JSON.stringify({sessionId:e})})}async function Be(e){return w(`/network`,{method:`POST`,body:JSON.stringify({sessionId:e})})}async function Ve(e,t,n){return w(`/probe`,{method:`POST`,body:JSON.stringify({sessionId:e,ref:t,stepId:n})})}async function He(e,t){return w(`/screenshot`,{method:`POST`,body:JSON.stringify({sessionId:e,label:t})})}async function Ue(e){await w(`/close`,{method:`POST`,body:JSON.stringify({sessionId:e})})}async function O(e){return w(`/save`,{method:`POST`,body:JSON.stringify(e)})}async function We(e,t,n={}){return w(`/emit`,{method:`POST`,body:JSON.stringify({ir:e,target:t,...n})})}async function k(e,t,n){return w(`/verify`,{method:`POST`,body:JSON.stringify({sessionId:e,ir:t,target:n,timeoutMs:18e4})})}async function Ge(e){return w(`/write`,{method:`POST`,body:JSON.stringify(e)})}async function Ke(e){return w(`/sessions?projectId=${encodeURIComponent(e)}`)}async function A(e){return w(`/session?id=${encodeURIComponent(e)}`)}async function qe(e,t){return w(`/debug`,{method:`POST`,body:JSON.stringify({sessionId:e,mode:t})})}async function Je(e){return w(`/debug/stop`,{method:`POST`,body:JSON.stringify({sessionId:e})})}async function Ye(e){return w(`/changes?sessionId=${encodeURIComponent(e)}`)}async function Xe(e){return w(`/reveal`,{method:`POST`,body:JSON.stringify(e)})}var j=null;async function Ze(e=!1){return(!j||e)&&(j=w(`/apps`).then(e=>({apps:e.apps??[],defaultId:e.defaultId??``})).catch(e=>{throw j=null,e})),j}async function Qe(e,t){return w(`/run-file`,{method:`POST`,body:JSON.stringify({sessionId:e,path:t,timeoutMs:18e4})})}async function $e(e){return w(`/draft/clean`,{method:`POST`,body:JSON.stringify({sessionId:e})})}var M={type:`string`,description:`快照里的 ref,例如 d1-e12。页面导航后会失效。`},et={type:`function`,function:{name:`ui_plan_steps`,description:`提交整份步骤计划(人可读的动作 + 目标描述,不含定位器)。这一步只做测试设计,不会打开浏览器。`,parameters:{type:`object`,properties:{title:{type:`string`,description:`用例标题,中文即可`},steps:{type:`array`,description:`按执行顺序排列的计划步骤`,items:{type:`object`,properties:{action:{type:`string`,enum:[`goto`,`click`,`fill`,`select`,`press`,`hover`,`expect`,`expectUrl`,`wait`],description:`测试动作;不要写「截图」——截图是探索时给人看的,不是测试步骤`},target:{type:`string`,description:`给人看的目标描述,例如「右上角的登录按钮」「用户名输入框」`},value:{type:`string`,description:"输入内容 / 选项;账号密码等占位数据写成 ${ENV_NAME}"},url:{type:`string`,description:`goto / expectUrl 的地址,相对路径即可`},note:{type:`string`,description:`补充说明,例如断言什么结果`}},required:[`action`,`target`]}}},required:[`steps`]}}},tt=[et],nt=[et,{type:`function`,function:{name:`ui_browser_open`,description:`在浏览器里打开一个地址(相对地址会用 baseURL 拼接),返回页面快照。`,parameters:{type:`object`,properties:{url:{type:`string`,description:`绝对地址或 / 开头的相对地址`}},required:[`url`]}}},{type:`function`,function:{name:`ui_browser_snapshot`,description:`重新获取当前页面快照。页面变化较大、或 ref 不确定时用。`,parameters:{type:`object`,properties:{depth:{type:`number`,description:`快照深度,默认 6,越大越啰嗦`},targetRef:{type:`string`,description:`只看某个元素的子树`}}}}},{type:`function`,function:{name:`ui_browser_click`,description:`点击一个元素。成功后会自动返回新快照。`,parameters:{type:`object`,properties:{ref:M,note:{type:`string`,description:`这一步在做什么`}},required:[`ref`]}}},{type:`function`,function:{name:`ui_browser_fill`,description:`填写输入框(会先清空已有内容)。`,parameters:{type:`object`,properties:{ref:M,text:{type:`string`,description:"要填入的内容;占位数据用 ${ENV_NAME} 表示环境变量"},note:{type:`string`}},required:[`ref`,`text`]}}},{type:`function`,function:{name:`ui_browser_select`,description:`选择下拉框选项(按 value 或可见文本)。`,parameters:{type:`object`,properties:{ref:M,value:{type:`string`},note:{type:`string`}},required:[`ref`,`value`]}}},{type:`function`,function:{name:`ui_browser_press`,description:`按一个键,例如 Enter / Tab / Escape。`,parameters:{type:`object`,properties:{key:{type:`string`},ref:{type:`string`}},required:[`key`]}}},{type:`function`,function:{name:`ui_browser_hover`,description:`悬停到元素上(用于展开菜单)。`,parameters:{type:`object`,properties:{ref:M,note:{type:`string`}},required:[`ref`]}}},{type:`function`,function:{name:`ui_browser_back`,description:`浏览器后退一步。`,parameters:{type:`object`,properties:{}}}},{type:`function`,function:{name:`ui_browser_wait`,description:`等待:给 text 时等到页面出现该文案(比死等毫秒可靠),否则等待指定毫秒。返回等待后的快照。`,parameters:{type:`object`,properties:{text:{type:`string`,description:`要等待出现的可见文案`},ms:{type:`number`,description:`没有 text 时等待的毫秒数`},timeout:{type:`number`,description:`等待 text 的超时毫秒数,默认 15000`}}}}},{type:`function`,function:{name:`ui_browser_screenshot`,description:`截一张当前页面图,给用户看(模型看不到图片内容)。`,parameters:{type:`object`,properties:{label:{type:`string`,description:`截图标签,例如 after-login`}}}}},{type:`function`,function:{name:`ui_browser_console`,description:`读取浏览器控制台里的 error / warning / pageerror(排查偶发失败用)。`,parameters:{type:`object`,properties:{}}}},{type:`function`,function:{name:`ui_browser_network`,description:`读取最近的失败请求(状态码 ≥ 400 或请求失败),用来判断是不是接口挂了。`,parameters:{type:`object`,properties:{}}}},{type:`function`,function:{name:`ui_locator_probe`,description:`把一个 ref 转成可写进脚本的定位器,并校验唯一性。写步骤之前,对每个要操作的元素都调用一次。`,parameters:{type:`object`,properties:{ref:M,stepId:{type:`string`,description:`可选:左侧计划里的步骤 id(如 p2)。传了会把定位器回填到该步骤。`}},required:[`ref`]}}},{type:`function`,function:{name:`ui_test_set_steps`,description:`提交 / 替换整份测试步骤(IR)。每次提交都会刷新右侧代码预览。先探索、再提交,不要凭想象写定位器。`,parameters:{type:`object`,properties:{title:{type:`string`,description:`用例标题,中文即可`},steps:{type:`array`,description:`按执行顺序排列的步骤`,items:{type:`object`,properties:{action:{type:`string`,enum:[`goto`,`click`,`fill`,`select`,`press`,`hover`,`expect`,`expectUrl`,`wait`,`screenshot`]},locator:{type:`object`,description:`定位器。首选 ui_locator_probe 给出的 recommended,不要自己拼长 CSS`,properties:{kind:{type:`string`,enum:[`testid`,`role`,`label`,`placeholder`,`text`,`attr`,`css`]},role:{type:`string`},name:{type:`string`},value:{type:`string`},attr:{type:`string`},exact:{type:`boolean`},nth:{type:`number`,description:`同名元素有多个时取第几个(0 = 第一个)。用 ui_locator_probe 返回的 nth,不要自己猜`}},required:[`kind`]},url:{type:`string`},value:{type:`string`,description:`输入内容 / 选项值 / 截图名`},key:{type:`string`},text:{type:`string`,description:`expect 时要断言的文本`},state:{type:`string`,enum:[`visible`,`hidden`]},ms:{type:`number`},note:{type:`string`},planStepId:{type:`string`,description:`可选:对应左侧计划步骤 id,便于逐条勾掉计划`}},required:[`action`]}}},required:[`steps`]}}},{type:`function`,function:{name:`ui_test_get_steps`,description:`读取当前已提交的步骤,改之前先看一眼。`,parameters:{type:`object`,properties:{}}}},{type:`function`,function:{name:`ui_test_verify`,description:`在临时目录试跑当前步骤对应的脚本,返回是否通过和日志尾部。`,parameters:{type:`object`,properties:{}}}}],rt=`浏览器已被关闭,这一轮探索已结束`;function it(e){if(!e||!e.includes(`error`))return!1;let t;try{t=JSON.parse(e)}catch{return!1}if(!t||typeof t!=`object`)return!1;let n=String(t.error??``);return n.includes(`浏览器已被关闭`)||n.includes(`浏览器进程已退出`)||n.includes(`Target page, context or browser has been closed`)}var N=(e,t)=>e.length>t?`${e.slice(0,t)}…(已截断)`:e;async function at(e,t,n){let r={};try{r=JSON.parse(t||`{}`)}catch{return JSON.stringify({error:`工具参数不是合法 JSON`})}let i=n.sessionId,a=e=>typeof r[e]==`string`?String(r[e]):``;try{if(e===`ui_plan_steps`){let e=Array.isArray(r.steps)?r.steps:[];if(!e.length){let e=await A(i).then(e=>e.session.plan??[]).catch(()=>[]);return JSON.stringify({ok:!0,stepCount:e.length,plan:e.map(e=>({id:e.id,action:e.action,target:e.target})),note:`没有提交新步骤,计划保持不变。`})}let t=(await O({sessionId:i,title:a(`title`)||void 0,plan:e,mergePlan:!0})).session.plan??[];return n.onPlan?.(t),JSON.stringify({ok:!0,stepCount:t.length,plan:t.map(e=>({id:e.id,action:e.action,target:e.target})),note:`计划已保存,用户可以在左侧调整。接下来开始探索:逐个 probe 并回填定位器。`})}if(e===`ui_browser_open`){let e=await Re(i,a(`url`));return JSON.stringify({url:e.url,title:e.title,elements:e.count,truncated:e.truncated,snapshot:N(e.snapshot,12e3)})}if(e===`ui_browser_snapshot`){let e=await T(i,{depth:Number(r.depth)||void 0,targetRef:a(`targetRef`)||void 0});return JSON.stringify({url:e.url,title:e.title,elements:e.count,truncated:e.truncated,snapshot:N(e.snapshot,12e3)})}if(e===`ui_browser_click`||e===`ui_browser_fill`||e===`ui_browser_select`||e===`ui_browser_hover`){let t=await E(i,{action:e.replace(`ui_browser_`,``),ref:a(`ref`),text:a(`text`),value:a(`value`),note:a(`note`)});return JSON.stringify({ok:!0,action:t.action,url:t.url,snapshot:N(t.snapshot,9e3)})}if(e===`ui_browser_press`){let e=await E(i,{action:`press`,ref:a(`ref`),key:a(`key`)});return JSON.stringify({ok:!0,url:e.url,snapshot:N(e.snapshot,9e3)})}if(e===`ui_browser_back`){let e=await E(i,{action:`back`});return JSON.stringify({ok:!0,url:e.url,snapshot:N(e.snapshot,9e3)})}if(e===`ui_browser_wait`){let e=await D(i,{text:a(`text`)||void 0,ms:Number(r.ms)||void 0,timeout:Number(r.timeout)||void 0});return JSON.stringify({ok:!0,action:e.action,url:e.url,snapshot:N(e.snapshot,9e3)})}if(e===`ui_browser_screenshot`){let e=await He(i,a(`label`)||`snapshot`);return n.onShot?.(e.url),JSON.stringify({ok:!0,url:e.url,note:`截图已显示在面板里;你看不到图片内容,需要判断结构请用快照。`})}if(e===`ui_browser_console`){let e=(await ze(i)).messages??[];return JSON.stringify(e.length?{count:e.length,messages:e.slice(-20)}:{count:0})}if(e===`ui_browser_network`){let e=(await Be(i)).requests??[];return JSON.stringify(e.length?{count:e.length,requests:e.slice(-20)}:{count:0})}if(e===`ui_locator_probe`){let e=a(`ref`);if(!e)return JSON.stringify({error:`缺少 ref`});let t=a(`stepId`),r=await Ve(i,e,t||void 0);return t&&r.plan&&n.onPlan?.(r.plan),JSON.stringify({ref:r.ref,element:r.element,confidence:r.confidence,recommended:r.recommended,fragile:!!r.fragile,warning:r.warning??``,candidates:r.candidates.slice(0,3),boundStep:r.planStep?{id:r.planStep.id,status:r.planStep.status}:void 0,note:r.confidence===`high`?`定位器唯一且指向同一元素,可以写进步骤`:r.recommended?`能用但不稳:${r.warning||`同名元素较多`}。照抄 recommended(含 nth),并补一条结果断言`:`没有唯一候选:换一个更具体的元素,或改成对结果文案的 expect`})}if(e===`ui_test_set_steps`){let e=Array.isArray(r.steps)?r.steps:[],t={title:a(`title`)||`未命名流程`,target:n.target,steps:e},o=await O({sessionId:i,title:t.title,ir:t}),s=o.session.ir??t,c=t.steps.length-s.steps.length;return n.onIr?.(s),n.onCode?.(o.code,o.suggestedPath),JSON.stringify({ok:!0,title:s.title,stepCount:s.steps.length,previewPath:o.suggestedPath,note:c?`步骤已保存,但有 ${c} 步被丢掉(动作不支持或没带 locator)。用 ui_test_get_steps 核对后重新提交;不要自己试跑,试跑由用户确认代码后手动发起。`:`步骤已保存,右侧代码预览已刷新。不要自己试跑:试跑由用户确认代码后手动发起。`})}if(e===`ui_test_get_steps`){let e=await A(i);return JSON.stringify({title:e.session.ir?.title??``,steps:e.session.ir?.steps??[],suggestedPath:e.suggestedPath})}if(e===`ui_test_verify`){let e=await k(i),t=String(e.log??``);return typeof e.code==`string`&&n.onCode?.(e.code,e.suggestedPath??``),JSON.stringify({passed:!!e.passed,exitCode:e.exitCode??null,timedOut:!!e.timedOut,durationMs:e.durationMs??0,draftPath:e.draftPath??``,tracePath:e.tracePath??``,log:N(t.slice(-4e3),4e3),note:e.passed?`试跑通过。草稿留在 .lantern-ai 里,用户可以直接看 trace / 用 Playwright UI 调试,确认后再写入项目。`:`试跑失败:只改步骤 IR(定位器 / 等待 / 断言)。草稿和 trace 会保留,用户能打开看现场;如果是功能本身不符合预期,不要为了跑绿改断言。`})}return JSON.stringify({error:`未知工具:${e}`})}catch(e){return JSON.stringify({error:e instanceof Error?e.message:String(e)})}}function ot(e){return e?.length?e.map((e,t)=>{let n=[`${t+1}. [${e.id}] ${e.action}`];return e.target&&n.push(`目标:${e.target}`),e.url&&n.push(`url=${e.url}`),e.value&&n.push(`值=${e.value}`),e.locator&&n.push(`已绑定 ${P(e.locator)}`),n.join(` · `)}).join(`
2
2
  `):``}function P(e){if(!e)return``;let t=Number.isInteger(e.nth)?` nth=${e.nth}`:``;return e.kind===`role`?`role=${e.role??``}${e.name?` name="${e.name}"`:``}${t}`:e.kind===`attr`?`[${e.attr}="${e.value??``}"]${t}`:e.kind===`testid`?`testid=${e.value??``}${t}`:`${e.kind}="${e.value??e.name??``}"${t}`}function st(e){return e===`python`?`Python + pytest + playwright.sync_api`:`TypeScript + @playwright/test`}function ct(e,t){return e.replaceAll(`{{project}}`,t.project).replaceAll(`{{dir}}`,t.dir).replaceAll(`{{language}}`,t.language).replaceAll(`{{plan}}`,t.plan)}function lt(e,t,n,r,i){let a=ot(n);if(r?.trim()){let n=ct(r.trim(),{project:e.name,dir:e.dir,language:st(t),plan:a||`如果还没有计划:先调用 ui_plan_steps 列出计划,再开始探索。`}),o=String(i??``).trim();return o?`${n}\n\n${o}`:n}return[`你是 UI 自动化测试工程师:用浏览器把流程点一遍,确认元素能唯一定位,再提交步骤。`,`项目:${e.name}(${e.dir}),目标语言:${st(t)}。`,`ref 导航后失效要重新 snapshot;每个元素先用 ui_locator_probe 拿唯一定位器,再用 ui_test_set_steps 提交。`,"探索阶段不要自己试跑;至少一条 expect 断言用户可见的结果;账号等占位值写成 ${ENV_NAME}。",a?`\n${a}`:``,`最后用中文简短汇报。`].filter(Boolean).join(`
3
3
  `)}function ut(e,t,n){return n?.trim()?ct(n.trim(),{project:e.name,dir:e.dir,language:st(t),plan:``}):[`你是测试设计师:只把需求拆成「动作 + 目标描述」的步骤计划,不打开浏览器、不写定位器。`,`项目:${e.name}(${e.dir}),目标语言:${st(t)}。`,`只调用一次 ui_plan_steps;4~12 步,覆盖打开页面、前置、核心操作与至少一条结果断言。`,"账号密码等写成 ${ENV_NAME}。"].join(`
4
4
  `)}function dt(e,t,n){return[`需求 / 流程:`,e.trim(),``,t?`起始地址(baseURL):${t}`:`起始地址:从需求里判断,用相对路径。`,`目标语言:${n===`python`?`Python (pytest)`:`TypeScript`}`,``,`请给出步骤计划。`].join(`
@@ -0,0 +1 @@
1
+ var e=`0.1.27`;export{e as t};
@@ -1,4 +1,4 @@
1
1
  var e=`/__tb_pm`,t=[`planning`,`in_progress`,`archived`],n=[`planning`,`in_progress`,`done`],r=[`urgent`,`high`,`medium`,`low`],i=[`pending`,`todo`,`in_progress`,`testing`,`done`,`cancelled`],a=[`critical`,`major`,`minor`,`trivial`],o=[`pending`,`todo`,`fixed`,`verifying`,`passed`,`cancelled`],s={planning:`规划中`,in_progress:`进行中`,archived:`已归档`},c={planning:`规划中`,in_progress:`进行中`,done:`已完成`},l={urgent:`紧急`,high:`高`,medium:`中`,low:`低`},u={pending:`待评估`,todo:`待开发`,in_progress:`开发中`,testing:`测试中`,done:`已完成`,cancelled:`已取消`},d={critical:`致命`,major:`严重`,minor:`一般`,trivial:`轻微`},ee={pending:`待确认`,todo:`待修复`,fixed:`修复完成`,verifying:`待验证`,passed:`验证通过`,cancelled:`已取消`},f={in_progress:`fixed`,closed:`passed`};function p(e){if(typeof e!=`string`)return``;let t=e.trim();return o.includes(t)?t:f[t]??``}function m(e){return e===`passed`||e===`cancelled`}var h=/^\d{4}-\d{2}-\d{2}$/;function g(e,t=2e3){return typeof e==`string`?e.trim().slice(0,t):``}function _(e){let t=g(e,10);return h.test(t)?t:``}function v(e,t,n){let r=g(e,40);return t.includes(r)?r:n}function y(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,50)){if(!n||typeof n!=`object`)continue;let e=g(n.text,500);e&&t.push({text:e,done:n.done===!0})}return t}function b(e){if(!e||typeof e!=`object`)return null;let n=e,r=g(n.name,200);if(!r)return null;let i=new Date().toISOString();return{id:g(n.id,64)||`pj_${Math.random().toString(16).slice(2,10)}`,name:r,description:g(n.description),status:v(n.status,t,`planning`),createdAt:g(n.createdAt,40)||i,updatedAt:g(n.updatedAt,40)||i}}function x(e){if(!e||typeof e!=`object`)return null;let t=e,r=g(t.name,200);if(!r)return null;let i=new Date().toISOString();return{id:g(t.id,64)||`it_${Math.random().toString(16).slice(2,10)}`,projectId:g(t.projectId,64),name:r,startDate:_(t.startDate),endDate:_(t.endDate),status:v(t.status,n,`planning`),remark:g(t.remark),createdAt:g(t.createdAt,40)||i,updatedAt:g(t.updatedAt,40)||i}}function S(e){if(!e||typeof e!=`object`)return null;let t=e,n=g(t.title,2e3);if(!n)return null;let a=new Date().toISOString();return{id:g(t.id,64)||`rq_${Math.random().toString(16).slice(2,10)}`,autoId:g(t.autoId,20),projectId:g(t.projectId,64),iterationId:g(t.iterationId,64),title:n,priority:v(t.priority,r,`medium`),status:v(t.status,i,`pending`),description:g(t.description),acceptanceCriteria:y(t.acceptanceCriteria),githubIssue:g(t.githubIssue,50),attachment:g(t.attachment),createdAt:g(t.createdAt,40)||a,updatedAt:g(t.updatedAt,40)||a}}function C(e){if(!e||typeof e!=`object`)return null;let t=e,n=g(t.title,200);if(!n)return null;let r=new Date().toISOString();return{id:g(t.id,64)||`bg_${Math.random().toString(16).slice(2,10)}`,autoId:g(t.autoId,20),projectId:g(t.projectId,64),iterationId:g(t.iterationId,64),requirementId:g(t.requirementId,64),title:n,severity:v(t.severity,a,`minor`),status:p(t.status)||`pending`,reproduceSteps:g(t.reproduceSteps),expectedResult:g(t.expectedResult),actualResult:g(t.actualResult),environment:g(t.environment,500),githubIssue:g(t.githubIssue,50),attachment:g(t.attachment),remark:g(t.remark),createdAt:g(t.createdAt,40)||r,updatedAt:g(t.updatedAt,40)||r}}function w(e,t){return Array.isArray(e)?e.map(t).filter(e=>!!e):[]}function T(){return{projects:[],iterations:[],requirements:[],bugs:[]}}function E(e){if(!e||typeof e!=`object`)return T();let t=e;return{projects:w(t.projects,b),iterations:w(t.iterations,x),requirements:w(t.requirements,S),bugs:w(t.bugs,C)}}async function D(t,n){let r=await fetch(e,{method:t,headers:n===void 0?void 0:{"Content-Type":`application/json`},body:n===void 0?void 0:JSON.stringify(n)}),i=await r.json().catch(()=>({}));if(!r.ok)throw Error(i.error||`HTTP ${r.status}`);return i}async function O(){try{return(await fetch(`${e}?health=1`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}async function k(){return E(await D(`GET`))}async function A(){await k()}function j(e,t){return e===`projects`?b(t):e===`iterations`?x(t):e===`requirements`?S(t):C(t)}async function M(e,t,n){let r=await D(`POST`,{entity:e,items:t,...n});return(Array.isArray(r.items)?r.items:[]).map(t=>j(e,t)).filter(e=>!!e)}async function N(e,t,n){let r=j(e,(await D(`PUT`,{entity:e,id:t,...n})).item);if(!r)throw Error(`更新记录失败`);return r}async function P(e,t){let n=await D(`DELETE`,{entity:e,ids:t});return{removed:Number(n.removed??0),cascaded:Number(n.cascaded??0)}}function F(e){let[t,n,r]=e.split(`-`).map(Number);return Date.UTC(t,(n??1)-1,r??1)}function I(e,t){return!h.test(e)||!h.test(t)?null:Math.round((F(t)-F(e))/864e5)}function L(e=new Date){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function R(e,t=L()){let n=I(e.startDate,e.endDate);if(n===null)return 0;let r=n+1,i=I(e.startDate,t);return i===null?0:Math.min(100,Math.max(0,Math.round((i+1)/r*100)))}function z(e,t=L()){if(e.status===`done`)return null;let n=I(e.endDate,t);return n===null?null:n>0?n:null}function te(e){let t={};for(let n of e.projects)t[n.id]={iterations:0,requirements:0,requirementsDone:0,bugs:0,bugsClosed:0,requirementPercent:0,bugClosedPercent:100};for(let n of e.iterations){let e=t[n.projectId];e&&(e.iterations+=1)}for(let n of e.requirements){let e=t[n.projectId];e&&(e.requirements+=1,n.status===`done`&&(e.requirementsDone+=1))}for(let n of e.bugs){let e=t[n.projectId];e&&(e.bugs+=1,m(n.status)&&(e.bugsClosed+=1))}for(let e of Object.values(t))e.requirementPercent=e.requirements?Math.round(e.requirementsDone/e.requirements*100):0,e.bugClosedPercent=e.bugs?Math.round(e.bugsClosed/e.bugs*100):100;return t}function B(e,t={}){let n=t.status??`all`,r=(t.keyword??``).trim().toLowerCase();return e.filter(e=>!(n!==`all`&&e.status!==n||r&&!`${e.name} ${e.description}`.toLowerCase().includes(r)))}function V(e,t={}){let n=t.projectId??`all`,r=t.status??`all`,i=(t.keyword??``).trim().toLowerCase();return e.filter(e=>!(n!==`all`&&e.projectId!==n||r!==`all`&&e.status!==r||i&&!`${e.name} ${e.remark}`.toLowerCase().includes(i)))}function H(e,t={}){let n=t.projectId??`all`,r=t.iterationId??`all`,i=t.status??`all`,a=t.priority??`all`,o=(t.keyword??``).trim().toLowerCase();return e.filter(e=>!(n!==`all`&&e.projectId!==n||r!==`all`&&e.iterationId!==r||i!==`all`&&e.status!==i||a!==`all`&&e.priority!==a||o&&!`${e.autoId} ${e.title} ${e.description}`.toLowerCase().includes(o)))}function U(e){return[...e].sort((e,t)=>{let n=e.startDate||``,r=t.startDate||``;if(n!==r)return r.localeCompare(n);let i=Date.parse(e.createdAt)||0,a=Date.parse(t.createdAt)||0;return i===a?t.name.localeCompare(e.name,`zh-Hans-CN`,{numeric:!0}):a-i})}function W(e){return[...e].sort((e,t)=>{let n=Date.parse(e.createdAt)||0,r=Date.parse(t.createdAt)||0;return n===r?t.autoId.localeCompare(e.autoId,`zh-Hans-CN`,{numeric:!0}):r-n})}function G(e){return[...e].sort((e,t)=>{let n=Date.parse(e.createdAt)||0,r=Date.parse(t.createdAt)||0;return n===r?t.autoId.localeCompare(e.autoId,`zh-Hans-CN`,{numeric:!0}):r-n})}function K(e,t={}){let n=t.projectId??`all`,r=t.iterationId??`all`,i=t.status??`all`,a=t.severity??`all`,o=(t.keyword??``).trim().toLowerCase();return e.filter(e=>!(n!==`all`&&e.projectId!==n||r!==`all`&&e.iterationId!==r||i!==`all`&&e.status!==i||a!==`all`&&e.severity!==a||o&&!`${e.autoId} ${e.title} ${e.reproduceSteps}`.toLowerCase().includes(o)))}function q(e,t){let n=t.trim();if(!n)return``;let r=e.find(e=>e.name===n);if(r)return r.id;let i=n.toLowerCase();return e.find(e=>e.name.toLowerCase()===i)?.id??``}function J(e,t){let n=t.trim();if(!n)return``;let r=n.toLowerCase();return e.find(e=>e.title===n)?.id??e.find(e=>e.title.toLowerCase()===r)?.id??e.find(e=>e.autoId.toLowerCase()===r)?.id??``}function Y(e){let t=e.split(`
2
2
  `).map(e=>e.trim()).find(Boolean);return t?Array.from(t).slice(0,60).join(``):``}function X(e){return e.split(`
3
3
  `).map(e=>e.trim()).filter(Boolean).map(e=>({url:e,name:$(e)}))}function Z(e){return e.map(e=>e.url).join(`
4
- `)}function Q(e){try{let t=new URL(e,`http://localhost`).searchParams.get(`p`)??``;return/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(decodeURIComponent(t))}catch{return!1}}function $(e){try{let t=new URL(e,`http://localhost`),n=t.searchParams.get(`p`),r=n?decodeURIComponent(n):t.pathname;return(r.split(`/`).filter(Boolean).pop()??r).replace(/^\d{10,}-[a-z0-9]+-/,``)}catch{return e}}function ne(e){let t=new Uint8Array(e),n=32768,r=``;for(let e=0;e<t.length;e+=n)r+=String.fromCharCode(...t.subarray(e,e+n));return btoa(r)}async function re(e){if(!e.length)return[];let t=await D(`POST`,{upload:await Promise.all(e.map(async e=>({name:e.name||`attachment`,type:e.type||`application/octet-stream`,data:ne(await e.arrayBuffer())})))});return(Array.isArray(t.files)?t.files:[]).map(e=>{let t=e,n=typeof t.url==`string`?t.url:``;return n?{url:n,name:typeof t.name==`string`&&t.name?t.name:$(n)}:null}).filter(e=>!!e)}async function ie(e,t=``){let n=e.filter(Boolean);if(n.length)try{await D(`POST`,t?{cleanup:n,bugId:t}:{cleanup:n})}catch{}}export{X as A,H as C,z as D,Q as E,A as F,L as I,N as L,G as M,U as N,R as O,W as P,re as R,B as S,J as T,T as _,n as a,K as b,s as c,i as d,u as f,P as g,M as h,ee as i,te as j,Z as k,r as l,ie as m,d as n,c as o,Y as p,o as r,t as s,a as t,l as u,O as v,q as w,V as x,k as y};
4
+ `)}function Q(e){try{let t=new URL(e,`http://localhost`).searchParams.get(`p`)??``;return/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(decodeURIComponent(t))}catch{return!1}}function ne(e){if(!e)return[];let t=[],n=new Set,r=e=>{if(!e)return;let r=`${e.name}\0${e.size}\0${e.type}`;n.has(r)||(n.add(r),t.push(e))};for(let t of Array.from(e.items??[]))t.kind===`file`&&r(t.getAsFile());for(let t of Array.from(e.files??[]))r(t);return t}function $(e){try{let t=new URL(e,`http://localhost`),n=t.searchParams.get(`p`),r=n?decodeURIComponent(n):t.pathname;return(r.split(`/`).filter(Boolean).pop()??r).replace(/^\d{10,}-[a-z0-9]+-/,``)}catch{return e}}function re(e){let t=new Uint8Array(e),n=32768,r=``;for(let e=0;e<t.length;e+=n)r+=String.fromCharCode(...t.subarray(e,e+n));return btoa(r)}async function ie(e){if(!e.length)return[];let t=await D(`POST`,{upload:await Promise.all(e.map(async e=>({name:e.name||`attachment`,type:e.type||`application/octet-stream`,data:re(await e.arrayBuffer())})))});return(Array.isArray(t.files)?t.files:[]).map(e=>{let t=e,n=typeof t.url==`string`?t.url:``;return n?{url:n,name:typeof t.name==`string`&&t.name?t.name:$(n)}:null}).filter(e=>!!e)}async function ae(e,t=``){let n=e.filter(Boolean);if(n.length)try{await D(`POST`,t?{cleanup:n,bugId:t}:{cleanup:n})}catch{}}export{Z as A,B as C,Q as D,J as E,W as F,A as I,L,te as M,G as N,z as O,U as P,N as R,V as S,q as T,T as _,n as a,ne as b,s as c,i as d,u as f,P as g,M as h,ee as i,X as j,R as k,r as l,ae as m,d as n,c as o,Y as p,o as r,t as s,a as t,l as u,O as v,H as w,K as x,k as y,ie as z};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/jszip.min.Bh2Mgo40.js","_astro/react.Blvh0GOs.js"])))=>i.map(i=>d[i]);
2
- import{s as e}from"./react.Blvh0GOs.js";import{W as t,r as n,s as r,t as i}from"./req-analysis.CIZ_cIJQ.js";import{b as a}from"./settings.DbhUT6Ao.js";import{t as o}from"./app-version.BPkgRlbu.js";function s(e){return t(e)}var c=`/__tb_testpoints`,l=`测试点生成提示词.md`,u=[`functional`,`boundary`,`exception`,`business`,`nonfunctional`],d=[`P0`,`P1`,`P2`,`P3`],f={functional:{label:`功能`,hint:`主流程 / 替代流程 / 每个功能点`,tone:`blue`,accent:`bg-[#3370ff]`},boundary:{label:`边界值`,hint:`为空 / 上下限 / 刚好越界`,tone:`purple`,accent:`bg-[#7b5bd6]`},exception:{label:`异常`,hint:`失败路径 / 非法输入 / 并发`,tone:`red`,accent:`bg-[#e5484d]`},business:{label:`业务规则`,hint:`状态流转 / 权限 / 唯一性`,tone:`amber`,accent:`bg-[#d9820b]`},nonfunctional:{label:`非功能`,hint:`性能 / 安全 / 兼容 / 时区`,tone:`green`,accent:`bg-[#2f9e44]`}},p={P0:{label:`P0`,tone:`red`,markerId:`priority-1`},P1:{label:`P1`,tone:`amber`,markerId:`priority-2`},P2:{label:`P2`,tone:`blue`,markerId:`priority-3`},P3:{label:`P3`,tone:`gray`,markerId:`priority-4`}},m=Object.fromEntries(u.map(e=>[e,f[e].label]));async function h(e,t){let n=await fetch(`${c}${e}`,{...t,headers:t?.body===void 0?void 0:{"Content-Type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>({}));if(!n.ok||r.ok===!1)throw Error(r.error||`HTTP ${n.status}`);return r}async function g(){try{let e=await h(`/prompt`);return{file:l,exists:e.exists===!0,generate:e.generate??``}}catch(e){return{file:l,exists:!1,generate:``,error:e instanceof Error?e.message:String(e)}}}async function _(e){return h(`/prompt/sync`,{method:`POST`,body:JSON.stringify({enabled:e})})}var v={P0:0,P1:1,P2:2,P3:3};function y(e){let t=e?.points??[],n={P0:0,P1:0,P2:0,P3:0};for(let e of t)e.priority in n&&(n[e.priority]+=1);return{total:t.length,byPriority:n,coveredDimensions:u.filter(e=>t.some(t=>t.dimension===e)).length}}function b(e){return[...e].sort((e,t)=>Number(!!e.supplemental)-Number(!!t.supplemental)||u.indexOf(e.dimension)-u.indexOf(t.dimension)||v[e.priority]-v[t.priority]||e.title.localeCompare(t.title,`zh`))}function x(e,t=[]){if(!e.length)return``;let n=S(e,t),r=[],i=`\0`;for(let e of n){let t=e.storyId||``;t!==i&&(i=t,r.push(t?`#### ${t}`:`#### 全局测试点`)),r.push(`- **[${e.priority}]** ${e.title}(${e.id})`),e.storyId&&r.push(` - 来源故事:${e.storyId}`),r.push(` - 维度:${f[e.dimension].label}`),e.precondition&&r.push(` - 前置:${e.precondition}`),e.steps.length&&r.push(` - 步骤:${e.steps.join(`;`)}`),e.expected&&r.push(` - 预期:${e.expected}`)}return r.join(`
2
+ import{s as e}from"./react.Blvh0GOs.js";import{W as t,r as n,s as r,t as i}from"./req-analysis.CIZ_cIJQ.js";import{b as a}from"./settings.DbhUT6Ao.js";import{t as o}from"./app-version.rNBCZA_9.js";function s(e){return t(e)}var c=`/__tb_testpoints`,l=`测试点生成提示词.md`,u=[`functional`,`boundary`,`exception`,`business`,`nonfunctional`],d=[`P0`,`P1`,`P2`,`P3`],f={functional:{label:`功能`,hint:`主流程 / 替代流程 / 每个功能点`,tone:`blue`,accent:`bg-[#3370ff]`},boundary:{label:`边界值`,hint:`为空 / 上下限 / 刚好越界`,tone:`purple`,accent:`bg-[#7b5bd6]`},exception:{label:`异常`,hint:`失败路径 / 非法输入 / 并发`,tone:`red`,accent:`bg-[#e5484d]`},business:{label:`业务规则`,hint:`状态流转 / 权限 / 唯一性`,tone:`amber`,accent:`bg-[#d9820b]`},nonfunctional:{label:`非功能`,hint:`性能 / 安全 / 兼容 / 时区`,tone:`green`,accent:`bg-[#2f9e44]`}},p={P0:{label:`P0`,tone:`red`,markerId:`priority-1`},P1:{label:`P1`,tone:`amber`,markerId:`priority-2`},P2:{label:`P2`,tone:`blue`,markerId:`priority-3`},P3:{label:`P3`,tone:`gray`,markerId:`priority-4`}},m=Object.fromEntries(u.map(e=>[e,f[e].label]));async function h(e,t){let n=await fetch(`${c}${e}`,{...t,headers:t?.body===void 0?void 0:{"Content-Type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>({}));if(!n.ok||r.ok===!1)throw Error(r.error||`HTTP ${n.status}`);return r}async function g(){try{let e=await h(`/prompt`);return{file:l,exists:e.exists===!0,generate:e.generate??``}}catch(e){return{file:l,exists:!1,generate:``,error:e instanceof Error?e.message:String(e)}}}async function _(e){return h(`/prompt/sync`,{method:`POST`,body:JSON.stringify({enabled:e})})}var v={P0:0,P1:1,P2:2,P3:3};function y(e){let t=e?.points??[],n={P0:0,P1:0,P2:0,P3:0};for(let e of t)e.priority in n&&(n[e.priority]+=1);return{total:t.length,byPriority:n,coveredDimensions:u.filter(e=>t.some(t=>t.dimension===e)).length}}function b(e){return[...e].sort((e,t)=>Number(!!e.supplemental)-Number(!!t.supplemental)||u.indexOf(e.dimension)-u.indexOf(t.dimension)||v[e.priority]-v[t.priority]||e.title.localeCompare(t.title,`zh`))}function x(e,t=[]){if(!e.length)return``;let n=S(e,t),r=[],i=`\0`;for(let e of n){let t=e.storyId||``;t!==i&&(i=t,r.push(t?`#### ${t}`:`#### 全局测试点`)),r.push(`- **[${e.priority}]** ${e.title}(${e.id})`),e.storyId&&r.push(` - 来源故事:${e.storyId}`),r.push(` - 维度:${f[e.dimension].label}`),e.precondition&&r.push(` - 前置:${e.precondition}`),e.steps.length&&r.push(` - 步骤:${e.steps.join(`;`)}`),e.expected&&r.push(` - 预期:${e.expected}`)}return r.join(`
3
3
  `)}function S(e,t=[]){if(!e.length)return[];if(!t.length)return[...e];let n=new Map(t.map((e,t)=>[e,t]));return e.map((e,t)=>({point:e,index:t})).sort((e,r)=>(e.point.storyId?n.get(e.point.storyId)??t.length+1:t.length)-(r.point.storyId?n.get(r.point.storyId)??t.length+1:t.length)||e.index-r.index).map(e=>e.point)}function C(e){return(e||`需求分析`).replace(/[\\/:*?"<>|]/g,`_`).slice(0,60)}function w(e){let t=[];return e.precondition&&t.push(`前置条件:${e.precondition}`),e.steps.length&&(t.push(`步骤:`),e.steps.forEach((e,n)=>t.push(`${n+1}. ${e}`))),e.expected&&t.push(`预期:${e.expected}`),t.join(`
4
4
  `)}function T(e,t){let n=2166136261;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);let r=(n>>>0).toString(36),i=t.replace(/[^A-Za-z0-9_-]/g,``).slice(0,24);return i?`${e}-${i}-${r}`:`${e}-${r}`}function E(e){return{id:T(`tp`,e.id),title:`[${e.priority}] ${e.title}`,labels:[f[e.dimension].label],markers:[{markerId:p[e.priority].markerId}],notes:{plain:{content:w(e)}}}}var D=[{re:/ai\s*拆解|推送ai|回写拆解/i,title:`ai拆解`},{re:/ai自动同步|知识信息列表.*开关|知识信息管理/i,title:`知识信息管理`},{re:/信息审核|审核倒计时|出具审核结论|待审核信息/i,title:`政企通信息审核`},{re:/信息确认|确认无误|待确认信息/i,title:`政企通信息确认`},{re:/开通确认|确认开通/i,title:`政企通开通确认`},{re:/信息管理列表|承办单位修改|查看详情|政企通路径|关联信息标题/i,title:`政企通信息管理`},{re:/页面管理|页面树|节点|前台预览|本级节点布局|暂存|发给承办|信息列表|展示类型/i,title:`政企通页面管理`},{re:/菜单|子菜单|文案本地化|时间展示/i,title:`政企通`}];function O(e,t){return t.find(t=>t===e)||t.find(t=>e.length>=t.length&&e.includes(t))||t.find(t=>t.length>e.length&&t.includes(e))||null}function k(e,t,n){if(!n.length)return e.title||e.id;let r=e.title||``,i=`${r} ${e.sourceRefs.map(e=>t.get(e)||e).join(` `)}`,a=[...n].sort((e,t)=>t.length-e.length||e.localeCompare(t,`zh`));for(let e of D){if(!e.re.test(i))continue;let t=O(e.title,a);if(t)return t}for(let e of a)if(e&&r.includes(e))return e;for(let e of a)if(e&&i.includes(e))return e;return e.title||e.id}function A(e){let t=b(e);return u.map(e=>({key:e,label:f[e].label,hint:f[e].hint,points:t.filter(t=>t.dimension===e)}))}function j(e,t=[]){let n=e.testPoints?.points??[];if(!n.length)return[];let r=new Map(e.outline.map(e=>[e.id,e.title])),i=new Map(e.stories.map(e=>[e.id,e])),a=t.filter(Boolean),o=new Map,s=e=>{let t=o.get(e);return t||(t={title:e,storyIds:new Set,points:[]},o.set(e,t)),t};for(let e of a)s(e);for(let e of n){let t=e.storyId?i.get(e.storyId):void 0,n;n=t&&a.length?k(t,r,a):t?t.title||t.id:`全局测试点`;let o=s(n);o.points.push(e),e.storyId&&o.storyIds.add(e.storyId)}let c=[...a,...[...o.keys()].filter(e=>!a.includes(e)&&e!==`全局测试点`),...o.has(`全局测试点`)?[`全局测试点`]:[]],l=new Set,u=[];for(let e of c){if(l.has(e))continue;l.add(e);let t=o.get(e);t&&(t.points.length||a.includes(e))&&u.push({key:e,title:e,storyIds:[...t.storyIds],points:b(t.points),dimensions:A(t.points)})}return u}var M=`org.xmind.ui.logic.right`;function N(e,t){return t.map(t=>({id:T(`dim`,`${e}:${t.key}`),title:`${t.label}(${t.points.length})`,notes:{plain:{content:`${f[t.key].hint}\n测试点 ${t.points.length} 条`}},children:{attached:t.points.map(E)}}))}function P(e){return{id:T(`req`,e.key),title:`${e.title}(${e.points.length})`,notes:{plain:{content:[e.storyIds.length?`来源故事:${e.storyIds.join(`、`)}`:``,`测试点 ${e.points.length} 条`].filter(Boolean).join(`
5
5
  `)}},children:{attached:N(e.key,e.dimensions)}}}function F(e,t=[]){let n=e.testPoints,r=j(e,t).filter(e=>e.points.length>0),i=s(e);if(!r.length)return[{id:`sheet-1`,class:`sheet`,title:i,rootTopic:{id:`root-topic`,title:`${i}(0)`,structureClass:M,notes:{plain:{content:n?.summary||`还没有测试点。`}},children:{attached:u.map(e=>({id:T(`dim`,e),title:`${f[e].label}(0)`,notes:{plain:{content:`${f[e].hint}\n测试点 0 条`}},children:{attached:[]}}))}}}];if(r.length===1){let e=r[0];return[{id:`sheet-1`,class:`sheet`,title:e.title,rootTopic:{id:T(`root`,e.key),title:`${e.title}(${e.points.length})`,structureClass:M,notes:{plain:{content:[n?.summary||``,e.storyIds.length?`来源故事:${e.storyIds.join(`、`)}`:``,`测试点 ${e.points.length} 条`].filter(Boolean).join(`
@@ -0,0 +1 @@
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};
@@ -3,7 +3,7 @@
3
3
  try {
4
4
  if ('scrollRestoration' in history) history.scrollRestoration = 'manual';
5
5
  } catch (e) {}
6
- </script><script type="module" src="/_astro/Base.astro_astro_type_script_index_0_lang.Cb6ggViJ.js"></script><meta name="astro-view-transitions-enabled" content="true"><meta name="astro-view-transitions-fallback" content="animate"><script type="module" src="/_astro/ClientRouter.astro_astro_type_script_index_0_lang.CO1cjG9V.js"></script><script>
6
+ </script><script type="module" src="/_astro/Base.astro_astro_type_script_index_0_lang.DR-2Adek.js"></script><meta name="astro-view-transitions-enabled" content="true"><meta name="astro-view-transitions-fallback" content="animate"><script type="module" src="/_astro/ClientRouter.astro_astro_type_script_index_0_lang.CO1cjG9V.js"></script><script>
7
7
  (function () {
8
8
  try {
9
9
  // 配置按空间分键(`tw.app.config.v1::<spaceId>`),主题必须从同一个键读,
@@ -98,7 +98,7 @@
98
98
  }
99
99
  } catch (e) {}
100
100
  })();
101
- </script><link rel="stylesheet" href="/_astro/Base.COYvzmy5.css"><script type="module" src="/_astro/page.Bx2KSkeL.js"></script><style>[data-astro-transition-scope="astro-bbhp3f5g-3"] { view-transition-name: astro-bbhp3f5g-3; }@layer astro { ::view-transition-old(astro-bbhp3f5g-3) {
101
+ </script><link rel="stylesheet" href="/_astro/Base.Bilfw8As.css"><script type="module" src="/_astro/page.Bx2KSkeL.js"></script><style>[data-astro-transition-scope="astro-bbhp3f5g-3"] { view-transition-name: astro-bbhp3f5g-3; }@layer astro { ::view-transition-old(astro-bbhp3f5g-3) {
102
102
  animation-duration: 180ms;
103
103
  animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
104
104
  animation-fill-mode: both;
@@ -134,7 +134,7 @@
134
134
  animation-duration: 180ms;
135
135
  animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
136
136
  animation-fill-mode: both;
137
- animation-name: astroFadeIn; }</style></head><body class="tw-body antialiased"><div class="tw-shell min-h-screen"><aside class="tw-nav-aside fixed inset-y-0 left-0 flex flex-col z-45" id="tw-nav-aside"><div class="tw-nav-brand"><div class="tw-nav-brand-row"><a href="/" class="tw-nav-brand-link min-w-0 flex-1" data-astro-reload><span class="tw-nav-brand-mark" aria-hidden="true"><img class="tw-nav-brand-mark-img" src="/brand/brand-mark.png" alt="" width="36" height="36"></span><span class="tw-nav-brand-text"><span class="tw-nav-brand-title-row"><span class="tw-nav-brand-title" data-i18n="nav.brand">Lantern Harness</span><span class="tw-nav-brand-ver" data-hint="平台版本 v0.1.25">v0.1.25<span class="tw-nav-brand-dot" id="tw-update-dot" role="button" tabindex="-1" aria-label="有新版本可更新" hidden></span></span></span></span></a></div></div><div class="tw-nav-space-slot"><div class="tw-nav-space tw-nav-space-ph" id="tw-nav-space-ph" aria-hidden="true"><div class="tw-nav-space-ph-box"><span class="tw-nav-space-ph-ico"></span><span class="tw-nav-space-ph-lines"><span class="tw-nav-space-ph-bar is-cap"></span><span class="tw-nav-space-ph-bar is-name"></span></span></div></div><style>astro-island,astro-slot,astro-static-slot{display:contents}</style><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).only=e,window.dispatchEvent(new Event(`astro:only`))})();</script><script>(function(){function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(t,n){if(e(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function n(n){var r=t(n,`string`);return e(r)==`symbol`?r:r+``}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let i=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);{let e={0:e=>a(e),1:e=>n(e),2:e=>new RegExp(e),3:e=>new Date(e),4:e=>new Map(n(e)),5:e=>new Set(n(e)),6:e=>BigInt(e),7:e=>new URL(e),8:e=>new Uint8Array(e),9:e=>new Uint16Array(e),10:e=>new Uint32Array(e),11:e=>1/0*e},t=t=>{let[n,r]=t;return n in e?e[n](r):void 0},n=e=>e.map(t),a=e=>typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)]));class o extends HTMLElement{constructor(...e){super(...e),r(this,`Component`,void 0),r(this,`hydrator`,void 0),r(this,`hydrate`,async()=>{var e;if(!this.hydrator||!this.isConnected)return;let t=(e=this.parentElement)==null?void 0:e.closest(`astro-island[ssr]`);if(t){t.addEventListener(`astro:hydrate`,this.hydrate,{once:!0});return}let n=this.querySelectorAll(`astro-slot`),r={},i=this.querySelectorAll(`template[data-astro-template]`);for(let e of i){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`data-astro-template`)||`default`]=e.innerHTML,e.remove())}for(let e of n){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`name`)||`default`]=e.innerHTML)}let o;try{o=this.hasAttribute(`props`)?a(JSON.parse(this.getAttribute(`props`))):{}}catch(e){let t=this.getAttribute(`component-url`)||`<unknown>`,n=this.getAttribute(`component-export`);throw n&&(t+=` (export ${n})`),console.error(`[hydrate] Error parsing props for component ${t}`,this.getAttribute(`props`),e),e}await this.hydrator(this)(this.Component,o,r,{client:this.getAttribute(`client`)}),this.removeAttribute(`ssr`),this.dispatchEvent(new CustomEvent(`astro:hydrate`))}),r(this,`unmount`,()=>{this.isConnected||this.dispatchEvent(new CustomEvent(`astro:unmount`))})}disconnectedCallback(){document.removeEventListener(`astro:after-swap`,this.unmount),document.addEventListener(`astro:after-swap`,this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute(`await-children`)||document.readyState===`interactive`||document.readyState===`complete`)this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener(`DOMContentLoaded`,e),t.disconnect(),this.childrenConnectedCallback()},t=new MutationObserver(()=>{var t;((t=this.lastChild)==null?void 0:t.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue===`astro:end`&&(this.lastChild.remove(),e())});t.observe(this,{childList:!0}),document.addEventListener(`DOMContentLoaded`,e)}}async childrenConnectedCallback(){let e=this.getAttribute(`before-hydration-url`);e&&await import(e),this.start()}getRetryImportUrl(e){let t=new URL(e,document.baseURI);return t.searchParams.set(`astro-retry`,Date.now().toString()),t.toString()}async importWithRetry(e){try{return await import(e)}catch(t){return await new Promise(e=>setTimeout(e,1e3)),import(this.getRetryImportUrl(e))}}handleHydrationError(e){let t=this.getAttribute(`component-url`),n=new CustomEvent(`astro:hydration-error`,{cancelable:!0,bubbles:!0,composed:!0,detail:{error:e,componentUrl:t}});this.dispatchEvent(n)&&console.error(`[astro-island] Error hydrating ${t}`,e)}async start(){let e=JSON.parse(this.getAttribute(`opts`)),t=this.getAttribute(`client`);if(Astro[t]===void 0)window.addEventListener(`astro:${t}`,()=>this.start(),{once:!0});else try{await Astro[t](async()=>{let e=this.getAttribute(`renderer-url`);try{let[t,{default:n}]=await Promise.all([this.importWithRetry(this.getAttribute(`component-url`)),e?this.importWithRetry(e):Promise.resolve({default:()=>()=>{}})]),r=this.getAttribute(`component-export`)||`default`;if(r.includes(`.`)){this.Component=t;for(let e of r.split(`.`)){if(i.has(e)||!this.Component||typeof this.Component!=`object`&&typeof this.Component!=`function`||!Object.hasOwn(this.Component,e))throw Error(`Invalid component export path: ${r}`);this.Component=this.Component[e]}}else{if(i.has(r))throw Error(`Invalid component export path: ${r}`);this.Component=t[r]}return this.hydrator=n,this.hydrate}catch(e){return this.handleHydrationError(e),()=>{}}},e,this)}catch(e){this.handleHydrationError(e)}}attributeChangedCallback(){this.hydrate()}}r(o,`observedAttributes`,[`props`]),customElements.get(`astro-island`)||customElements.define(`astro-island`,o)}})();</script><astro-island uid="2wH2Dz" component-url="/_astro/SpaceSwitcher.DQOG363O.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{&quot;data-astro-transition-persist&quot;:[0,&quot;astro-gyrtbwwo-1&quot;]}" ssr client="only" opts="{&quot;name&quot;:&quot;SpaceSwitcher&quot;,&quot;value&quot;:&quot;react&quot;}" data-astro-transition-persist="astro-gyrtbwwo-1"></astro-island></div><button type="button" id="tw-nav-toggle" class="tw-nav-toggle" aria-label="收起或展开左侧导航" aria-expanded="true" aria-controls="tw-nav-aside"><svg class="tw-nav-toggle-icon is-collapse" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 6l-6 6 6 6"></path></svg><svg class="tw-nav-toggle-icon is-expand" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"></path></svg></button><nav class="tw-nav-list flex-1 overflow-y-auto"><a href="/workbench/" class="tw-nav-item" data-i18n-hint="nav.home" data-hint="我的工作台"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 10.5 12 3l9 7.5"></path><path d="M5 9.5V20h14V9.5"></path></svg><span class="tw-nav-label" data-i18n="nav.home">我的工作台</span></a><div class="tw-nav-libraries"><div class="tw-nav-libraries-ph"><a href="/dashboard/" class="tw-nav-item" data-plugin-nav="dashboard"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="3" width="7" height="7" rx="1.5"></rect><rect x="14" y="3" width="7" height="7" rx="1.5"></rect><rect x="3" y="14" width="7" height="7" rx="1.5"></rect><rect x="14" y="14" width="7" height="7" rx="1.5"></rect></svg><span class="tw-nav-label" data-i18n="nav.dashboard">仪表盘</span></a><a href="/tasks/" class="tw-nav-item" data-plugin-nav="tasks"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 5h10"></path><path d="M9 12h10"></path><path d="M9 19h10"></path><path d="M4 5h.01"></path><path d="M4 12h.01"></path><path d="M4 19h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.tasks">任务管理</span></a><a href="/todos/" class="tw-nav-item" data-plugin-nav="todos"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M8 6h13"></path><path d="M8 12h13"></path><path d="M8 18h13"></path><path d="M3 6h.01"></path><path d="M3 12h.01"></path><path d="M3 18h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.todos">待办事项</span></a><a href="/pm/projects/" class="tw-nav-item" data-plugin-nav="projects"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"></path></svg><span class="tw-nav-label" data-i18n="nav.projects">项目列表</span></a><a href="/pm/iterations/" class="tw-nav-item" data-plugin-nav="iterations"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="5" width="18" height="16" rx="2"></rect><path d="M8 3v4"></path><path d="M16 3v4"></path><path d="M3 10h18"></path></svg><span class="tw-nav-label" data-i18n="nav.iterations">迭代管理</span></a><a href="/pm/requirements/" class="tw-nav-item" data-plugin-nav="pmRequirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.requirementsMgmt">需求管理</span></a><a href="/pm/bugs/" class="tw-nav-item" data-plugin-nav="bugs"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="14" r="5"></circle><path d="M9 6l2 2"></path><path d="M15 6l-2 2"></path><path d="M7 11H4"></path><path d="M20 11h-3"></path><path d="M7 17H4"></path><path d="M20 17h-3"></path></svg><span class="tw-nav-label" data-i18n="nav.bugs">缺陷管理</span></a><a href="/reports/" class="tw-nav-item" data-plugin-nav="reports"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.reports">工作汇报</span></a><a href="/test-stats/" class="tw-nav-item" data-plugin-nav="testStats"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 20V10"></path><path d="M10 20V4"></path><path d="M16 20v-7"></path><path d="M22 20H2"></path></svg><span class="tw-nav-label" data-i18n="nav.testStats">测试统计</span></a><a href="/case-exec/" class="tw-nav-item is-active font-medium" data-plugin-nav="caseExec"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="9"></circle><circle cx="12" cy="12" r="5"></circle><circle cx="12" cy="12" r="1.4"></circle></svg><span class="tw-nav-label" data-i18n="nav.caseExec">用例执行统计</span></a><a href="/cases/library/" class="tw-nav-item" data-plugin-nav="cases"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 11l3 3L22 4"></path><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg><span class="tw-nav-label" data-i18n="nav.caseManage">用例管理</span></a><a href="/knowledge/" class="tw-nav-item" data-plugin-nav="knowledgeLib"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path></svg><span class="tw-nav-label" data-i18n="nav.knowledge">知识库管理</span></a><a href="/requirements/" class="tw-nav-item" data-plugin-nav="requirements" data-i18n-hint="nav.requirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h6"></path></svg><span class="tw-nav-label" data-i18n="nav.requirements">需求文档库</span></a><a href="/templates/" class="tw-nav-item" data-plugin-nav="templates" data-i18n-hint="nav.templates"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 3 3 8l9 5 9-5-9-5z"></path><path d="m3 13 9 5 9-5"></path></svg><span class="tw-nav-label" data-i18n="nav.templates">测试模板库</span></a></div><astro-island uid="Z1lgSd4" component-url="/_astro/NavLibraries.BybmHnXn.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{&quot;data-astro-transition-persist&quot;:[0,&quot;astro-iywf7oe7-2&quot;]}" ssr client="only" opts="{&quot;name&quot;:&quot;NavLibraries&quot;,&quot;value&quot;:&quot;react&quot;}" data-astro-transition-persist="astro-iywf7oe7-2"></astro-island><script>(function(){const host = ".tw-nav-libraries";
137
+ animation-name: astroFadeIn; }</style></head><body class="tw-body antialiased"><div class="tw-shell min-h-screen"><aside class="tw-nav-aside fixed inset-y-0 left-0 flex flex-col z-45" id="tw-nav-aside"><div class="tw-nav-brand"><div class="tw-nav-brand-row"><a href="/" class="tw-nav-brand-link min-w-0 flex-1" data-astro-reload><span class="tw-nav-brand-mark" aria-hidden="true"><img class="tw-nav-brand-mark-img" src="/brand/brand-mark.png" alt="" width="36" height="36"></span><span class="tw-nav-brand-text"><span class="tw-nav-brand-title-row"><span class="tw-nav-brand-title" data-i18n="nav.brand">Lantern Harness</span><span class="tw-nav-brand-ver" data-hint="平台版本 v0.1.27">v0.1.27<span class="tw-nav-brand-dot" id="tw-update-dot" role="button" tabindex="-1" aria-label="有新版本可更新" hidden></span></span></span></span></a></div></div><div class="tw-nav-space-slot"><div class="tw-nav-space tw-nav-space-ph" id="tw-nav-space-ph" aria-hidden="true"><div class="tw-nav-space-ph-box"><span class="tw-nav-space-ph-ico"></span><span class="tw-nav-space-ph-lines"><span class="tw-nav-space-ph-bar is-cap"></span><span class="tw-nav-space-ph-bar is-name"></span></span></div></div><style>astro-island,astro-slot,astro-static-slot{display:contents}</style><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).only=e,window.dispatchEvent(new Event(`astro:only`))})();</script><script>(function(){function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(t,n){if(e(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function n(n){var r=t(n,`string`);return e(r)==`symbol`?r:r+``}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let i=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);{let e={0:e=>a(e),1:e=>n(e),2:e=>new RegExp(e),3:e=>new Date(e),4:e=>new Map(n(e)),5:e=>new Set(n(e)),6:e=>BigInt(e),7:e=>new URL(e),8:e=>new Uint8Array(e),9:e=>new Uint16Array(e),10:e=>new Uint32Array(e),11:e=>1/0*e},t=t=>{let[n,r]=t;return n in e?e[n](r):void 0},n=e=>e.map(t),a=e=>typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)]));class o extends HTMLElement{constructor(...e){super(...e),r(this,`Component`,void 0),r(this,`hydrator`,void 0),r(this,`hydrate`,async()=>{var e;if(!this.hydrator||!this.isConnected)return;let t=(e=this.parentElement)==null?void 0:e.closest(`astro-island[ssr]`);if(t){t.addEventListener(`astro:hydrate`,this.hydrate,{once:!0});return}let n=this.querySelectorAll(`astro-slot`),r={},i=this.querySelectorAll(`template[data-astro-template]`);for(let e of i){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`data-astro-template`)||`default`]=e.innerHTML,e.remove())}for(let e of n){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`name`)||`default`]=e.innerHTML)}let o;try{o=this.hasAttribute(`props`)?a(JSON.parse(this.getAttribute(`props`))):{}}catch(e){let t=this.getAttribute(`component-url`)||`<unknown>`,n=this.getAttribute(`component-export`);throw n&&(t+=` (export ${n})`),console.error(`[hydrate] Error parsing props for component ${t}`,this.getAttribute(`props`),e),e}await this.hydrator(this)(this.Component,o,r,{client:this.getAttribute(`client`)}),this.removeAttribute(`ssr`),this.dispatchEvent(new CustomEvent(`astro:hydrate`))}),r(this,`unmount`,()=>{this.isConnected||this.dispatchEvent(new CustomEvent(`astro:unmount`))})}disconnectedCallback(){document.removeEventListener(`astro:after-swap`,this.unmount),document.addEventListener(`astro:after-swap`,this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute(`await-children`)||document.readyState===`interactive`||document.readyState===`complete`)this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener(`DOMContentLoaded`,e),t.disconnect(),this.childrenConnectedCallback()},t=new MutationObserver(()=>{var t;((t=this.lastChild)==null?void 0:t.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue===`astro:end`&&(this.lastChild.remove(),e())});t.observe(this,{childList:!0}),document.addEventListener(`DOMContentLoaded`,e)}}async childrenConnectedCallback(){let e=this.getAttribute(`before-hydration-url`);e&&await import(e),this.start()}getRetryImportUrl(e){let t=new URL(e,document.baseURI);return t.searchParams.set(`astro-retry`,Date.now().toString()),t.toString()}async importWithRetry(e){try{return await import(e)}catch(t){return await new Promise(e=>setTimeout(e,1e3)),import(this.getRetryImportUrl(e))}}handleHydrationError(e){let t=this.getAttribute(`component-url`),n=new CustomEvent(`astro:hydration-error`,{cancelable:!0,bubbles:!0,composed:!0,detail:{error:e,componentUrl:t}});this.dispatchEvent(n)&&console.error(`[astro-island] Error hydrating ${t}`,e)}async start(){let e=JSON.parse(this.getAttribute(`opts`)),t=this.getAttribute(`client`);if(Astro[t]===void 0)window.addEventListener(`astro:${t}`,()=>this.start(),{once:!0});else try{await Astro[t](async()=>{let e=this.getAttribute(`renderer-url`);try{let[t,{default:n}]=await Promise.all([this.importWithRetry(this.getAttribute(`component-url`)),e?this.importWithRetry(e):Promise.resolve({default:()=>()=>{}})]),r=this.getAttribute(`component-export`)||`default`;if(r.includes(`.`)){this.Component=t;for(let e of r.split(`.`)){if(i.has(e)||!this.Component||typeof this.Component!=`object`&&typeof this.Component!=`function`||!Object.hasOwn(this.Component,e))throw Error(`Invalid component export path: ${r}`);this.Component=this.Component[e]}}else{if(i.has(r))throw Error(`Invalid component export path: ${r}`);this.Component=t[r]}return this.hydrator=n,this.hydrate}catch(e){return this.handleHydrationError(e),()=>{}}},e,this)}catch(e){this.handleHydrationError(e)}}attributeChangedCallback(){this.hydrate()}}r(o,`observedAttributes`,[`props`]),customElements.get(`astro-island`)||customElements.define(`astro-island`,o)}})();</script><astro-island uid="2wH2Dz" component-url="/_astro/SpaceSwitcher.DQOG363O.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{&quot;data-astro-transition-persist&quot;:[0,&quot;astro-gyrtbwwo-1&quot;]}" ssr client="only" opts="{&quot;name&quot;:&quot;SpaceSwitcher&quot;,&quot;value&quot;:&quot;react&quot;}" data-astro-transition-persist="astro-gyrtbwwo-1"></astro-island></div><button type="button" id="tw-nav-toggle" class="tw-nav-toggle" aria-label="收起或展开左侧导航" aria-expanded="true" aria-controls="tw-nav-aside"><svg class="tw-nav-toggle-icon is-collapse" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 6l-6 6 6 6"></path></svg><svg class="tw-nav-toggle-icon is-expand" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"></path></svg></button><nav class="tw-nav-list flex-1 overflow-y-auto"><a href="/workbench/" class="tw-nav-item" data-i18n-hint="nav.home" data-hint="我的工作台"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 10.5 12 3l9 7.5"></path><path d="M5 9.5V20h14V9.5"></path></svg><span class="tw-nav-label" data-i18n="nav.home">我的工作台</span></a><div class="tw-nav-libraries"><div class="tw-nav-libraries-ph"><a href="/dashboard/" class="tw-nav-item" data-plugin-nav="dashboard"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="3" width="7" height="7" rx="1.5"></rect><rect x="14" y="3" width="7" height="7" rx="1.5"></rect><rect x="3" y="14" width="7" height="7" rx="1.5"></rect><rect x="14" y="14" width="7" height="7" rx="1.5"></rect></svg><span class="tw-nav-label" data-i18n="nav.dashboard">仪表盘</span></a><a href="/tasks/" class="tw-nav-item" data-plugin-nav="tasks"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 5h10"></path><path d="M9 12h10"></path><path d="M9 19h10"></path><path d="M4 5h.01"></path><path d="M4 12h.01"></path><path d="M4 19h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.tasks">任务管理</span></a><a href="/todos/" class="tw-nav-item" data-plugin-nav="todos"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M8 6h13"></path><path d="M8 12h13"></path><path d="M8 18h13"></path><path d="M3 6h.01"></path><path d="M3 12h.01"></path><path d="M3 18h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.todos">待办事项</span></a><a href="/pm/projects/" class="tw-nav-item" data-plugin-nav="projects"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"></path></svg><span class="tw-nav-label" data-i18n="nav.projects">项目列表</span></a><a href="/pm/iterations/" class="tw-nav-item" data-plugin-nav="iterations"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="5" width="18" height="16" rx="2"></rect><path d="M8 3v4"></path><path d="M16 3v4"></path><path d="M3 10h18"></path></svg><span class="tw-nav-label" data-i18n="nav.iterations">迭代管理</span></a><a href="/pm/requirements/" class="tw-nav-item" data-plugin-nav="pmRequirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.requirementsMgmt">需求管理</span></a><a href="/pm/bugs/" class="tw-nav-item" data-plugin-nav="bugs"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="14" r="5"></circle><path d="M9 6l2 2"></path><path d="M15 6l-2 2"></path><path d="M7 11H4"></path><path d="M20 11h-3"></path><path d="M7 17H4"></path><path d="M20 17h-3"></path></svg><span class="tw-nav-label" data-i18n="nav.bugs">缺陷管理</span></a><a href="/reports/" class="tw-nav-item" data-plugin-nav="reports"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.reports">工作汇报</span></a><a href="/test-stats/" class="tw-nav-item" data-plugin-nav="testStats"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 20V10"></path><path d="M10 20V4"></path><path d="M16 20v-7"></path><path d="M22 20H2"></path></svg><span class="tw-nav-label" data-i18n="nav.testStats">测试统计</span></a><a href="/case-exec/" class="tw-nav-item is-active font-medium" data-plugin-nav="caseExec"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="9"></circle><circle cx="12" cy="12" r="5"></circle><circle cx="12" cy="12" r="1.4"></circle></svg><span class="tw-nav-label" data-i18n="nav.caseExec">用例执行统计</span></a><a href="/cases/library/" class="tw-nav-item" data-plugin-nav="cases"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 11l3 3L22 4"></path><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg><span class="tw-nav-label" data-i18n="nav.caseManage">用例管理</span></a><a href="/knowledge/" class="tw-nav-item" data-plugin-nav="knowledgeLib"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path></svg><span class="tw-nav-label" data-i18n="nav.knowledge">知识库管理</span></a><a href="/requirements/" class="tw-nav-item" data-plugin-nav="requirements" data-i18n-hint="nav.requirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h6"></path></svg><span class="tw-nav-label" data-i18n="nav.requirements">需求文档库</span></a><a href="/templates/" class="tw-nav-item" data-plugin-nav="templates" data-i18n-hint="nav.templates"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 3 3 8l9 5 9-5-9-5z"></path><path d="m3 13 9 5 9-5"></path></svg><span class="tw-nav-label" data-i18n="nav.templates">测试模板库</span></a></div><astro-island uid="Z1lgSd4" component-url="/_astro/NavLibraries.BybmHnXn.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{&quot;data-astro-transition-persist&quot;:[0,&quot;astro-iywf7oe7-2&quot;]}" ssr client="only" opts="{&quot;name&quot;:&quot;NavLibraries&quot;,&quot;value&quot;:&quot;react&quot;}" data-astro-transition-persist="astro-iywf7oe7-2"></astro-island><script>(function(){const host = ".tw-nav-libraries";
138
138
  const cacheKey = "tw.hydrate.nav";
139
139
  const fixActive = true;
140
140
  const capture = false;
@@ -364,7 +364,7 @@ const syncNavGroups = true;
364
364
  // 缓存坏了就当没有
365
365
  }
366
366
  })();
367
- })();</script></div><a href="/prompts/" class="tw-nav-item" data-plugin-nav="prompts" data-pinned-nav="prompts"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 20h9"></path><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg><span class="tw-nav-label" data-i18n="nav.prompts">提示词管理</span></a><a href="/docs/manual/" class="tw-nav-item" data-hint="帮助中心" data-i18n-hint="nav.helpCenter"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M5 4.5h9.5L19 9v10.5H5V4.5Z" stroke-linejoin="round"></path><path d="M14.5 4.5V9H19" stroke-linejoin="round"></path><path d="M8 13h8M8 16.5h6" stroke-linecap="round"></path></svg><span class="tw-nav-label" data-i18n="nav.helpCenter">帮助中心</span></a></nav><div class="tw-nav-foot"><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).load=e,window.dispatchEvent(new Event(`astro:load`))})();</script><astro-island uid="Z12jkyC" prefix="r1" component-url="/_astro/SettingsDialog.D3f4EOwl.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{}" ssr client="load" opts="{&quot;name&quot;:&quot;SettingsDialog&quot;,&quot;value&quot;:true}" await-children><div class="tw-nav-foot-row"><button type="button" class="tw-nav-settings-btn" data-hint="设置"><svg class="tw-nav-ico w-4.5 h-4.5 shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9c.2.6.7 1 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"></path></svg><span data-i18n="nav.settings">设置</span></button><button type="button" class="tw-nav-provider-chip is-empty" data-hint="未配置模型"><span class="tw-nav-provider-dot" aria-hidden="true"></span><span class="tw-nav-provider-name">未配置</span></button></div><span hidden="" style="position:fixed;top:1px;left:1px;width:1px;height:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;display:none"></span><!--astro:end--></astro-island></div></aside><script data-astro-rerun>
367
+ })();</script></div><a href="/prompts/" class="tw-nav-item" data-plugin-nav="prompts" data-pinned-nav="prompts"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 20h9"></path><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg><span class="tw-nav-label" data-i18n="nav.prompts">提示词管理</span></a><a href="/docs/manual/" class="tw-nav-item" data-hint="帮助中心" data-i18n-hint="nav.helpCenter"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M5 4.5h9.5L19 9v10.5H5V4.5Z" stroke-linejoin="round"></path><path d="M14.5 4.5V9H19" stroke-linejoin="round"></path><path d="M8 13h8M8 16.5h6" stroke-linecap="round"></path></svg><span class="tw-nav-label" data-i18n="nav.helpCenter">帮助中心</span></a></nav><div class="tw-nav-foot"><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).load=e,window.dispatchEvent(new Event(`astro:load`))})();</script><astro-island uid="Z12jkyC" prefix="r1" component-url="/_astro/SettingsDialog.CR3Iv-ml.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{}" ssr client="load" opts="{&quot;name&quot;:&quot;SettingsDialog&quot;,&quot;value&quot;:true}" await-children><div class="tw-nav-foot-row"><button type="button" class="tw-nav-settings-btn" data-hint="设置"><svg class="tw-nav-ico w-4.5 h-4.5 shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9c.2.6.7 1 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"></path></svg><span data-i18n="nav.settings">设置</span></button><button type="button" class="tw-nav-provider-chip is-empty" data-hint="未配置模型"><span class="tw-nav-provider-dot" aria-hidden="true"></span><span class="tw-nav-provider-name">未配置</span></button></div><span hidden="" style="position:fixed;top:1px;left:1px;width:1px;height:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;display:none"></span><!--astro:end--></astro-island></div></aside><script data-astro-rerun>
368
368
  (function () {
369
369
  try {
370
370
  var raw = localStorage.getItem('tw.app.model.v1');