lantern-harness 0.1.31 → 0.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/500.html +4 -4
  3. package/dist/_astro/Base.Dlgbb4Ry.css +1 -0
  4. package/dist/_astro/{Base.astro_astro_type_script_index_0_lang.Cd3ccDN-.js → Base.astro_astro_type_script_index_0_lang.BQ1EoZdo.js} +2 -2
  5. package/dist/_astro/{CaseExecBoard.CTuf_Nom.js → CaseExecBoard.CTVdi8MV.js} +1 -1
  6. package/dist/_astro/CaseGenerateApp.CJK7V6iA.js +10 -0
  7. package/dist/_astro/CasesLibrary.Don-Cnus.js +24 -0
  8. package/dist/_astro/ChatApp.BTcAJ7PK.js +226 -0
  9. package/dist/_astro/{ColumnResize.BgYkV9Iy.js → ColumnResize._Iq05ix_.js} +1 -1
  10. package/dist/_astro/{DashboardBoard.B5Qo5Y3e.js → DashboardBoard.BaJyXPXA.js} +1 -1
  11. package/dist/_astro/{DocsFileBrowser.DnxVsmed.js → DocsFileBrowser.D2Cff2LP.js} +1 -1
  12. package/dist/_astro/{KnowledgeLibrary.DARUegK8.js → KnowledgeLibrary.CWxIHa8I.js} +1 -1
  13. package/dist/_astro/{NavLibraries.FAj9zUuq.js → NavLibraries.CZlA6Z1w.js} +1 -1
  14. package/dist/_astro/{PluginsPage.CRBtbpx-.js → PluginsPage.CyjR13X6.js} +2 -2
  15. package/dist/_astro/PluginsPage.DMEvFLnP.js +1 -0
  16. package/dist/_astro/{PmBugsBoard.uNPzbw-N.js → PmBugsBoard.ChL0RBVn.js} +1 -1
  17. package/dist/_astro/{PmIterationsBoard.CjR8L71i.js → PmIterationsBoard.hTKVnMgh.js} +1 -1
  18. package/dist/_astro/{PmProjectDetail.Cpug99Lt.js → PmProjectDetail.Saj76lNM.js} +1 -1
  19. package/dist/_astro/{PmProjectsBoard.VLqrwucj.js → PmProjectsBoard.CCtClGM1.js} +1 -1
  20. package/dist/_astro/PmRequirementsBoard.BNNq671Z.js +1 -0
  21. package/dist/_astro/{PmRequirementsBoard.CdP4gEzq.js → PmRequirementsBoard.DGXYC1Te.js} +1 -1
  22. package/dist/_astro/{PmShared.ChKKU3Ww.js → PmShared.BuhrL7Gb.js} +1 -1
  23. package/dist/_astro/PromptsLibrary.DJtTAFz_.js +1 -0
  24. package/dist/_astro/{ReportsPage.iSM5TWMq.js → ReportsPage.BjD8w0zS.js} +1 -1
  25. package/dist/_astro/ReqAnalysisBoard.BsQ4A1Lt.js +39 -0
  26. package/dist/_astro/{RequirementsLibrary.X89V8-QF.js → RequirementsLibrary.WxAFCP3X.js} +1 -1
  27. package/dist/_astro/{SettingsDialog.FHQTm21D.js → SettingsDialog.CR7rv0mg.js} +1 -1
  28. package/dist/_astro/SpaceSwitcher.BCZbiL7o.js +7 -0
  29. package/dist/_astro/{TasksBoard.Z8rBCO1F.js → TasksBoard.CdWQSwlg.js} +1 -1
  30. package/dist/_astro/{TemplatesLibrary.DBHSAPQ0.js → TemplatesLibrary.y_RtSjYC.js} +1 -1
  31. package/dist/_astro/{TestStatsBoard.BtqoPuLc.js → TestStatsBoard.C3vkF9vc.js} +1 -1
  32. package/dist/_astro/{TodosBoard.ETI63YgA.js → TodosBoard.CSupMlTp.js} +1 -1
  33. package/dist/_astro/{UiAutoBoard.DxrlgvI7.js → UiAutoBoard._og5jRon.js} +3 -3
  34. package/dist/_astro/app-version.DpWEt8o3.js +1 -0
  35. package/dist/_astro/case-gen-run.DDhoxXlU.js +22 -0
  36. package/dist/_astro/{case-review.DlCarphW.js → case-review.s1w_mD4l.js} +1 -1
  37. package/dist/_astro/{plugins.SqANn3ZB.js → plugins.CVnHeKyf.js} +1 -1
  38. package/dist/_astro/prompts-meta.Dnmq-SnF.js +2 -0
  39. package/dist/_astro/req-analysis.D9EOpleR.js +31 -0
  40. package/dist/_astro/story-review.COs6QaUe.js +14 -0
  41. package/dist/case-exec/index.html +5 -5
  42. package/dist/cases/generate/index.html +5 -5
  43. package/dist/cases/library/index.html +5 -5
  44. package/dist/dashboard/index.html +5 -5
  45. package/dist/docs/changelog/index.html +76 -37
  46. package/dist/docs/install/index.html +4 -4
  47. package/dist/docs/manual/index.html +24 -16
  48. package/dist/knowledge/index.html +5 -5
  49. package/dist/plugins/index.html +5 -5
  50. package/dist/pm/bugs/index.html +5 -5
  51. package/dist/pm/iterations/index.html +5 -5
  52. package/dist/pm/projects/detail/index.html +5 -5
  53. package/dist/pm/projects/index.html +5 -5
  54. package/dist/pm/requirements/index.html +5 -5
  55. package/dist/prompts/index.html +5 -5
  56. package/dist/reports/index.html +5 -5
  57. package/dist/requirement-analysis/index.html +5 -5
  58. package/dist/requirements/index.html +5 -5
  59. package/dist/tasks/index.html +5 -5
  60. package/dist/templates/index.html +5 -5
  61. package/dist/test-automation/index.html +5 -5
  62. package/dist/test-stats/index.html +5 -5
  63. package/dist/todos/index.html +5 -5
  64. package/dist/workbench/index.html +5 -5
  65. package/docs//346/223/215/344/275/234/346/211/213/345/206/214.md +20 -12
  66. package/lh-plugins/lh-case-review.mjs +159 -0
  67. package/lh-plugins/lh-req-analysis.mjs +123 -6
  68. package/lh-plugins/plugin-prompts.mjs +2 -0
  69. package/lh-plugins/req-analysis-prompt.mjs +30 -4
  70. package/package.json +1 -1
  71. package/dist/_astro/Base.9LLJ6KVG.css +0 -1
  72. package/dist/_astro/CaseGenerateApp.CHQnkY5R.js +0 -10
  73. package/dist/_astro/CasesLibrary.B7wyxL0p.js +0 -21
  74. package/dist/_astro/ChatApp.OW9jzZNM.js +0 -226
  75. package/dist/_astro/PluginsPage.Bof7KzU6.js +0 -1
  76. package/dist/_astro/PmRequirementsBoard.B5ypu68O.js +0 -1
  77. package/dist/_astro/PromptsLibrary.CK6nLgdD.js +0 -1
  78. package/dist/_astro/ReqAnalysisBoard.D94a1NoW.js +0 -39
  79. package/dist/_astro/SpaceSwitcher.MmSkP3wb.js +0 -7
  80. package/dist/_astro/app-version.C6rzHe1M.js +0 -1
  81. package/dist/_astro/case-gen-run.CKShZ1Ha.js +0 -22
  82. package/dist/_astro/prompts-meta.C_MeYq8G.js +0 -2
  83. package/dist/_astro/req-analysis.CIZ_cIJQ.js +0 -23
  84. package/dist/_astro/story-review.BzBFIFt-.js +0 -15
@@ -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.Cd3ccDN-.js"></script><meta name="astro-view-transitions-enabled" content="true"><meta name="astro-view-transitions-fallback" content="animate"><script type="module" src="/_astro/ClientRouter.astro_astro_type_script_index_0_lang.CO1cjG9V.js"></script><script>
6
+ </script><script type="module" src="/_astro/Base.astro_astro_type_script_index_0_lang.BQ1EoZdo.js"></script><meta name="astro-view-transitions-enabled" content="true"><meta name="astro-view-transitions-fallback" content="animate"><script type="module" src="/_astro/ClientRouter.astro_astro_type_script_index_0_lang.CO1cjG9V.js"></script><script>
7
7
  (function () {
8
8
  try {
9
9
  // 配置按空间分键(`tw.app.config.v1::<spaceId>`),主题必须从同一个键读,
@@ -98,7 +98,7 @@
98
98
  }
99
99
  } catch (e) {}
100
100
  })();
