lantern-harness 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/README.md +6 -6
- package/builtin/session/lh-spaces.mjs +102 -0
- package/cli/data-root.mjs +80 -3
- package/cli/lantern.mjs +2 -1
- package/cli/server.mjs +4 -0
- package/cli/spaces.mjs +91 -5
- package/config/app.defaults.json +4 -2
- package/dist/500.html +9 -5
- package/dist/_astro/Base.ByB0D4ZA.css +1 -0
- package/dist/_astro/{Base.astro_astro_type_script_index_0_lang.lxEwQ1R4.js → Base.astro_astro_type_script_index_0_lang.Cg_8YLVA.js} +1 -1
- package/dist/_astro/CaseGenerateApp.BlZyjWEr.js +9 -0
- package/dist/_astro/CasesLibrary.C76La3Xj.js +1 -0
- package/dist/_astro/ChatApp.gfsPLvan.js +269 -0
- package/dist/_astro/ColumnResize.Bs6GL3DJ.js +1 -0
- package/dist/_astro/DatePicker.BdwFRioL.js +1 -0
- package/dist/_astro/{DocsFileBrowser.DkE26UTR.js → DocsFileBrowser.BxAyrkkw.js} +1 -1
- package/dist/_astro/KnowledgeLibrary.Cv488Hot.js +1 -0
- package/dist/_astro/NavLibraries.ALZ9e12z.js +1 -0
- package/dist/_astro/PluginsPage.B2uxCiHL.js +1 -0
- package/dist/_astro/{PluginsPage.BNzpPg2H.js → PluginsPage.DEkyOfQE.js} +2 -2
- package/dist/_astro/PromptsLibrary.BUC1OiCH.js +1 -0
- package/dist/_astro/RequirementsLibrary.D3olQI63.js +1 -0
- package/dist/_astro/{SearchableSelect.DMS2XmXc.js → SearchableSelect.DP74JRWW.js} +1 -1
- package/dist/_astro/SelectDropdown.D2i7-lQC.js +1 -0
- package/dist/_astro/{SettingsDialog.DC0e7580.js → SettingsDialog.CrMDjSLJ.js} +1 -1
- package/dist/_astro/SlideOverDrawer.C7UVeCX1.js +1 -0
- package/dist/_astro/SpaceSwitcher.Wf8EPYUx.js +7 -0
- package/dist/_astro/TasksBoard.2j7rGT9O.js +1 -0
- package/dist/_astro/TemplatesLibrary.J0x7yIcY.js +1 -0
- package/dist/_astro/TodosBoard.BugeB7_7.js +1 -0
- package/dist/_astro/app-config.vqDkEMS3.js +1 -0
- package/dist/_astro/doc-roots.DAJP9Svr.js +1 -0
- package/dist/_astro/i18n.9qZsrs3u.js +7 -0
- package/dist/_astro/{open-docs-in-session.D3JCwMWB.js → open-docs-in-session.fLwnA5qh.js} +1 -1
- package/dist/_astro/plugins.DSUPSizB.js +1 -0
- package/dist/_astro/project-docs.Cd2gKPKh.js +1 -0
- package/dist/_astro/{settings.BoQ0e0m1.js → settings.CkbipdPI.js} +2 -2
- package/dist/_astro/{useListAnim.CnbC_9MC.js → useListAnim.Y3N2budK.js} +1 -1
- package/dist/cases/generate/index.html +10 -6
- package/dist/cases/library/index.html +10 -6
- package/dist/docs/changelog/index.html +69 -6
- package/dist/docs/install/index.html +22 -8
- package/dist/docs/manual/index.html +74 -11
- package/dist/index.html +10 -6
- package/dist/knowledge/index.html +10 -6
- package/dist/knowledge//345/212/237/350/203/275/346/265/213/350/257/225/347/224/250/344/276/213/347/274/226/345/206/231/350/247/204/350/214/203/index.html +9 -5
- package/dist/plugins/index.html +10 -6
- package/dist/prompts/index.html +10 -6
- package/dist/requirements/index.html +10 -6
- package/dist/tasks/index.html +253 -0
- package/dist/templates/index.html +10 -6
- package/dist/templates//345/212/237/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212//345/212/237/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212/346/250/241/346/235/277/index.html +9 -5
- package/dist/templates//346/200/247/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212//346/200/247/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212/346/250/241/346/235/277/index.html +9 -5
- package/dist/templates//346/200/247/350/203/275/346/265/213/350/257/225/347/224/250/344/276/213//346/200/247/350/203/275/346/265/213/350/257/225/347/224/250/344/276/213/346/250/241/346/235/277/index.html +9 -5
- package/dist/templates//346/216/245/345/217/243/346/265/213/350/257/225/346/212/245/345/221/212//346/216/245/345/217/243/346/265/213/350/257/225/346/212/245/345/221/212/346/250/241/346/235/277/index.html +9 -5
- package/dist/templates//350/207/252/345/212/250/345/214/226/346/265/213/350/257/225/347/224/250/344/276/213//350/207/252/345/212/250/345/214/226/346/265/213/350/257/225/347/224/250/344/276/213/346/250/241/346/235/277/index.html +9 -5
- package/dist/todos/index.html +253 -0
- package/docs//345/205/250/345/261/200/346/217/222/344/273/266.md +2 -2
- package/docs//345/256/211/350/243/205/346/211/213/345/206/214.md +10 -8
- package/docs//346/223/215/344/275/234/346/211/213/345/206/214.md +73 -23
- package/lh-plugins/lh-project-docs.mjs +2 -0
- package/lh-plugins/lh-tasks.mjs +223 -0
- package/lh-plugins/lh-todos.mjs +297 -0
- package/lh-plugins/storage-domain.mjs +1 -0
- package/package.json +1 -1
- package/dist/_astro/Base.B9f_iFAZ.css +0 -1
- package/dist/_astro/CaseGenerateApp.Br4uKjun.js +0 -9
- package/dist/_astro/CasesLibrary.CpPoVQ4P.js +0 -1
- package/dist/_astro/ChatApp.CYSPlSNP.js +0 -258
- package/dist/_astro/KnowledgeLibrary.DZinlAWn.js +0 -1
- package/dist/_astro/NavLibraries.EayBsg5g.js +0 -1
- package/dist/_astro/PluginsPage.CY61glLU.js +0 -1
- package/dist/_astro/PromptsLibrary.DfrrCjs7.js +0 -1
- package/dist/_astro/RequirementsLibrary.Dt0Gj6Nr.js +0 -1
- package/dist/_astro/SelectDropdown.Dc7QaPbH.js +0 -1
- package/dist/_astro/SpaceSwitcher.Yy2w8MDF.js +0 -7
- package/dist/_astro/TemplatesLibrary.uK-SjK1z.js +0 -1
- package/dist/_astro/app-config.CpjKWnzM.js +0 -1
- package/dist/_astro/i18n.BVvhz-vw.js +0 -7
- package/dist/_astro/plugins.CrpY8UI9.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,n as t}from"./react-dom.CqAxpHMt.js";import{i as n}from"./app-config.vqDkEMS3.js";import{t as r}from"./jsx-runtime.BUXbF_vF.js";import{a as i,i as a,n as o,r as s,t as c}from"./ConfirmDialog.BYz4HREM.js";import{t as l}from"./SelectDropdown.D2i7-lQC.js";import{a as ee,o as u,r as te}from"./plugins.DSUPSizB.js";import{C as ne,D as d,E as re,F as ie,I as f,M as p,N as ae,O as oe,P as se,S as m,T as h,b as g,f as _,j as v,k as y,n as ce,t as b,v as le,w as ue,x,y as S}from"./DatePicker.BdwFRioL.js";import{n as C,t as w}from"./ColumnResize.Bs6GL3DJ.js";var T=e(t(),1),E=r(),de=8e3,fe=[{key:`select`,width:32,min:28},{key:`index`,width:36,min:28},{key:`title`,min:160},{key:`status`,width:100,min:76},{key:`priority`,width:100,min:84},{key:`task`,width:156,min:96},{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:120,min:80},{key:`action`,width:80,min:64}],pe=[`title`,`status`,`priority`,`linkedTask`,`startDate`,`dueDate`,`note`],me={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`},he={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]`},D={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`},ge={pending:`bg-stone-400`,in_progress:`bg-[#3370ff]`,done:`bg-[#34c724]`,cancelled:`bg-stone-300`},_e={urgent_important:`bg-[#f54a45]`,important:`bg-[#ff8800]`,urgent:`bg-[#f7ba1e]`,normal:`bg-stone-300`,"":`border border-stone-300 bg-transparent`},O={status:`按状态分组`,priority:`按紧急程度分组`,none:`不分组`},ve=[`in_progress`,`pending`,`overdue`,`done`,`cancelled`],ye=x.map(e=>({value:e,label:m[e]})),be=[{value:``,label:`未设置`},...S.map(e=>({value:e,label:g[e]}))],xe=Object.keys(O).map(e=>({value:e,label:O[e]})),Se=[{value:`all`,label:`全部紧急程度`},...S.map(e=>({value:e,label:g[e]}))],Ce=`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 we(e){let{value:t,placeholder:n,muted:r,onChange:i,onCommit:a,onCancel:o}=e;return(0,E.jsx)(`input`,{type:`text`,value:t,placeholder:n,onChange:e=>i(e.target.value),onBlur:a,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),e.currentTarget.blur()):e.key===`Escape`&&(e.preventDefault(),o(),e.currentTarget.blur())},className:`${Ce} ${r&&!t?`text-stone-300`:``}`})}function Te(e){return(0,E.jsx)(b,{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 k(){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`path`,{d:`M5 19 11 5l6 14`}),(0,E.jsx)(`path`,{d:`M7.5 14h7`}),(0,E.jsx)(`path`,{d:`M18 9v10`})]})}function A(){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,E.jsx)(`path`,{d:`m8.5 12.5 2.5 2.5 4.5-5`})]})}function j(){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}),(0,E.jsx)(`path`,{d:`M9 4v16`})]})}function M(){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`rect`,{x:`4`,y:`5`,width:`16`,height:`15`,rx:`2`}),(0,E.jsx)(`path`,{d:`M4 10h16M9 3v4M15 3v4`})]})}function N(){return(0,E.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`M7 4h10l-5 7 5 9H7l5-9Z`})})}function Ee(e){return(0,E.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:`transition-transform ${e.open?``:`-rotate-90`}`,children:(0,E.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function P(e){return(0,E.jsxs)(`div`,{className:`flex items-start gap-3 px-6 py-2`,children:[(0,E.jsxs)(`div`,{className:`flex w-[132px] shrink-0 items-center gap-2 pt-1.5 text-sm text-stone-600`,children:[(0,E.jsx)(`span`,{className:`flex h-4 w-4 items-center justify-center text-stone-400`,children:e.icon}),(0,E.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,E.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.children})]})}var F=`h-9 w-full rounded-md border border-transparent bg-transparent px-2 text-sm text-stone-800 outline-none transition-colors hover:border-stone-200 focus:border-[#3370ff] focus:bg-white placeholder:text-stone-400`;function De(e){let{open:t,item:n,preset:r,tasks:c,tasksOn:ee,onClose:u,onSaved:te}=e,[d,re]=(0,T.useState)({title:``}),[se,h]=(0,T.useState)(``),[_,v]=(0,T.useState)(!1),[y,le]=(0,T.useState)(!0);(0,T.useEffect)(()=>{t&&(h(``),v(!1),le(!0),re(n?{title:n.title,status:n.status,priority:n.priority,linkedTask:n.linkedTask,taskId:n.taskId,startDate:n.startDate,dueDate:n.dueDate,note:n.note}:{title:``,status:`pending`,priority:``,startDate:p(),dueDate:p(),...r}))},[t,n,r]);let ue=[{value:``,label:`不关联`},...c.filter(e=>e.status!==`closed`||e.id===n?.taskId).map(e=>({value:e.id,label:e.title}))];function x(e){re(t=>({...t,...e}))}let S=ae({startDate:d.startDate??``,dueDate:d.dueDate??``}),C=ie({dueDate:d.dueDate??``}),w=oe(d.status??`pending`),de=w?ce((n&&oe(n.status)?n.taskEndDate:``)||p()):``,fe=C===null?``:d.status===`done`?`已完成`:d.status===`cancelled`?`已取消`:C<0?`逾期 ${Math.abs(C)} 天`:C===0?`今天截止`:`${C} 天`;async function pe(){let e=(d.title??``).trim();if(!e)h(`请填写待办名称`);else if(d.startDate&&d.dueDate&&d.dueDate<d.startDate)h(`截止日期不能早于开始日期`);else{v(!0),h(``);try{let t={...d,title:e};n?await f(n.id,t):await ne([t],{mode:`manual`}),await te(),u()}catch(e){h(e instanceof Error?e.message:String(e))}finally{v(!1)}}}return(0,E.jsxs)(a,{open:t,onClose:u,transition:!0,className:`relative z-100`,children:[(0,E.jsx)(o,{transition:!0,className:`tw-dialog-backdrop-anim fixed inset-0 bg-black/25`,"aria-hidden":`true`}),(0,E.jsx)(`div`,{className:`fixed inset-0 flex justify-end`,children:(0,E.jsxs)(i,{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,E.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-stone-100 px-6 py-4`,children:[(0,E.jsx)(s,{className:`text-base font-semibold text-stone-900`,children:n?`待办详情`:`新建待办`}),(0,E.jsx)(`button`,{type:`button`,onClick:u,"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,E.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-3`,children:[(0,E.jsx)(P,{icon:(0,E.jsx)(k,{}),label:`待办名称`,children:(0,E.jsx)(`input`,{autoFocus:!0,value:d.title,onChange:e=>x({title:e.target.value}),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),pe())},placeholder:`请输入内容`,className:F})}),(0,E.jsx)(P,{icon:(0,E.jsx)(A,{}),label:`待办状态`,children:(0,E.jsx)(l,{unstyled:!0,showCheck:!1,ariaLabel:`待办状态`,menuMinWidth:140,options:ye,value:d.status??`pending`,onChange:e=>x({status:e}),className:`w-full`,triggerClassName:`h-9 w-full rounded-md px-2 text-left transition-colors hover:bg-stone-50 focus:ring-2 focus:ring-[#3370ff]/30`,renderTrigger:()=>(0,E.jsx)(`span`,{className:`inline-flex h-7 items-center rounded-full px-3 text-sm font-medium ${he[d.status??`pending`]}`,children:m[d.status??`pending`]}),renderOptionPrefix:e=>(0,E.jsx)(`span`,{className:`h-2 w-2 rounded-full ${ge[e.value]}`})})}),(0,E.jsxs)(`button`,{type:`button`,onClick:()=>le(e=>!e),"aria-expanded":y,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,E.jsx)(`span`,{className:`flex h-4 w-4 items-center justify-center text-stone-400`,children:(0,E.jsx)(j,{})}),(0,E.jsx)(`span`,{children:`任务详情`}),(0,E.jsx)(`span`,{className:`text-stone-400`,children:(0,E.jsx)(Ee,{open:y})})]}),y?(0,E.jsxs)(`div`,{className:`ml-[42px] border-l border-stone-100 pl-1`,children:[(0,E.jsx)(P,{icon:(0,E.jsx)(j,{}),label:`所属任务`,children:ee?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(l,{unstyled:!0,showCheck:!1,ariaLabel:`所属任务`,menuMinWidth:220,options:ue,value:d.taskId??``,onChange:e=>{x({taskId:e,linkedTask:c.find(t=>t.id===e)?.title??``})},triggerClassName:`h-9 w-full rounded-md px-2 text-sm hover:border-stone-200 focus:border-[#3370ff]`,renderTrigger:()=>(0,E.jsx)(`span`,{className:`truncate ${d.taskId||d.linkedTask?`text-stone-800`:`text-stone-400`}`,children:d.taskId?c.find(e=>e.id===d.taskId)?.title??``:d.linkedTask||`请选择任务`})}),c.length===0?(0,E.jsx)(`p`,{className:`mt-1 px-2 text-xs text-stone-400`,children:`任务管理里还没有任务,可到「任务管理」新建后再关联。`}):null]}):(0,E.jsx)(`div`,{className:`flex h-9 items-center rounded-md bg-stone-50 px-2 text-sm text-stone-400`,children:(0,E.jsx)(`span`,{className:`truncate`,children:d.linkedTask?`${d.linkedTask}(任务管理插件未启用)`:`任务管理插件未启用,无法关联任务`})})}),(0,E.jsx)(P,{icon:(0,E.jsx)(A,{}),label:`重要紧急程度`,children:(0,E.jsx)(l,{unstyled:!0,hideChevron:!0,showCheck:!1,ariaLabel:`重要紧急程度`,menuMinWidth:128,options:be,value:d.priority??``,onChange:e=>x({priority:e}),className:`w-fit`,triggerClassName:`h-8 rounded-md px-2.5 text-center text-sm font-medium focus:ring-2 focus:ring-[#3370ff]/30 ${D[d.priority??``]}`,renderTrigger:()=>(0,E.jsx)(`span`,{children:d.priority?g[d.priority]:`未设置`}),renderOptionPrefix:e=>(0,E.jsx)(`span`,{className:`h-2 w-2 rounded-full ${_e[e.value]}`})})}),(0,E.jsx)(P,{icon:(0,E.jsx)(M,{}),label:`结束日期`,children:(0,E.jsxs)(`div`,{className:`flex h-9 items-center px-2 text-sm tabular-nums`,"aria-readonly":`true`,children:[de?(0,E.jsx)(`span`,{className:`text-stone-800`,children:de}):(0,E.jsx)(`span`,{className:`text-stone-400`,children:`待办未完成`}),(0,E.jsx)(`span`,{className:`ml-2 text-[11px] text-stone-400`,children:w?`按完成日期自动记录`:`状态为已完成 / 已取消时自动记录`})]})})]}):null,(0,E.jsx)(P,{icon:(0,E.jsx)(M,{}),label:`开始日期`,children:(0,E.jsx)(b,{value:d.startDate??``,onChange:e=>x({startDate:e}),className:`${F} tabular-nums`})}),(0,E.jsx)(P,{icon:(0,E.jsx)(M,{}),label:`截止日期`,children:(0,E.jsx)(b,{value:d.dueDate??``,onChange:e=>x({dueDate:e}),className:`${F} tabular-nums`})}),(0,E.jsx)(P,{icon:(0,E.jsx)(N,{}),label:`待办周期`,children:(0,E.jsx)(`div`,{className:`px-2 pt-1.5 text-sm text-stone-500`,children:S===null?`—`:`${S} 天`})}),(0,E.jsx)(P,{icon:(0,E.jsx)(N,{}),label:`剩余天数`,children:(0,E.jsx)(`div`,{className:`px-2 pt-1.5 text-sm text-stone-500`,children:fe||`—`})}),(0,E.jsx)(P,{icon:(0,E.jsx)(k,{}),label:`备注`,children:(0,E.jsx)(`textarea`,{value:d.note??``,onChange:e=>x({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`})}),se?(0,E.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:se}):null]}),(0,E.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-stone-100 px-6 py-3`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:u,disabled:_,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,E.jsx)(`button`,{type:`button`,onClick:()=>void pe(),disabled:_,className:`h-8 rounded-lg bg-[#3370ff] px-4 text-sm font-medium text-white transition-colors hover:bg-[#2b5fd9] disabled:opacity-40`,children:_?`保存中…`:n?`保存`:`新建`})]})]})})]})}function I(){let[e,t]=(0,T.useState)(!1),[r,i]=(0,T.useState)(!0),[a,o]=(0,T.useState)(null),[s,x]=(0,T.useState)([]),[O,Ce]=(0,T.useState)([]),[k,A]=(0,T.useState)(!1),[j,M]=(0,T.useState)(null),[N,Ee]=(0,T.useState)(!1),[P,F]=(0,T.useState)(``),[I,Oe]=(0,T.useState)(`all`),[L,ke]=(0,T.useState)(`status`),[Ae,je]=(0,T.useState)({}),[R,Me]=(0,T.useState)({}),[Ne,Pe]=(0,T.useState)({}),[z,B]=(0,T.useState)(null),[V,H]=(0,T.useState)(null),[Fe,Ie]=(0,T.useState)(!1),[Le,Re]=(0,T.useState)(null),U=(0,T.useRef)(!0),ze=(0,T.useRef)(!1),W=(0,T.useRef)(!1),G=C(`lh:todos:cols:v1`,fe),Be=z!==null,K=(0,T.useRef)(z);K.current=z;let Ve=(0,T.useRef)(!1),He=(0,T.useRef)(async()=>{});He.current=qe,(0,T.useEffect)(()=>(U.current=!0,()=>{U.current=!1}),[]),(0,T.useEffect)(()=>{if(!Be)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=K.current;if(!n)return;if(n.title.trim()){He.current();return}let r=p();!n.note.trim()&&!n.taskId&&n.status===n.baseStatus&&n.priority===n.basePriority&&n.startDate===r&&n.dueDate===r&&B(null)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[Be]);let q=(0,T.useCallback)(async()=>{try{let[e,t]=await Promise.all([y(),k?_().catch(()=>[]):Promise.resolve([])]);if(!U.current)return;let n=t;if(!ze.current&&k){ze.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=>le(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)}}x(e),Ce(n),M(null)}catch(e){if(!U.current)return;M(e instanceof Error?e.message:String(e))}},[k]);(0,T.useEffect)(()=>{let e=ee(e=>{i(!!e.todos),A(!!e.tasks)});return n().then(()=>{i(te(`todos`)),A(te(`tasks`)),t(!0)}),e},[]),(0,T.useEffect)(()=>{e&&r&&(async()=>{let e=await re();U.current&&(e?(await q(),U.current&&o(!0)):o(!1))})()},[e,r,q]),(0,T.useEffect)(()=>{if(a!==!0)return;let e=window.setInterval(()=>{W.current||q()},de),t=()=>{W.current||q()};return window.addEventListener(`focus`,t),()=>{window.clearInterval(e),window.removeEventListener(`focus`,t)}},[a,q]),(0,T.useEffect)(()=>{if(!k||a!==!0||O.length===0)return;let e=s.filter(e=>!e.taskId&&e.linkedTask.trim());if(!e.length)return;let t=!1;return(async()=>{let n=[];for(let t of e){let e=O.find(e=>e.title.trim()===t.linkedTask.trim());if(e)try{n.push(await f(t.id,{taskId:e.id}))}catch{}}!t&&n.length&&x(e=>e.map(e=>n.find(t=>t.id===e.id)??e))})(),()=>{t=!0}},[k,a,s,O]);function Ue(e,t,n){Pe(r=>({...r,[e]:{...r[e],[t]:n}}))}function J(e){Pe(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})}let We=(0,T.useMemo)(()=>[{value:``,label:`不关联`},...O.filter(e=>e.status!==`closed`).map(e=>({value:e.id,label:e.title}))],[O]);function Y(e){return e.taskId?O.find(t=>t.id===e.taskId)?.title??e.linkedTask:e.linkedTask}async function X(e,t){x(n=>n.map(n=>n.id===e?{...n,...t}:n));try{let n=await f(e,t);if(!U.current)return;x(t=>t.map(t=>t.id===e?n:t)),M(null),t.taskId&&await q()}catch(e){M(e instanceof Error?e.message:String(e)),await q()}}async function Ge(e){let t=Ne[e],n=s.find(t=>t.id===e);if(!t||!n)return;let r={},i=n;for(let e of pe){let n=t[e];n!==void 0&&String(i[e]??``)!==String(n)&&(r[e]=n)}if(!Object.keys(r).length)J(e);else if(typeof r.title==`string`&&!r.title.trim())M(`待办名称不能为空`),J(e);else try{let t=await f(e,r);if(!U.current)return;x(n=>n.map(n=>n.id===e?t:n)),Pe(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)),J(e)}}function Ke(e){let t=e.newStatus??`pending`,n=e.newPriority??``;B({groupKey:e.key,title:``,status:t,priority:n,taskId:``,startDate:p(),dueDate:p(),note:``,baseStatus:t,basePriority:n}),je(t=>({...t,[e.key]:!1}))}async function qe(){let e=K.current;if(!e||Ve.current)return;let t=e.title.trim();if(t){Ve.current=!0,Ie(!0);try{let n=O.find(t=>t.id===e.taskId);await ne([{title:t,status:e.status,priority:e.priority,taskId:e.taskId,linkedTask:n?.title??``,startDate:e.startDate,dueDate:e.dueDate,note:e.note}],{mode:`manual`}),K.current===e&&B(null),M(null),await q()}catch(e){M(e instanceof Error?e.message:String(e))}finally{Ve.current=!1,U.current&&Ie(!1)}}}async function Je(){let e=V;if(e){H(null),Ee(!0),M(null);try{await ue(e.map(e=>e.id)),Me({}),await q()}catch(e){M(e instanceof Error?e.message:String(e))}finally{U.current&&Ee(!1)}}}let Z=p(),Ye=(0,T.useMemo)(()=>d(s,{status:`all`,priority:I,keyword:P,today:Z}),[s,I,P,Z]),Q=(0,T.useMemo)(()=>v(Ye),[Ye]),Xe=(0,T.useMemo)(()=>L===`none`?[{key:`all`,label:`全部待办`,pill:`bg-stone-500 text-white`,items:Q}]:L===`priority`?[...S,``].map(e=>({key:`priority:${e||`none`}`,label:e?g[e]:`未设置`,pill:e?D[e]:`bg-stone-300 text-stone-600`,items:Q.filter(t=>t.priority===e),newPriority:e})):ve.map(e=>({key:`status:${e}`,label:m[e],pill:me[e],items:Q.filter(t=>h(t,Z)===e),newStatus:e===`overdue`?`pending`:e})),[L,Q,Z]).filter(e=>e.items.length>0||z?.groupKey===e.key&&!!z),Ze=Object.keys(R).filter(e=>R[e]),$=(0,T.useMemo)(()=>{let e={total:s.length,pending:0,in_progress:0,done:0,overdue:0};for(let t of s){let n=h(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},[s,Z]);return e?r?a===null?(0,E.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,E.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,E.jsx)(`span`,{className:`tw-lib-spin`,"aria-hidden":`true`})})}):a?(0,E.jsxs)(`section`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-stone-200 bg-white`,children:[(0,E.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-3 border-b border-stone-100 px-4 py-3`,children:[(0,E.jsxs)(`div`,{className:`text-sm text-stone-600`,children:[`共 `,(0,E.jsx)(`span`,{className:`font-medium text-stone-800`,children:$.total}),` 条`,(0,E.jsxs)(`span`,{className:`text-stone-400`,children:[` `,`· 待开始 `,$.pending,` · 进行中 `,$.in_progress,` · 已完成 `,$.done,$.overdue?` · 已延期 ${$.overdue}`:``]})]}),(0,E.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2`,children:[(0,E.jsx)(`input`,{value:P,onChange:e=>F(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,E.jsx)(l,{flat:!0,className:`w-[132px]`,ariaLabel:`分组方式`,options:xe,value:L,onChange:e=>ke(e)}),(0,E.jsx)(l,{flat:!0,className:`w-[136px]`,ariaLabel:`紧急程度筛选`,options:Se,value:I,onChange:e=>Oe(e)}),(0,E.jsx)(`button`,{type:`button`,disabled:N||Ze.length===0,onClick:()=>H(s.filter(e=>R[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,E.jsx)(`button`,{type:`button`,disabled:N,onClick:()=>Re({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,E.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,E.jsx)(`span`,{className:`min-w-0 flex-1`,children:j}),(0,E.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,E.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,onFocusCapture:()=>{W.current=!0},onBlurCapture:()=>{window.setTimeout(()=>{W.current=!!document.activeElement?.closest(`.tw-todo-table`)},0)},children:(0,E.jsxs)(`table`,{className:`tw-todo-table w-full table-fixed border-collapse text-sm`,style:G.tableStyle,children:[(0,E.jsx)(`colgroup`,{children:fe.map(e=>(0,E.jsx)(`col`,{style:G.widthOf(e.key)?{width:G.widthOf(e.key)}:void 0},e.key))}),(0,E.jsx)(`thead`,{className:`tw-table-head sticky top-0 z-10 text-xs text-stone-500`,children:(0,E.jsxs)(`tr`,{children:[(0,E.jsx)(`th`,{className:`px-2 py-2 text-left font-medium`,children:(0,E.jsx)(`input`,{type:`checkbox`,"aria-label":`全选可见待办`,checked:Q.length>0&&Q.every(e=>R[e.id]),onChange:e=>{let t=e.target.checked;Me(e=>{let n={...e};for(let e of Q)t?n[e.id]=!0:delete n[e.id];return n})}})}),(0,E.jsx)(`th`,{className:`px-1 py-2 text-left font-medium`,"aria-label":`行号`}),(0,E.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`待办名称`,(0,E.jsx)(w,{...G.resizeProps(2)})]}),(0,E.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`待办状态`,(0,E.jsx)(w,{...G.resizeProps(3)})]}),(0,E.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`紧急程度`,(0,E.jsx)(w,{...G.resizeProps(4)})]}),(0,E.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`所属任务`,(0,E.jsx)(w,{...G.resizeProps(5)})]}),(0,E.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`开始日期`,(0,E.jsx)(w,{...G.resizeProps(6)})]}),(0,E.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`截止日期`,(0,E.jsx)(w,{...G.resizeProps(7)})]}),(0,E.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`结束日期`,(0,E.jsx)(w,{...G.resizeProps(8)})]}),(0,E.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`周期`,(0,E.jsx)(w,{...G.resizeProps(9)})]}),(0,E.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`剩余`,(0,E.jsx)(w,{...G.resizeProps(10)})]}),(0,E.jsxs)(`th`,{className:`relative px-2 py-2 text-left font-medium whitespace-nowrap`,children:[`备注`,(0,E.jsx)(w,{...G.resizeProps(11)})]}),(0,E.jsx)(`th`,{className:`px-1 py-2 text-center font-medium whitespace-nowrap`,children:`操作`})]})}),Xe.map(e=>{let t=Ae[e.key]===!0;return(0,E.jsxs)(`tbody`,{children:[(0,E.jsx)(`tr`,{className:`border-t border-stone-100 bg-white`,children:(0,E.jsx)(`td`,{colSpan:13,className:`px-2 py-0 pt-3 pb-1.5`,children:(0,E.jsxs)(`button`,{type:`button`,onClick:()=>je(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,E.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,E.jsx)(`path`,{d:`m6 9 6 6 6-6`})}),(0,E.jsx)(`span`,{className:`rounded-md px-2 py-0.5 text-xs font-medium ${e.pill}`,children:e.label}),(0,E.jsxs)(`span`,{className:`text-xs text-stone-400 tabular-nums`,children:[e.items.length,` 条记录`]})]})})}),t?null:e.items.map((e,t)=>{let n=Ne[e.id]??{},r={...e,...n},i=h(r,Z),a=ae(r),o=ie(r,Z),s=o===null?`—`:r.status===`done`?`已完成`:r.status===`cancelled`?`已取消`:o<0?`逾期 ${Math.abs(o)} 天`:o===0?`今天截止`:`${o} 天`;return(0,E.jsxs)(`tr`,{className:`group/row border-t border-stone-100 hover:bg-[#f7f8fa]`,children:[(0,E.jsx)(`td`,{className:`px-2 py-1 align-middle`,children:(0,E.jsx)(`input`,{type:`checkbox`,"aria-label":`选择 ${e.title}`,checked:!!R[e.id],onChange:t=>Me(n=>{let r={...n};return t.target.checked?r[e.id]=!0:delete r[e.id],r})})}),(0,E.jsx)(`td`,{className:`px-1 py-1 align-middle text-xs text-stone-400 tabular-nums`,children:t+1}),(0,E.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,E.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[e.source===`ai`?(0,E.jsx)(`span`,{className:`shrink-0 rounded bg-[#e1eaff] px-1 py-px text-[10px] text-[#1f4ec2]`,title:`AI 记录`,children:`AI`}):null,(0,E.jsx)(we,{value:r.title,placeholder:`输入待办名称`,onChange:t=>Ue(e.id,`title`,t),onCommit:()=>void Ge(e.id),onCancel:()=>J(e.id)})]})}),(0,E.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,E.jsx)(l,{unstyled:!0,hideChevron:!0,showCheck:!1,centerContent:!0,ariaLabel:`待办状态`,menuMinWidth:120,options:ye,value:e.status,onChange:t=>void X(e.id,{status:t}),triggerClassName:`h-7 w-full rounded-md px-2 text-center text-xs font-medium focus:ring-2 focus:ring-[#3370ff]/30 ${he[i]}`,renderTrigger:()=>(0,E.jsx)(`span`,{className:`w-full truncate text-center`,children:m[e.status]}),renderOptionPrefix:e=>(0,E.jsx)(`span`,{className:`h-2 w-2 rounded-full ${ge[e.value]}`})})}),(0,E.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,E.jsx)(l,{unstyled:!0,hideChevron:!0,showCheck:!1,centerContent:!0,ariaLabel:`紧急程度`,menuMinWidth:128,options:be,value:e.priority,onChange:t=>void X(e.id,{priority:t}),triggerClassName:`h-7 w-full rounded-md px-1.5 text-center text-xs font-medium focus:ring-2 focus:ring-[#3370ff]/30 ${D[e.priority]}`,renderTrigger:()=>(0,E.jsx)(`span`,{className:`w-full truncate text-center`,children:e.priority?g[e.priority]:`未设置`}),renderOptionPrefix:e=>(0,E.jsx)(`span`,{className:`h-2 w-2 rounded-full ${_e[e.value]}`})})}),(0,E.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:k?(0,E.jsx)(l,{unstyled:!0,showCheck:!1,ariaLabel:`所属任务`,menuMinWidth:220,options:We,value:r.taskId,onChange:t=>{let n=O.find(e=>e.id===t);X(e.id,{taskId:t,linkedTask:n?.title??``})},triggerClassName:`h-8 w-full rounded-md px-1.5 text-sm hover:border-stone-200`,renderTrigger:()=>(0,E.jsx)(`span`,{className:`truncate ${Y(r)?`text-stone-800`:`text-stone-300`}`,children:Y(r)||`未关联`})}):(0,E.jsx)(`span`,{className:`block truncate px-1.5 text-xs text-stone-400`,children:Y(r)?`${Y(r)} · 插件未启用`:`任务管理插件未启用`})}),(0,E.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,E.jsx)(Te,{value:r.startDate,onChange:t=>void X(e.id,{startDate:t})})}),(0,E.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,E.jsx)(Te,{value:r.dueDate,onChange:t=>void X(e.id,{dueDate:t})})}),(0,E.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap tabular-nums`,children:se(r)?(0,E.jsx)(`span`,{className:`text-stone-500`,children:ce(se(r))}):(0,E.jsx)(`span`,{className:`text-stone-400`,children:`待办未完成`})}),(0,E.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap text-stone-500 tabular-nums`,children:a===null?`—`:`${a} 天`}),(0,E.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,E.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,E.jsx)(we,{value:r.note,placeholder:`—`,muted:!0,onChange:t=>Ue(e.id,`note`,t),onCommit:()=>void Ge(e.id),onCancel:()=>J(e.id)})}),(0,E.jsx)(`td`,{className:`px-1 py-1 text-right align-middle`,children:(0,E.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:()=>Re({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,E.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,E.jsx)(`path`,{d:`M14 4h6v6`}),(0,E.jsx)(`path`,{d:`M20 4 13 11`}),(0,E.jsx)(`path`,{d:`M10 20H4v-6`}),(0,E.jsx)(`path`,{d:`M4 20l7-7`})]})}),(0,E.jsx)(`button`,{type:`button`,disabled:N,onClick:()=>H([e]),"aria-label":`删除 ${e.title}`,className:`rounded p-1 text-stone-300 transition-colors hover:bg-red-50 hover:text-red-600 focus:text-red-600 disabled:opacity-40`,children:(0,E.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,E.jsx)(`path`,{d:`M3 6h18`}),(0,E.jsx)(`path`,{d:`M8 6V4h8v2`}),(0,E.jsx)(`path`,{d:`M19 6l-1 14H6L5 6`}),(0,E.jsx)(`path`,{d:`M10 11v6M14 11v6`})]})})]})})]},e.id)}),t?null:z?.groupKey===e.key?(0,E.jsxs)(`tr`,{className:`tw-new-row border-t border-stone-100`,children:[(0,E.jsx)(`td`,{className:`px-2 py-1 align-middle`}),(0,E.jsx)(`td`,{className:`px-1 py-1 align-middle text-xs text-stone-400 tabular-nums`,children:e.items.length+1}),(0,E.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,E.jsx)(`input`,{autoFocus:!0,value:z.title,disabled:Fe,placeholder:`输入待办名称,回车或点空白处保存`,onChange:e=>B(t=>t&&{...t,title:e.target.value}),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),qe()):e.key===`Escape`&&(e.preventDefault(),B(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,E.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,E.jsx)(l,{unstyled:!0,hideChevron:!0,showCheck:!1,centerContent:!0,ariaLabel:`待办状态`,menuMinWidth:120,options:ye,value:z.status,onChange:e=>B(t=>t&&{...t,status:e}),triggerClassName:`h-7 w-full rounded-md px-2 text-center text-xs font-medium focus:ring-2 focus:ring-[#3370ff]/30 ${he[z.status]}`,renderTrigger:()=>(0,E.jsx)(`span`,{className:`w-full truncate text-center`,children:m[z.status]}),renderOptionPrefix:e=>(0,E.jsx)(`span`,{className:`h-2 w-2 rounded-full ${ge[e.value]}`})})}),(0,E.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,E.jsx)(l,{unstyled:!0,hideChevron:!0,showCheck:!1,centerContent:!0,ariaLabel:`紧急程度`,menuMinWidth:128,options:be,value:z.priority,onChange:e=>B(t=>t&&{...t,priority:e}),triggerClassName:`h-7 w-full rounded-md px-1.5 text-center text-xs font-medium focus:ring-2 focus:ring-[#3370ff]/30 ${D[z.priority]}`,renderTrigger:()=>(0,E.jsx)(`span`,{className:`w-full truncate text-center`,children:z.priority?g[z.priority]:`未设置`}),renderOptionPrefix:e=>(0,E.jsx)(`span`,{className:`h-2 w-2 rounded-full ${_e[e.value]}`})})}),(0,E.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:k?(0,E.jsx)(l,{unstyled:!0,showCheck:!1,ariaLabel:`所属任务`,menuMinWidth:220,options:We,value:z.taskId,onChange:e=>B(t=>t&&{...t,taskId:e}),triggerClassName:`h-8 w-full rounded-md px-1.5 text-sm hover:border-stone-200`,renderTrigger:()=>{let e=O.find(e=>e.id===z.taskId);return(0,E.jsx)(`span`,{className:`truncate ${e?`text-stone-800`:`text-stone-300`}`,children:e?.title||`未关联`})}}):(0,E.jsx)(`span`,{className:`block truncate px-1.5 text-xs text-stone-400`,children:`任务管理插件未启用`})}),(0,E.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,E.jsx)(b,{value:z.startDate,onChange:e=>B(t=>t&&{...t,startDate:e}),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,E.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,E.jsx)(b,{value:z.dueDate,onChange:e=>B(t=>t&&{...t,dueDate:e}),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,E.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap tabular-nums`,children:oe(z.status)?(0,E.jsx)(`span`,{className:`text-stone-500`,children:ce(p())}):(0,E.jsx)(`span`,{className:`text-stone-400`,children:`待办未完成`})}),(0,E.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap text-stone-400 tabular-nums`,children:`—`}),(0,E.jsx)(`td`,{className:`px-2 py-1 align-middle text-xs whitespace-nowrap text-stone-400 tabular-nums`,children:`—`}),(0,E.jsx)(`td`,{className:`px-1 py-1 align-middle`,children:(0,E.jsx)(`input`,{value:z.note,disabled:Fe,placeholder:`—`,onChange:e=>B(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,E.jsx)(`td`,{className:`px-1 py-1 align-middle`})]}):(0,E.jsxs)(`tr`,{className:`border-t border-stone-100`,children:[(0,E.jsx)(`td`,{className:`px-2 py-0.5`}),(0,E.jsx)(`td`,{className:`px-1 py-0.5`}),(0,E.jsx)(`td`,{className:`px-1 py-0.5`,colSpan:11,children:(0,E.jsxs)(`button`,{type:`button`,disabled:Fe,onClick:()=>Ke(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,E.jsx)(`span`,{className:`text-sm leading-none`,children:`+`}),`新增记录`]})})]})]},e.key)}),Xe.length===0?(0,E.jsx)(`tbody`,{children:(0,E.jsx)(`tr`,{children:(0,E.jsx)(`td`,{colSpan:13,className:`px-3 py-16 text-center text-sm text-stone-400`,children:s.length===0?`还没有待办`:`没有匹配的待办,试试调整搜索或筛选`})})}):null]})}),(0,E.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,E.jsxs)(`span`,{children:[`共 `,Q.length,` 条`,Ze.length?` · 已选 ${Ze.length}`:``]}),(0,E.jsx)(`span`,{className:`ml-auto text-stone-400`,children:`点击单元格直接编辑,回车或点空白处保存`})]}),(0,E.jsx)(De,{open:Le!==null,item:Le?.item??null,preset:Le?.preset,tasks:O,tasksOn:k,onClose:()=>Re(null),onSaved:q}),(0,E.jsx)(c,{open:V!=null,title:V&&V.length>1?`批量删除`:`删除待办`,message:V&&V.length>1?`确认删除已选中的 ${V.length} 条待办?此操作不可恢复。`:`删除「${V?.[0]?.title??``}」?此操作不可恢复。`,confirmLabel:`删除`,cancelLabel:`取消`,danger:!0,onClose:()=>H(null),onConfirm:()=>void Je()})]}):(0,E.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,E.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:u(`todos`)}):(0,E.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,E.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center`,children:(0,E.jsx)(`span`,{className:`tw-lib-spin`,"aria-hidden":`true`})})})}export{I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=[{id:`functional`,label:`功能测试`,casesFolder:`功能测试`,templateFolder:`功能测试用例`},{id:`api`,label:`接口测试`,casesFolder:`接口测试`,templateFolder:`接口测试用例`},{id:`performance`,label:`性能测试`,casesFolder:`性能测试`,templateFolder:`性能测试用例`},{id:`automation`,label:`自动化测试`,casesFolder:`自动化测试`,templateFolder:`自动化测试用例`}];function t(){return`ct_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,7)}`}function n(e){let t=e.trim()||`未命名类型`;return{casesFolder:t,templateFolder:`${t}用例`}}function r(e){if(!e||typeof e!=`object`)return null;let r=e,i=String(r.label??``).trim();if(!i)return null;let a=String(r.id??``).trim()||t(),o=n(i);return{id:a,label:i,casesFolder:typeof r.casesFolder==`string`&&r.casesFolder.trim()?r.casesFolder.trim():o.casesFolder,templateFolder:typeof r.templateFolder==`string`&&r.templateFolder.trim()?r.templateFolder.trim():o.templateFolder}}function i(t){if(!Array.isArray(t))return e.map(e=>({...e}));let n=[],i=new Set;for(let e of t){let t=r(e);t&&!i.has(t.id)&&(i.add(t.id),n.push(t))}return n.length?n:e.map(e=>({...e}))}function a(){return t()}var o=[`测试规范`,`方法论`,`环境约定`];function s(e){if(!Array.isArray(e))return[...o];let t=[],n=new Set;for(let r of e){let e=String(r??``).trim();!e||e.length>40||n.has(e)||(n.add(e),t.push(e))}return t.length?t:[...o]}var c=[{id:`case`,label:`用例生成提示词`,hint:`用于编写「用例生成」提示词:指导模型按需求与模板输出可入库用例;须约束 JSON 结构、字段对齐模板、步骤换行与覆盖策略,不要限定固定用例条数。`},{id:`general`,label:`通用提示词`,hint:`用于编写通用测试/工作台提示词:角色、输出风格与约束清晰,可直接作为系统或任务提示词使用。`}];function l(){return`pk_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,7)}`}function u(e){return`生成「${e.trim()||`自定义`}」类提示词:角色、输出风格与约束清晰,可直接作为系统或任务提示词使用。`}function d(e){if(!e||typeof e!=`object`)return null;let t=e,n=String(t.label??``).trim();if(!n)return null;let r=String(t.id??``).trim()||l(),i=typeof t.hint==`string`&&t.hint.trim()?t.hint.trim():u(n);return r===`case`&&i.includes(`「测试用例生成」`)&&(i=c[0].hint),{id:r,label:n,hint:i}}function f(e){if(!Array.isArray(e))return c.map(e=>({...e}));let t=[],n=new Set;for(let r of e){let e=d(r);e&&!n.has(e.id)&&(n.add(e.id),t.push(e))}return t.length?t:c.map(e=>({...e}))}function p(){return l()}var m=[{id:`tasks`,href:`tasks/`,i18n:`nav.tasks`,plugin:`tasks`,match:`tasks`},{id:`todos`,href:`todos/`,i18n:`nav.todos`,plugin:`todos`,match:`todos`},{id:`cases`,href:`cases/library/`,i18n:`nav.caseManage`,plugin:`cases`,match:`cases`},{id:`prompts`,href:`prompts/`,i18n:`nav.prompts`,plugin:`prompts`,match:`prompts`},{id:`knowledgeLib`,href:`knowledge/`,i18n:`nav.knowledge`,plugin:`knowledgeLib`,match:`knowledge`},{id:`requirements`,href:`requirements/`,i18n:`nav.requirements`,plugin:`requirements`,match:`requirements`},{id:`templates`,href:`templates/`,i18n:`nav.templates`,plugin:`templates`,match:`templates`}],h=[],ee=[`prompts`];function te(e){return ee.includes(e)}var g=[`check`,`pencil`,`book`,`fileText`,`layers`,`list`,`folder`,`star`,`database`,`target`,`code`,`flask`,`home`,`clipboard`,`bug`,`calendar`,`chart`,`globe`,`link`,`users`,`terminal`,`tag`,`flag`,`zap`],_={tasks:`clipboard`,todos:`list`,cases:`check`,prompts:`pencil`,knowledgeLib:`book`,requirements:`fileText`,templates:`layers`};function ne(e){return typeof e==`string`&&g.includes(e)}function v(e){let t={..._};if(!e||typeof e!=`object`||Array.isArray(e))return t;for(let n of m){let r=e[n.id];ne(r)&&(t[n.id]=r)}return t}var y=new Set(m.map(e=>e.id));function b(e){return typeof e==`string`&&y.has(e)}function re(e){return m.find(t=>t.id===e)}function x(e){return`item:${e}`}function S(e){return`group:${e}`}function C(){return`ng_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,7)}`}function ie(){return h.map(e=>({id:e.id,name:e.name,items:[...e.items]}))}function w(e,t=!0){if(e==null||!Array.isArray(e))return t?ie():[];let n=new Set,r=[],i=new Set;for(let t of e){if(!t||typeof t!=`object`)continue;let e=t,a=String(e.name??``).trim();if(!a)continue;let o=String(e.id??``).trim()||C();i.has(o)&&(o=C());let s=[];if(Array.isArray(e.items))for(let t of e.items)b(t)&&!n.has(t)&&(n.add(t),s.push(t));let c=String(e.parentId??``).trim()||void 0;i.add(o),r.push({id:o,name:a,items:s,parentId:c})}let a=new Set(r.map(e=>e.id)),o=r.map(e=>{let t=e.parentId;return(!t||t===e.id||!a.has(t))&&(t=void 0),t?{...e,parentId:t}:{id:e.id,name:e.name,items:e.items}}),s=new Map(o.map(e=>[e.id,e])),c=o.map(e=>{if(!e.parentId)return e;let t=s.get(e.parentId);if(t?.parentId){let n=t.parentId;return n&&n!==e.id&&a.has(n)?{...e,parentId:n}:{id:e.id,name:e.name,items:e.items}}return e}),l=new Set(c.map(e=>e.parentId).filter(e=>!!e));return c.filter(e=>e.items.length>0||l.has(e.id))}function T(e,t){let n=t.name.trim(),r=t.items.filter((e,t,n)=>b(e)&&n.indexOf(e)===t);if(!n||!r.length)return{groups:e,id:t.id?.trim()||``};let i=t.id?.trim()||C(),a=e.find(e=>e.id===i),o=t.parentId===void 0?a?.parentId:t.parentId.trim()||void 0;if(o===i&&(o=void 0),o){let t=e.find(e=>e.id===o);t?t.parentId&&(o=t.parentId):o=void 0}let s=new Set(r),c=e.filter(e=>e.id!==i).map(e=>({...e,items:e.items.filter(e=>!s.has(e))}));return c.push(o?{id:i,name:n,items:r,parentId:o}:{id:i,name:n,items:r}),{groups:w(c),id:i}}function ae(e,t){return e.filter(e=>e.parentId===t).map(e=>e.id)}function oe(e,t){return e.filter(e=>e.parentId===t)}function se(e,t){let n=e.find(e=>e.id===t);if(!n)return e;let r=e.filter(e=>e.id!==t);return n.parentId?r.map(e=>e.id===n.parentId?{...e,items:[...e.items,...n.items]}:e.parentId===t?{...e,parentId:n.parentId}:e):r.map(e=>e.parentId===t?{id:e.id,name:e.name,items:e.items}:e)}function ce(e,t,n){let r=e.find(e=>e.id===t);return!r||!b(n)||r.items.includes(n)?e:T(e,{id:r.id,name:r.name,items:[...r.items,n]}).groups}function le(e,t){let n=e.find(e=>e.items.includes(t))??null;return n?{groups:e.map(e=>e.id===n.id?{...e,items:e.items.filter(e=>e!==t)}:e).filter(e=>e.items.length>0),owner:n}:{groups:e,owner:null}}function ue(e,t,n,r){let i=x(t),a=S(n.id),o=r.some(e=>e.id===n.id),s=e.indexOf(a),c=e.filter(e=>e!==i&&(o||e!==a)),l=s<0?c.length:o?s+1:s;return c.splice(l,0,i),O(c,r)}function E(e){let t=new Map(e.map(e=>[e.id,e])),n=new Map;for(let r of e){let e=r.parentId?t.get(r.parentId)??r:r;for(let t of r.items)n.set(t,e)}let r=new Set,i=[];for(let e of m){let t=n.get(e.id);if(t){if(r.has(t.id))continue;r.add(t.id),i.push({type:`group`,group:t})}else i.push({type:`item`,id:e.id})}return i}function D(e){return E(e).map(e=>e.type===`item`?x(e.id):S(e.group.id))}function de(e){let t=new Set,n=new Set;for(let r of e){r.parentId||n.add(S(r.id));for(let e of r.items)t.add(e)}for(let e of m)t.has(e.id)||n.add(x(e.id));return n}function O(e,t){let n=de(t),r=[],i=new Set;if(Array.isArray(e))for(let t of e)typeof t==`string`&&n.has(t)&&!i.has(t)&&(i.add(t),r.push(t));for(let e of D(t))i.has(e)||r.push(e);return r}function k(e,t){let n=new Map(e.map(e=>[e.id,e])),r=new Set(e.flatMap(e=>e.items)),i=O(t,e),a=[];for(let e of i)if(e.startsWith(`group:`)){let t=n.get(e.slice(6));t&&a.push({type:`group`,group:t})}else if(e.startsWith(`item:`)){let t=e.slice(5);b(t)&&!r.has(t)&&a.push({type:`item`,id:t})}return a}function A(e,t,n){let r=t.find(e=>e.id===n);if(!r)return O(e,t);let i=new Set(r.items.map(e=>x(e))),a=S(n),o=[...e],s=o.length;for(let e=0;e<o.length;e++){let t=o[e];if(t===a||i.has(t)){s=o.slice(0,e).filter(e=>e!==a&&!i.has(e)).length;break}}let c=o.filter(e=>e!==a&&!i.has(e));return c.splice(s,0,a),O(c,t)}function fe(e,t,n,r=[]){if(t.parentId)return O(e,n);let i=S(t.id),a=[...r.map(e=>S(e)),...t.items.map(e=>x(e))],o=e.filter(e=>e!==i);return o.push(...a),O(o,n)}function pe(e,t,n){let r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0||r===i)return[...e];let a=[...e],[o]=a.splice(r,1);return o===void 0?[...e]:(a.splice(i,0,o),a)}var j=`tw.space.active-id`,me=`tw.spaces.list.v1`;function M(e,t){try{return(e===`local`?localStorage:sessionStorage).getItem(t)?.trim()||``}catch{return``}}function N(e,t,n){try{(e===`local`?localStorage:sessionStorage).setItem(t,n)}catch{}}function P(e){let t=String(e||``).trim();t&&(N(`session`,j,t),N(`local`,j,t))}function F(){let e=M(`session`,j);if(e)return e;let t=M(`local`,j);if(t)return t;try{let e=sessionStorage.getItem(me);if(!e)return``;let t=JSON.parse(e);return String(t?.activeId||``).trim()}catch{return``}}function I(e){let t=F();return t?`${e}::${t}`:e}var L=`/__tb_config`,R=`tw.app.config.v1`,z=`tw.app.apikey.v1`,B=`tw.app.model.v1`,V=!1,H=null,U=``,W=!1,he={language:`zh-CN`,appearance:`system`,sessionFontSize:14,toolStepDetail:`standard`,busySendBehavior:`queue`,subagentModel:``};function G(){return`p_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,7)}`}function ge(e){if(!e||typeof e!=`object`)return null;let t=String(e.name??``).trim()||`未命名提供商`,n=String(e.baseURL??``).trim(),r=String(e.model??``).trim();return{id:String(e.id??``).trim()||G(),name:t,baseURL:n,model:r,apiKey:typeof e.apiKey==`string`&&e.apiKey.trim()?e.apiKey.trim():void 0,availableModels:Array.isArray(e.availableModels)?e.availableModels.filter(e=>typeof e==`string`):void 0}}function _e(e){let t=typeof e.baseURL==`string`?e.baseURL.trim():``,n=typeof e.model==`string`?e.model.trim():``;return!t&&!n&&!e.apiKey?[]:[{id:G(),name:`默认`,baseURL:t||`https://api.deepseek.com/v1`,model:n,apiKey:typeof e.apiKey==`string`&&e.apiKey.trim()?e.apiKey.trim():void 0,availableModels:Array.isArray(e.availableModels)?e.availableModels.filter(e=>typeof e==`string`):void 0}]}function K(e){let t=e?.reasoningEffort===`low`||e?.reasoningEffort===`high`||e?.reasoningEffort===`max`?e.reasoningEffort:`high`,n=[];Array.isArray(e?.providers)&&e.providers.length?n=e.providers.map(e=>ge(e)).filter(e=>!!e):e&&(e.baseURL||e.model||e.apiKey)&&(n=_e(e));let r=typeof e?.activeId==`string`?e.activeId:``;return n.length&&!n.some(e=>e.id===r)&&(r=n[0].id),n.length||(r=``),{activeId:r,reasoningEffort:t,providers:n}}function q(){return{version:1,model:{activeId:``,reasoningEffort:`high`,providers:[]},access:`readonly`,general:{...he},plugins:{cases:!1,caseGen:!1,prompts:!0,promptGen:!1,knowledgeLib:!1,knowledgeGen:!1,requirements:!1,templates:!1,knowledge:!1,memory:!1,pluginDev:!1,todos:!1,tasks:!1},caseTypes:e.map(e=>({...e})),promptKinds:c.map(e=>({...e})),knowledgeCategories:[...o],navGroups:h.map(e=>({...e,items:[...e.items]})),navIcons:{..._},navOrder:D(h)}}function J(e){let t=q();if(!e||typeof e!=`object`)return t;let n=e.general&&typeof e.general==`object`?e.general:{},r={...t.plugins,...e.plugins??{}},a=w(e.navGroups);return{version:typeof e.version==`number`?e.version:1,model:K(e.model),access:e.access===`readwrite`||e.access===`full`||e.access===`readonly`?e.access:`readonly`,general:{language:n.language===`en`?`en`:`zh-CN`,appearance:n.appearance===`light`||n.appearance===`dark`||n.appearance===`system`?n.appearance:`system`,sessionFontSize:typeof n.sessionFontSize==`number`&&n.sessionFontSize>=12&&n.sessionFontSize<=22?Math.round(n.sessionFontSize):14,toolStepDetail:n.toolStepDetail===`concise`||n.toolStepDetail===`standard`||n.toolStepDetail===`detailed`||n.toolStepDetail===`full`?n.toolStepDetail:`standard`,busySendBehavior:n.busySendBehavior===`interrupt`?`interrupt`:`queue`,subagentModel:typeof n.subagentModel==`string`?n.subagentModel.trim():``},plugins:r,caseTypes:i(e.caseTypes),promptKinds:f(e.promptKinds),knowledgeCategories:s(e.knowledgeCategories),navGroups:a,navIcons:v(e.navIcons),navOrder:O(e.navOrder,a)}}function ve(){try{let e=localStorage.getItem(B);if(e)return K(JSON.parse(e))}catch{}try{let e=localStorage.getItem(I(R));if(e){let t=JSON.parse(e);if(t?.model)return K(t.model)}}catch{}return null}function ye(e){try{localStorage.setItem(B,JSON.stringify(e))}catch{}}function Y(){try{let e=localStorage.getItem(I(R)),t=ve();if(!e)return t?J({...q(),model:t}):null;let n=J(JSON.parse(e));return t&&(n.model=t),n}catch{return null}}function X(e){try{let{model:t,...n}=e;localStorage.setItem(I(R),JSON.stringify(n)),ye(t)}catch{}}function be(){try{return localStorage.getItem(z)?.trim()||localStorage.getItem(I(z))?.trim()||``}catch{return``}}function xe(e){try{e?localStorage.setItem(z,e):localStorage.removeItem(z),localStorage.removeItem(I(z))}catch{}}function Se(){try{let e=q(),t=!1,n=localStorage.getItem(`tw-llm-settings`);if(n){let r=JSON.parse(n);e.model=K({providers:[{id:G(),name:r.name||`默认`,baseURL:r.baseURL||``,model:r.model||``,apiKey:r.apiKey,availableModels:r.availableModels}],reasoningEffort:r.reasoningEffort}),e.model.providers[0]&&(e.model.activeId=e.model.providers[0].id),t=!0}let r=localStorage.getItem(`tw-access-level`);(r===`readonly`||r===`readwrite`||r===`full`)&&(e.access=r,t=!0);let i=localStorage.getItem(`tw.general.prefs.v1`);i&&(e.general=J({general:JSON.parse(i)}).general,t=!0);let a=localStorage.getItem(`tw.plugins.enabled.v1`);if(a){let n=JSON.parse(a);e.plugins={...e.plugins,...n},t=!0}return t?e:null}catch{return null}}function Z(e){let t=e.model.providers;return t.length?t.find(t=>t.id===e.model.activeId)??t[0]??null:null}function Ce(){return V}function we(){return H||Te(),H??q()}function Te(){if(!W&&(W=!0,typeof window<`u`))try{let e=Y();e&&(H=e)}catch{}}function Ee(){return U}function De(){return[...H?.model.providers??[]]}async function Oe(){try{let e=await fetch(L,{signal:AbortSignal.timeout(2e3)});if(e.ok){let t=await e.json();H=J(t.config);let n=Z(H),r=String(t.apiKey??``).trim();return U=r||n?.apiKey?.trim()||``,r&&n&&!n.apiKey&&(U=r),V=!0,X(H),H}}catch{}V=!1;let e=Y();return e||=Se()??q(),H=e,U=Z(e)?.apiKey?.trim()||be(),X(H),H}var Q=null;async function $(e){if(X(e),V)try{await fetch(L,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({config:e})})}catch{}}function ke(e){let t=H??q(),n=J({...t,...e,model:e.model?{...t.model,...e.model,providers:e.model.providers??t.model.providers}:t.model,general:{...t.general,...e.general??{}},plugins:{...t.plugins,...e.plugins??{}},caseTypes:e.caseTypes??t.caseTypes,promptKinds:e.promptKinds??t.promptKinds,knowledgeCategories:e.knowledgeCategories??t.knowledgeCategories,navGroups:e.navGroups??t.navGroups,navIcons:e.navIcons??t.navIcons,navOrder:e.navOrder??t.navOrder});return H=n,U=Z(n)?.apiKey?.trim()||``,Q&&clearTimeout(Q),Q=setTimeout(()=>{Q=null,$(n)},280),n}function Ae(){return Q&&=(clearTimeout(Q),null),$(H??q())}function je(e){if(U=e.trim(),V||xe(U),!H)return;let t=H.model.providers.map(e=>e.id===H.model.activeId?{...e,apiKey:U||void 0}:e);H=J({...H,model:{...H.model,providers:t}})}function Me(){let e=H;if(!e)return null;let t=Z(e);if(!t?.baseURL?.trim()||!t.model?.trim())return null;let n=(t.apiKey||U).trim();return n?{baseURL:t.baseURL.trim(),apiKey:n,model:t.model.trim(),reasoningEffort:e.model.reasoningEffort,availableModels:t.availableModels}:null}function Ne(){return G()}export{A,s as B,x as C,O as D,v as E,c as F,n as H,u as I,p as L,se as M,pe as N,ue as O,T as P,f as R,te as S,w as T,a as U,e as V,i as W,ce as _,Ce as a,re as b,je as c,F as d,P as f,g,m as h,Oe as i,le as j,fe as k,Me as l,_ as m,Ee as n,De as o,I as p,we as r,Ne as s,Ae as t,ke as u,k as v,oe as w,S as x,ae as y,o as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={cases:{path:`用例管理`,label:`用例管理`,legacyPaths:[`cases`,`用例`]},requirements:{path:`需求文档库`,label:`需求文档库`,legacyPaths:[`requirements`,`需求`]},prompts:{path:`提示词管理`,label:`提示词管理`,legacyPaths:[`prompts`,`提示词`]},knowledge:{path:`知识库管理`,label:`知识库管理`,legacyPaths:[`knowledge`,`知识库`]},templates:{path:`测试模板库`,label:`测试模板库`,legacyPaths:[`templates`,`模板`]}};function t(t){return e[t]?.label??t}function n(e){return`${t(e)}/`}export{n,t};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as e}from"./react-dom.CqAxpHMt.js";import{s as t}from"./settings.CkbipdPI.js";var n=e({applyDomI18n:()=>o,t:()=>a}),r={"nav.home":`我的工作台`,"nav.tasks":`任务管理`,"nav.todos":`待办事项`,"nav.requirements":`需求文档库`,"nav.caseManage":`用例管理`,"nav.cases":`用例`,"nav.templates":`测试模板库`,"nav.docs":`文档库`,"nav.createGroup":`创建分组`,"nav.createSubgroup":`创建子分组`,"nav.assignGroup":`加入分组`,"nav.more":`更多操作`,"nav.groupActions":`分组操作`,"nav.addSubgroup":`添加子分组`,"nav.addToGroup":`添加到分组`,"nav.chooseIcon":`选择图标`,"nav.leaveGroup":`取消分组`,"nav.currentGroup":`当前`,"nav.noGroups":`还没有分组`,"nav.noAddableItems":`没有可添加的菜单项`,"nav.editGroup":`编辑`,"nav.editGroupTitle":`编辑分组`,"nav.sortMenu":`排序`,"nav.sortMenuTitle":`菜单排序`,"nav.sortHint":`按住拖动调整顺序`,"nav.sortUp":`上移`,"nav.sortDown":`下移`,"nav.done":`完成`,"nav.deleteGroup":`删除分组`,"nav.deleteGroupMsg":`删除分组后,其中的菜单项会在菜单栏平铺显示。`,"nav.deleteSubgroupMsg":`删除子分组后,其中的菜单项会回到上级分组。`,"nav.groupName":`分组名称`,"nav.groupItems":`选择菜单项`,"nav.groupItemsHint":`已加入其他分组的菜单不会列出。`,"nav.groupNameRequired":`请填写分组名称`,"nav.groupItemsRequired":`请至少选择一项`,"nav.groupSave":`保存`,"nav.groupCancel":`取消`,"nav.prompts":`提示词管理`,"nav.knowledge":`知识库管理`,"nav.plugins":`我的插件`,"nav.brand":`Lantern Harness`,"nav.settings":`设置`,"nav.changelog":`变更日志`,"nav.changelogShort":`版本日志`,"nav.helpCenter":`帮助中心`,"docs.nav.title":`文档`,"docs.nav.changelog":`版本日志`,"docs.nav.manual":`操作手册`,"docs.nav.install":`安装手册`,"nav.repo":`GitHub 仓库`,"nav.repoShort":`仓库`,"nav.npm":`npm 包`,"nav.npmShort":`npm`,"nav.site":`炊烟小站`,"nav.siteShort":`小站`,"nav.board":`问题与建议`,"nav.boardShort":`问题与建议`,"space.label":`数据空间`,"space.current":`当前空间`,"space.switchTo":`切换到该空间`,"space.manage":`管理空间`,"space.others":`其他空间`,"space.manageTitle":`空间管理`,"space.manageDesc":`每个数据空间是一份相互隔离的数据目录:需求 / 用例 / 提示词 / 知识库 / 模板、会话与配置互不影响。`,"space.listTitle":`全部空间`,"space.newTitle":`新建空间`,"space.newDesc":`新建一份独立的数据目录;默认提示词会随空间一起创建,之后可在「提示词管理」继续修改。`,"space.addNew":`+ 新增空间`,"space.edit":`编辑`,"space.editTitle":`编辑空间`,"space.save":`保存`,"space.cancel":`取消`,"space.loading":`加载中…`,"space.detailFailed":`读取空间信息失败`,"space.updateFailed":`保存失败`,"space.updated":`已保存「{name}」`,"space.publicNameLocked":`公共空间名称不可修改`,"space.switch":`切换`,"space.nameLabel":`空间名称`,"space.namePlaceholder":`输入空间名称`,"space.create":`新建`,"space.promptBriefLabel":`提示词要求`,"space.promptBriefPlaceholder":`描述这个空间里的助手应怎样工作,Enter 或点发送生成提示词;Shift+Enter 换行`,"space.promptGenerate":`生成提示词`,"space.promptGenerating":`生成中…`,"space.promptGeneratingStatus":`正在生成提示词`,"space.promptStop":`停止生成`,"space.promptBodyLabel":`默认提示词`,"space.promptBodyPlaceholder":`将写入该空间的 默认提示词.md`,"space.promptHint":`创建后写入该空间的提示词管理,作为默认提示词。`,"space.promptBriefHint":`这段要求会随空间保存,便于之后重新生成提示词。`,"space.promptEditHint":`保存后覆盖该空间的 默认提示词.md,工作台会立即使用新提示词。`,"space.promptNeedReq":`请先填写提示词要求,再生成。`,"space.promptNeedBody":`请先填写默认提示词。`,"space.promptNeedModel":`请先在设置里配置可用的模型后再生成。`,"space.promptGenEmpty":`模型没有给出可用提示词,请重试或直接手写。`,"space.needName":`请先填写空间名称。`,"space.created":`已创建「{name}」`,"space.createdWithPrompt":`已创建「{name}」,默认提示词已写入该空间的提示词管理`,"space.name":`名称`,"space.location":`位置`,"space.size":`体积`,"space.sizeTitle":`统计各空间占用的磁盘大小`,"space.sizing":`统计中…`,"space.status":`状态`,"space.builtin":`默认`,"space.publicName":`公共空间`,"space.activeTag":`当前`,"space.missing":`目录不存在`,"space.rename":`重命名`,"space.copy":`复制`,"space.export":`导出`,"space.exportContent":`导出内容库`,"space.exportContentTitle":`不含密钥、会话、记忆与缓存,适合分享内容`,"space.exportFull":`导出备份`,"space.exportFullTitle":`含密钥、会话与全部本机状态,适合自己备份`,"space.discover":`扫描文件夹`,"space.discoverTitle":`扫描托管目录,纳入带 .lantern/space.json 清单的空间文件夹;其它文件夹列出来等你确认`,"space.discovering":`扫描中…`,"space.discoverAdded":`已纳入 {n} 个空间`,"space.discoverNone":`没有发现可纳入的空间文件夹`,"space.discoverBackfilled":`并为 {n} 个已有空间补写了 space.json 清单`,"space.discoverSkipped":`跳过 {n} 个(重名、名称非法或缺空间元数据)`,"space.candidatesTitle":`扫描到 {n} 个不是数据空间的文件夹,要纳入吗?`,"space.candidatesHint":`勾选后纳入列表;不会写入空间清单(.lantern/space.json),文件夹内容保持原样。`,"space.candidatesSelectAll":`全选`,"space.candidatesClear":`全不选`,"space.candidatesIgnore":`忽略`,"space.candidatesIgnored":`已忽略,未纳入任何文件夹`,"space.candidatesAdopt":`纳入所选`,"space.candidatesAdopted":`已纳入 {n} 个文件夹`,"space.candidatesRejected":`未纳入:{names}`,"space.removeList":`移出列表`,"space.deleteDisk":`删除数据`,"space.import":`导入`,"space.refresh":`刷新`,"space.empty":`还没有自定义空间,点「+ 新增空间」开始。`,"space.newParentHint":`新建的空间会落在:`,"space.switching":`正在切换…`,"space.reloadHint":`切换后页面会自动重载。`,"space.confirmRemoveTitle":`移出列表`,"space.confirmRemoveMsg":`将从列表中移除「{name}」,磁盘数据保留在:
|
|
2
|
+
{path}
|
|
3
|
+
之后可在管理界面重新纳入。`,"space.confirmDeleteTitle":`删除数据`,"space.confirmDeleteMsg":`将永久删除「{name}」及其全部数据,无法恢复:
|
|
4
|
+
{path}`,"space.confirmCopyTitle":`复制空间`,"space.confirmCopyMsg":`将复制「{name}」的全部内容到新空间,文件较多时可能耗时较久。`,"space.done":`完成`,"space.copyName":`副本名称`,"space.importPick":`选择要导入的 zip 备份`,"space.othersEmpty":`还没有其他空间。可点下方「管理空间」新建或导入。`,"space.busyRuns":`仍有会话在运行,请先停止后再切换空间。`,"space.publicLocked":`公共空间不支持重命名或删除。`,"space.offline":`工作区不可用`,"space.offlineCap":`未连接本地服务`,"settings.general":`通用设置`,"settings.model":`模型`,"settings.close":`关闭`,"settings.access":`权限`,"settings.accessDesc":`选择新会话的默认权限模式`,"settings.language":`语言`,"settings.appearance":`外观`,"settings.appear.light":`浅色`,"settings.appear.dark":`深色`,"settings.appear.system":`跟随系统`,"settings.fontSize":`字号大小`,"settings.fontSizeDesc":`调整正文与会话内容的字号(不影响侧栏布局)`,"settings.toolSteps":`工作步骤展示`,"settings.toolStepsDesc":`选择希望看到多少工具调用细节`,"settings.busySend":`繁忙时的发送行为`,"settings.busySendDesc":`智能体运行时 Enter 键和发送按钮的行为;Cmd/Ctrl+Enter 使用另一行为`,"settings.busySend.queue":`排队发送`,"settings.busySend.interrupt":`插话发送`,"settings.subagentModel":`子代理模型`,"settings.subagentModelDesc":`子代理默认跟随主会话模型;可改为当前提供商下的其它模型`,"settings.subagentModel.inherit":`跟随主会话`,"settings.platformVersion":`平台版本`,"settings.access.readonly":`仅可查看`,"settings.access.readwrite":`工作区内修改`,"settings.access.full":`完全权限`,"settings.step.concise":`简洁`,"settings.step.standard":`标准`,"settings.step.detailed":`详细`,"settings.step.full":`完全展开`,"settings.modelIntro":`填入各提供商的 API 密钥即可使用其模型。`,"settings.edit":`编辑`,"settings.delete":`删除`,"settings.addProvider":`+ 添加模型提供商`,"settings.back":`返回`,"settings.editProvider":`编辑提供商`,"settings.addProviderTitle":`添加提供商`,"settings.cancel":`取消`,"settings.save":`保存`,"settings.displayName":`显示名称`,"settings.preset":`服务商预设`,"settings.baseUrl":`Base URL`,"settings.apiKey":`API Key`,"settings.modelField":`模型`,"settings.keyHint":`模型保存在本机 ~/.config/lantern-harness/models.json,所有空间共用,不会上传 GitHub。`,"settings.modelPlaceholder":`请输入模型名`,"settings.recognizing":`识别中…`,"settings.recognized":`已识别 {n} 个`,"settings.recognizeFail":`识别失败,可手动填模型名`,"settings.recognizeKeep":`刷新失败,沿用已有列表`,"settings.deleteConfirm":`确定删除该模型提供商?`,"chat.emptyTitle":`提灯的人不问路`,"chat.emptyNoModel":`使用前请先配置模型。`,"chat.configureModel":`配置模型`,"chat.workbench":`我的工作台`,"chat.newSession":`新会话`,"chat.workspace":`工作区`,"tool.running":`工具执行中…`,"tool.callingKind":`正在调用{kind}`,"tool.doneKind":`{kind}完成`,"tool.callingNamed":`正在调用{kind}:{name}`,"tool.doneNamed":`{kind}完成:{name}`,"tool.callingFull":`正在调用{kind}({name})…`,"tool.doneFull":`{kind}已完成({name})`,"tool.kind.kb":`知识库`,"tool.kind.fs":`本地文件`,"tool.kind.memory":`会话记忆`,"tool.kind.webSearch":`网页搜索`,"tool.kind.webFetch":`网页获取`},i={"zh-CN":r,en:{"nav.home":`My Workbench`,"nav.tasks":`Tasks`,"nav.todos":`Todos`,"nav.requirements":`Requirements`,"nav.caseManage":`Test Cases`,"nav.cases":`Cases`,"nav.templates":`Test Templates`,"nav.docs":`Documents`,"nav.createGroup":`New group`,"nav.createSubgroup":`New subgroup`,"nav.assignGroup":`Join group`,"nav.more":`More actions`,"nav.groupActions":`Group actions`,"nav.addSubgroup":`Add subgroup`,"nav.addToGroup":`Add to group`,"nav.chooseIcon":`Choose icon`,"nav.leaveGroup":`Leave group`,"nav.currentGroup":`Current`,"nav.noGroups":`No groups yet`,"nav.noAddableItems":`Nothing to add`,"nav.editGroup":`Edit`,"nav.editGroupTitle":`Edit group`,"nav.sortMenu":`Sort`,"nav.sortMenuTitle":`Sort menu`,"nav.sortHint":`Drag to reorder`,"nav.sortUp":`Move up`,"nav.sortDown":`Move down`,"nav.done":`Done`,"nav.deleteGroup":`Delete group`,"nav.deleteGroupMsg":`Items in this group will be shown flat in the menu.`,"nav.deleteSubgroupMsg":`Items in this subgroup will return to its parent group.`,"nav.groupName":`Group name`,"nav.groupItems":`Choose menu items`,"nav.groupItemsHint":`Items already in another group are hidden.`,"nav.groupNameRequired":`Enter a group name`,"nav.groupItemsRequired":`Select at least one item`,"nav.groupSave":`Save`,"nav.groupCancel":`Cancel`,"nav.prompts":`Prompts`,"nav.knowledge":`Knowledge Mgmt`,"nav.plugins":`My Plugins`,"nav.brand":`Lantern Harness`,"nav.settings":`Settings`,"nav.changelog":`Changelog`,"nav.changelogShort":`Changelog`,"nav.helpCenter":`Help Center`,"docs.nav.title":`Docs`,"docs.nav.changelog":`Changelog`,"docs.nav.manual":`User Guide`,"docs.nav.install":`Install Guide`,"nav.repo":`GitHub`,"nav.repoShort":`Repo`,"nav.npm":`npm package`,"nav.npmShort":`npm`,"nav.site":`Yycy Docs`,"nav.siteShort":`Site`,"nav.board":`Questions & suggestions`,"nav.boardShort":`Suggestions`,"space.label":`Data space`,"space.current":`Current space`,"space.switchTo":`Switch to this space`,"space.manage":`Manage spaces`,"space.others":`Other spaces`,"space.manageTitle":`Spaces`,"space.manageDesc":`Each data space is a fully isolated data directory: requirements, cases, prompts, knowledge, templates, sessions and config never leak across spaces.`,"space.listTitle":`All spaces`,"space.newTitle":`New space`,"space.newDesc":`Create an isolated data directory. The default prompt is created with the space and can be edited later in Prompt management.`,"space.addNew":`+ New space`,"space.edit":`Edit`,"space.editTitle":`Edit space`,"space.save":`Save`,"space.cancel":`Cancel`,"space.loading":`Loading…`,"space.detailFailed":`Failed to load space info`,"space.updateFailed":`Save failed`,"space.updated":`Saved "{name}"`,"space.publicNameLocked":`The public space name cannot be changed`,"space.switch":`Switch`,"space.nameLabel":`Space name`,"space.namePlaceholder":`Enter a space name`,"space.create":`Create`,"space.promptBriefLabel":`Prompt requirements`,"space.promptBriefPlaceholder":`Describe how the assistant should work. Enter or send to generate; Shift+Enter for a new line`,"space.promptGenerate":`Generate prompt`,"space.promptGenerating":`Generating…`,"space.promptGeneratingStatus":`Generating prompt`,"space.promptStop":`Stop generating`,"space.promptBodyLabel":`Default prompt`,"space.promptBodyPlaceholder":`Saved as 默认提示词.md in this space`,"space.promptHint":`Saved to this space’s Prompt management as the default prompt.`,"space.promptBriefHint":`Saved with the space so you can regenerate the prompt later.`,"space.promptEditHint":`Saving overwrites this space’s 默认提示词.md; the workbench uses it immediately.`,"space.promptNeedReq":`Write prompt requirements before generating.`,"space.promptNeedBody":`Fill in the default prompt first.`,"space.promptNeedModel":`Configure a working model in Settings before generating.`,"space.promptGenEmpty":`The model returned an empty prompt. Retry, or write one yourself.`,"space.needName":`Enter a space name first.`,"space.created":`Created "{name}"`,"space.createdWithPrompt":`Created "{name}". The default prompt is in Prompt management.`,"space.name":`Name`,"space.location":`Location`,"space.size":`Size`,"space.sizeTitle":`Measure disk usage for each space`,"space.sizing":`Measuring…`,"space.status":`Status`,"space.builtin":`Default`,"space.publicName":`Public space`,"space.activeTag":`Active`,"space.missing":`Directory missing`,"space.rename":`Rename`,"space.copy":`Copy`,"space.export":`Export`,"space.exportContent":`Export content`,"space.exportContentTitle":`Excludes keys, sessions, memories and caches — safe to share`,"space.exportFull":`Export backup`,"space.exportFullTitle":`Includes keys, sessions and all local state — for your own backup`,"space.discover":`Scan folder`,"space.discoverTitle":`Scan the managed folder for space folders carrying a .lantern/space.json manifest; other folders are listed for your confirmation`,"space.discovering":`Scanning…`,"space.discoverAdded":`Adopted {n} space(s)`,"space.discoverNone":`No adoptable space folder found`,"space.discoverBackfilled":`Wrote space.json manifests for {n} existing space(s)`,"space.discoverSkipped":`Skipped {n} (name conflict, invalid name, or missing space metadata)`,"space.candidatesTitle":`Found {n} folder(s) that are not spaces. Adopt them?`,"space.candidatesHint":`Checked folders are added to the list. No space manifest (.lantern/space.json) is written; folder contents stay untouched.`,"space.candidatesSelectAll":`Select all`,"space.candidatesClear":`Select none`,"space.candidatesIgnore":`Ignore`,"space.candidatesIgnored":`Ignored — nothing was adopted`,"space.candidatesAdopt":`Adopt selected`,"space.candidatesAdopted":`Adopted {n} folder(s)`,"space.candidatesRejected":`Not adopted: {names}`,"space.removeList":`Unlist`,"space.deleteDisk":`Delete data`,"space.import":`Import`,"space.refresh":`Refresh`,"space.empty":`No custom space yet — click "New space" to start.`,"space.newParentHint":`New spaces are created under:`,"space.switching":`Switching…`,"space.reloadHint":`The page reloads automatically after switching.`,"space.confirmRemoveTitle":`Remove from list`,"space.confirmRemoveMsg":`This removes "{name}" from the list but keeps its data on disk:
|
|
5
|
+
{path}
|
|
6
|
+
It can be added back later.`,"space.confirmDeleteTitle":`Delete data`,"space.confirmDeleteMsg":`This permanently deletes "{name}" and all of its data, with no way to undo:
|
|
7
|
+
{path}`,"space.confirmCopyTitle":`Copy space`,"space.confirmCopyMsg":`All content of "{name}" will be copied into a new space. This can take a while for large spaces.`,"space.done":`Done`,"space.copyName":`New copy name`,"space.importPick":`Choose a zip backup to import`,"space.othersEmpty":`No other spaces yet. Open Manage spaces below to create or import one.`,"space.busyRuns":`A session is still running. Stop it before switching spaces.`,"space.publicLocked":`The built-in public space cannot be renamed or deleted.`,"space.offline":`Workspace unavailable`,"space.offlineCap":`Local service offline`,"settings.general":`General`,"settings.model":`Models`,"settings.close":`Close`,"settings.access":`Permissions`,"settings.accessDesc":`Default permission mode for new sessions`,"settings.language":`Language`,"settings.appearance":`Appearance`,"settings.appear.light":`Light`,"settings.appear.dark":`Dark`,"settings.appear.system":`System`,"settings.fontSize":`Font size`,"settings.fontSizeDesc":`Body and session text size (sidebar layout stays fixed)`,"settings.toolSteps":`Tool step detail`,"settings.toolStepsDesc":`How much tool-call detail to show`,"settings.busySend":`Send while busy`,"settings.busySendDesc":`Enter / Send while the agent is running; Cmd/Ctrl+Enter uses the other action`,"settings.busySend.queue":`Queue`,"settings.busySend.interrupt":`Interrupt`,"settings.subagentModel":`Subagent model`,"settings.subagentModelDesc":`Subagents inherit the main chat model by default; pick another from the active provider`,"settings.subagentModel.inherit":`Follow main chat`,"settings.platformVersion":`Platform version`,"settings.access.readonly":`View only`,"settings.access.readwrite":`Edit in workspace`,"settings.access.full":`Full access`,"settings.step.concise":`Concise`,"settings.step.standard":`Standard`,"settings.step.detailed":`Detailed`,"settings.step.full":`Full`,"settings.modelIntro":`Add each provider’s API key to use its models.`,"settings.edit":`Edit`,"settings.delete":`Delete`,"settings.addProvider":`+ Add model provider`,"settings.back":`Back`,"settings.editProvider":`Edit provider`,"settings.addProviderTitle":`Add provider`,"settings.cancel":`Cancel`,"settings.save":`Save`,"settings.displayName":`Display name`,"settings.preset":`Provider preset`,"settings.baseUrl":`Base URL`,"settings.apiKey":`API Key`,"settings.modelField":`Model`,"settings.keyHint":`Models are saved in ~/.config/lantern-harness/models.json and shared across spaces; never pushed to GitHub.`,"settings.modelPlaceholder":`Enter model id`,"settings.recognizing":`Detecting…`,"settings.recognized":`{n} models found`,"settings.recognizeFail":`Detection failed — enter a model id manually`,"settings.recognizeKeep":`Refresh failed — keeping previous list`,"settings.deleteConfirm":`Delete this model provider?`,"chat.emptyTitle":`Those who carry the lantern do not ask the way.`,"chat.emptyNoModel":`Configure a model to get started.`,"chat.configureModel":`Configure model`,"chat.workbench":`My Workbench`,"chat.newSession":`New chat`,"chat.workspace":`Workspace`,"tool.running":`Running tool…`,"tool.callingKind":`Calling {kind}`,"tool.doneKind":`{kind} done`,"tool.callingNamed":`Calling {kind}: {name}`,"tool.doneNamed":`{kind} done: {name}`,"tool.callingFull":`Calling {kind} ({name})…`,"tool.doneFull":`{kind} finished ({name})`,"tool.kind.kb":`knowledge base`,"tool.kind.fs":`local files`,"tool.kind.memory":`memory`,"tool.kind.webSearch":`web search`,"tool.kind.webFetch":`web fetch`}};function a(e,n,r){let a=i[r??(typeof window<`u`?t().language:`zh-CN`)]?.[e]??i[`zh-CN`][e]??e;if(n)for(let[e,t]of Object.entries(n))a=a.replaceAll(`{${e}}`,String(t));return a}function o(e){if(typeof document>`u`)return;let n=e??t().language;document.documentElement.lang=n===`en`?`en`:`zh-CN`,document.querySelectorAll(`[data-i18n]`).forEach(e=>{let t=e.dataset.i18n;t&&t in r&&(e.textContent=a(t,void 0,n))}),document.querySelectorAll(`[data-i18n-hint]`).forEach(e=>{let t=e.dataset.i18nHint;t&&t in r&&(e.dataset.hint=a(t,void 0,n))})}export{a as n,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e,i as t,p as n}from"./app-config.
|
|
1
|
+
import{d as e,i as t,p as n}from"./app-config.vqDkEMS3.js";import{o as r}from"./settings.CkbipdPI.js";var i=`/__tb_sessions`,a=`tw-chat-sessions`,o=`tw-chat-active-id`,s=`tw-chat-history`,c=`tw-session-rail-open`,l=!1,u=null;function d(){return`s_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function f(e){let t=Date.now();return{id:d(),title:`新对话`,createdAt:t,updatedAt:t,archived:!1,pinned:!1,messages:[],...e}}function p(e){let t=(e.find(e=>e.role===`user`&&(e.content??``).trim())?.content??``).trim().replace(/\s+/g,` `);return t?t.length>24?`${t.slice(0,24)}…`:t:`新对话`}function m(){try{let e=localStorage.getItem(s);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function h(e){if(!e)return null;let t=(Array.isArray(e.sessions)?e.sessions:[]).filter(e=>!e.deleted);return t.length?{sessions:t,activeId:typeof e.activeId==`string`&&t.some(t=>t.id===e.activeId)?e.activeId:t.find(e=>!e.archived)?.id??t[0].id}:null}function g(){return n(a)}function _(){return n(o)}function v(){try{let e=localStorage.getItem(g());return e?h(JSON.parse(e)):null}catch{return null}}function y(e){try{localStorage.setItem(g(),JSON.stringify(e)),localStorage.setItem(_(),e.activeId)}catch{}}function b(){let e=m(),t=f({title:e.length?p(e):`新对话`,messages:e}),n={sessions:[t],activeId:t.id};try{localStorage.removeItem(s)}catch{}return n}async function x(e){let t=e?.preferSessionId?.trim()||``,n=v();try{let e=await fetch(i,{signal:AbortSignal.timeout(2e3)});if(e.ok){let r=await e.json();l=!0;let i=h(r.store??null);if(!i){let e=t&&n?n.sessions.find(e=>e.id===t):void 0;i=e?{sessions:[e],activeId:t}:b(),await C(i)}else if(t&&n&&!i.sessions.some(e=>e.id===t)){let e=n.sessions.find(e=>e.id===t);e?(i={...i,sessions:[e,...i.sessions],activeId:t},await C(i)):y(i)}else t&&i.sessions.some(e=>e.id===t)&&(i={...i,activeId:t}),y(i);return i}}catch{}return l=!1,n??b()}function S(){return v()??b()}async function C(e){if(y(e),l)try{await fetch(i,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({store:e})})}catch{}}function w(e){y(e),u&&clearTimeout(u),u=setTimeout(()=>{u=null,C(e)},320)}async function T(e){u&&=(clearTimeout(u),null),await C(e)}async function E(){if(!l)return null;try{let e=await fetch(i,{signal:AbortSignal.timeout(2e3)});return e.ok?h((await e.json()).store??null):null}catch{return null}}function D(e,t){let n=/<!--tb-schedule:([^>]+)-->/,r=!1,i=e.sessions.map(e=>{let i=t.sessions.find(t=>t.id===e.id);if(!i||!Array.isArray(i.messages))return e;let a=Array.isArray(e.messages)?[...e.messages]:[],o=new Set;for(let e of a){let t=e&&typeof e==`object`&&`content`in e?String(e.content??``):``,r=n.exec(t);r?.[1]&&o.add(r[1]);let i=e&&typeof e==`object`&&`scheduleId`in e?String(e.scheduleId??``):``;i&&o.add(i)}let s=!1;for(let e of i.messages){let t=e&&typeof e==`object`&&`content`in e?String(e.content??``):``,r=n.exec(t);r?.[1]&&!o.has(r[1])&&(a.push(e),o.add(r[1]),s=!0)}return s?(r=!0,{...e,messages:a,updatedAt:Date.now()}):e});return r?{...e,sessions:i}:e}function O(e,t){let n=f({workspacePath:t?.workspacePath,access:t?.access});return{sessions:[n,...e.sessions],activeId:n.id}}function k(e,t,n){return{...e,sessions:e.sessions.map(e=>e.id===t?{...e,workspacePath:n||void 0,updatedAt:Date.now()}:e)}}function A(e,t,n){let r=n.trim()||`未命名`;return{...e,sessions:e.sessions.map(e=>e.id===t?{...e,title:r,updatedAt:Date.now()}:e)}}function j(e,t,n=!0){return{...e,sessions:e.sessions.map(e=>e.id===t?n&&e.archived?{...e,pinned:!0,archived:!1,updatedAt:Date.now()}:{...e,pinned:n,updatedAt:Date.now()}:e)}}function M(e,t){let n=e.sessions.filter(e=>e.id!==t);if(!n.length){let e=f();return{sessions:[e],activeId:e.id}}return{sessions:n,activeId:e.activeId===t?n.find(e=>!e.archived&&!e.deleted)?.id??n[0].id:e.activeId}}function N(e,t,n=!0){let r=e.sessions.map(e=>e.id===t?{...e,archived:n,deleted:!n&&e.deleted,pinned:!n&&e.pinned,updatedAt:Date.now()}:e),i=e.activeId;return n&&i===t&&(i=r.find(e=>!e.archived&&!e.deleted)?.id??r[0].id),{sessions:r,activeId:i}}function P(e,t){return{...e,sessions:e.sessions.map(e=>e.workspacePath===t?{...e,workspacePath:void 0,updatedAt:Date.now()}:e)}}function F(e){return!(e.archived||e.deleted||e.pinned||Array.isArray(e.messages)&&e.messages.length>0)}function I(e,t,n,r){let i=r?.touchUpdatedAt!==!1;return{...e,sessions:e.sessions.map(e=>{if(e.id!==t)return e;let a=r?.touchTitle&&(e.title===`新对话`||!e.title)||e.title===`新对话`?p(n):e.title;return{...e,messages:n.slice(-80),title:a,updatedAt:i?Date.now():e.updatedAt}})}}function L(e,t,n){return I(e,e.activeId,t,n)}function R(e){return Array.isArray(e)?e.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return t.role!==`assistant`||!Array.isArray(t.activitySteps)||!t.activitySteps.some(e=>e.status===`running`)?e:{...t,activitySteps:t.activitySteps.map(e=>e.status===`running`?{...e,status:`done`}:e)}}):e}function z(e){let t=!1,n=e.sessions.map(e=>{let n=R(e.messages);return n===e.messages?e:(t=!0,{...e,messages:n})});return t?{...e,sessions:n}:e}function B(e,t,n){return{...e,sessions:e.sessions.map(e=>{if(e.id!==t)return e;let r=[...Array.isArray(e.messages)?e.messages:[],n].slice(-80);return{...e,messages:r,updatedAt:Date.now()}})}}function V(e,t,n){return{...e,sessions:e.sessions.map(e=>e.id===t?{...e,...n,updatedAt:Date.now()}:e)}}function H(e,t){return V(e,e.activeId,t)}function U(e,t){return e.sessions.some(e=>e.id===t)?{...e,activeId:t}:e}function W(e){return[...e].sort((e,t)=>{let n=+!!e.pinned,r=+!!t.pinned;return n===r?t.updatedAt-e.updatedAt:r-n})}function G(){try{return localStorage.getItem(n(c))!==`0`}catch{return!0}}function K(e){try{localStorage.setItem(n(c),e?`1`:`0`)}catch{}}function q(t){let n=e();return n?`tb:session-handoff:${n}:${t}`:`tb:session-handoff:${t}`}function J(e){return e.replace(/\\/g,`/`).replace(/^\.\//,``).replace(/^\/+/,``)}function Y(e,t,n){return e.sessions.find(e=>{if(t===`cases`){let t=e.caseGen?.linkedCasePath;return!!(t&&J(t)===n)}let r=t===`prompts`?e.promptGen?.linkedPromptPath:e.knowledgeGen?.linkedKnowledgePath;return!!(r&&J(r)===n)})}async function X(e,n){await x().catch(()=>null),await t().catch(()=>null);let i=S(),a=J(n.path),o=Y(i,e,a);if(o||=(i=O(i,{access:r()}),await T(i),i.sessions.find(e=>e.id===i.activeId)),!o)throw Error(`无法创建或定位会话`);try{let e=i.sessions.find(e=>e.id===o.id)??o;sessionStorage.setItem(q(o.id),JSON.stringify({session:e}))}catch{}let s=new URLSearchParams({session:o.id,focusRoot:e,focusPath:a,attachRoot:e,attachPath:a,attachName:n.name});window.location.href=`/?${s.toString()}`}export{p as C,I as D,H as E,V as O,U as S,L as T,K as _,k as a,z as b,E as c,F as d,G as f,A as g,j as h,N as i,T as l,D as m,q as n,O as o,S as p,B as r,M as s,X as t,x as u,w as v,P as w,W as x,R as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t,u as n}from"./app-config.vqDkEMS3.js";var r=[`内容库`,`生成能力`,`记忆与检索`,`待办与效率`,`开发工具`],i=[{id:`cases`,category:`内容库`,name:`用例管理`,description:`侧栏进入用例库:浏览、搜索、打开与删除用例。关闭后入口隐藏,「生成测试用例」一并关闭;磁盘文件仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`caseGen`,category:`生成能力`,name:`生成测试用例`,description:`在工作台用「/」打开配置:选类型、模板与提示词后生成用例并写入用例库。需同时开启「用例管理」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0,requires:`cases`},{id:`prompts`,category:`内容库`,name:`提示词管理`,description:`侧栏进入提示词库:浏览、搜索、打开与删除提示词,并维护当前空间的「默认提示词」。每个空间都需要,因此默认开启且不可关闭;「生成提示词」仍是独立开关。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!0,alwaysOn:!0},{id:`promptGen`,category:`生成能力`,name:`生成提示词`,description:`用「/」打开配置后对话生成提示词;质检通过后写入提示词库。需同时开启「提示词管理」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0,requires:`prompts`},{id:`knowledgeLib`,category:`内容库`,name:`知识库管理`,description:`侧栏进入知识库:浏览、搜索、打开与删除文档。关闭后入口隐藏,「生成知识库」一并关闭;磁盘文件仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`knowledgeGen`,category:`生成能力`,name:`生成知识库`,description:`用「/」打开配置后对话生成规范、方法论或环境约定;质检通过后写入知识库。需同时开启「知识库管理」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0,requires:`knowledgeLib`},{id:`requirements`,category:`内容库`,name:`需求文档库`,description:`侧栏进入需求文档库:浏览、搜索、上传与整理需求文档。关闭后入口隐藏;磁盘文件仍保留,生成用例时也不再引用。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`templates`,category:`内容库`,name:`测试模板库`,description:`侧栏进入测试模板库:浏览、上传与整理用例 / 报告模板。关闭后入口隐藏;磁盘文件仍保留,生成用例时不再选用模板。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`knowledge`,category:`记忆与检索`,name:`知识库检索`,description:`工作台输入「@」引用知识库与模板文档;发送后由模型按需读取。关闭后 @ 只列工作区文件。`,version:`1.4.0`,requiresDev:!1,defaultEnabled:!1},{id:`memory`,category:`记忆与检索`,name:`会话记忆`,description:`五轨记忆(用户档案 / 全局事实 / 项目关键 / 项目日志 / 每日):待确认、归档与便签,在工作台「记忆」Tab 管理。`,version:`2.0.0`,requiresDev:!0,defaultEnabled:!1},{id:`todos`,category:`待办与效率`,name:`待办事项`,description:`侧栏进入待办事项:按状态 / 紧急程度筛选、行内改状态与手动维护;工作台会话也能通过工具直接记录与更新同一份待办。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`tasks`,category:`待办与效率`,name:`任务管理`,description:`侧栏进入任务列表:按任务池 / 进行中 / 已完成 / 已关闭跟踪任务,并汇总每个任务下关联待办的数量与完成进度。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`pluginDev`,category:`开发工具`,name:`插件开发`,description:`用固定提示词开发扩展插件:先评估形态与范围并用选项确认,确认后才改代码,完成后并入「扩展插件」。需要读写项目源码。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0}];function a(e=i){return r.map(t=>({category:t,items:e.filter(e=>e.category===t)})).filter(e=>e.items.length>0)}var o=`tw-plugins-changed`;function s(){let e={};for(let t of i)e[t.id]=t.defaultEnabled;return e}function c(e,t){let n={...e};if(t&&!p(t.id)?.alwaysOn){if(n[t.id]=t.enabled,t.enabled){let e=p(t.id)?.requires;e&&(n[e]=!0)}else for(let e of i)e.requires===t.id&&(n[e.id]=!1)}for(let e of i)e.alwaysOn&&(n[e.id]=!0);for(let e of i)e.requires&&!n[e.requires]&&(n[e.id]=!1);return n}function l(){let t=s(),n=e().plugins??{};for(let e of i)typeof n[e.id]==`boolean`&&(t[e.id]=n[e.id]);return c(t)}function u(e){return l()[e]}function d(e,r){if(p(e)?.alwaysOn)return l();let i=c(l(),{id:e,enabled:r});return n({plugins:i}),t(),typeof window<`u`&&window.dispatchEvent(new CustomEvent(o,{detail:i})),i}function f(e){if(typeof window>`u`)return()=>{};let t=t=>{let n=t.detail;e(n??l())};return window.addEventListener(o,t),()=>{window.removeEventListener(o,t)}}function p(e){return i.find(t=>t.id===e)}function m(e){let t=p(e),n=t?.name??e;return t?.requires&&!u(t.requires)?`请先在「我的插件」中启用「${p(t.requires)?.name??t.requires}」`:`请先在「我的插件」中启用「${n}」`}export{f as a,l as i,a as n,m as o,u as r,d as s,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e===`requirements`?`/__tb_requirements`:e===`cases`?`/__tb_cases`:e===`prompts`?`/__tb_prompts`:e===`knowledge`?`/__tb_knowledge`:`/__tb_templates`}async function t(t,n,r){let i=await fetch(`${e(t)}${n}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r??{})}),a=await i.json();if(!i.ok)throw Error(a.error||`HTTP ${i.status}`);return a}async function n(t){try{return(await fetch(`${e(t)}/health`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}async function r(e,n=`.`){let r=await t(e,`/list`,{path:n});return{path:r.path,entries:r.entries??[]}}async function i(t){let n=await fetch(`${e(t)}/tree`,{signal:AbortSignal.timeout(3e3)}),r=await n.json();if(!n.ok)throw Error(r.error||`HTTP ${n.status}`);return{tree:r.tree??[],totalFiles:r.totalFiles??0}}async function a(e,n,r){return(await t(e,`/mkdir`,{parent:n,name:r})).path}async function o(e,n,r){let i=await r.arrayBuffer(),a=new Uint8Array(i),o=``;for(let e=0;e<a.length;e++)o+=String.fromCharCode(a[e]);let s=btoa(o);return t(e,`/upload`,{parent:n,name:r.name,contentBase64:s})}async function s(e,n){let r=await t(e,`/read`,{path:n});if(r.encoding===`utf-8`&&typeof r.content==`string`)return{path:r.path,content:r.content,encoding:r.encoding};throw Error(`该文件不是可预览的文本`)}async function c(e,n){let r=await t(e,`/read`,{path:n});if(r.encoding===`utf-8`&&typeof r.content==`string`)return{path:r.path,encoding:`utf-8`,content:r.content};if(typeof r.contentBase64==`string`)return{path:r.path,encoding:`base64`,contentBase64:r.contentBase64};throw Error(`无法读取文件`)}async function l(e,n,r){await t(e,`/write-text`,{path:n,content:r})}async function u(e,n,r){await t(e,`/write-binary`,{path:n,contentBase64:r})}async function d(e,n){await t(e,`/delete`,{path:n})}async function f(e,n,r){return(await t(e,`/rename`,{path:n,name:r})).path}function p(e){let t=e.lastIndexOf(`/`);return t<0?`.`:e.slice(0,t)}function m(e,t){return e===t||e.startsWith(`${t}/`)}function h(e,t,n){return m(e,t)?n+e.slice(t.length):e}function g(e,t){for(let n of e){if(n.path===t)return n;let e=g(n.children,t);if(e)return e}return null}function _(e){let t=0;for(let n of e.children)t+=1+_(n);return t}async function v(e,n){await t(e,`/open`,{path:n})}export{l as _,g as a,a as c,c as d,s as f,u as g,o as h,i,v as l,f as m,d as n,m as o,h as p,n as r,r as s,_ as t,p as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/i18n.
|
|
2
|
-
import{c as e,l as t,o as n,r,s as i,t as a,u as o}from"./app-config.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/i18n.9qZsrs3u.js","_astro/react-dom.CqAxpHMt.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as e,l as t,o as n,r,s as i,t as a,u as o}from"./app-config.vqDkEMS3.js";var s=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),c=function(e){return`/`+e},l={},u=function(e){return e.pathname.endsWith(`.css`)},d=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},f=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function f(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=c(t,n);let r=f(t),i=u(r);return d(l,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:s,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},p=[{label:`DeepSeek`,baseURL:`https://api.deepseek.com/v1`,model:``},{label:`通义千问`,baseURL:`https://dashscope.aliyuncs.com/compatible-mode/v1`,model:`qwen-plus`},{label:`OpenAI`,baseURL:`https://api.openai.com/v1`,model:`gpt-4o-mini`},{label:`自定义`,baseURL:``,model:``}],m=`tw-settings-changed`,h=`tw-open-settings`;function g(){return t()}function _(){return n()}function v(){return r().model.activeId}function y(t){let n=r(),s=[...n.model.providers],c=n.model.activeId,l=s.findIndex(e=>e.id===c);if(l<0){let e=i();s.push({id:e,name:`默认`,baseURL:t.baseURL.trim(),apiKey:t.apiKey.trim()||void 0,model:t.model.trim(),availableModels:t.availableModels}),c=e}else s[l]={...s[l],baseURL:t.baseURL.trim(),apiKey:t.apiKey.trim()||void 0,model:t.model.trim(),availableModels:t.availableModels};e(t.apiKey),o({model:{...n.model,activeId:c,reasoningEffort:t.reasoningEffort??n.model.reasoningEffort,providers:s}}),a(),typeof window<`u`&&window.dispatchEvent(new CustomEvent(m))}function b(e,t){let n=r(),i=[...n.model.providers],s=i.findIndex(t=>t.id===e.id),c={...e,name:e.name.trim()||`未命名提供商`,baseURL:e.baseURL.trim(),model:e.model.trim(),apiKey:e.apiKey?.trim()||void 0};s>=0?i[s]=c:i.push(c);let l=t?.activate===!1&&n.model.activeId||c.id;return o({model:{...n.model,providers:i,activeId:l}}),a(),typeof window<`u`&&window.dispatchEvent(new CustomEvent(m)),i}function x(e){let t=r(),n=t.model.providers.filter(t=>t.id!==e),i=t.model.activeId;return i===e&&(i=n[0]?.id??``),o({model:{...t.model,providers:n,activeId:i}}),a(),typeof window<`u`&&window.dispatchEvent(new CustomEvent(m)),n}function S(e){let t=r();t.model.providers.some(t=>t.id===e)&&(o({model:{...t.model,activeId:e}}),a(),typeof window<`u`&&window.dispatchEvent(new CustomEvent(m)))}function C(e){let t=g();t&&y({...t,...e})}var w=`tw-access-changed`;function T(){return r().access}function E(e){o({access:e}),a(),typeof window<`u`&&window.dispatchEvent(new CustomEvent(w,{detail:e}))}function D(e){if(typeof window>`u`)return()=>{};let t=t=>{let n=t.detail;e(n??T())};return window.addEventListener(w,t),()=>window.removeEventListener(w,t)}function O(e){return window.addEventListener(m,e),()=>window.removeEventListener(m,e)}function k(e=`general`){window.dispatchEvent(new CustomEvent(h,{detail:{tab:e}}))}var A=`tw-general-prefs-changed`;function j(){return{...r().general}}function M(e){let t={...j(),...e};return t.sessionFontSize<12&&(t.sessionFontSize=12),t.sessionFontSize>22&&(t.sessionFontSize=22),o({general:t}),a(),L(t),typeof window<`u`&&window.dispatchEvent(new CustomEvent(A,{detail:t})),t}function N(e){if(typeof window>`u`)return()=>{};let t=t=>{e(t.detail??j())};return window.addEventListener(A,t),()=>window.removeEventListener(A,t)}var P=null,F=null;function I(e){return e===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e}function L(e=j()){if(typeof document>`u`)return;let t=document.documentElement,n=I(e.appearance);t.dataset.theme=n,t.style.colorScheme=n,t.lang=e.language===`en`?`en`:`zh-CN`;let r=`${e.sessionFontSize}px`;t.style.setProperty(`--tw-ui-font-size`,r),t.style.setProperty(`--tw-session-font-size`,r),t.style.fontSize=``,P&&F&&(P.removeEventListener(`change`,F),P=null,F=null),e.appearance===`system`&&(P=window.matchMedia(`(prefers-color-scheme: dark)`),F=()=>{let e=I(`system`);t.dataset.theme=e,t.style.colorScheme=e},P.addEventListener(`change`,F));try{f(()=>import(`./i18n.9qZsrs3u.js`).then(e=>e.t).then(t=>t.applyDomI18n(e.language)),__vite__mapDeps([0,1]))}catch{}}export{S as _,v as a,_ as c,N as d,O as f,M as g,E as h,x as i,g as l,C as m,p as n,T as o,k as p,L as r,j as s,h as t,D as u,b as v,f as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,n as t}from"./react-dom.CqAxpHMt.js";import{p as n}from"./app-config.
|
|
1
|
+
import{c as e,n as t}from"./react-dom.CqAxpHMt.js";import{p as n}from"./app-config.vqDkEMS3.js";import{t as r}from"./jsx-runtime.BUXbF_vF.js";import{t as i}from"./SelectDropdown.D2i7-lQC.js";var a=e(t(),1),o=[5,10,20,50],s=`tw.docs.page-size.v1`;function c(e){return typeof e==`number`&&o.includes(e)}function l(e){try{let t=localStorage.getItem(n(s)),r=t===null?NaN:Number(t);return c(r)?r:e}catch{return e}}function u(e){if(c(e))try{localStorage.setItem(n(s),String(e))}catch{}}var d=r(),f=`h-8 px-3 shrink-0 whitespace-nowrap text-sm text-stone-600 border border-stone-200 rounded-lg hover:bg-stone-50 disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,p=o.map(e=>({value:String(e),label:String(e)}));function m(e){let[t,n]=(0,a.useState)(()=>l(e));return[t,(0,a.useCallback)(e=>{c(e)&&(u(e),n(e))},[])]}function h({page:e,totalPages:t,pageSize:n,busy:r=!1,onPage:a,onPageSize:o}){return(0,d.jsxs)(`div`,{className:`shrink-0 px-4 py-3 border-t border-stone-100 flex items-center justify-between gap-2 flex-wrap`,children:[(0,d.jsxs)(`span`,{className:`text-xs text-stone-500 flex items-center gap-1.5`,children:[(0,d.jsxs)(`span`,{children:[`第 `,e,` / `,t,` 页 ·`]}),(0,d.jsx)(i,{compact:!0,centerContent:!0,options:p,value:String(n),onChange:e=>o(Number(e)),disabled:r,ariaLabel:`每页条数`,showCheck:!1,className:`w-18`}),(0,d.jsx)(`span`,{children:`条`})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,d.jsx)(`button`,{type:`button`,disabled:r||e<=1,onClick:()=>a(1),className:f,children:`首页`}),(0,d.jsx)(`button`,{type:`button`,disabled:r||e<=1,onClick:()=>a(e-1),className:f,children:`上一页`}),(0,d.jsx)(`button`,{type:`button`,disabled:r||e>=t,onClick:()=>a(e+1),className:f,children:`下一页`}),(0,d.jsx)(`button`,{type:`button`,disabled:r||e>=t,onClick:()=>a(t),className:f,children:`末页`})]})]})}function g(){let[e,t]=(0,a.useState)(!1),n=(0,a.useCallback)(()=>t(!0),[]);return{cls:e?`tw-anim-list `:``,play:n}}export{h as n,m as r,g as t};
|
|
@@ -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.
|
|
6
|
+
</script><script type="module" src="/_astro/Base.astro_astro_type_script_index_0_lang.Cg_8YLVA.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
|
var raw = localStorage.getItem('tw.app.config.v1');
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
var savedCfg = JSON.parse(cfgRaw) || {};
|
|
43
43
|
var plugins = savedCfg.plugins || {};
|
|
44
44
|
if (plugins.cases === false) document.documentElement.dataset.pluginOffCases = '1';
|
|
45
|
-
if (plugins.
|
|
45
|
+
if (plugins.todos === false) document.documentElement.dataset.pluginOffTodos = '1';
|
|
46
|
+
if (plugins.tasks === false) document.documentElement.dataset.pluginOffTasks = '1';
|
|
46
47
|
if (plugins.knowledgeLib === false)
|
|
47
48
|
document.documentElement.dataset.pluginOffKnowledgeLib = '1';
|
|
48
49
|
if (plugins.requirements === false)
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
}
|
|
64
65
|
} catch (e) {}
|
|
65
66
|
})();
|
|
66
|
-
</script><link rel="stylesheet" href="/_astro/Base.
|
|
67
|
+
</script><link rel="stylesheet" href="/_astro/Base.ByB0D4ZA.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) {
|
|
67
68
|
animation-duration: 180ms;
|
|
68
69
|
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
|
|
69
70
|
animation-fill-mode: both;
|
|
@@ -99,7 +100,7 @@
|
|
|
99
100
|
animation-duration: 180ms;
|
|
100
101
|
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
|
|
101
102
|
animation-fill-mode: both;
|
|
102
|
-
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"><span class="tw-nav-brand-mark" aria-hidden="true"><img class="tw-nav-brand-mark-img" src="/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.2">v0.1.2</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.Yy2w8MDF.js" component-export="default" renderer-url="/_astro/client.Be_SakrB.js" props="{"data-astro-transition-persist":[0,"astro-gyrtbwwo-1"]}" ssr client="only" opts="{"name":"SpaceSwitcher","value":"react"}" 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="/" 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="/cases/library/" class="tw-nav-item is-active font-medium" 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="/prompts/" class="tw-nav-item" data-plugin-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="/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.EayBsg5g.js" component-export="default" renderer-url="/_astro/client.Be_SakrB.js" props="{"data-astro-transition-persist":[0,"astro-iywf7oe7-2"]}" ssr client="only" opts="{"name":"NavLibraries","value":"react"}" data-astro-transition-persist="astro-iywf7oe7-2"></astro-island></div><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.DC0e7580.js" component-export="default" renderer-url="/_astro/client.Be_SakrB.js" props="{}" ssr client="load" opts="{"name":"SettingsDialog","value":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>
|
|
103
|
+
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"><span class="tw-nav-brand-mark" aria-hidden="true"><img class="tw-nav-brand-mark-img" src="/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.2">v0.1.2</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.Wf8EPYUx.js" component-export="default" renderer-url="/_astro/client.Be_SakrB.js" props="{"data-astro-transition-persist":[0,"astro-gyrtbwwo-1"]}" ssr client="only" opts="{"name":"SpaceSwitcher","value":"react"}" 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="/" 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="/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="/cases/library/" class="tw-nav-item is-active font-medium" 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.ALZ9e12z.js" component-export="default" renderer-url="/_astro/client.Be_SakrB.js" props="{"data-astro-transition-persist":[0,"astro-iywf7oe7-2"]}" ssr client="only" opts="{"name":"NavLibraries","value":"react"}" data-astro-transition-persist="astro-iywf7oe7-2"></astro-island></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.CrMDjSLJ.js" component-export="default" renderer-url="/_astro/client.Be_SakrB.js" props="{}" ssr client="load" opts="{"name":"SettingsDialog","value":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>
|
|
103
104
|
(function () {
|
|
104
105
|
var root = document.documentElement;
|
|
105
106
|
var btn = document.getElementById('tw-nav-toggle');
|
|
@@ -130,6 +131,8 @@
|
|
|
130
131
|
var en = {
|
|
131
132
|
'nav.brand': 'Lantern Harness',
|
|
132
133
|
'nav.home': 'My Workbench',
|
|
134
|
+
'nav.tasks': 'Tasks',
|
|
135
|
+
'nav.todos': 'Todos',
|
|
133
136
|
'nav.caseManage': 'Test Cases',
|
|
134
137
|
'nav.prompts': 'Prompts',
|
|
135
138
|
'nav.knowledge': 'Knowledge Mgmt',
|
|
@@ -164,7 +167,7 @@
|
|
|
164
167
|
});
|
|
165
168
|
} catch (e) {}
|
|
166
169
|
})();
|
|
167
|
-
</script><main data-astro-transition-scope="astro-bbhp3f5g-3" class="tw-main min-h-screen"><div id="tw-route-loading" class="tw-route-loading is-hidden" role="status" aria-live="polite" aria-label="页面加载中"><span class="tw-route-loading-spin" aria-hidden="true"></span></div><div class="max-w-4xl mx-auto px-8 py-8"><header class="mb-6"><h1 class="text-2xl font-bold text-stone-900">用例生成</h1><p class="mt-2 text-sm text-stone-500">选择用例类型、需求与模板后,以会话方式生成用例;结果按所选格式写入<code class="text-stone-600">cases/</code>对应目录(需 <code class="text-stone-600">npm run dev</code>)。</p></header><astro-island uid="ZtCJ0E" component-url="/_astro/CaseGenerateApp.
|
|
170
|
+
</script><main data-astro-transition-scope="astro-bbhp3f5g-3" class="tw-main min-h-screen"><div id="tw-route-loading" class="tw-route-loading is-hidden" role="status" aria-live="polite" aria-label="页面加载中"><span class="tw-route-loading-spin" aria-hidden="true"></span></div><div class="max-w-4xl mx-auto px-8 py-8"><header class="mb-6"><h1 class="text-2xl font-bold text-stone-900">用例生成</h1><p class="mt-2 text-sm text-stone-500">选择用例类型、需求与模板后,以会话方式生成用例;结果按所选格式写入<code class="text-stone-600">cases/</code>对应目录(需 <code class="text-stone-600">npm run dev</code>)。</p></header><astro-island uid="ZtCJ0E" component-url="/_astro/CaseGenerateApp.BlZyjWEr.js" component-export="default" renderer-url="/_astro/client.Be_SakrB.js" props="{}" ssr client="only" opts="{"name":"CaseGenerateApp","value":"react"}"></astro-island></div></main></div><script>
|
|
168
171
|
(function () {
|
|
169
172
|
/**
|
|
170
173
|
* 切页滚回顶部。
|
|
@@ -220,8 +223,9 @@
|
|
|
220
223
|
if (cur.dataset.spaceService) nextRoot.dataset.spaceService = cur.dataset.spaceService;
|
|
221
224
|
// 插件开关同理:不搬过去会先亮出被隐藏的侧栏入口,等 page-load 再收起
|
|
222
225
|
[
|
|
226
|
+
'pluginOffTasks',
|
|
227
|
+
'pluginOffTodos',
|
|
223
228
|
'pluginOffCases',
|
|
224
|
-
'pluginOffPrompts',
|
|
225
229
|
'pluginOffKnowledgeLib',
|
|
226
230
|
'pluginOffRequirements',
|
|
227
231
|
'pluginOffTemplates',
|