101
- </script><link rel="stylesheet" href="/_astro/Base.9LLJ6KVG.css"><script type="module" src="/_astro/page.Bx2KSkeL.js"></script><style>[data-astro-transition-scope="astro-bbhp3f5g-3"] { view-transition-name: astro-bbhp3f5g-3; }@layer astro { ::view-transition-old(astro-bbhp3f5g-3) {
101
+ </script><link rel="stylesheet" href="/_astro/Base.Dlgbb4Ry.css"><script type="module" src="/_astro/page.Bx2KSkeL.js"></script><style>[data-astro-transition-scope="astro-bbhp3f5g-3"] { view-transition-name: astro-bbhp3f5g-3; }@layer astro { ::view-transition-old(astro-bbhp3f5g-3) {
102
102
  animation-duration: 180ms;
103
103
  animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
104
104
  animation-fill-mode: both;
@@ -134,7 +134,7 @@
134
134
  animation-duration: 180ms;
135
135
  animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
136
136
  animation-fill-mode: both;
137
- animation-name: astroFadeIn; }</style></head><body class="tw-body antialiased"><div class="tw-shell min-h-screen"><aside class="tw-nav-aside fixed inset-y-0 left-0 flex flex-col z-45" id="tw-nav-aside"><div class="tw-nav-brand"><div class="tw-nav-brand-row"><a href="/" class="tw-nav-brand-link min-w-0 flex-1" data-astro-reload><span class="tw-nav-brand-mark" aria-hidden="true"><img class="tw-nav-brand-mark-img" src="/brand/brand-mark.png" alt="" width="36" height="36"></span><span class="tw-nav-brand-text"><span class="tw-nav-brand-title-row"><span class="tw-nav-brand-title" data-i18n="nav.brand">Lantern Harness</span><span class="tw-nav-brand-ver" data-hint="平台版本 v0.1.31">v0.1.31<span class="tw-nav-brand-dot" id="tw-update-dot" role="button" tabindex="-1" aria-label="有新版本可更新" hidden></span></span></span></span></a></div></div><div class="tw-nav-space-slot"><div class="tw-nav-space tw-nav-space-ph" id="tw-nav-space-ph" aria-hidden="true"><div class="tw-nav-space-ph-box"><span class="tw-nav-space-ph-ico"></span><span class="tw-nav-space-ph-lines"><span class="tw-nav-space-ph-bar is-cap"></span><span class="tw-nav-space-ph-bar is-name"></span></span></div></div><style>astro-island,astro-slot,astro-static-slot{display:contents}</style><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).only=e,window.dispatchEvent(new Event(`astro:only`))})();</script><script>(function(){function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(t,n){if(e(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function n(n){var r=t(n,`string`);return e(r)==`symbol`?r:r+``}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let i=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);{let e={0:e=>a(e),1:e=>n(e),2:e=>new RegExp(e),3:e=>new Date(e),4:e=>new Map(n(e)),5:e=>new Set(n(e)),6:e=>BigInt(e),7:e=>new URL(e),8:e=>new Uint8Array(e),9:e=>new Uint16Array(e),10:e=>new Uint32Array(e),11:e=>1/0*e},t=t=>{let[n,r]=t;return n in e?e[n](r):void 0},n=e=>e.map(t),a=e=>typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)]));class o extends HTMLElement{constructor(...e){super(...e),r(this,`Component`,void 0),r(this,`hydrator`,void 0),r(this,`hydrate`,async()=>{var e;if(!this.hydrator||!this.isConnected)return;let t=(e=this.parentElement)==null?void 0:e.closest(`astro-island[ssr]`);if(t){t.addEventListener(`astro:hydrate`,this.hydrate,{once:!0});return}let n=this.querySelectorAll(`astro-slot`),r={},i=this.querySelectorAll(`template[data-astro-template]`);for(let e of i){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`data-astro-template`)||`default`]=e.innerHTML,e.remove())}for(let e of n){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`name`)||`default`]=e.innerHTML)}let o;try{o=this.hasAttribute(`props`)?a(JSON.parse(this.getAttribute(`props`))):{}}catch(e){let t=this.getAttribute(`component-url`)||`<unknown>`,n=this.getAttribute(`component-export`);throw n&&(t+=` (export ${n})`),console.error(`[hydrate] Error parsing props for component ${t}`,this.getAttribute(`props`),e),e}await this.hydrator(this)(this.Component,o,r,{client:this.getAttribute(`client`)}),this.removeAttribute(`ssr`),this.dispatchEvent(new CustomEvent(`astro:hydrate`))}),r(this,`unmount`,()=>{this.isConnected||this.dispatchEvent(new CustomEvent(`astro:unmount`))})}disconnectedCallback(){document.removeEventListener(`astro:after-swap`,this.unmount),document.addEventListener(`astro:after-swap`,this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute(`await-children`)||document.readyState===`interactive`||document.readyState===`complete`)this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener(`DOMContentLoaded`,e),t.disconnect(),this.childrenConnectedCallback()},t=new MutationObserver(()=>{var t;((t=this.lastChild)==null?void 0:t.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue===`astro:end`&&(this.lastChild.remove(),e())});t.observe(this,{childList:!0}),document.addEventListener(`DOMContentLoaded`,e)}}async childrenConnectedCallback(){let e=this.getAttribute(`before-hydration-url`);e&&await import(e),this.start()}getRetryImportUrl(e){let t=new URL(e,document.baseURI);return t.searchParams.set(`astro-retry`,Date.now().toString()),t.toString()}async importWithRetry(e){try{return await import(e)}catch(t){return await new Promise(e=>setTimeout(e,1e3)),import(this.getRetryImportUrl(e))}}handleHydrationError(e){let t=this.getAttribute(`component-url`),n=new CustomEvent(`astro:hydration-error`,{cancelable:!0,bubbles:!0,composed:!0,detail:{error:e,componentUrl:t}});this.dispatchEvent(n)&&console.error(`[astro-island] Error hydrating ${t}`,e)}async start(){let e=JSON.parse(this.getAttribute(`opts`)),t=this.getAttribute(`client`);if(Astro[t]===void 0)window.addEventListener(`astro:${t}`,()=>this.start(),{once:!0});else try{await Astro[t](async()=>{let e=this.getAttribute(`renderer-url`);try{let[t,{default:n}]=await Promise.all([this.importWithRetry(this.getAttribute(`component-url`)),e?this.importWithRetry(e):Promise.resolve({default:()=>()=>{}})]),r=this.getAttribute(`component-export`)||`default`;if(r.includes(`.`)){this.Component=t;for(let e of r.split(`.`)){if(i.has(e)||!this.Component||typeof this.Component!=`object`&&typeof this.Component!=`function`||!Object.hasOwn(this.Component,e))throw Error(`Invalid component export path: ${r}`);this.Component=this.Component[e]}}else{if(i.has(r))throw Error(`Invalid component export path: ${r}`);this.Component=t[r]}return this.hydrator=n,this.hydrate}catch(e){return this.handleHydrationError(e),()=>{}}},e,this)}catch(e){this.handleHydrationError(e)}}attributeChangedCallback(){this.hydrate()}}r(o,`observedAttributes`,[`props`]),customElements.get(`astro-island`)||customElements.define(`astro-island`,o)}})();</script><astro-island uid="2wH2Dz" component-url="/_astro/SpaceSwitcher.MmSkP3wb.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{&quot;data-astro-transition-persist&quot;:[0,&quot;astro-gyrtbwwo-1&quot;]}" ssr client="only" opts="{&quot;name&quot;:&quot;SpaceSwitcher&quot;,&quot;value&quot;:&quot;react&quot;}" data-astro-transition-persist="astro-gyrtbwwo-1"></astro-island></div><button type="button" id="tw-nav-toggle" class="tw-nav-toggle" aria-label="收起或展开左侧导航" aria-expanded="true" aria-controls="tw-nav-aside"><svg class="tw-nav-toggle-icon is-collapse" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 6l-6 6 6 6"></path></svg><svg class="tw-nav-toggle-icon is-expand" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"></path></svg></button><nav class="tw-nav-list flex-1 overflow-y-auto"><a href="/workbench/" class="tw-nav-item is-active font-medium" data-i18n-hint="nav.home" data-hint="我的工作台"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 10.5 12 3l9 7.5"></path><path d="M5 9.5V20h14V9.5"></path></svg><span class="tw-nav-label" data-i18n="nav.home">我的工作台</span></a><div class="tw-nav-libraries"><div class="tw-nav-libraries-ph"><a href="/dashboard/" class="tw-nav-item" data-plugin-nav="dashboard"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="3" width="7" height="7" rx="1.5"></rect><rect x="14" y="3" width="7" height="7" rx="1.5"></rect><rect x="3" y="14" width="7" height="7" rx="1.5"></rect><rect x="14" y="14" width="7" height="7" rx="1.5"></rect></svg><span class="tw-nav-label" data-i18n="nav.dashboard">仪表盘</span></a><a href="/tasks/" class="tw-nav-item" data-plugin-nav="tasks"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 5h10"></path><path d="M9 12h10"></path><path d="M9 19h10"></path><path d="M4 5h.01"></path><path d="M4 12h.01"></path><path d="M4 19h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.tasks">任务管理</span></a><a href="/todos/" class="tw-nav-item" data-plugin-nav="todos"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M8 6h13"></path><path d="M8 12h13"></path><path d="M8 18h13"></path><path d="M3 6h.01"></path><path d="M3 12h.01"></path><path d="M3 18h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.todos">待办事项</span></a><a href="/pm/projects/" class="tw-nav-item" data-plugin-nav="projects"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"></path></svg><span class="tw-nav-label" data-i18n="nav.projects">项目列表</span></a><a href="/pm/iterations/" class="tw-nav-item" data-plugin-nav="iterations"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="5" width="18" height="16" rx="2"></rect><path d="M8 3v4"></path><path d="M16 3v4"></path><path d="M3 10h18"></path></svg><span class="tw-nav-label" data-i18n="nav.iterations">迭代管理</span></a><a href="/pm/requirements/" class="tw-nav-item" data-plugin-nav="pmRequirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.requirementsMgmt">需求管理</span></a><a href="/pm/bugs/" class="tw-nav-item" data-plugin-nav="bugs"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="14" r="5"></circle><path d="M9 6l2 2"></path><path d="M15 6l-2 2"></path><path d="M7 11H4"></path><path d="M20 11h-3"></path><path d="M7 17H4"></path><path d="M20 17h-3"></path></svg><span class="tw-nav-label" data-i18n="nav.bugs">缺陷管理</span></a><a href="/reports/" class="tw-nav-item" data-plugin-nav="reports"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.reports">工作汇报</span></a><a href="/test-stats/" class="tw-nav-item" data-plugin-nav="testStats"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 20V10"></path><path d="M10 20V4"></path><path d="M16 20v-7"></path><path d="M22 20H2"></path></svg><span class="tw-nav-label" data-i18n="nav.testStats">测试统计</span></a><a href="/case-exec/" class="tw-nav-item" data-plugin-nav="caseExec"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="9"></circle><circle cx="12" cy="12" r="5"></circle><circle cx="12" cy="12" r="1.4"></circle></svg><span class="tw-nav-label" data-i18n="nav.caseExec">用例执行统计</span></a><a href="/cases/library/" class="tw-nav-item" data-plugin-nav="cases"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 11l3 3L22 4"></path><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg><span class="tw-nav-label" data-i18n="nav.caseManage">用例管理</span></a><a href="/knowledge/" class="tw-nav-item" data-plugin-nav="knowledgeLib"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path></svg><span class="tw-nav-label" data-i18n="nav.knowledge">知识库管理</span></a><a href="/requirements/" class="tw-nav-item" data-plugin-nav="requirements" data-i18n-hint="nav.requirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h6"></path></svg><span class="tw-nav-label" data-i18n="nav.requirements">需求文档库</span></a><a href="/templates/" class="tw-nav-item" data-plugin-nav="templates" data-i18n-hint="nav.templates"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 3 3 8l9 5 9-5-9-5z"></path><path d="m3 13 9 5 9-5"></path></svg><span class="tw-nav-label" data-i18n="nav.templates">测试模板库</span></a></div><astro-island uid="Z1lgSd4" component-url="/_astro/NavLibraries.FAj9zUuq.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{&quot;data-astro-transition-persist&quot;:[0,&quot;astro-iywf7oe7-2&quot;]}" ssr client="only" opts="{&quot;name&quot;:&quot;NavLibraries&quot;,&quot;value&quot;:&quot;react&quot;}" data-astro-transition-persist="astro-iywf7oe7-2"></astro-island><script>(function(){const host = ".tw-nav-libraries";
137
+ animation-name: astroFadeIn; }</style></head><body class="tw-body antialiased"><div class="tw-shell min-h-screen"><aside class="tw-nav-aside fixed inset-y-0 left-0 flex flex-col z-45" id="tw-nav-aside"><div class="tw-nav-brand"><div class="tw-nav-brand-row"><a href="/" class="tw-nav-brand-link min-w-0 flex-1" data-astro-reload><span class="tw-nav-brand-mark" aria-hidden="true"><img class="tw-nav-brand-mark-img" src="/brand/brand-mark.png" alt="" width="36" height="36"></span><span class="tw-nav-brand-text"><span class="tw-nav-brand-title-row"><span class="tw-nav-brand-title" data-i18n="nav.brand">Lantern Harness</span><span class="tw-nav-brand-ver" data-hint="平台版本 v0.1.33">v0.1.33<span class="tw-nav-brand-dot" id="tw-update-dot" role="button" tabindex="-1" aria-label="有新版本可更新" hidden></span></span></span></span></a></div></div><div class="tw-nav-space-slot"><div class="tw-nav-space tw-nav-space-ph" id="tw-nav-space-ph" aria-hidden="true"><div class="tw-nav-space-ph-box"><span class="tw-nav-space-ph-ico"></span><span class="tw-nav-space-ph-lines"><span class="tw-nav-space-ph-bar is-cap"></span><span class="tw-nav-space-ph-bar is-name"></span></span></div></div><style>astro-island,astro-slot,astro-static-slot{display:contents}</style><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).only=e,window.dispatchEvent(new Event(`astro:only`))})();</script><script>(function(){function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(t,n){if(e(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function n(n){var r=t(n,`string`);return e(r)==`symbol`?r:r+``}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let i=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);{let e={0:e=>a(e),1:e=>n(e),2:e=>new RegExp(e),3:e=>new Date(e),4:e=>new Map(n(e)),5:e=>new Set(n(e)),6:e=>BigInt(e),7:e=>new URL(e),8:e=>new Uint8Array(e),9:e=>new Uint16Array(e),10:e=>new Uint32Array(e),11:e=>1/0*e},t=t=>{let[n,r]=t;return n in e?e[n](r):void 0},n=e=>e.map(t),a=e=>typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)]));class o extends HTMLElement{constructor(...e){super(...e),r(this,`Component`,void 0),r(this,`hydrator`,void 0),r(this,`hydrate`,async()=>{var e;if(!this.hydrator||!this.isConnected)return;let t=(e=this.parentElement)==null?void 0:e.closest(`astro-island[ssr]`);if(t){t.addEventListener(`astro:hydrate`,this.hydrate,{once:!0});return}let n=this.querySelectorAll(`astro-slot`),r={},i=this.querySelectorAll(`template[data-astro-template]`);for(let e of i){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`data-astro-template`)||`default`]=e.innerHTML,e.remove())}for(let e of n){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`name`)||`default`]=e.innerHTML)}let o;try{o=this.hasAttribute(`props`)?a(JSON.parse(this.getAttribute(`props`))):{}}catch(e){let t=this.getAttribute(`component-url`)||`<unknown>`,n=this.getAttribute(`component-export`);throw n&&(t+=` (export ${n})`),console.error(`[hydrate] Error parsing props for component ${t}`,this.getAttribute(`props`),e),e}await this.hydrator(this)(this.Component,o,r,{client:this.getAttribute(`client`)}),this.removeAttribute(`ssr`),this.dispatchEvent(new CustomEvent(`astro:hydrate`))}),r(this,`unmount`,()=>{this.isConnected||this.dispatchEvent(new CustomEvent(`astro:unmount`))})}disconnectedCallback(){document.removeEventListener(`astro:after-swap`,this.unmount),document.addEventListener(`astro:after-swap`,this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute(`await-children`)||document.readyState===`interactive`||document.readyState===`complete`)this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener(`DOMContentLoaded`,e),t.disconnect(),this.childrenConnectedCallback()},t=new MutationObserver(()=>{var t;((t=this.lastChild)==null?void 0:t.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue===`astro:end`&&(this.lastChild.remove(),e())});t.observe(this,{childList:!0}),document.addEventListener(`DOMContentLoaded`,e)}}async childrenConnectedCallback(){let e=this.getAttribute(`before-hydration-url`);e&&await import(e),this.start()}getRetryImportUrl(e){let t=new URL(e,document.baseURI);return t.searchParams.set(`astro-retry`,Date.now().toString()),t.toString()}async importWithRetry(e){try{return await import(e)}catch(t){return await new Promise(e=>setTimeout(e,1e3)),import(this.getRetryImportUrl(e))}}handleHydrationError(e){let t=this.getAttribute(`component-url`),n=new CustomEvent(`astro:hydration-error`,{cancelable:!0,bubbles:!0,composed:!0,detail:{error:e,componentUrl:t}});this.dispatchEvent(n)&&console.error(`[astro-island] Error hydrating ${t}`,e)}async start(){let e=JSON.parse(this.getAttribute(`opts`)),t=this.getAttribute(`client`);if(Astro[t]===void 0)window.addEventListener(`astro:${t}`,()=>this.start(),{once:!0});else try{await Astro[t](async()=>{let e=this.getAttribute(`renderer-url`);try{let[t,{default:n}]=await Promise.all([this.importWithRetry(this.getAttribute(`component-url`)),e?this.importWithRetry(e):Promise.resolve({default:()=>()=>{}})]),r=this.getAttribute(`component-export`)||`default`;if(r.includes(`.`)){this.Component=t;for(let e of r.split(`.`)){if(i.has(e)||!this.Component||typeof this.Component!=`object`&&typeof this.Component!=`function`||!Object.hasOwn(this.Component,e))throw Error(`Invalid component export path: ${r}`);this.Component=this.Component[e]}}else{if(i.has(r))throw Error(`Invalid component export path: ${r}`);this.Component=t[r]}return this.hydrator=n,this.hydrate}catch(e){return this.handleHydrationError(e),()=>{}}},e,this)}catch(e){this.handleHydrationError(e)}}attributeChangedCallback(){this.hydrate()}}r(o,`observedAttributes`,[`props`]),customElements.get(`astro-island`)||customElements.define(`astro-island`,o)}})();</script><astro-island uid="2wH2Dz" component-url="/_astro/SpaceSwitcher.BCZbiL7o.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{&quot;data-astro-transition-persist&quot;:[0,&quot;astro-gyrtbwwo-1&quot;]}" ssr client="only" opts="{&quot;name&quot;:&quot;SpaceSwitcher&quot;,&quot;value&quot;:&quot;react&quot;}" data-astro-transition-persist="astro-gyrtbwwo-1"></astro-island></div><button type="button" id="tw-nav-toggle" class="tw-nav-toggle" aria-label="收起或展开左侧导航" aria-expanded="true" aria-controls="tw-nav-aside"><svg class="tw-nav-toggle-icon is-collapse" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 6l-6 6 6 6"></path></svg><svg class="tw-nav-toggle-icon is-expand" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"></path></svg></button><nav class="tw-nav-list flex-1 overflow-y-auto"><a href="/workbench/" class="tw-nav-item is-active font-medium" data-i18n-hint="nav.home" data-hint="我的工作台"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 10.5 12 3l9 7.5"></path><path d="M5 9.5V20h14V9.5"></path></svg><span class="tw-nav-label" data-i18n="nav.home">我的工作台</span></a><div class="tw-nav-libraries"><div class="tw-nav-libraries-ph"><a href="/dashboard/" class="tw-nav-item" data-plugin-nav="dashboard"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="3" width="7" height="7" rx="1.5"></rect><rect x="14" y="3" width="7" height="7" rx="1.5"></rect><rect x="3" y="14" width="7" height="7" rx="1.5"></rect><rect x="14" y="14" width="7" height="7" rx="1.5"></rect></svg><span class="tw-nav-label" data-i18n="nav.dashboard">仪表盘</span></a><a href="/tasks/" class="tw-nav-item" data-plugin-nav="tasks"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 5h10"></path><path d="M9 12h10"></path><path d="M9 19h10"></path><path d="M4 5h.01"></path><path d="M4 12h.01"></path><path d="M4 19h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.tasks">任务管理</span></a><a href="/todos/" class="tw-nav-item" data-plugin-nav="todos"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M8 6h13"></path><path d="M8 12h13"></path><path d="M8 18h13"></path><path d="M3 6h.01"></path><path d="M3 12h.01"></path><path d="M3 18h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.todos">待办事项</span></a><a href="/pm/projects/" class="tw-nav-item" data-plugin-nav="projects"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"></path></svg><span class="tw-nav-label" data-i18n="nav.projects">项目列表</span></a><a href="/pm/iterations/" class="tw-nav-item" data-plugin-nav="iterations"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="5" width="18" height="16" rx="2"></rect><path d="M8 3v4"></path><path d="M16 3v4"></path><path d="M3 10h18"></path></svg><span class="tw-nav-label" data-i18n="nav.iterations">迭代管理</span></a><a href="/pm/requirements/" class="tw-nav-item" data-plugin-nav="pmRequirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.requirementsMgmt">需求管理</span></a><a href="/pm/bugs/" class="tw-nav-item" data-plugin-nav="bugs"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="14" r="5"></circle><path d="M9 6l2 2"></path><path d="M15 6l-2 2"></path><path d="M7 11H4"></path><path d="M20 11h-3"></path><path d="M7 17H4"></path><path d="M20 17h-3"></path></svg><span class="tw-nav-label" data-i18n="nav.bugs">缺陷管理</span></a><a href="/reports/" class="tw-nav-item" data-plugin-nav="reports"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.reports">工作汇报</span></a><a href="/test-stats/" class="tw-nav-item" data-plugin-nav="testStats"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 20V10"></path><path d="M10 20V4"></path><path d="M16 20v-7"></path><path d="M22 20H2"></path></svg><span class="tw-nav-label" data-i18n="nav.testStats">测试统计</span></a><a href="/case-exec/" class="tw-nav-item" data-plugin-nav="caseExec"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="9"></circle><circle cx="12" cy="12" r="5"></circle><circle cx="12" cy="12" r="1.4"></circle></svg><span class="tw-nav-label" data-i18n="nav.caseExec">用例执行统计</span></a><a href="/cases/library/" class="tw-nav-item" data-plugin-nav="cases"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 11l3 3L22 4"></path><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg><span class="tw-nav-label" data-i18n="nav.caseManage">用例管理</span></a><a href="/knowledge/" class="tw-nav-item" data-plugin-nav="knowledgeLib"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path></svg><span class="tw-nav-label" data-i18n="nav.knowledge">知识库管理</span></a><a href="/requirements/" class="tw-nav-item" data-plugin-nav="requirements" data-i18n-hint="nav.requirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h6"></path></svg><span class="tw-nav-label" data-i18n="nav.requirements">需求文档库</span></a><a href="/templates/" class="tw-nav-item" data-plugin-nav="templates" data-i18n-hint="nav.templates"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 3 3 8l9 5 9-5-9-5z"></path><path d="m3 13 9 5 9-5"></path></svg><span class="tw-nav-label" data-i18n="nav.templates">测试模板库</span></a></div><astro-island uid="Z1lgSd4" component-url="/_astro/NavLibraries.CZlA6Z1w.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{&quot;data-astro-transition-persist&quot;:[0,&quot;astro-iywf7oe7-2&quot;]}" ssr client="only" opts="{&quot;name&quot;:&quot;NavLibraries&quot;,&quot;value&quot;:&quot;react&quot;}" data-astro-transition-persist="astro-iywf7oe7-2"></astro-island><script>(function(){const host = ".tw-nav-libraries";
138
138
  const cacheKey = "tw.hydrate.nav";
139
139
  const fixActive = true;
140
140
  const capture = false;
@@ -364,7 +364,7 @@ const syncNavGroups = true;
364
364
  // 缓存坏了就当没有
365
365
  }
366
366
  })();
367
- })();</script></div><a href="/prompts/" class="tw-nav-item" data-plugin-nav="prompts" data-pinned-nav="prompts"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 20h9"></path><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg><span class="tw-nav-label" data-i18n="nav.prompts">提示词管理</span></a><a href="/docs/manual/" class="tw-nav-item" data-hint="帮助中心" data-i18n-hint="nav.helpCenter"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M5 4.5h9.5L19 9v10.5H5V4.5Z" stroke-linejoin="round"></path><path d="M14.5 4.5V9H19" stroke-linejoin="round"></path><path d="M8 13h8M8 16.5h6" stroke-linecap="round"></path></svg><span class="tw-nav-label" data-i18n="nav.helpCenter">帮助中心</span></a></nav><div class="tw-nav-foot"><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).load=e,window.dispatchEvent(new Event(`astro:load`))})();</script><astro-island uid="Z12jkyC" prefix="r1" component-url="/_astro/SettingsDialog.FHQTm21D.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{}" ssr client="load" opts="{&quot;name&quot;:&quot;SettingsDialog&quot;,&quot;value&quot;:true}" await-children><div class="tw-nav-foot-row"><button type="button" class="tw-nav-settings-btn" data-hint="设置"><svg class="tw-nav-ico w-4.5 h-4.5 shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9c.2.6.7 1 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"></path></svg><span data-i18n="nav.settings">设置</span></button><button type="button" class="tw-nav-provider-chip is-empty" data-hint="未配置模型"><span class="tw-nav-provider-dot" aria-hidden="true"></span><span class="tw-nav-provider-name">未配置</span></button></div><span hidden="" style="position:fixed;top:1px;left:1px;width:1px;height:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;display:none"></span><!--astro:end--></astro-island></div></aside><script data-astro-rerun>
367
+ })();</script></div><a href="/prompts/" class="tw-nav-item" data-plugin-nav="prompts" data-pinned-nav="prompts"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 20h9"></path><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg><span class="tw-nav-label" data-i18n="nav.prompts">提示词管理</span></a><a href="/docs/manual/" class="tw-nav-item" data-hint="帮助中心" data-i18n-hint="nav.helpCenter"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M5 4.5h9.5L19 9v10.5H5V4.5Z" stroke-linejoin="round"></path><path d="M14.5 4.5V9H19" stroke-linejoin="round"></path><path d="M8 13h8M8 16.5h6" stroke-linecap="round"></path></svg><span class="tw-nav-label" data-i18n="nav.helpCenter">帮助中心</span></a></nav><div class="tw-nav-foot"><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).load=e,window.dispatchEvent(new Event(`astro:load`))})();</script><astro-island uid="Z12jkyC" prefix="r1" component-url="/_astro/SettingsDialog.CR7rv0mg.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{}" ssr client="load" opts="{&quot;name&quot;:&quot;SettingsDialog&quot;,&quot;value&quot;:true}" await-children><div class="tw-nav-foot-row"><button type="button" class="tw-nav-settings-btn" data-hint="设置"><svg class="tw-nav-ico w-4.5 h-4.5 shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9c.2.6.7 1 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"></path></svg><span data-i18n="nav.settings">设置</span></button><button type="button" class="tw-nav-provider-chip is-empty" data-hint="未配置模型"><span class="tw-nav-provider-dot" aria-hidden="true"></span><span class="tw-nav-provider-name">未配置</span></button></div><span hidden="" style="position:fixed;top:1px;left:1px;width:1px;height:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;display:none"></span><!--astro:end--></astro-island></div></aside><script data-astro-rerun>
368
368
  (function () {
369
369
  try {
370
370
  var raw = localStorage.getItem('tw.app.model.v1');
@@ -471,7 +471,7 @@ const syncNavGroups = true;
471
471
  });
472
472
  } catch (e) {}
473
473
  })();
474
- </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 data-astro-transition-persist="workbench-chat" class="tw-workbench-host"><astro-island uid="XhrnG" component-url="/_astro/ChatApp.OW9jzZNM.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{&quot;slashDocs&quot;:[1,[]]}" ssr client="only" opts="{&quot;name&quot;:&quot;ChatApp&quot;,&quot;value&quot;:&quot;react&quot;}"></astro-island></div></main><astro-island uid="1ae4mb" component-url="/_astro/Toast.BO2NFckG.js" component-export="GlobalToastHost" renderer-url="/_astro/client.BHNTqLjv.js" props="{&quot;data-astro-transition-persist&quot;:[0,&quot;astro-34g7cspi-4&quot;]}" ssr client="only" opts="{&quot;name&quot;:&quot;GlobalToastHost&quot;,&quot;value&quot;:&quot;react&quot;}" data-astro-transition-persist="astro-34g7cspi-4"></astro-island></div><script>
474
+ </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 data-astro-transition-persist="workbench-chat" class="tw-workbench-host"><astro-island uid="XhrnG" component-url="/_astro/ChatApp.BTcAJ7PK.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{&quot;slashDocs&quot;:[1,[]]}" ssr client="only" opts="{&quot;name&quot;:&quot;ChatApp&quot;,&quot;value&quot;:&quot;react&quot;}"></astro-island></div></main><astro-island uid="1ae4mb" component-url="/_astro/Toast.BO2NFckG.js" component-export="GlobalToastHost" renderer-url="/_astro/client.BHNTqLjv.js" props="{&quot;data-astro-transition-persist&quot;:[0,&quot;astro-34g7cspi-4&quot;]}" ssr client="only" opts="{&quot;name&quot;:&quot;GlobalToastHost&quot;,&quot;value&quot;:&quot;react&quot;}" data-astro-transition-persist="astro-34g7cspi-4"></astro-island></div><script>
475
475
  (function () {
476
476
  /**
477
477
  * 切页滚回顶部。
@@ -175,7 +175,7 @@
175
175
 
176
176
  | 库 | 操作 |
177
177
  | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
178
- | 用例管理 | 双击本地打开;工具栏「上传用例」导入本地用例(`.xlsx` / `.xls` / `.csv` / `.md`,传到根目录;同名会确认后覆盖);批量删除;行内「备份」把当前文件拷到「用例管理/备份列表/」(首次备份才创建该文件夹,主列表不展示);工具栏「备份列表」可查看并手动删除;备份不自动过期;开启评审插件后多出「评审」列与「评审」按钮(见下节) |
178
+ | 用例管理 | 双击本地打开;工具栏「上传用例」导入本地用例(`.xlsx` / `.xls` / `.csv` / `.md`,传到根目录;同名会确认后覆盖);批量删除;行内「备份」把当前文件拷到「用例管理/备份列表/」(首次备份才创建该文件夹,主列表不展示);行内「重排」按需求条目序把整份用例重新排序并重编号(见下节);工具栏「备份列表」可查看并手动删除;备份不自动过期;开启评审插件后多出「评审」列与「评审」按钮(见下节) |
179
179
  | 提示词管理 | **运行时与日常增删改都以这里为准**;双击本地打开;删除(系统提示词不可删;插件开启期间,插件引用的提示词也不可删);「关联插件」列标出归属;行内可复制 / 改名(悬停文件名右侧出现改名按钮,重名会拦下);「生成提示词」跳转工作台。仓库根目录 `prompt/` 仅为完整参考稿,不参与运行 |
180
180
  | 知识库管理 | 双击本地打开;批量删除;「在会话中打开」;「生成知识库」跳转工作台 |
181
181
  | 需求文档库 | 新建文件夹 / 上传文件(`.md` / `.txt` / `.docx` / `.xlsx` / `.csv`);文件列表按**上传时间**新→旧,行内显示大小与上传时间;左侧文件夹名过长悬停出气泡;单击预览(仅 `.md` / `.txt`),双击本地打开;删除 |
@@ -237,7 +237,7 @@ version: '1.0' # 可选
237
237
  | 测试技能 | 自动化测试 | 关 | 侧栏进入自动化测试:自动识别并挂载 Playwright / pytest / Selenium 项目,按项目自带任务运行,运行 / 停止用例、实时日志与 HTML 报告;「生成」Tab 先出可编辑步骤计划、再由 AI 驱动浏览器绑定定位器,写入时一次生成 spec + 页面对象 + 登录态文件(需本地服务) |
238
238
  | 需求管理 | 需求文档库 | 关 | 侧栏进入需求文档库;关闭后入口隐藏,生成用例时不再引用需求文档;磁盘文件仍保留 |
239
239
  | 需求管理 | 需求分析 | 关 | 侧栏进入需求分析:按需求文档结构播种条目并拆查询/修改子点与用户故事;条目可展开对照原文;审查待确认可补充/忽略/落成故事(需本地服务) |
240
- | 需求管理 | 用户故事审查 | 关 | 需求分析页多出「用户故事审查」与「审查结果 / 忽略」Tab,待确认清单可补写、补充、忽略;开启「需求分析」时默认一并打开(需本地服务) |
240
+ | 需求管理 | 用户故事审查 | 关 | 需求分析页多出「审查结果 / 忽略」Tab;生成用户故事成功后自动初审,结果页可重新审查 / 全量扫描;待确认可补写、补充、忽略;开启「需求分析」时默认一并打开(需本地服务) |
241
241
  | 需求管理 | 生成测试点 | 关 | 多出「测试点」Tab,按五维拆测试点并标 P0–P3,可导出 XMind / Markdown;重新生成前确认;开启「需求分析」时默认一并打开(需本地服务) |
242
242
  | 记忆与检索 | 知识库检索 | 关 | 工作台输入 `@` 引用 `知识库管理/`、`测试模板库/` 与工作区文档 |
243
243
  | 记忆与检索 | 会话记忆 | 关 | 长期记忆 / 项目关键 / 项目日志等记忆轨 + 待确认队列;`.lantern/local/memories/`(需本地服务) |
@@ -419,22 +419,22 @@ version: '1.0' # 可选
419
419
 
420
420
  - **数据位置**:落在当前数据空间的 `需求分析/需求分析.json`(`{ version, docs, seq, storySeq }`),第一次写入才建目录 / 文件;切换空间各用各的。`需求分析/` 与「项目管理」的那几个目录一样,不会被侧栏当成同名分组目录搬走。
421
421
  - **来源只读**:「新建分析」与工作台左栏的来源下拉列「需求文档库」里可拆解的文档(`.md` / `.txt` / `.docx` / `.xlsx` 等;不支持的格式置灰说明);**不会改原文档**。下拉可拆解的排前面,同档按**上传/创建时间新→旧**排序(与文档库「创建时间」同一口径)。
422
- - **历史分析**:左栏顶部列出已有分析(按更新时间倒序),点一条切换;同一份来源文档重复选一次会复用已有记录(不会每次新建一份),换一份来源文档才会新建。
423
- - **分步执行(不自动串联)**:左栏按顺序点——**拆解需求** → **生成用户故事** →(可选)**用户故事审查** →(可选)**生成测试点**。拆解需求不会自动生成故事,也不会自动审查。
424
- - **拆解需求**:需求条目**跟需求文档结构**走(Ideal 小模块行 / Markdown 章节先播种),模型只在父级下补「查询 / 修改」子点与原文摘录,禁止另造文档没有的条目标题;本步不写用户故事。
425
- - **生成用户故事**:须先**拆解成功**(状态为已拆解);拆解失败或中断时按钮不可用。**按已整理的查/改需求点**分批生成并挂全 `sourceRefs`(可多点并一条故事,但不得漏 id);同一点击内再对照原始需求做一次二次卡控补漏。正常情况不必再点重新生成,接着做审查质检。一条只做一件事;服务端分配 `US-001` 递增编号。生成失败会清空本轮故事,此时不可审查、不可生成测试点。
426
- - **用户故事审查 / 生成测试点**:须已有成功生成的用户故事;故事为空或仍为「待拆解」时按钮不可用。
422
+ - **历史分析**:详情顶栏「返回列表」右侧用下拉切换已有分析(可搜索;选项第二行显示状态 / 条目数 / 故事数);同一份来源文档重复选一次会复用已有记录(不会每次新建一份),换一份来源文档才会新建。列表页仍按更新时间倒序浏览全部记录。
423
+ - **分步执行**:左栏按顺序点——**拆解需求** → **生成用户故事** →(可选)**生成测试点**。拆解不会自动生成故事。若「用户故事审查」插件开着,**生成用户故事成功后会自动初审**(切到「审查结果」Tab);左栏不再单独放审查按钮。
424
+ - **拆解需求**:需求条目**跟需求文档结构**走,按表头特征播种父级(不是猜文档类型):① Ideal 行表(`大模块/大类` + `小模块/功能点` + `优化/问题内容/需求描述` 等列名别名);② 功能规格竖表(`功能名称` + `功能描述`,可兼编号);③ 需求清单横表(`模块` + `需求内容/需求点`;**不会**把「字段名称 / 字段类型」定义表当成需求);都没有时再按 Markdown / Word 的 `##`/`###` 章节,最后才用 `【短名】`。表解析出 ≥3 条时优先用表。模型只在父级下补「查询 / 修改」子点与原文摘录,禁止另造文档没有的条目标题;本步不写用户故事。生成用户故事 / 审查 / 测试点仍吃结构化 RO,不必随表头改口径。
425
+ - **生成用户故事**:须先**拆解成功**(状态为已拆解);拆解失败或中断时按钮不可用。**按已整理的查/改需求点**分批生成并挂全 `sourceRefs`(可多点并一条故事,但不得漏 id);同一点击内再对照原始需求做一次二次卡控补漏。成功后若审查插件开着会自动审查。一条只做一件事;服务端分配 `US-001` 递增编号。生成失败会清空本轮故事,此时不自动审查、不可生成测试点。
426
+ - **生成测试点**:须已有成功生成的用户故事;故事为空或仍为「待拆解」时按钮不可用。
427
427
  - **Tab 顺序**:需求条目 → 用户故事 → 审查结果 → 测试点(默认停在需求条目)。
428
- - **需求条目 Tab**:可展开卡片——头为文档条目标题与覆盖汇总;展开见**已整理的需求点**(按文档原文顺序;每个子点可再展开看对应原文摘录)、**文档该条原文**,以及覆盖该点的用户故事(可点回故事列表)。每个查/改子点可点**变更需求点**:新增(多行需求内容交给模型拆点子点,插到当前点下方,同父级 id 序号顺延)、修改原文、或删除(二次确认后顺延编号并摘掉故事引用)。
428
+ - **需求条目 Tab**:可展开卡片——头为文档条目标题与覆盖汇总;展开见**已整理的需求点**(按文档原文顺序;每个子点可再展开看对应原文摘录)、**文档该条原文**,以及覆盖该点的用户故事(可点回故事列表)。每个查/改子点可点**变更需求点**:新增(多行需求内容交给模型拆点子点,插到当前点下方,同父级 id 序号顺延)、修改原文、或删除(二次确认后顺延编号并摘掉故事引用)。**拆解需求**时会同时整理原文结构(读「提示词管理」里的 `原文结构提示词.md`,模型只分组,句子必须是来源里的原句,结果记在这份分析上)。页签右侧导出**原文 XMind**或**原文 Markdown**(大类 → 需求标题 → 需求编号 → 原文步骤;编号在步骤上面)。表尾的输入参数、输出参数、流程、提出人等字段不导出。还没拆解出结构时导出按钮会提示先拆解需求。原文 XMind 为向右逻辑图骨架(从左往右,折线竖脊接到各子项),标题和编号白底细边框,步骤不单独设样式。仅在该 Tab 且这份分析有来源文档时显示。
429
429
  - **用户故事**:按关联需求点的文档序排列;卡片上来源显示 `RO-id + 标题`(可点到对应子点并展开原文);字段不全显示「待补全」提示,不刷进审查主清单。
430
- - **用例「引用需求点」**:只填真实 `RO-…` id,格式「编号 + 标题/原文」;入库时会去掉误填的 `US-…` / 测试点分组前缀。
430
+ - **用例「引用需求点」**:填真实 `RO-…` id,格式「编号 + 标题/原文」;有测试点清单时在 RO 之后加「;TP-xxx」,用来确定条目内的先后。入库时会去掉误填的 `US-…` / 测试点分组前缀;用于排序与追溯,不影响覆盖判定。
431
431
  - **长文档分批**:拆解需求仍按 `^## ` 章节切段(单批不超过 12k 字)。生成用户故事以需求点批次为主(按父级 / 每批约 12 个子点),原文二次卡控时才按章节切段对照。
432
- - **审查(待确认)**:需手点「用户故事审查」。**初审一次全量**挖待确认;之后点「复审用户故事」只刷新上轮清单(问题仍在则更新、已改掉则消失),**默认不再扩表**。真要再挖新问题,在审查结果页点「重新全量扫描」(已忽略仍不回潮)。主清单只报需要人确认的事(需求点未覆盖、原文不清、需业务拍板等),不是「需求缺字段」质检。规则层算覆盖率;模型层只补待确认。故事缺角色 / 异常等改在故事卡提示。
432
+ - **审查(待确认)**:生成用户故事成功后**自动初审**(一次全量挖待确认)。之后在「审查结果」页点「重新审查」只刷新上轮清单(问题仍在则更新、已改掉则消失),**默认不再扩表**;真要再挖新问题点「重新全量扫描」(已忽略仍不回潮)。还没有报告时可用空态「开始审查」。主清单只报需要人确认的事(需求点未覆盖、原文不清、需业务拍板等),不是「需求缺字段」质检。规则层算覆盖率;模型层只补待确认。故事缺角色 / 异常等改在故事卡提示。
433
433
  - **缺口操作**:勾选后可「补写选中缺口」(AI 改故事)、「补充」(手动加故事)、「忽略 / 批量忽略」。审查结果页左侧待确认、右侧忽略列表,可恢复或「落成用户故事」;再审查不会把已忽略项灌回。
434
434
  - **编辑故事**:卡片展开即七段式,可逐段改、增删行、上下移 / 删故事。
435
435
  - **源文档变了**:指纹变化后提示重新拆解需求;确认后旧故事、体检、测试点与忽略一并清掉,按文档结构重新播种条目。
436
- - **生成测试点**:主链路仍是故事 → 五维测试点;重新生成前会确认。正式点优先,扩展点可标 supplemental。
437
- - **提示词**:日常只改「提示词管理」里的 `需求分析提示词.md`(「## 拆解需求」/「## 生成用户故事」;旧文件仅有「## 拆解」时两步共用该段,靠工具限权)与 `用户故事审查提示词.md`。完整参考稿在仓库 `prompt/` 同名文件。你改过的内容不会被覆盖;未改动的短种子会跟着代码缺省升级。
436
+ - **生成测试点**:主链路仍是故事 → 五维测试点;重新生成前会确认。正式点优先,扩展点可标 supplemental。导出 XMind 与原文结构同一套向右逻辑图骨架(折线竖脊、根深蓝 / 需求蓝 / 维度白底细边框,测试点叶子不单独设样式)。
437
+ - **提示词**:日常只改「提示词管理」里的 `需求分析提示词.md`(「## 拆解需求」/「## 生成用户故事」;旧文件仅有「## 拆解」时两步共用该段,靠工具限权)、`原文结构提示词.md`(拆解需求时一并读取,只管原文怎么分大类,不并进拆解段落)与 `用户故事审查提示词.md`。需求分析与审查的完整参考稿在仓库 `prompt/` 同名文件。你改过的内容不会被覆盖;未改动的短种子会跟着代码缺省升级。
438
438
  - 拆解需求 / 生成用户故事 / 审查 / 补写 / 测试点都走当前配置的模型(BYOK),没配模型时按钮会拦下来并提示先配置。
439
439
 
440
440
  ### 用例质量评审与场景遗漏补全
@@ -500,6 +500,14 @@ version: '1.0' # 可选
500
500
 
501
501
  > 类型 / 分类与磁盘目录:模板库按分类分子目录(如 `测试模板库/安全测试用例/`);用例与知识库为**平铺**存储——用例类型体现在文件名,知识库分类写入文档 frontmatter,均不产生子目录。改名不会自动迁移已有文件。
502
502
 
503
+ #### 用例顺序与「重排」
504
+
505
+ - **入库顺序**:生成的用例写入文件前会统一排序,口径为**需求条目(RO)→ 条目内测试点(TP)→ 生成顺序**。所以同一份需求里「第二步创建问卷」不会被后生成的条目挤到文件末尾。
506
+ - **引用需求点格式**:`RO-id 标题或原文;TP-xxx`(RO 在前,TP 在后)。RO 用来定条目顺序,TP 用来定条目内的先后;只写 US 编号时按故事的「来源条目」反查。
507
+ - **模块字段**:`模块` 填大模块原文,`子模块 / 小模块` 填小模块名。需求表是「大模块,小模块」这种层级路径时,子模块只写最后一段(叶子名),入库与重排都能对上。
508
+ - **兜底**:老文件没有「引用需求点」时,按 Ideal 小模块 / 章节文本匹配排;再对不上才退用户故事 / 用例编号。
509
+ - **已有文件重排**:用例管理行内点「重排」→ 选一份需求分析记录(或「仅按引用编号」)→ 预览需移动的行数与前 5 条 → 「开始重排」。写回前自动备份到「用例管理/备份列表/」,用例编号重编为 1…N;该文件的评审结论会一并清空(编号变了,旧结论对不上),需要的话重新评审。
510
+
503
511
  ### 知识库检索(@ 引用)
504
512
 
505
513
  1. 插件库打开「知识库检索」。
@@ -460,6 +460,106 @@ export async function appendSheetRows(abs, rows, headers) {
460
460
  fs.writeFileSync(abs, out);
461
461
  }
462
462
 
463
+ /* --------------------------- 整表重排写回 --------------------------- */
464
+
465
+ /** md 用例表定位:表头行 + 分隔行 + 表体末行;找不到返回 null */
466
+ function findMarkdownCaseTable(lines) {
467
+ for (let i = 0; i < lines.length - 1; i += 1) {
468
+ const line = lines[i];
469
+ if (!line.trim().startsWith('|')) continue;
470
+ if (!isSepLine(lines[i + 1])) continue;
471
+ let end = i + 1;
472
+ while (end + 1 < lines.length && lines[end + 1].trim().startsWith('|')) end += 1;
473
+ return { header: i, sep: i + 1, end };
474
+ }
475
+ // 没有分隔行的手写表格:退回「表头含用例字样」的第一行
476
+ for (let i = 0; i < lines.length; i += 1) {
477
+ if (!lines[i].includes('|') || !lines[i].includes('用例')) continue;
478
+ let end = i;
479
+ while (end + 1 < lines.length && lines[end + 1].trim().startsWith('|')) end += 1;
480
+ return { header: i, sep: i, end };
481
+ }
482
+ return null;
483
+ }
484
+
485
+ function isSepLine(line) {
486
+ return /^\s*\|?[\s:|-]+\|?\s*$/.test(line) && /-+/.test(line);
487
+ }
488
+
489
+ /**
490
+ * md / csv 整表写回:只替换用例表体。
491
+ * - md 保留表头、对齐行、表格前后的说明 / 备注段落
492
+ * - csv 保留表头行与 BOM
493
+ */
494
+ export function rewriteTextRows(abs, ext, rows, headers) {
495
+ const raw = fs.readFileSync(abs, 'utf8');
496
+ const sep = raw.includes('\r\n') ? '\r\n' : '\n';
497
+ const body = rows.map((r) =>
498
+ ext === '.md'
499
+ ? `| ${headers.map((h) => mdCell(r[h])).join(' | ')} |`
500
+ : headers.map((h) => csvCell(r[h])).join(','),
501
+ );
502
+
503
+ if (ext !== '.md') {
504
+ const bom = raw.startsWith('\uFEFF') ? '\uFEFF' : '';
505
+ const lines = raw.replace(/^\uFEFF/, '').split(/\r?\n/);
506
+ const headerIdx = lines.findIndex((l) => l.trim());
507
+ if (headerIdx < 0) {
508
+ fs.writeFileSync(
509
+ abs,
510
+ `${bom}${headers.map(csvCell).join(',')}${sep}${body.join(sep)}${sep}`,
511
+ 'utf8',
512
+ );
513
+ return;
514
+ }
515
+ const head = lines[headerIdx];
516
+ fs.writeFileSync(abs, `${bom}${head}${sep}${body.join(sep)}${sep}`, 'utf8');
517
+ return;
518
+ }
519
+
520
+ const lines = raw.split(/\r?\n/);
521
+ const table = findMarkdownCaseTable(lines);
522
+ if (!table) {
523
+ const head = `| ${headers.map(mdCell).join(' | ')} |`;
524
+ const align = `| ${headers.map(() => '---').join(' | ')} |`;
525
+ const trimmed = raw.replace(/[\r\n]+$/, '');
526
+ const prefix = trimmed.trim() ? `${trimmed}${sep}${sep}` : '';
527
+ fs.writeFileSync(abs, `${prefix}${head}${sep}${align}${sep}${body.join(sep)}${sep}`, 'utf8');
528
+ return;
529
+ }
530
+ const next = [...lines.slice(0, table.sep + 1), ...body, ...lines.slice(table.end + 1)];
531
+ fs.writeFileSync(abs, next.join(sep), 'utf8');
532
+ }
533
+
534
+ /** xlsx / xls 整表写回:保留首个工作表与表头,只覆盖数据行(已提前备份) */
535
+ export async function rewriteSheetRows(abs, rows, headers) {
536
+ const mod = await import('xlsx');
537
+ const xlsx = mod.default ?? mod;
538
+ const book = xlsx.read(fs.readFileSync(abs), { type: 'buffer', cellDates: true });
539
+ const sheetName = book.SheetNames[0];
540
+ if (!sheetName) throw Object.assign(new Error('用例文件里没有工作表'), { statusCode: 422 });
541
+ const sheet = book.Sheets[sheetName];
542
+ const range = xlsx.utils.decode_range(sheet['!ref'] ?? 'A1:A1');
543
+ // 先清掉旧数据行,避免新行数变少时残留尾巴
544
+ for (let r = 1; r <= range.e.r; r += 1) {
545
+ for (let c = 0; c <= range.e.c; c += 1) {
546
+ delete sheet[xlsx.utils.encode_cell({ r, c })];
547
+ }
548
+ }
549
+ rows.forEach((row, i) => {
550
+ headers.forEach((h, c) => {
551
+ const v = String(row[h] ?? '');
552
+ if (!v) return;
553
+ sheet[xlsx.utils.encode_cell({ r: i + 1, c })] = { t: 's', v };
554
+ });
555
+ });
556
+ sheet['!ref'] = xlsx.utils.encode_range({
557
+ s: { r: 0, c: 0 },
558
+ e: { r: Math.max(0, rows.length), c: Math.max(range.e.c, headers.length - 1) },
559
+ });
560
+ fs.writeFileSync(abs, xlsx.write(book, { bookType: 'xlsx', type: 'buffer' }));
561
+ }
562
+
463
563
  /* ------------------------------ HTTP ------------------------------ */
464
564
 
465
565
  function sendJson(res, status, body) {
@@ -702,9 +802,68 @@ async function reviewRoutes(req, res, root, tail, query) {
702
802
  });
703
803
  }
704
804
 
805
+ if (await rewriteRoute(req, res, root, tail)) return;
806
+
705
807
  return sendJson(res, 405, { ok: false, error: 'Method Not Allowed' });
706
808
  }
707
809
 
810
+ /** 整表重排:按客户端排好序的行覆盖原文件,写前备份 */
811
+ async function rewriteRoute(req, res, root, tail) {
812
+ if (tail !== '/rewrite') return false;
813
+ if ((req.method || 'GET') !== 'POST') return false;
814
+ const body = JSON.parse((await readBody(req)) || '{}');
815
+ const rel = text(body.path, 400);
816
+ if (!rel) {
817
+ sendJson(res, 400, { ok: false, error: '缺少用例文件路径' });
818
+ return true;
819
+ }
820
+ const headers = strList(body.headers, 40, 60);
821
+ if (!headers.length) {
822
+ sendJson(res, 400, { ok: false, error: '缺少用例字段' });
823
+ return true;
824
+ }
825
+ const rows = (Array.isArray(body.rows) ? body.rows : []).slice(0, 5000).map((r) => {
826
+ const out = {};
827
+ for (const h of headers) out[h] = typeof r?.[h] === 'string' ? r[h] : String(r?.[h] ?? '');
828
+ return out;
829
+ });
830
+ if (!rows.length) {
831
+ sendJson(res, 400, { ok: false, error: '没有要写入的用例' });
832
+ return true;
833
+ }
834
+ const abs = caseFileAbs(root, rel);
835
+ if (!fs.existsSync(abs)) {
836
+ sendJson(res, 404, { ok: false, error: `用例文件不存在:${rel}` });
837
+ return true;
838
+ }
839
+ const ext = path.extname(abs).toLowerCase();
840
+ if (!['.md', '.markdown', '.csv', '.xlsx', '.xls'].includes(ext)) {
841
+ sendJson(res, 415, { ok: false, error: `暂不支持写回 ${ext || '(无扩展名)'} 文件` });
842
+ return true;
843
+ }
844
+ const backup = backupCaseFile(root, abs);
845
+ if (ext === '.xlsx' || ext === '.xls') await rewriteSheetRows(abs, rows, headers);
846
+ else rewriteTextRows(abs, ext === '.csv' ? '.csv' : '.md', rows, headers);
847
+
848
+ // 重排后用例编号变了,旧评审结论里的编号对不上:清掉这一份的评审 / 补全结果
849
+ const store = readStore(root);
850
+ const idx = store.files.findIndex((x) => x.path === rel);
851
+ if (idx >= 0) {
852
+ store.files[idx].review = null;
853
+ store.files[idx].blindspot = null;
854
+ store.files[idx].hash = hashOfFile(abs) || store.files[idx].hash;
855
+ store.files[idx].updatedAt = new Date().toISOString();
856
+ writeStore(root, store);
857
+ }
858
+
859
+ const backupRel = path
860
+ .relative(resolveContentRoot(root, CASES_DIR_NAME).abs, backup)
861
+ .split(path.sep)
862
+ .join('/');
863
+ sendJson(res, 200, { ok: true, path: rel, rows: rows.length, backup: backupRel });
864
+ return true;
865
+ }
866
+
708
867
  async function blindspotRoutes(req, res, root, tail, query) {
709
868
  const method = req.method || 'GET';
710
869
 
@@ -19,6 +19,8 @@ import { ensurePluginPrompt, isPluginOnInSpace, readPluginPrompt } from './plugi
19
19
  import {
20
20
  REQ_ANALYSIS_PROMPT_FILE,
21
21
  REQ_ANALYSIS_PROMPT_TEMPLATE,
22
+ SOURCE_STRUCTURE_PROMPT_FILE,
23
+ SOURCE_STRUCTURE_PROMPT_TEMPLATE,
22
24
  parseReqPromptSections,
23
25
  } from './req-analysis-prompt.mjs';
24
26
 
@@ -98,20 +100,96 @@ export function reqDocsDir(spaceDir) {
98
100
  return resolveContentRoot(spaceDir, REQ_DOCS_DIR_NAME).abs;
99
101
  }
100
102
 
103
+ /** 解开 mammoth 输出的 HTML 实体,避免正文里留下 `&amp;` 之类 */
104
+ function decodeHtmlEntities(text) {
105
+ return String(text ?? '')
106
+ .replace(/&nbsp;/g, ' ')
107
+ .replace(/&lt;/g, '<')
108
+ .replace(/&gt;/g, '>')
109
+ .replace(/&quot;/g, '"')
110
+ .replace(/&#39;|&apos;/g, "'")
111
+ .replace(/&#x([0-9a-f]+);/gi, (_m, hex) => String.fromCodePoint(parseInt(hex, 16)))
112
+ .replace(/&#(\d+);/g, (_m, dec) => String.fromCodePoint(Number(dec)))
113
+ .replace(/&amp;/g, '&');
114
+ }
115
+
116
+ /** 内联片段压成单行纯文本(标题、列表项用) */
117
+ function htmlInlineText(html) {
118
+ return decodeHtmlEntities(String(html ?? '').replace(/<[^>]+>/g, ''))
119
+ .replace(/\s+/g, ' ')
120
+ .trim();
121
+ }
122
+
123
+ /** 标题层级 → Markdown:docx 的 1–6 级统一压到 `#`/`##`/`###`(前端按 2–3 级切章节) */
124
+ function headingToMarkdown(level, inner) {
125
+ const text = htmlInlineText(inner);
126
+ if (!text) return '';
127
+ const hashes = '#'.repeat(Math.min(3, Math.max(1, Number(level) || 1)));
128
+ return `\n\n${hashes} ${text}\n`;
129
+ }
130
+
131
+ /**
132
+ * 整张 HTML 表先压成「一行一条、单元格用 ` | `」——必须在把 `</p>` 换成换行之前做,
133
+ * 否则单元格里的段落会把一行拆成「键\n| 值\n|」,表头解析全失效。
134
+ */
135
+ function htmlTableToMarkdown(tableHtml) {
136
+ const rows = [];
137
+ for (const tr of String(tableHtml ?? '').matchAll(/<tr[^>]*>([\s\S]*?)<\/tr>/gi)) {
138
+ const cells = [...tr[1].matchAll(/<t[dh][^>]*>([\s\S]*?)<\/t[dh]>/gi)].map((m) =>
139
+ htmlInlineText(m[1]),
140
+ );
141
+ // 保留空单元格占位,避免竖表 / 清单表列错位
142
+ if (!cells.length || cells.every((c) => !c)) continue;
143
+ rows.push(cells.join(' | '));
144
+ }
145
+ return rows.length ? `\n\n${rows.join('\n')}\n\n` : '\n\n';
146
+ }
147
+
101
148
  /**
102
- * Word(docx)正文抽取:按段落 + 表格拼成纯文本。
103
- * 标题层级压成 `#` / `##`,方便前端按 `^## ` 切分章节。
149
+ * Word(docx)正文抽取:按标题 / 段落 / 表格拼成纯文本,标题层级压成 `#` / `##` / `###`。
150
+ * 用 `convertToHtml` 而不是 `extractRawText`:后者会丢掉标题样式,文档结构一没了,
151
+ * 拆解就只能退回按【短名】猜条目(表头里的【提出人】也会被当成需求标题)。
104
152
  */
105
153
  async function extractDocx(fileAbs) {
106
154
  const { default: mammoth } = await import('mammoth');
107
155
  // 传 buffer 而不是路径:数据空间路径常带中文,交给库自己拼路径容易读不到
108
- const { value } = await mammoth.extractRawText({ buffer: fs.readFileSync(fileAbs) });
109
- const lines = String(value ?? '')
156
+ const buffer = fs.readFileSync(fileAbs);
157
+ const { value } = await mammoth.convertToHtml({ buffer });
158
+ const text = String(value ?? '')
159
+ // 图片是 base64 data URI,正文用不上且会撑爆上下文,直接丢
160
+ .replace(/<img[^>]*>/g, '')
161
+ .replace(/<h([1-6])[^>]*>([\s\S]*?)<\/h\1>/g, (_m, level, inner) =>
162
+ headingToMarkdown(level, inner),
163
+ )
164
+ .replace(/<li[^>]*>([\s\S]*?)<\/li>/g, (_m, inner) => {
165
+ const line = htmlInlineText(inner);
166
+ return line ? `\n- ${line}` : '';
167
+ })
168
+ // 表格整段替换(先于 </p>→换行),保证「功能名称 | xxx」落在同一行
169
+ .replace(/<table[^>]*>[\s\S]*?<\/table>/gi, (table) => htmlTableToMarkdown(table))
170
+ .replace(/<br\s*\/?>/g, '\n')
171
+ .replace(/<\/(p|div|section)>/g, '\n')
172
+ .replace(/<[^>]+>/g, '')
173
+ .split('\n')
174
+ .map((line) =>
175
+ decodeHtmlEntities(line)
176
+ .replace(/[ \t\u3000]+/g, ' ')
177
+ .trim(),
178
+ )
179
+ .filter((line, index, all) => line || all[index - 1])
180
+ .join('\n')
181
+ .replace(/\n{3,}/g, '\n\n')
182
+ .trim();
183
+ if (text) return text;
184
+ // 正文全在文本框 / 图片里时 HTML 可能为空,退回纯文本抽取
185
+ const raw = await mammoth.extractRawText({ buffer });
186
+ return String(raw.value ?? '')
110
187
  .replace(/\r\n?/g, '\n')
111
188
  .split('\n')
112
189
  .map((line) => line.trim())
113
- .filter((line, index, all) => line || all[index - 1]);
114
- return lines.join('\n').trim();
190
+ .filter((line, index, all) => line || all[index - 1])
191
+ .join('\n')
192
+ .trim();
115
193
  }
116
194
 
117
195
  /** Excel 正文抽取:每个工作表一个 `## 工作表名` 章节 + CSV 正文 */
@@ -485,6 +563,7 @@ function normalizeDoc(raw) {
485
563
  .filter(Boolean)
486
564
  .slice(0, 50);
487
565
  }
566
+ doc.sourceExport = normalizeSourceExport(raw.sourceExport);
488
567
 
489
568
  const seenOutline = new Set();
490
569
  const outline = (Array.isArray(raw.outline) ? raw.outline : [])
@@ -628,9 +707,33 @@ function normalizePatch(base, raw) {
628
707
  .filter(Boolean)
629
708
  .slice(0, 50);
630
709
  }
710
+ if ('sourceExport' in raw) patch.sourceExport = normalizeSourceExport(raw.sourceExport);
631
711
  return patch;
632
712
  }
633
713
 
714
+ function normalizeSourceExport(raw) {
715
+ if (!raw || typeof raw !== 'object') return null;
716
+ const groups = [];
717
+ for (const group of Array.isArray(raw.groups) ? raw.groups : []) {
718
+ if (!group || typeof group !== 'object') continue;
719
+ const category = text(group.category, 200);
720
+ const items = [];
721
+ for (const item of Array.isArray(group.items) ? group.items : []) {
722
+ if (!item || typeof item !== 'object') continue;
723
+ const title = text(item.title, 200);
724
+ const body = text(item.body, 4000);
725
+ if (!title && !body) continue;
726
+ items.push({ title: title || body.slice(0, 40), body: body || title });
727
+ if (items.length >= 80) break;
728
+ }
729
+ if (!category || !items.length) continue;
730
+ groups.push({ category, items });
731
+ if (groups.length >= 40) break;
732
+ }
733
+ if (!groups.length) return null;
734
+ return { at: text(raw.at, 40) || new Date().toISOString(), groups };
735
+ }
736
+
634
737
  /**
635
738
  * @returns {import('vite').Plugin}
636
739
  */
@@ -662,14 +765,23 @@ export function lhReqAnalysisPlugin() {
662
765
  // 「重新打开插件会重新生成」不能只靠开关那一下,这里也兜一层
663
766
  if (isPluginOnInSpace('reqAnalysis', root)) {
664
767
  ensurePluginPrompt(REQ_ANALYSIS_PROMPT_FILE, REQ_ANALYSIS_PROMPT_TEMPLATE, root);
768
+ ensurePluginPrompt(
769
+ SOURCE_STRUCTURE_PROMPT_FILE,
770
+ SOURCE_STRUCTURE_PROMPT_TEMPLATE,
771
+ root,
772
+ );
665
773
  }
666
774
  const content = readPluginPrompt(REQ_ANALYSIS_PROMPT_FILE, root);
667
775
  const sections = parseReqPromptSections(content);
776
+ const structure = readPluginPrompt(SOURCE_STRUCTURE_PROMPT_FILE, root);
668
777
  return sendJson(res, 200, {
669
778
  ok: true,
670
779
  file: REQ_ANALYSIS_PROMPT_FILE,
671
780
  exists: Boolean(content.trim()),
781
+ structureFile: SOURCE_STRUCTURE_PROMPT_FILE,
672
782
  ...sections,
783
+ // 整理原文结构用单独的「原文结构提示词.md」,不读需求分析提示词里的段落
784
+ structure,
673
785
  });
674
786
  }
675
787
 
@@ -690,6 +802,11 @@ export function lhReqAnalysisPlugin() {
690
802
  REQ_ANALYSIS_PROMPT_TEMPLATE,
691
803
  root,
692
804
  );
805
+ ensurePluginPrompt(
806
+ SOURCE_STRUCTURE_PROMPT_FILE,
807
+ SOURCE_STRUCTURE_PROMPT_TEMPLATE,
808
+ root,
809
+ );
693
810
  return sendJson(res, 200, { ok: true, enabled: true, ...out });
694
811
  }
695
812
 
@@ -57,6 +57,7 @@ export const PLUGIN_PROMPT_FILES = Object.freeze({
57
57
  '工作汇报提示词.md': 'reports',
58
58
  'Playwright提示词.md': 'uiAuto',
59
59
  '需求分析提示词.md': 'reqAnalysis',
60
+ '原文结构提示词.md': 'reqAnalysis',
60
61
  '用户故事审查提示词.md': 'storyReview',
61
62
  '测试点生成提示词.md': 'testPoints',
62
63
  '用例质量评审提示词.md': 'caseReview',
@@ -65,6 +66,7 @@ export const PLUGIN_PROMPT_FILES = Object.freeze({
65
66
 
66
67
  export const UI_AUTO_PROMPT_FILE = 'Playwright提示词.md';
67
68
  export const REQ_ANALYSIS_PROMPT_FILE = '需求分析提示词.md';
69
+ export const SOURCE_STRUCTURE_PROMPT_FILE = '原文结构提示词.md';
68
70
  export const STORY_REVIEW_PROMPT_FILE = '用户故事审查提示词.md';
69
71
  export const TEST_POINTS_PROMPT_FILE = '测试点生成提示词.md';
70
72
  export const CASE_REVIEW_PROMPT_FILE = '用例质量评审提示词.md';