lantern-harness 0.2.2 → 0.2.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.
Files changed (178) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +7 -7
  3. package/builtin/case-backup-contract.mjs +27 -0
  4. package/builtin/case-workflow-contract.mjs +158 -0
  5. package/builtin/session/lh-nav-groups.mjs +33 -1
  6. package/builtin/session/space-layout.mjs +8 -1
  7. package/builtin/session/space-skills.mjs +8 -1
  8. package/cli/mcp-server.mjs +986 -32
  9. package/cli/server.mjs +2 -0
  10. package/dist/500.html +9 -4
  11. package/dist/_astro/Base.BQf1tZMl.css +1 -0
  12. package/dist/_astro/{Base.astro_astro_type_script_index_0_lang.XUV2H6ea.js → Base.astro_astro_type_script_index_0_lang.Dm3O_y-S.js} +1 -1
  13. package/dist/_astro/{BusinessMapBoard.mRxl2G3D.js → BusinessMapBoard.CYxHcku_.js} +1 -1
  14. package/dist/_astro/{CaseExecBoard.Cqkxuf5c.js → CaseExecBoard.CK9aGPmH.js} +1 -1
  15. package/dist/_astro/CaseExecutionBoard.C94pmIMQ.js +5 -0
  16. package/dist/_astro/CaseGenerateApp.D5xlk9At.js +10 -0
  17. package/dist/_astro/CasesLibrary.BHQC955x.js +21 -0
  18. package/dist/_astro/ChatApp.CIt15w_1.js +1 -0
  19. package/dist/_astro/ChatApp.d4a9R3YS.js +262 -0
  20. package/dist/_astro/{DashboardBoard.CAJVE2G4.js → DashboardBoard.qgc1s7pG.js} +1 -1
  21. package/dist/_astro/{DefectSubmitEntry.BzKXJ-zq.js → DefectSubmitEntry.JI85N1-i.js} +1 -1
  22. package/dist/_astro/{DocsFileBrowser.apKMbGVf.js → DocsFileBrowser.z5JZ74cy.js} +1 -1
  23. package/dist/_astro/{DocsPager.DMN9-Tjg.js → DocsPager.Dg765uHW.js} +1 -1
  24. package/dist/_astro/{KnowledgeLibrary.BcoMQeUd.js → KnowledgeLibrary.mkShtVun.js} +1 -1
  25. package/dist/_astro/{LifeKrTasksBoard.DJU0-QI-.js → LifeKrTasksBoard.DpAwQffE.js} +1 -1
  26. package/dist/_astro/{LifeKrTodosBoard.GK7KRAO3.js → LifeKrTodosBoard.BIjPiZ8H.js} +1 -1
  27. package/dist/_astro/{LifeObjectivesBoard.DuKa6Q3k.js → LifeObjectivesBoard.DYwLHPEG.js} +1 -1
  28. package/dist/_astro/{LifePlanTypeSelect.Cm2lUmnH.js → LifePlanTypeSelect.CYaziESp.js} +1 -1
  29. package/dist/_astro/{LifeReviewsBoard.BWOOVMtz.js → LifeReviewsBoard.DIxoWBDA.js} +1 -1
  30. package/dist/_astro/{LifeShared.bY2l01Ha.js → LifeShared.DuFQsMEx.js} +1 -1
  31. package/dist/_astro/{LifeStagesBoard.CIzxPOJB.js → LifeStagesBoard.DtOri9EW.js} +1 -1
  32. package/dist/_astro/{LifeYearCycleSelect.BlsyPmmI.js → LifeYearCycleSelect.ByJ9-PGg.js} +1 -1
  33. package/dist/_astro/{LifeYearPlansBoard.DaA9O08j.js → LifeYearPlansBoard.BQN07wcv.js} +1 -1
  34. package/dist/_astro/NavLibraries.BO4ezcUc.js +1 -0
  35. package/dist/_astro/{PluginsPage.B063QIlQ.js → PluginsPage.B1VeDtLx.js} +2 -2
  36. package/dist/_astro/{PmBugsBoard.Cu-v0Gfd.js → PmBugsBoard.Ddl3kqqt.js} +1 -1
  37. package/dist/_astro/{PmIterationsBoard.CgRzkP-j.js → PmIterationsBoard.BJN7disI.js} +1 -1
  38. package/dist/_astro/{PmProjectDetail.DVCEh0Lm.js → PmProjectDetail.D78gWhqk.js} +1 -1
  39. package/dist/_astro/{PmProjectsBoard.z-bQa98r.js → PmProjectsBoard.Bf8VB3t6.js} +1 -1
  40. package/dist/_astro/PmRequirementsBoard.CDyNHN2a.js +1 -0
  41. package/dist/_astro/{PmRequirementsBoard.CyfBI0u_.js → PmRequirementsBoard.DarfGIrL.js} +1 -1
  42. package/dist/_astro/{PmShared.BQVzwsiz.js → PmShared.TOjBbtV8.js} +1 -1
  43. package/dist/_astro/{ReportsPage.najSzJeT.js → ReportsPage.BXGduuY3.js} +1 -1
  44. package/dist/_astro/{ReqAnalysisBoard.BQb8dHFD.js → ReqAnalysisBoard.WLtIfBg8.js} +1 -1
  45. package/dist/_astro/{RequirementBreakdownLibrary.Cn6OV6xt.js → RequirementBreakdownLibrary.DMoeTeqX.js} +1 -1
  46. package/dist/_astro/{RequirementsLibrary.CqKNFVsP.js → RequirementsLibrary.Iv7zOqWe.js} +1 -1
  47. package/dist/_astro/{SettingsDialog.db3BpFw0.js → SettingsDialog.BvDU9EU6.js} +1 -1
  48. package/dist/_astro/SlideOverDrawer.CvyB-quk.js +1 -0
  49. package/dist/_astro/{SpaceSwitcher.DSUVAPOi.js → SpaceSwitcher.D9bBNQBZ.js} +1 -1
  50. package/dist/_astro/{TableFieldConfig.72AL-8p-.js → TableFieldConfig.DHj25OKN.js} +1 -1
  51. package/dist/_astro/{TasksBoard.CCDhCSR7.js → TasksBoard.CXmGdylV.js} +1 -1
  52. package/dist/_astro/TemplatesLibrary.DsL2q-wp.js +1 -0
  53. package/dist/_astro/{TestReportsLibrary.fWiEyCRx.js → TestReportsLibrary.BBC1TYgP.js} +1 -1
  54. package/dist/_astro/{TestStatsBoard.BSUBsWSu.js → TestStatsBoard.VXjP4hu6.js} +1 -1
  55. package/dist/_astro/{TodosBoard.By5YdlUe.js → TodosBoard.-yKgp06M.js} +1 -1
  56. package/dist/_astro/UiAutoBoard.BD5ZyLHj.js +3 -0
  57. package/dist/_astro/UiAutoEnvPanel.DrHUOlmH.js +10 -0
  58. package/dist/_astro/UiAutoGenerationDialog.gypq1zP9.js +12 -0
  59. package/dist/_astro/UiAutoProjectsPage.Dhzr09E9.js +3 -0
  60. package/dist/_astro/app-config.BSO5r82v.js +1 -0
  61. package/dist/_astro/app-version.CkDFkv4s.js +1 -0
  62. package/dist/_astro/{bash-tools.CS2w8LOb.js → bash-tools.C4DJiRJs.js} +1 -1
  63. package/dist/_astro/case-fields.C03NY3zC.js +148 -0
  64. package/dist/_astro/case-gen-run.C4p8uyU3.js +26 -0
  65. package/dist/_astro/case-prompt.ByLTgz4r.js +2 -0
  66. package/dist/_astro/{case-review.DFWZkoR9.js → case-review.BodP2jKm.js} +1 -1
  67. package/dist/_astro/{case-template.Clb7HrDB.js → case-template.CC2eXegU.js} +2 -2
  68. package/dist/_astro/case-types.BjF1BivA.js +1 -0
  69. package/dist/_astro/case-workflow-contract.BBQ9bbKL.js +1 -0
  70. package/dist/_astro/{defect-workbench.CjTb4FDv.js → defect-workbench.DBmohR-y.js} +1 -1
  71. package/dist/_astro/{hydrate-cache.O4CIma9y.js → hydrate-cache.CMMErx63.js} +1 -1
  72. package/dist/_astro/{i18n.Cp4so7KR.js → i18n.CEWjL5GX.js} +2 -2
  73. package/dist/_astro/{open-docs-in-session.BpcAcBSI.js → open-docs-in-session.BoyV6R2A.js} +1 -1
  74. package/dist/_astro/plugins.ChGmBEkF.js +1 -0
  75. package/dist/_astro/{project-docs.bB9lQ1Ki.js → project-docs.BRgNjXhG.js} +1 -1
  76. package/dist/_astro/{req-analysis.C_gARMrB.js → req-analysis.BLvcktvQ.js} +1 -1
  77. package/dist/_astro/{settings.D02wZj3w.js → settings.BojKNwUC.js} +2 -2
  78. package/dist/_astro/{spaces-client.BAtG6PkW.js → spaces-client.B28rzu8J.js} +1 -1
  79. package/dist/_astro/{story-review.DTN91Vl9.js → story-review.dEBWTeOW.js} +1 -1
  80. package/dist/_astro/{test-points.C7ZgggQT.js → test-points.BuNgdNcU.js} +1 -1
  81. package/dist/_astro/ui-auto.LUcREUMe.js +1 -0
  82. package/dist/_astro/{view-prefs.COAKEQtZ.js → view-prefs.CWc5cQ2q.js} +1 -1
  83. package/dist/business-map/index.html +10 -5
  84. package/dist/case-exec/index.html +10 -5
  85. package/dist/case-execution/index.html +10 -5
  86. package/dist/cases/api/index.html +988 -0
  87. package/dist/cases/automation/index.html +988 -0
  88. package/dist/cases/functional/index.html +988 -0
  89. package/dist/cases/generate/index.html +10 -5
  90. package/dist/cases/index.html +1 -1
  91. package/dist/cases/library/index.html +1 -983
  92. package/dist/cases/other/index.html +988 -0
  93. package/dist/cases/performance/index.html +988 -0
  94. package/dist/dashboard/index.html +10 -5
  95. package/dist/defect-rules/index.html +10 -5
  96. package/dist/defect-submit/index.html +10 -5
  97. package/dist/defect-submit/templates/index.html +10 -5
  98. package/dist/docs/changelog/index.html +88 -58
  99. package/dist/docs/install/index.html +12 -6
  100. package/dist/docs/manual/index.html +42 -31
  101. package/dist/knowledge/index.html +10 -5
  102. package/dist/life/kr-tasks/index.html +10 -5
  103. package/dist/life/kr-todos/index.html +10 -5
  104. package/dist/life/objectives/index.html +10 -5
  105. package/dist/life/reviews/index.html +10 -5
  106. package/dist/life/stages/index.html +10 -5
  107. package/dist/life/year-plans/index.html +10 -5
  108. package/dist/plugins/index.html +10 -5
  109. package/dist/pm/bugs/index.html +10 -5
  110. package/dist/pm/iterations/index.html +10 -5
  111. package/dist/pm/projects/detail/index.html +10 -5
  112. package/dist/pm/projects/index.html +10 -5
  113. package/dist/pm/requirements/index.html +10 -5
  114. package/dist/reports/index.html +10 -5
  115. package/dist/requirement-analysis/index.html +10 -5
  116. package/dist/requirement-breakdowns/index.html +10 -5
  117. package/dist/requirements/index.html +10 -5
  118. package/dist/tasks/index.html +10 -5
  119. package/dist/templates/index.html +10 -5
  120. package/dist/test-automation/index.html +10 -5
  121. package/dist/test-automation/projects/index.html +10 -5
  122. package/dist/test-reports/index.html +10 -5
  123. package/dist/test-stats/index.html +10 -5
  124. package/dist/todos/index.html +10 -5
  125. package/dist/workbench/index.html +10 -5
  126. package/docs/Codex-MCP/351/233/206/346/210/220.md +97 -53
  127. package/docs//344/274/232/350/257/235/346/217/222/344/273/266.md +7 -1
  128. package/docs//345/205/250/345/261/200/346/217/222/344/273/266.md +1 -1
  129. package/docs//345/256/211/350/243/205/346/211/213/345/206/214.md +4 -2
  130. package/docs//346/223/215/344/275/234/346/211/213/345/206/214.md +43 -36
  131. package/lh-plugins/case-automation/service.mjs +921 -0
  132. package/lh-plugins/case-automation/store.mjs +231 -0
  133. package/lh-plugins/case-automation/tables.mjs +115 -0
  134. package/lh-plugins/case-automation-prompt.mjs +57 -0
  135. package/lh-plugins/case-execution/assets.mjs +180 -0
  136. package/lh-plugins/case-execution/files.mjs +67 -15
  137. package/lh-plugins/case-execution/plans.mjs +318 -0
  138. package/lh-plugins/case-execution/service.mjs +80 -13
  139. package/lh-plugins/case-execution-prompt.mjs +4 -1
  140. package/lh-plugins/lh-case-automation.mjs +169 -0
  141. package/lh-plugins/lh-case-design.mjs +456 -0
  142. package/lh-plugins/lh-case-execution.mjs +53 -1
  143. package/lh-plugins/lh-case-review.mjs +29 -11
  144. package/lh-plugins/lh-project-docs.mjs +24 -0
  145. package/lh-plugins/lh-uiauto.mjs +111 -2
  146. package/lh-plugins/plugin-prompts.mjs +1 -0
  147. package/lh-plugins/uiauto-adapters/playwright.mjs +44 -4
  148. package/lh-plugins/uiauto-adapters/shared.mjs +4 -0
  149. package/lh-plugins/uiauto-explorer/emit-files.mjs +16 -2
  150. package/lh-plugins/uiauto-explorer/ir.mjs +3 -0
  151. package/lh-plugins/uiauto-explorer/merge.mjs +37 -1
  152. package/lh-plugins/uiauto-explorer/navigation-guard.mjs +255 -0
  153. package/lh-plugins/uiauto-explorer/runner.mjs +65 -3
  154. package/lh-plugins/uiauto-explorer/sessions.mjs +29 -1
  155. package/package.json +1 -1
  156. package/skills/case-automation-bridge/SKILL.md +27 -0
  157. package/skills/case-execution/SKILL.md +11 -0
  158. package/skills/lantern-workflow/SKILL.md +39 -1
  159. package/dist/_astro/Base.Du_-4L-4.css +0 -1
  160. package/dist/_astro/CaseExecutionBoard.CjX4CoKd.js +0 -5
  161. package/dist/_astro/CaseGenerateApp.acgnxl79.js +0 -10
  162. package/dist/_astro/CasesLibrary.zmzOQwdn.js +0 -21
  163. package/dist/_astro/ChatApp.Ben9LFra.js +0 -1
  164. package/dist/_astro/ChatApp.DBi6q7Qv.js +0 -262
  165. package/dist/_astro/NavLibraries.DVR5Ua-S.js +0 -1
  166. package/dist/_astro/PmRequirementsBoard.B0W6bsW2.js +0 -1
  167. package/dist/_astro/SlideOverDrawer.BMg2tce6.js +0 -1
  168. package/dist/_astro/TemplatesLibrary.peYzrHZ2.js +0 -1
  169. package/dist/_astro/UiAutoBoard.BGdlp5Sr.js +0 -3
  170. package/dist/_astro/UiAutoEnvPanel.BUASgPLB.js +0 -10
  171. package/dist/_astro/UiAutoGenerationDialog.D1PyCgrD.js +0 -12
  172. package/dist/_astro/UiAutoProjectsPage.B6A9NlVK.js +0 -3
  173. package/dist/_astro/app-config.Dvfzl5_N.js +0 -1
  174. package/dist/_astro/app-version.CNpnKIb9.js +0 -1
  175. package/dist/_astro/case-fields.CmePqYfh.js +0 -148
  176. package/dist/_astro/case-gen-run.Cvvdv_kv.js +0 -26
  177. package/dist/_astro/case-prompt.CZ3vWUju.js +0 -2
  178. package/dist/_astro/plugins.Db9xoFZb.js +0 -1
@@ -0,0 +1,26 @@
1
+ import{p as e}from"./app-config.BSO5r82v.js";import{o as t,r as n}from"./plugins.ChGmBEkF.js";import{r}from"./case-workflow-contract.BBQ9bbKL.js";import{n as i,r as a}from"./case-types.BjF1BivA.js";import{a as o,r as s,t as c}from"./case-fields.C03NY3zC.js";import{t as l}from"./case-template.CC2eXegU.js";import{g as u}from"./req-analysis.BLvcktvQ.js";var d=`/__tb_case_sessions`,f=`tw.case.sessions.v1`,p=!1;function m(){return`csess_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,7)}`}function h(e){if(typeof e==`string`&&e.trim()){let t=e.trim();return a().some(e=>e.id===t),t}return a()[0]?.id??`functional`}function g(e){if(!e||!Array.isArray(e.sessions))return{sessions:[],activeId:``};let t=e.sessions.filter(e=>e&&typeof e==`object`&&e.id).map(e=>({...e,caseType:h(e.caseType)})),n=typeof e.activeId==`string`?e.activeId:``;return t.length&&!t.some(e=>e.id===n)&&(n=t[0].id),t.length||(n=``),{sessions:t,activeId:n}}function _(){try{let t=localStorage.getItem(e(f));return t?g(JSON.parse(t)):{sessions:[],activeId:``}}catch{return{sessions:[],activeId:``}}}function v(t){try{localStorage.setItem(e(f),JSON.stringify(t))}catch{}}async function y(){try{let e=await fetch(d,{signal:AbortSignal.timeout(2e3)});if(e.ok){let t=await e.json();p=!0;let n=g(t.store);return v(n),n}}catch{}return p=!1,_()}function b(){return _()}async function x(e){if(v(e),p)try{await fetch(d,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({store:e})})}catch{}}function S(e){v(e),x(e)}function C(e){let t=Date.now(),n={id:m(),title:e.title?.trim()||`用例生成`,createdAt:t,updatedAt:t,caseType:e.caseType,outputFormat:e.outputFormat,reqPaths:e.reqPaths,templateId:e.templateId,templateTitle:e.templateTitle,promptPath:e.promptPath,knowledgePaths:e.knowledgePaths?.length?[...e.knowledgePaths]:void 0,messages:[]};return S({sessions:[n,..._().sessions],activeId:n.id}),n}function w(e,t){let n=_(),r=n.sessions.map(n=>n.id===e?{...n,...t,updatedAt:Date.now()}:n),i={...n,sessions:r};return S(i),i}function T(e){return e.reqSource?e.reqSource:e.reqPath?{kind:`doc`,path:e.reqPath}:void 0}function E(e){let t=[e.templateTitle||e.templateId?.split(`/`).pop()||`默认模板`,e.outputFormat.toUpperCase()],n=T(e);return n?.kind===`stories`?t.push(`${e.docTitle||`用户故事`} · ${n.storyIds.length} 条故事`):n?.kind===`doc`&&t.push(n.path.split(`/`).pop()||n.path),e.testPointIds?.length&&t.push(`${e.testPointIds.length} 条测试点`),e.requirementBreakdownContext&&t.push(`需求拆解 XMind`),e.businessContext&&t.push(`业务地图 · ${e.businessContext.systemName}`),t.join(` · `)}function D(e){let t=e.match(/```(?:json)?\s*([\s\S]*?)```/)?.[1]??e.match(/\{[\s\S]*\}/)?.[0]??e.match(/\[[\s\S]*\]/)?.[0];if(!t)return null;try{let e=JSON.parse(t);if(Array.isArray(e)&&e.length>0)return{docTitle:``,cases:e,coverageRate:null,uncovered:[],writeNote:``};if(e&&typeof e==`object`){let t=e,n=t.用例??t.cases??t.items;if(!Array.isArray(n)||n.length===0)return null;let r=t.需求名称??t.文档名称??t.docTitle??t.title,i=typeof r==`string`?r.trim():``,a=t.覆盖需求率??t.coverageRate??t.coverage,o=null;if(typeof a==`number`&&Number.isFinite(a))o=Math.max(0,Math.min(100,Math.round(a)));else if(typeof a==`string`&&a.trim()){let e=parseInt(a.replace(/%/g,``),10);Number.isFinite(e)&&(o=Math.max(0,Math.min(100,e)))}let s=t.未覆盖说明??t.uncovered??t.omissions,c=Array.isArray(s)?s.map(e=>String(e).trim()).filter(Boolean):typeof s==`string`&&s.trim()?[s.trim()]:[],l=t.编写说明??t.note??t.summary,u=typeof l==`string`?l.trim():``;return{docTitle:i,cases:n,coverageRate:o,uncovered:c,writeNote:u}}}catch{return null}return null}function O(e){return e.replace(/[\\/:*?"<>|]/g,`_`).replace(/\s+/g,`-`).slice(0,64)||`cases`}var k=/v\d+(?:\.\d+)*/i;function A(e){let t=String(e??``).trim().split(/[/\\]/).pop()?.trim()||``;t=t.replace(/\.(xlsx|xls|docx|doc|md|txt|csv)$/i,``),t=t.replace(/_\d{8}-\d{6}$/,``);for(let e of a()){let n=`_${e.label}用例`;if(t.endsWith(n)){t=t.slice(0,-n.length);break}}let n=t.match(k);return n&&n.index!=null?`${t.slice(0,n.index).replace(/[\s_\-—·.]+$/u,``)}${n[0]}`:(t.split(/[_\s\-—]+/u).find(e=>e.trim())||t).trim()}function j(e){let t=A(e);return t?k.test(t)?O(`${t}迭代版本`):O(t):O(`cases`)}function M(e){let t=A(e);return t=t.replace(/[\s_\-—·()()[\]【】]/g,``).toLowerCase(),t}function N(e,t){let n=M(e),r=M(t);return n.length<4||r.length<4?!1:n===r||n.includes(r)||r.includes(n)}function P(e=new Date){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}${t(e.getMonth()+1)}${t(e.getDate())}-${t(e.getHours())}${t(e.getMinutes())}${t(e.getSeconds())}`}function F(e,t,n=new Date){let r=`_${i(t).label}用例`;return`${j(e)||`cases`}${r}_${P(n)}`}function I(e,t){let n=String(e||``).match(RegExp(`${t}-\\d+`,`i`));return n?n[0].toUpperCase():``}function L(e,t){if(e===t)return 0;if(!e)return 1;if(!t)return-1;let n=e.match(/^(.*?)(\d+)$/),r=t.match(/^(.*?)(\d+)$/);return n&&r&&n[1]===r[1]?Number(n[2])-Number(r[2]):e.localeCompare(t,`zh`)}function ee(e){return u(e??``)}var te=/[,,、//||>]+/;function R(e,t){return t?e.len===t.len?e.exact===t.exact?e.index<t.index:e.exact:e.len>t.len:!0}function z(e){let t=new Map;return e.forEach((e,n)=>{let r=e=>{let r=e.trim();r&&(t.has(r)||t.set(r,n))};r(e);for(let t of e.split(te))r(t)}),t}function ne(e,t,n,r=z(t)){if(!t.length)return 0;let i=null,a=[n.submodule&&e[n.submodule],n.module&&e[n.module],n.title&&e[n.title]];for(let e of a){let n=String(e??``).trim();if(n){for(let e=0;e<t.length;e+=1){let r=t[e];if(r&&n===r){let t={len:r.length,exact:!0,index:e};R(t,i)&&(i=t)}}for(let[e,t]of r){if(!n.includes(e))continue;let r={len:e.length,exact:!1,index:t};R(r,i)&&(i=r)}}}return i?i.index:t.length+1}function B(e,t){let n=null;for(let r of e){let e=t.get(r.toUpperCase());e!=null&&(n==null||e<n)&&(n=e)}return n}function V(e,t,n){if(e.length<=1)return e;let r=s(t),i=r.requirement||c.requirement,a=r.no||c.no,o=r.title||c.title,l=r.reqCite,u=n?.idealOrder??[],d={submodule:r.submodule,module:r.module,title:o},f=new Map((n?.outlineOrder??[]).map((e,t)=>[e.toUpperCase(),t])),p=new Map((n?.storyIds??[]).map((e,t)=>[e.toUpperCase(),t])),m=new Map((n?.testPointIds??[]).map((e,t)=>[e.toUpperCase(),t])),h=n?.storySourceRefs,g=z(u),_=f.size>0,v=e.map((e,t)=>{let{roIds:n,tpIds:r}=Y(l?String(e[l]??``):``),a=I(e[i]??``,`US`)||I(e[o]??``,`US`),s=_?B(n,f):null;s==null&&_&&a&&h&&(s=B(h.get(a)??h.get(a.toUpperCase())??[],f));let c=B(r,m),v=[...r].sort(L)[0]??``,y=[...n].sort(L)[0]??``;return{row:e,index:t,roRank:s,roId:y,tpIdx:c,tpId:v,idealRank:u.length?ne(e,u,d,g):0,us:a,usRank:a?p.get(a)??p.size+1:p.size+2}}),y=2**53-1;return v.sort((e,t)=>{if(_){let n=e.roRank??y,r=t.roRank??y;if(n!==r)return n-r;if(e.roRank!=null&&t.roRank!=null){let n=e.tpIdx??(e.tpId?y-1:y),r=t.tpIdx??(t.tpId?y-1:y);return n===r?n===y-1&&e.tpId!==t.tpId?L(e.tpId,t.tpId):e.index-t.index:n-r}}if(u.length){let n=e.idealRank,r=t.idealRank;if(n!==r)return n-r;if(n<u.length)return e.index-t.index}if(p.size){let n=e.us?e.usRank:p.size+2,r=t.us?t.usRank:p.size+2;if(n!==r)return n-r}let n=L(e.us,t.us);if(n)return n;let r=I(e.row[o]??``,`TP`)||I(e.row[a]??``,`TP`),i=I(t.row[o]??``,`TP`)||I(t.row[a]??``,`TP`);if(m.size&&(r||i)){let e=r?m.get(r)??m.size+1:m.size+2,t=i?m.get(i)??m.size+1:m.size+2;if(e!==t)return e-t}let s=L(r,i);if(s)return s;if(e.roId||t.roId){let n=L(e.roId,t.roId);if(n)return n}if(e.tpId||t.tpId){let n=L(e.tpId,t.tpId);if(n)return n}return L(String(e.row[a]??``),String(t.row[a]??``))||e.index-t.index}).map(e=>e.row)}function re(e,t){let n=[];for(let r of t){let t=e.filter(e=>!String(e[r]??``).trim()).length;t===e.length?n.push(`字段「${r}」全部为空`):t>Math.max(2,Math.floor(e.length*.3))&&n.push(`字段「${r}」有 ${t}/${e.length} 条为空`)}return n}function ie(e,t=``,n){let r=i(e.caseType).label,a=e.templateHeaders.length>0?e.templateHeaders:[...o],c=e.outputFormat===`md`?`最终结果将保存为 Markdown 表格文件`:e.outputFormat===`csv`?`最终结果将保存为 CSV 文件`:`最终结果将保存为 Excel 文件`,l=e.promptBody.trim();if(!l)throw Error(`用例生成默认技能尚未就绪,请重新打开插件`);let u=e.templateBody?`\n\n### 用例模板:${e.templateTitle||e.templateId||``}\n${e.templateBody}`:`\n\n### 模板字段:${a.join(`、`)}`,d=e.reqBlock?`\n\n${e.reqBlock}`:``,f=e.requirementBreakdownContext?.block?`\n\n${e.requirementBreakdownContext.block}`:``,p=e.businessContext?.block?`\n\n${e.businessContext.block}`:``,m=e.testPointIds?.length??0,h=!!(n&&n.total>1),g=e.testPointBlock?`\n\n### 测试点(逐条覆盖,别合并成一条用例;${h?`本批 ${m||n.pointCount} 条,第 ${n.index}/${n.total} 批`:`共 ${m||`全部`} 条,下文为完整清单`})\n${e.testPointBlock}`:``,_=e.testPointBlock?h?`- 本批是第 ${n.index}/${n.total} 批,下文仅列出本批 ${m||n.pointCount} 条测试点:须逐条落到用例里;不要编写未列出的测试点;测试点的前置 / 步骤 / 预期分别对应用例的对应字段\n- 「覆盖需求率」「编写说明」只概括本批;系统会合并各批后再入库\n- 「未覆盖说明」只列本批清单里确实没写成用例的真实缺口(如缺规则、材料不足);本批已全部落成时必须输出空数组 \`[]\`;禁止写「本批仅覆盖 / 由其他批次负责 / 均已落成 / 不计入本批缺口」等分批说明(那不是缺口)\n`:`- 已选测试点共 ${m||`全部`} 条,正文已完整注入,须逐条落到用例里;测试点的前置 / 步骤 / 预期分别对应用例的对应字段。不要声称「材料未提供后半段测试点」\n`:``,v=K(a.includes(`备注`)?a:[...a,`备注`]),y=s(v),b=y.module,x=y.submodule,S=[];b&&S.push(`「${b}」对齐需求大模块 / 章节(Ideal 表填大模块原文;普通文档填对应章节名)`),x&&S.push(`「${x}」对齐需求小模块 / 小节原文,不要自造更细的名称`);let C=S.length>0?`- 字段对齐:${S.join(`;`)};用例数组严格按需求条目 / 测试点清单顺序输出\n`:`- 用例数组严格按需求条目 / 测试点清单 / 文档段落顺序输出(系统入库还会按此序重排)
2
+ `;return`${l}
3
+ ${u}${d}${f}${p}${g}
4
+
5
+ 【运行时约束 · 生成测试用例插件已启用】
6
+ - 本轮以「生成测试用例」插件自动关联的技能规则为准,不要再遵循工作台闲聊/系统提示词风格
7
+ - 用例类型:${r}
8
+ - ${c}
9
+ ${e.requirementBreakdownContext?`- 已注入需求拆解库中的最新 XMind:结合其标题层级、前后置条件和原文步骤补齐用例;与用户故事冲突时以更具体且更新的 XMind 内容为补充依据,并把无法判断的冲突写进备注或待确认
10
+ `:``}${e.businessContext?`- 已注入业务地图:使用其中的目录、功能规则、输入输出和流程步骤设计正常流、跨角色 / 跨系统流和分支场景;不得把未注入的其他系统当作当前范围
11
+ `:``}${e.businessContext?`- 业务地图只作为业务结构与规则依据,不读取或输出登录账号、密码、Cookie、Token 等认证信息
12
+ `:``}
13
+ ${_}- 需求名称默认可用「${t||`未命名需求`}」
14
+ - 「用例」数组必须按上文材料的需求顺序输出(需求条目 RO 序 → 条目内测试点 TP 序 → 文档段落 / 用户故事顺序),不要按自造模块名、优先级或维度重排
15
+ ${C}- 「用例」对象键必须与当前模板字段完全一致(另可多写「备注」「引用需求点」列):${v.join(`、`)}
16
+ - 仅输出一个 JSON 对象(可无代码围栏),结构为:
17
+ {"需求名称":"...","覆盖需求率":0-100,"未覆盖说明":["..."],"编写说明":"...","用例":[...]}
18
+ - 「引用需求点」必填,格式为「需求条目 + 测试点」两段:\`RO-id 标题或原文摘录;TP-xxx\`(RO 在前并带一句标题 / 摘录,TP 在后);RO id 必须来自材料「需求条目」里真实存在的 \`RO-…\`;TP id 取本条用例所覆盖测试点的编号(材料中有测试点清单时必填);不要填 \`US-…\`、不要写 \`全局测试点:…\` 这类分组前缀;只有用户故事时 RO 填该故事的「来源条目」,仍不要只写 US id
19
+ - 补充扩展场景:同一「引用需求点」,并在「备注」写「补充:…」;同点内正式用例在前、补充在后
20
+ - 「待业务确认 / 待确认」类不确定项也要写成用例,不要只丢进「未覆盖说明」:步骤写可执行操作,预期写「记录实际行为,规则待业务确认后回填判定口径」,并在「备注」写「待业务确认:…」(可与「补充:」并存)
21
+ - 「未覆盖说明」只写确实没写成用例的缺口;已用备注标过待业务确认的不要再重复列进「未覆盖说明」;某个需求点一条引用都没有时须在未覆盖说明点名
22
+ - 不要输出 JSON 以外的解释性正文;界面只会展示执行摘要,用例由系统静默入库`}function H(e,t=100){return Math.min(95,Math.max(1,Math.round(95*(1-Math.exp(-Math.max(0,e)/t)))))}function ae(e=0,t){let n=Math.max(0,Math.floor(e)),r=!!(t&&t.total>1),i;if(r&&t){let e=H(n,80)/100;i=Math.min(95,Math.max(1,Math.round((t.index-1+e)/t.total*95)))}else i=H(n);return`正在编写用例…\n\n${r?`第 ${t.index}/${t.total} 批${t.label?` · ${t.label}`:``}\n`:``}进度约 ${i}% · 已用 ${n}s\n${r?`系统自动分批生成,全部完成后合并入库并给出覆盖率。`:`大文档可能需要数分钟;完成后将给出覆盖率与入库结果。`}`}function U(e){if(!e.ok)return[`**执行失败**`,``,e.error||`未知错误`,``,`可调整插件中的需求 / 模板 / 提示词后重试。`].join(`
23
+ `);let t=[`**执行成功**`,``,`- 需求名称:${e.title||`—`}`,`- 共编写:${e.count??0} 条用例`,`- 覆盖需求率:${e.coverageRate==null?`未给出(已按用例入库)`:`${e.coverageRate}%`}`];e.path&&t.push(`- 入库文件:用例管理/${e.path}`),e.writeNote&&t.push(``,`**编写说明**`,e.writeNote);let n=e.uncovered??[];if(t.push(``,`**未覆盖 / 未编写原因**`),n.length)for(let e of n)t.push(`- ${e}`);else t.push(`- 无(模型未声明未覆盖项;待业务确认项已写入用例「备注」)`);let r=e.fieldGaps??[];if(r.length){t.push(``,`**字段完整性检测**`);for(let e of r)t.push(`- ${e}`)}return t.join(`
24
+ `)}async function W(e){if(!n(`cases`))throw Error(t(`cases`));let a=await fetch(`/__tb_case_design/save`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({rows:e.cases,headers:r(e.headers.length?e.headers:[...o]),title:F(e.title,e.caseType),format:e.outputFormat,folder:i(e.caseType).casesFolder,analysisId:e.baseline?.analysisId||void 0,expectedRevision:e.baseline?.revision,sourcePath:e.baseline?.sourcePath,expectedSourceFileHash:e.baseline?.sourceFileHash})}),s=await a.json();if(!a.ok)throw Error(s.error||`用例入库失败`);return s.path}function G(e){return e.some(e=>/备注/.test(e))?e:[...e,`备注`]}function K(e){return e.some(e=>/引用需求点|需求点/.test(e)&&!/需求编号/.test(e))?e:[...e,`引用需求点`]}var q=/\bRO-[A-Za-z0-9_-]+\b/gi,oe=/\bUS-\d+\b/gi,J=/\bTP-\d+\b/gi;function Y(e){let t=String(e??``);return{roIds:X(t,q),tpIds:X(t,J).map(e=>e.toUpperCase())}}function se(e,t=``){let n=String(e??``).trim(),r=String(t??``).replace(/\s+/g,` `).trim();return n?r?r===n||r.toUpperCase().startsWith(n.toUpperCase()+` `)||RegExp(`^${n}\\b`,`i`).test(r)?r:`${n} ${r}`:n:r}function X(e,t){let n=[],r=new Set;for(let i of String(e??``).matchAll(t)){let e=/^US-/i.test(i[0])?i[0].toUpperCase():i[0].replace(/^ro-/i,`RO-`),t=e.toUpperCase();r.has(t)||(r.add(t),n.push(e))}return n}function ce(e,t){let n=String(e??``).trim();if(!n)return``;n=n.replace(/全局测试点\s*[::]\s*/g,``).replace(/来源故事\s*[::]\s*/gi,``).replace(/\s+/g,` `).trim();let r=X(n,q),i=X(n,oe),a=X(n,J).map(e=>e.toUpperCase()),o=t?.outlineById,s=t?.storySourceRefs,c=e=>{let t=String(e??``).trim().replace(/\btp-\d+\b/gi,e=>e.toUpperCase());if(!a.length)return t;let n=new Set(Y(t).tpIds),r=a.filter(e=>!n.has(e));return r.length?t?`${t};${r.join(`、`)}`:r.join(`、`):t},l=e=>{let t=o?.get(e)??o?.get(e.toUpperCase());if(!t&&o){for(let[n,r]of o)if(n.toUpperCase()===e.toUpperCase()){t=r;break}}return se(e,(t?.quote||t?.title||``).replace(/\s+/g,` `).trim())};if(r.length)return c(r.map(l).join(`;`));if(i.length&&s){let e=[],t=new Set;for(let n of i){let r=s.get(n)??s.get(n.toUpperCase())??[];for(let n of r){let r=n.toUpperCase();t.has(r)||(t.add(r),e.push(l(n)))}}if(e.length)return c(e.join(`;`))}if(i.length&&!r.length){let e=n;for(let t of i)e=e.replace(new RegExp(t,`ig`),` `);return e=e.replace(/[/||,,;;]+/g,` `).replace(/\s+/g,` `).trim(),c(e||n)}return c(n)}function le(e){let t=new Map,n=String(e??``).split(/\n/);for(let e=0;e<n.length;e++){let r=n[e]??``,i=r.match(/\*\*(RO-[A-Za-z0-9_-]+)\*\*\s*(.+)?$/)||r.match(/\b(RO-[A-Za-z0-9_-]+)\b\s+(.+)$/);if(!i)continue;let a=i[1],o=(i[2]??``).replace(/\*\*/g,``).trim(),s=``,c=(n[e+1]??``).match(/^\s*>\s*(.+)$/);c&&(s=c[1].trim()),!o&&s&&(o=s.slice(0,80)),t.has(a)||t.set(a,{title:o,quote:s||void 0})}return t}function ue(e){let t=new Map,n=String(e??``).split(/^###\s+/m).slice(1);for(let e of n){let n=e.match(/^(US-\d+)\b/);if(!n)continue;let r=n[1],i=e.match(/\*\*来源条目\*\*[::]\s*(.+)/);if(!i)continue;let a=X(i[1],q);a.length&&t.set(r,a)}return t}function de(e,t,n){let r=s(t).reqCite||t.find(e=>/引用需求点|需求点/.test(e)&&!/需求编号/.test(e));return r?e.map(e=>{let t=e[r];if(t==null||!String(t).trim())return e;let i=ce(String(t),n);return i===String(t).trim()?e:{...e,[r]:i}}):e}var Z=/待业务确|待确认|业务确认/;function Q(e){return e.find(e=>/备注/.test(e))??`备注`}function fe(e){return e.find(e=>/用例标题|测试分项目|用例名称|标题/.test(e))??e.find(e=>e.includes(`标题`))??`用例标题`}function pe(e){for(let t of[`备注`,`备注说明`,`说明`,`remark`,`note`]){let n=e[t];if(typeof n==`string`&&n.trim())return n.trim()}return``}function me(e,t,n){let r=Q(n),i=fe(n),a=[],o=[];for(let e of t){let t=String(e??``).trim();if(!t||!Z.test(t)){t&&a.push(t);continue}let s=t.replace(/^[-*·\s]+/,``).split(/[。;;\n]/)[0]?.trim()||t,c=(s.length>48?`${s.slice(0,48)}…`:s).replace(/^待业务确认[::]\s*/u,``),l={};for(let e of n)l[e]=``;l[i]=c||`待业务确认项`,n.includes(`优先级`)&&(l.优先级=`P2`),n.includes(`用例类型`)&&(l.用例类型=`功能测试`);let u=n.find(e=>/步骤/.test(e)),d=n.find(e=>/预期|期望|结果标准/.test(e));u&&(l[u]=`1、按需求描述完成相关操作
25
+ 2、记录系统实际行为与提示文案`),d&&(l[d]=`记录实际行为;业务规则确认前不做通过/失败判定,确认后回填判定口径`),l[r]=t.startsWith(`待业务确认`)?t:`待业务确认:${t}`,o.push(l)}return{cases:[...e,...o],uncovered:a}}function he(e,t){let n=Q(t);return e.map(e=>{if(!e||typeof e!=`object`)return e;let t={...e};if(!String(t[n]??``).trim()){let e=pe(t);e&&(t[n]=e)}return t})}function ge(e){let t=String(e||``).trim();return!t||/本批仅覆盖|本批只覆盖|本批只负责|本批仅负责/.test(t)||/由其他批次|其他批次负责|其余批次|后续批次/.test(t)||/不计入本批缺口|不算本批缺口|非本批缺口/.test(t)||/均已落成用例|均已写成用例|本批.*全部落成|本批测试点.*均已/.test(t)||/指定的\s*\d+\s*条测试点/.test(t)}function _e(e){if(!e.length)return null;let t=[],n=[],r=new Set,i=[],a=0,o=0,s=``;for(let c of e){!s&&c.docTitle&&(s=c.docTitle),Array.isArray(c.cases)&&t.push(...c.cases);for(let e of c.uncovered){let t=e.trim();!t||r.has(t)||ge(t)||(r.add(t),n.push(t))}if(c.writeNote.trim()&&i.push(c.writeNote.trim()),c.coverageRate!=null&&Number.isFinite(c.coverageRate)){let e=Math.max(1,c.cases.length||1);a+=c.coverageRate*e,o+=e}}return t.length?{docTitle:s,cases:t,coverageRate:o>0?Math.round(a/o):null,uncovered:n,writeNote:i.length?i.length===1?i[0]:i.map((e,t)=>`(第 ${t+1} 批)${e}`).join(`
26
+ `):``}:null}async function $(e,t,n,a){let u=t.templateHeaders.length>0?t.templateHeaders:[...o],d=r(K(G(u))),f=me(e.cases,e.uncovered,d),p=he(f.cases,d),m=T(t);if(m&&!t.baseline)throw Error(`当前生成配置缺少需求基线,请重新打开配置并确认后生成`);let h=m?.kind===`stories`?m.storyIds:void 0,g=ee(t.reqBlock),_=le(t.reqBlock??``),v=ue(t.reqBlock??``),y=V(de(l(p,d),d,{outlineById:_,storySourceRefs:v}),d,{storyIds:h,testPointIds:t.testPointIds,idealOrder:g,outlineOrder:t.outlineOrder,storySourceRefs:v});if(a?.renumber||g.length||(t.outlineOrder?.length??0)>0){let e=s(d).no||c.no;d.includes(e)&&y.forEach((t,n)=>{t[e]=String(n+1)})}let b=(n||t.docTitle||``).trim()||e.docTitle||i(t.caseType).label,x=re(y,d),S=new Set(y.flatMap(e=>Object.values(e).flatMap(e=>String(e).match(/\b(?:RO-[A-Za-z0-9_-]+|TP-\d+|US-\d+)\b/g)||[]))),C=t.testPointIds?.length?t.testPointIds:t.outlineOrder?.length?t.outlineOrder:h||[],w=C.length?Math.round(C.filter(e=>S.has(e)).length/C.length*100):null,E=[...f.uncovered,...C.filter(e=>!S.has(e)).map(e=>`未覆盖:${e}`)];try{let n=await W({cases:y,headers:d,caseType:t.caseType,outputFormat:t.outputFormat,title:b,baseline:t.baseline}),r=U({ok:!0,title:b,path:n,count:y.length,coverageRate:w,uncovered:E,writeNote:e.writeNote,fieldGaps:x});return{ok:!0,path:n,count:y.length,title:b,coverageRate:w,uncovered:E,writeNote:e.writeNote,fieldGaps:x,summary:r}}catch(e){let t=e instanceof Error?e.message:String(e);return{ok:!1,error:t,summary:U({ok:!1,error:t})}}}async function ve(e,t,n){let r=D(e);if(!r){let e=`未能解析出用例结果,未写入文件`;return{ok:!1,error:e,summary:U({ok:!1,error:e})}}return $(r,t,n)}async function ye(e,t,n){let r=[];for(let t of e){let e=D(t.raw);if(!e){let e=`第 ${t.index}/${t.total} 批未能解析出用例结果,未写入文件`;return{ok:!1,error:e,summary:U({ok:!1,error:e})}}r.push(e)}let i=_e(r);if(!i){let e=`各批均未解析出用例,未写入文件`;return{ok:!1,error:e,summary:U({ok:!1,error:e})}}return $(i,t,n,{renumber:!0})}export{ae as a,ye as c,y as d,b as f,M as i,E as l,w as m,N as n,V as o,S as p,F as r,ve as s,ie as t,C as u};
@@ -0,0 +1,2 @@
1
+ import{a as e,r as t,t as n}from"./space-skills.CPucW8zt.js";var r={functional:`功能测试用例提示词.md`,api:`接口测试用例提示词.md`,performance:`性能测试用例提示词.md`,automation:`自动化测试用例提示词.md`},i=[{id:`functional`,file:r.functional,name:`功能用例设计`,focus:`逐条覆盖需求 / 用户故事、业务流程、边界值、异常和业务规则。`},{id:`api`,file:r.api,name:`接口用例设计`,focus:`覆盖鉴权、参数校验、状态码、响应结构、幂等、错误分支与契约约束。`},{id:`performance`,file:r.performance,name:`性能用例设计`,focus:`覆盖负载模型、并发、持续时间、指标阈值、监控口径和异常恢复。`},{id:`automation`,file:r.automation,name:`自动化用例设计`,focus:`覆盖可自动化步骤、稳定定位、断言、数据准备、清理和失败取证。`}];function a(e,t=`逐条覆盖需求、边界、异常与业务规则。`){let n=e.replace(/\.md$/i,``).trim()||`用例生成提示词`,r=/功能测试用例/.test(n);return[`# ${n}`,``,`> 用例生成提示词:确认后本轮只按这份提示词写用例,工作台的系统提示词不再叠加。`,``,`## 生成用例`,``,`- 逐条覆盖需求 / 用户故事,一条用例只验一个点,不合并步骤;`,`- 前置条件、操作步骤、预期结果要一一对应,步骤给人看也能照着执行;`,...r?[`- 自动化可解析(不改变人工执行):步骤按序号一条只写一个业务动作,写清可见操作对象、动作和具体输入;避免“进行相关操作”“完成配置”这类不可执行描述;`,`- 前置条件分开写账号 / 角色、测试数据、系统状态和依赖;预期写清观察对象与可见状态、文案、数值;异步结果写等待条件,不写固定时长;`,`- 界面元素使用用户可见的菜单、按钮、输入框或字段名称,不写 CSS / XPath / 坐标 / 组件类名;账号密码、Cookie、Token 等敏感信息不写入用例;`,`- 图形验证码、短信验证码、文件选择器、支付或系统原生弹窗等自动化阻塞项,在备注中写“自动化阻塞:…”;没有备注列时写进前置条件;`]:[],`- ${t}`,`- 每条用例标注优先级 P0–P3,P0 放主流程与核心校验;`,`- 字段与顺序严格跟随用例模板;Ideal 表时「模块」=大模块、「子模块」=小模块原文,并按小模块行序输出;`,`- 「引用需求点」只填材料里真实的 RO-… id,格式「RO-id 标题或原文」;不要填 US-… / TP-…;补充场景同引用并在「备注」写「补充:…」;`,`- 「待业务确认」类不确定项也要写成用例,并在「备注」标注「待业务确认:…」,不要只写进未覆盖说明;`,``].join(`
2
+ `)}async function o(){let e=await t(`caseGen`),r=new Set(e.map(e=>e.legacyPath));for(let e of i){if(r.has(e.file))continue;let t=await n(e.file,a(e.file,e.focus),`caseGen`);r.add(t)}return e=await t(`caseGen`),e}async function s(t,n=``){let a=`${t} ${n}`.toLowerCase(),s=i.find(e=>e.id===t)?.file,c=/性能|performance|perf/.test(a)?r.performance:/接口|api/.test(a)?r.api:/自动化|automation|e2e/.test(a)?r.automation:r.functional,l=s??c,u=await e(`caseGen`,[l,...i.map(e=>e.file)]);if(u||=(await o(),await e(`caseGen`,[l,...i.map(e=>e.file)])),!u)throw Error(`生成测试用例技能尚未就绪,请重新打开插件`);return u}export{s as n,o as t};
@@ -1,3 +1,3 @@
1
- import{a as e,n as t,t as n}from"./case-fields.CmePqYfh.js";var r=`/__tb_casereview`,i=`/__tb_caseblindspot`,a=`用例质量评审提示词.md`,o=`场景遗漏补全提示词.md`,s=[`coverage`,`steps`,`expected`,`data`,`convention`],c={coverage:{label:`需求覆盖`,weight:25,hint:`对应需求点是否明确、主流程与关键分支是否走到`,tone:`blue`},steps:{label:`步骤可执行`,weight:25,hint:`一步一个动作、有编号、照着能点`,tone:`purple`},expected:{label:`预期可判定`,weight:20,hint:`状态 / 文案 / 数值写清楚,第三方能判对错`,tone:`green`},data:{label:`数据与边界`,weight:15,hint:`前置数据与角色齐备,覆盖空值 / 上下限 / 重复`,tone:`amber`},convention:{label:`规范完整`,weight:15,hint:`编号、标题、优先级、类型与模板一致`,tone:`gray`}},l=[`usable`,`revise`,`invalid`],u={usable:{label:`可用`,tone:`green`,hint:`照着能执行,预期能判定`,badge:`bg-emerald-50 text-emerald-700 border-emerald-200`},revise:{label:`待修改`,tone:`amber`,hint:`能看懂但执行会卡住或结论扯皮`,badge:`bg-amber-50 text-amber-800 border-amber-200`},invalid:{label:`错误无效`,tone:`red`,hint:`存在硬伤,不能用`,badge:`bg-red-50 text-red-700 border-red-200`}},d=[`nonfunctional`,`security`,`compatibility`,`business`],f={nonfunctional:{label:`非功能`,hint:`响应时间、并发、大数量、断网与重试`,tone:`purple`,mark:`非功能`},security:{label:`安全边界与容错`,hint:`越权、注入、重复提交、竞态与篡改`,tone:`amber`,mark:`安全`},compatibility:{label:`兼容性`,hint:`分辨率、浏览器 / 端、深浅色、时区与格式`,tone:`blue`,mark:`兼容`},business:{label:`隐藏业务规则`,hint:`金额精度、状态互斥、唯一性、跨模块联动`,tone:`green`,mark:`业务`}},p={high:{label:`高`,tone:`red`},medium:{label:`中`,tone:`amber`},low:{label:`低`,tone:`gray`}},m={usable:85,revise:60},h=/^(正常|正确|成功|符合预期|无异常|没问题|ok|okay|通过|显示正常)的?$/i,g=/(提示|跳转|弹窗|状态|变为|变成|显示|返回|报错|错误码|http\s*\d|\d+%|金额|数量|\d+\s*(ms|s|秒|条|元|位|个|行|次))|「[^」]+」|"[^"]+"/i,_=/^(验证|测试|检查)[^,。]{0,4}(功能|流程|是否正确)?$/;function v(e){let t=String(e??``).replace(/<br\s*\/?>/gi,`
1
+ import{a as e,n as t,t as n}from"./case-fields.C03NY3zC.js";var r=`/__tb_casereview`,i=`/__tb_caseblindspot`,a=`用例质量评审提示词.md`,o=`场景遗漏补全提示词.md`,s=[`coverage`,`steps`,`expected`,`data`,`convention`],c={coverage:{label:`需求覆盖`,weight:25,hint:`对应需求点是否明确、主流程与关键分支是否走到`,tone:`blue`},steps:{label:`步骤可执行`,weight:25,hint:`一步一个动作、有编号、照着能点`,tone:`purple`},expected:{label:`预期可判定`,weight:20,hint:`状态 / 文案 / 数值写清楚,第三方能判对错`,tone:`green`},data:{label:`数据与边界`,weight:15,hint:`前置数据与角色齐备,覆盖空值 / 上下限 / 重复`,tone:`amber`},convention:{label:`规范完整`,weight:15,hint:`编号、标题、优先级、类型与模板一致`,tone:`gray`}},l=[`usable`,`revise`,`invalid`],u={usable:{label:`可用`,tone:`green`,hint:`照着能执行,预期能判定`,badge:`bg-emerald-50 text-emerald-700 border-emerald-200`},revise:{label:`待修改`,tone:`amber`,hint:`能看懂但执行会卡住或结论扯皮`,badge:`bg-amber-50 text-amber-800 border-amber-200`},invalid:{label:`错误无效`,tone:`red`,hint:`存在硬伤,不能用`,badge:`bg-red-50 text-red-700 border-red-200`}},d=[`nonfunctional`,`security`,`compatibility`,`business`],f={nonfunctional:{label:`非功能`,hint:`响应时间、并发、大数量、断网与重试`,tone:`purple`,mark:`非功能`},security:{label:`安全边界与容错`,hint:`越权、注入、重复提交、竞态与篡改`,tone:`amber`,mark:`安全`},compatibility:{label:`兼容性`,hint:`分辨率、浏览器 / 端、深浅色、时区与格式`,tone:`blue`,mark:`兼容`},business:{label:`隐藏业务规则`,hint:`金额精度、状态互斥、唯一性、跨模块联动`,tone:`green`,mark:`业务`}},p={high:{label:`高`,tone:`red`},medium:{label:`中`,tone:`amber`},low:{label:`低`,tone:`gray`}},m={usable:85,revise:60},h=/^(正常|正确|成功|符合预期|无异常|没问题|ok|okay|通过|显示正常)的?$/i,g=/(提示|跳转|弹窗|状态|变为|变成|显示|返回|报错|错误码|http\s*\d|\d+%|金额|数量|\d+\s*(ms|s|秒|条|元|位|个|行|次))|「[^」]+」|"[^"]+"/i,_=/^(验证|测试|检查)[^,。]{0,4}(功能|流程|是否正确)?$/;function v(e){let t=String(e??``).replace(/<br\s*\/?>/gi,`
2
2
  `).split(/\r?\n/).map(e=>e.trim()),n=[];for(let e of t){if(!e)continue;let t=e.split(/(?=(?:^|[;;])\s*\d+\s*[、..))])/).map(e=>e.replace(/^[;;\s]+/,``).trim()).filter(Boolean);n.push(...t.length?t:[e])}return n.filter(e=>e.length>0)}function y(e){let t=String(e??``).trim();return!t||h.test(t)?!1:g.test(t)&&t.length>=6}function b(e){let t=`${e.用例类型??``} ${e.用例标题??``} ${e.测试步骤??``}`;return/(边界|异常|失败|为空|超时|越界|并发|重复|非法|错误)/.test(t)}function x(e){let t=e=>String(e??``).toLowerCase().replace(/[\s\p{P}\p{S}]+/gu,``);return`${t(e.用例标题??``)}|${t(e.测试步骤??``)}`}function S(e){let t=e=>String(e??``).toLowerCase().replace(/[\s\p{P}\p{S}]+/gu,``);return[t(e[n.title]??e.用例标题??``),t(e[n.steps]??e.测试步骤??``),t(e[n.expected]??e.预期结果??``),t(e[n.precondition]??e.前置条件??``),t(e.用例状态??``)].join(`|`)}function C(e,t){if(!e.contentFp||!t)return!1;let n=S(t);if(n===e.contentFp)return!1;let r=e.contentFp.split(`|`),i=n.split(`|`);return r.length===4&&i.length>=4?r.join(`|`)!==i.slice(0,4).join(`|`):!0}function w(e){let r=new Map;for(let i of t(e)){let e=String(i[n.no]??i.用例编号??``).trim(),t=String(i[n.title]??i.用例标题??``).trim();e&&r.set(e,i),t&&!r.has(t)&&r.set(t,i)}return r}function T(e,t){let n=w(t),r=new Set;for(let t of e){let e=L(t);e&&!t.ignored&&(t.fixed||t.verdict!==`usable`&&C(t,n.get(String(t.no??``).trim())??n.get(String(t.title??``).trim())))&&r.add(e)}return r}function E(e){let t=new Set;for(let n of e){let e=L(n);e&&n.ignored&&t.add(e)}return t}function D(e,t=80){let n=String(e??``).replace(/```[\s\S]*?```/g,` `).replace(/[#>*_`]/g,` `).split(/[\n。;;!!??,,、|]+/),r=[];for(let e of n){let n=e.replace(/^[\s\-*\d.、))]+/,``).trim();if(!(n.length<3||n.length>24)&&!r.includes(n)&&(r.push(n),r.length>=t))break}return r}function O(n,r=``){let i=t(n),a=i.length,o=D(r),s=i.map(e=>{let t=String(e.用例编号??``).trim(),n=String(e.用例标题??``).trim(),r=v(e.测试步骤??``),i=String(e.预期结果??``).trim(),a=String(e.前置条件??``).trim(),s=String(e.优先级??``).trim().toUpperCase(),c=String(e.用例类型??``).trim(),l=String(e.所属模块??``).trim(),u=`${n} ${r.join(` `)} ${i}`,d=[];n||d.push(`用例标题为空`),r.length||d.push(`测试步骤为空`),i||d.push(`预期结果为空`),/^(同上|同前|同上一条|略)$/.test(i)&&d.push(`预期结果只有占位文字`);let f={coverage:(()=>{let e=l?60:25;if(o.length){let t=o.some(e=>u.includes(e));e+=t?40:0}else e+=30;return k(e)})(),steps:(()=>{if(!r.length)return 0;let e=r.length>=3?100:r.length===2?80:50;return r.some(e=>_.test(e))&&(e-=25),r.length===1&&r[0].length>80&&(e-=15),k(e)})(),expected:i?h.test(i)?45:y(i)?i.length>=12?100:90:65:0,data:(()=>{let t=a?60:20;return b(e)?t+=40:t+=15,k(t)})(),convention:(()=>{let e=100;return t||(e-=25),(n.length<6||n.length>60)&&(e-=20),[`P0`,`P1`,`P2`,`P3`].includes(s)||(e-=20),c||(e-=20),k(e)})()},p=[];n||p.push({dimension:`convention`,points:15,reason:`用例标题为空,无法从列表里认出这条用例测什么`,suggestion:`补一句「动词 + 对象 + 条件」的标题,例如「未登录用户提交订单时提示先登录」`}),r.length||p.push({dimension:`steps`,points:25,reason:`测试步骤为空,无法执行`,suggestion:`按「一步一个动作」补步骤,从进入路径写到触发动作`}),i?y(i)||p.push({dimension:`expected`,points:8,reason:`预期结果不够可判定:「${i.slice(0,30)}」`,suggestion:`写成具体状态或文案,例如「提示『手机号格式不正确』,输入框标红且不提交」`}):p.push({dimension:`expected`,points:20,reason:`预期结果为空,无法判定是否通过`,suggestion:`补可判定的结果:页面 / 状态 / 文案 / 数值`}),a||p.push({dimension:`data`,points:6,reason:`没有前置条件,执行者不知道该用什么账号 / 数据 / 状态`,suggestion:`补上需要的角色、数据量与初始状态(如「已登录普通用户,购物车有 1 件商品」)`}),b(e)||p.push({dimension:`data`,points:5,reason:`这条用例没有体现边界或异常路径`,suggestion:`确认是否需要补一条空值 / 上下限 / 失败路径的用例`}),t||p.push({dimension:`convention`,points:5,reason:`缺少用例编号,无法在报告或缺陷里互相引用`,suggestion:`按项目规则补编号(如 TC-模块-001)`});let g=A(f);return{no:t,title:n,verdict:d.length?`invalid`:g>=m.usable?`usable`:g>=m.revise?`revise`:`invalid`,score:g,dimensions:f,deductions:p,hard:d.join(`;`),contentFp:S(e)}}),c={usable:0,revise:0,invalid:0};for(let e of s)c[e.verdict]+=1;let l=new Map;for(let e of i){let t=x(e);t!==`|`&&l.set(t,(l.get(t)??0)+1)}let u=[...l.values()].reduce((e,t)=>e+(t>1?t:0),0),d=j(s),f=A(d),p=e.filter(e=>i.some(t=>e in t)),g=M(i,p);return{metrics:[{key:`total`,label:`用例总数`,value:a,text:`${a}`,hint:`本文件里的用例条数`},{key:`fieldComplete`,label:`字段完整率`,value:a?g/a:0,text:N(a?g/a:0),hint:`文件里的 ${p.length} 个字段是否都有内容`},{key:`stepExecutable`,label:`步骤可执行率`,value:a?i.filter(e=>v(e.测试步骤??``).length>=2).length/a:0,text:N(a?i.filter(e=>v(e.测试步骤??``).length>=2).length/a:0),hint:`有编号且至少两步`},{key:`expectedTestable`,label:`预期可判定率`,value:a?i.filter(e=>y(e.预期结果??``)).length/a:0,text:N(a?i.filter(e=>y(e.预期结果??``)).length/a:0),hint:`排除「正常 / 符合预期」这类模糊表述`},{key:`coverage`,label:`需求覆盖率`,value:o.length?Math.min(1,d.coverage/100):-1,text:o.length?N(Math.min(1,d.coverage/100)):`—`,hint:o.length?`与对照需求的关键点做匹配`:`未挂对照需求,不计算`},{key:`duplicate`,label:`重复用例率`,value:a?u/a:0,text:N(a?u/a:0),hint:`标题 + 步骤完全相同`},{key:`priority`,label:`优先级合规率`,value:a?i.filter(e=>[`P0`,`P1`,`P2`,`P3`].includes(String(e.优先级??``).toUpperCase())).length/a:0,text:N(a?i.filter(e=>[`P0`,`P1`,`P2`,`P3`].includes(String(e.优先级??``).toUpperCase())).length/a:0),hint:`优先级为 P0–P3 之一`},{key:`hard`,label:`硬伤用例`,value:s.filter(e=>e.hard).length,text:`${s.filter(e=>e.hard).length}`,hint:`标题 / 步骤 / 预期为空或冲突,直接判无效`}],cases:s,dimensions:d,score:f,counts:c}}function k(e){return Math.min(100,Math.max(0,Math.round(e)))}function A(e){let t=0;for(let n of s)t+=e[n]*(c[n].weight/100);return k(t)}function j(e){let t={};for(let n of s)t[n]=e.length?k(e.reduce((e,t)=>e+(t.dimensions[n]??0),0)/e.length):0;return t}function M(t,n){let r=n.length?n:e;return t.filter(e=>r.every(t=>String(e[t]??``).trim())).length}function N(e){return Number.isFinite(e)?`${Math.round(Math.max(0,Math.min(1,e))*100)}%`:`—`}var P={coverage:`需求覆盖偏低:写清对应需求点 / 模块,补主流程或关键分支`,steps:`步骤可执行偏低:拆成一步一个动作、补进入路径,避免笼统「验证功能」`,expected:`预期可判定偏低:写出可核对的状态 / 文案 / 数值,避免「正常」「成功」`,data:`数据与边界偏低:补前置账号与数据,并覆盖空值 / 上下限 / 异常路径`,convention:`规范完整偏低:核对编号、标题、优先级、类型是否与模板一致`};function F(e,t=12){let n=[],r=new Set,i=e=>{let t=e.trim();if(!t)return;let i=t.replace(/\s+/g,` `).toLowerCase();r.has(i)||(r.add(i),n.push(t.length>240?`${t.slice(0,238)}…`:t))};for(let r of e.deductions??[])if(i(String(r?.suggestion||r?.reason||``)),n.length>=t)return n;if(n.length===0&&(e.verdict===`revise`||e.verdict===`invalid`)&&e.dimensions)for(let r of s){let a=e.dimensions[r];if(typeof a==`number`&&a<m.usable&&(i(`${c[r].label} ${a}:${P[r]}`),n.length>=t))break}return n}function I(e){return s.map(t=>({key:t,label:c[t].label,score:k(e[t]??0),weight:c[t].weight}))}function L(e){return String(e.no??``).trim()||String(e.title??``).trim()}function R(e){return`${e.category}|${e.title.trim()}`}function z(e,t,n,r,i){let a=new Map(t.cases.map(e=>[L(e),e]).filter(([e])=>e)),o=e.map(e=>{let t=L(e);if(t&&n.has(t)){let n=a.get(t)??e,i=r.get(t),o={...n,contentFp:e.contentFp??n.contentFp,title:n.title||e.title,fixed:!1};return i?.ignored?o.ignored=!0:delete o.ignored,o}let i=t?r.get(t):void 0;return i?{...i,title:e.title||i.title,contentFp:e.contentFp??i.contentFp,...i.ignored?{ignored:!0}:{}}:e}),s={usable:0,revise:0,invalid:0};for(let e of o)e.ignored||(s[e.verdict]+=1);let c=j(o.filter(e=>!e.ignored)),l=e.length-n.size,u=t.modelCovered??t.cases.length;return{...t,metrics:i??t.metrics,score:A(c),counts:s,dimensions:I(c),cases:o,modelCovered:Math.min(o.length,u+Math.max(0,l))}}function B(e,t){let n=0;for(let r of e){if(r.ignored)continue;let e=L(r);r.fixed||e&&t?.has(e)||(r.verdict===`revise`||r.verdict===`invalid`)&&(n+=1)}return n}function V(e,t,n){let r=new Map;for(let e of t){let t=String(e.no??``).trim()||String(e.title??``).trim();t&&r.set(t,e)}let i=0,a=e.cases.map(e=>{let t=r.get(e.no)??r.get(e.title);if(!t)return e;i+=1;let n={...e.dimensions};for(let e of s){let r=t.dimensions?.[e];typeof r==`number`&&Number.isFinite(r)&&(n[e]=k(r))}let a=Array.isArray(t.deductions)?t.deductions.filter(e=>e&&e.reason).map(e=>({dimension:s.includes(e.dimension)?e.dimension:`expected`,points:k(Number(e.points)||0),reason:String(e.reason??``).slice(0,1e3),suggestion:String(e.suggestion??``).slice(0,1e3)})):[],o=A(n),c=e.hard||String(t.hard??``).trim()||void 0,l=c?`invalid`:o>=m.usable?`usable`:o>=m.revise?`revise`:`invalid`,u={...e,verdict:l,score:o,dimensions:n,deductions:a.length?a:e.deductions,fixed:!1};return c?u.hard=c:delete u.hard,u}),o={usable:0,revise:0,invalid:0};for(let e of a)o[e.verdict]+=1;let c=j(a);return{at:new Date().toISOString(),score:A(c),counts:o,dimensions:I(c),metrics:e.metrics,cases:a,summary:n.trim(),modeled:!0,modelCovered:i}}function H(e,r){let i=new Map,a=r?.length?w(r):new Map;if(r?.length)for(let e of t(r)){let t=String(e[n.no]??``).trim(),r=String(e[n.title]??``).trim();t&&r&&i.set(t,r)}let o=!1,s=e.cases.map(e=>{let t=e.title||i.get(String(e.no??``).trim())||``,n=a.get(String(e.no??``).trim())??a.get(String(e.title??``).trim()||t),r=e.contentFp||(n?S(n):void 0);if(e.fixed)return t===e.title&&r===e.contentFp?e:(o=!0,{...e,title:t,...r?{contentFp:r}:{}});let s=e.hard?`invalid`:e.score>=m.usable?`usable`:e.score>=m.revise?`revise`:`invalid`;return t===e.title&&s===e.verdict&&r===e.contentFp?e:(o=!0,{...e,title:t,verdict:s,...r?{contentFp:r}:{}})});if(!o)return e;let c={usable:0,revise:0,invalid:0};for(let e of s)e.ignored||(c[e.verdict]+=1);return{...e,cases:s,counts:c}}function U(e,t=``){return{at:new Date().toISOString(),score:e.score,counts:e.counts,dimensions:I(e.dimensions),metrics:e.metrics,cases:e.cases,summary:t||`规则判定:可用 ${e.counts.usable} · 待修改 ${e.counts.revise} · 错误无效 ${e.counts.invalid}。未接入模型,语义类问题(与需求冲突、预期与步骤无关)未计入。`,modeled:!1}}function W(e){return d.map(t=>({key:t,items:e.filter(e=>e.category===t)})).filter(e=>e.items.length>0)}function G(e,t,n){let r=[];if(r.push(`# 用例质量评审报告 · ${e}`),r.push(``),t){r.push(`- 评审时间:${t.at}`),r.push(`- 总分:${t.score}`),r.push(`- 三档:可用 ${t.counts.usable} · 待修改 ${t.counts.revise} · 错误无效 ${t.counts.invalid}`),r.push(`- 来源:${t.modeled?`规则 + 模型`:`仅规则`}`),r.push(``),r.push(`## 五维得分`),r.push(``);for(let e of t.dimensions)r.push(`- ${e.label}(权重 ${e.weight}):${e.score}`);r.push(``),r.push(`## 量化指标`),r.push(``);for(let e of t.metrics)r.push(`- ${e.label}:${e.text}`);t.summary&&(r.push(``),r.push(`## 结论`),r.push(``),r.push(t.summary)),r.push(``),r.push(`## 逐条明细`),r.push(``);for(let e of t.cases){r.push(`### ${e.no||`(无编号)`} ${e.title||`(无标题)`} · ${u[e.verdict].label} ${e.score}`),e.hard&&r.push(`- 硬伤:${e.hard}`);for(let t of e.deductions)r.push(`- [${c[t.dimension]?.label??t.dimension} −${t.points}] ${t.reason}`),t.suggestion&&r.push(` - 建议:${t.suggestion}`);r.push(``)}}else r.push(`- 还没有质量评审结果。`),r.push(``);if(n?.items.length){r.push(`## 场景补全`),r.push(``),r.push(`- 探测时间:${n.at}`),n.context.reqTitle&&r.push(`- 对照需求:${n.context.reqTitle}`),r.push(``);for(let e of W(n.items)){let t=f[e.key];r.push(`### ${t.label}(${e.items.length})`),r.push(``);for(let t of e.items)r.push(`- **[${p[t.severity].label}] ${t.title}**${t.added?`(已补全 ${t.caseNo})`:``}`),t.reqAnchor&&r.push(` - 归属需求:${t.reqAnchor}`),t.why&&r.push(` - 为什么容易漏:${t.why}`),t.precondition&&r.push(` - 前置条件:${t.precondition}`),t.steps.length&&r.push(` - 步骤:${t.steps.join(` → `)}`),t.expected&&r.push(` - 预期:${t.expected}`);r.push(``)}}return`${r.join(`
3
3
  `).trimEnd()}\n`}function K(e,t,n){let r=`${e.replace(/[\\/:*?"<>|]/g,`_`).slice(0,60)}-用例评审-${new Date().toISOString().slice(0,10)}.md`,i=new Blob([G(e,t,n)],{type:`text/markdown;charset=utf-8`}),a=URL.createObjectURL(i),o=document.createElement(`a`);return o.href=a,o.download=r,o.click(),URL.revokeObjectURL(a),r}async function q(e,t,n){let r;try{r=await fetch(`${e}${t}`,{...n,headers:n?.body===void 0?void 0:{"Content-Type":`application/json`,...n?.headers}})}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?e:Error("连不上本机评审服务(Failed to fetch)。确认 `lantern dev` 仍在跑,热更新刚结束时再点一次「重新评审」。")}let i=await r.json().catch(()=>({}));if(!r.ok||i.ok===!1)throw Error(i.error||`HTTP ${r.status}`);return i}async function J(e){try{return(await fetch(`${e}?health=1`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}function Y(){return J(r)}function X(){return J(i)}async function Z(){try{let e=await q(r,`/prompt`);return{file:e.file||`用例质量评审提示词.md`,exists:e.exists===!0,review:e.review??``}}catch(e){return{file:a,exists:!1,review:``,error:e instanceof Error?e.message:String(e)}}}async function Q(){try{let e=await q(i,`/prompt`);return{file:e.file||`场景遗漏补全提示词.md`,exists:e.exists===!0,detect:e.detect??``,complete:e.complete??``}}catch(e){return{file:o,exists:!1,detect:``,complete:``,error:e instanceof Error?e.message:String(e)}}}function $(e){return q(r,`/prompt/sync`,{method:`POST`,body:JSON.stringify({enabled:e})})}function ee(e){return q(i,`/prompt/sync`,{method:`POST`,body:JSON.stringify({enabled:e})})}async function te(){return(await q(`/__tb_casereview`,`/summaries`)).files??[]}async function ne(e){let t=await q(r,`/report?path=${encodeURIComponent(e)}`);return{entry:t.entry??null,stale:t.stale===!0}}async function re(e,t){return(await q(r,`/report`,{method:`PUT`,body:JSON.stringify({path:e,...t})})).entry}async function ie(){return(await q(`/__tb_casereview`,`/backups`)).items??[]}async function ae(e,t){return q(r,`/backups/create`,{method:`POST`,body:JSON.stringify({path:e,...t?.trim()?{name:t.trim()}:{}})})}async function oe(e){return{deleted:(await q(`/__tb_casereview`,`/backups/delete`,{method:`POST`,body:JSON.stringify({names:e})})).deleted??[]}}async function se(e,t,n){return q(r,`/rewrite`,{method:`POST`,body:JSON.stringify({path:e,headers:t,rows:n})})}export{U as A,Y as C,V as D,W as E,z as M,ee as N,H as O,$ as P,ne as S,te as T,oe as _,p as a,Q as b,m as c,L as d,F as f,ae as g,B as h,s as i,re as j,se as k,O as l,E as m,d as n,u as o,T as p,c as r,l as s,f as t,R as u,K as v,Z as w,ie as x,X as y};
@@ -1,7 +1,7 @@
1
- import{s as e}from"./react.Blvh0GOs.js";import{a as t,c as n,l as r,n as i,o as a,r as o,s,u as c}from"./case-fields.CmePqYfh.js";import{t as l}from"./jszip.min.Bh2Mgo40.js";import{f as u,p as d}from"./project-docs.bB9lQ1Ki.js";var f=e(l(),1),p=[`.md`,`.markdown`,`.txt`,`.csv`],m=[`.xlsx`,`.xls`];function h(e){return e.replace(/<br\s*\/?>/gi,`
1
+ import{s as e}from"./react.Blvh0GOs.js";import{a as t,c as n,l as r,n as i,o as a,r as o,s,u as c}from"./case-fields.C03NY3zC.js";import{t as l}from"./jszip.min.Bh2Mgo40.js";import{m as u,p as d}from"./project-docs.BRgNjXhG.js";var f=e(l(),1),p=[`.md`,`.markdown`,`.txt`,`.csv`],m=[`.xlsx`,`.xls`];function h(e){return e.replace(/<br\s*\/?>/gi,`
2
2
  `).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&amp;/g,`&`).trim()}function g(e){return e.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(h)}function _(e){return/^\s*\|?[\s-:|]+\|?\s*$/.test(e)&&/-+/.test(e)}function v(e){let n=String(e??``).split(/\r?\n/),r=-1,i=[];for(let e=0;e<n.length;e++){if(!n[e].includes(`|`))continue;let t=g(n[e]);if(t.some(e=>e.includes(`用例`))&&t.length>=2){r=e,i=t;break}}if(r<0||!i.length)return{headers:[...t],rows:[]};let a=_(n[r+1]??``)?r+2:r+1,o=[];for(let e=a;e<n.length;e++){let t=n[e];if(!t.includes(`|`)||_(t)){if(o.length>0&&!t.includes(`|`))break;continue}let r=g(t);if(r.every(e=>!e))continue;let a={};i.forEach((e,t)=>{a[e]=r[t]??``}),Object.values(a).some(e=>e.trim())&&o.push(a)}return{headers:i,rows:o}}function y(e){let n=String(e??``).replace(/^\uFEFF/,``),r=[],i=``,a=[],o=!1;for(let e=0;e<n.length;e++){let t=n[e];o?t===`"`?n[e+1]===`"`?(i+=`"`,e+=1):o=!1:i+=t:t===`"`?o=!0:t===`,`?(a.push(i),i=``):t===`
3
3
  `||t===`\r`?(t===`\r`&&n[e+1]===`
4
- `&&(e+=1),a.push(i),i=``,a.some(e=>e.trim())&&r.push(a),a=[]):i+=t}a.push(i),a.some(e=>e.trim())&&r.push(a);let[s,...c]=r,l=(s??[]).map(e=>String(e??``).trim()),u=l.filter(Boolean);return u.length?{headers:u,rows:c.map(e=>{let t={};return l.forEach((n,r)=>{n&&(t[n]=String(e[r]??``).trim())}),t})}:{headers:[...t],rows:[]}}function b(e){let t=String(e??``);return/说明|封面|目录|修订|变更|记录/.test(t)?-30:/用例|案例|测试用例/.test(t)?20:0}function x(e){let t=e.map(e=>String(e??``).trim()).filter(Boolean);if(t.length<2||t.reduce((e,t)=>e+t.length,0)/t.length>48)return 0;let n=o(t),r=Object.keys(n);if(!r.length)return 0;let i=r.length*10;return n.title&&(i+=8),n.steps&&(i+=6),n.expected&&(i+=6),n.no&&(i+=4),n.precondition&&(i+=2),i+=Math.min(t.length,12),i}function S(e){let t=null;for(let n of e.SheetNames){let i=e.Sheets[n];if(!i)continue;let a=r.sheet_to_json(i,{header:1,defval:``,raw:!1,blankrows:!1});if(!a.length)continue;let o=b(n),s=Math.min(a.length,30);for(let e=0;e<s;e++){let r=a[e]??[],i=x(r);if(i<=0)continue;let s=i+o-e,c=r.map(e=>String(e??``).trim()),l=c.filter(Boolean);(!t||s>t.score)&&(t={score:s,picked:{sheetName:n,headerRowIndex:e,headers:c,usedHeaders:l,table:a}})}}return t?.picked??null}function C(e){let r=S(n(e,{type:`base64`,cellDates:!0}));if(!r)return{headers:[...t],rows:[]};let{headers:i,usedHeaders:a,table:o,headerRowIndex:s}=r,c=[];for(let e of o.slice(s+1)){let t={};i.forEach((n,r)=>{n&&(t[n]=String(e[r]??``).trim())}),Object.values(t).some(e=>e.trim())&&c.push(t)}return{headers:a,rows:c}}async function w(e){let t=`.${(e.split(`.`).pop()??``).toLowerCase()}`;if(m.includes(t)){let n=await u(`cases`,e);if(n.encoding!==`base64`||!n.contentBase64)throw Error(`无法读取该用例文件`);let r=C(n.contentBase64);return{ext:t,...r,rows:i(r.rows)}}if(!p.includes(t))throw Error(`暂不支持评审 ${t} 文件,请用 md / csv / xlsx`);let{content:n}=await d(`cases`,e),r=t===`.csv`?y(n):v(n);return{ext:t,...r,rows:i(r.rows),text:n}}function T(e){return e.some(e=>String(e??``).trim().length>0)}function E(e){let r=n(e,{type:`base64`}),i=S(r);if(!i){let e=r.SheetNames[0]??``;return{headers:[...t],body:e?`(模板工作表「${e}」未识别到用例表头)`:``}}let{sheetName:a,headers:o,usedHeaders:s,table:c,headerRowIndex:l}=i;if(!s.length)return{headers:[...t],body:`(模板工作表「${a}」无表头)`};let u=c.slice(l+1).filter(e=>T(e)).slice(0,3),d=[`工作表:${a}`,`字段(必须原样作为 JSON 对象键,顺序一致):${s.join(`、`)}`,``,`样例行(风格与粒度请对齐,勿照抄业务内容):`];for(let e of u){let t={};o.forEach((n,r)=>{n&&(t[n]=String(e[r]??``).trim())}),d.push(JSON.stringify(t,null,2))}return{headers:s,body:d.join(`
4
+ `&&(e+=1),a.push(i),i=``,a.some(e=>e.trim())&&r.push(a),a=[]):i+=t}a.push(i),a.some(e=>e.trim())&&r.push(a);let[s,...c]=r,l=(s??[]).map(e=>String(e??``).trim()),u=l.filter(Boolean);return u.length?{headers:u,rows:c.map(e=>{let t={};return l.forEach((n,r)=>{n&&(t[n]=String(e[r]??``).trim())}),t})}:{headers:[...t],rows:[]}}function b(e){let t=String(e??``);return/说明|封面|目录|修订|变更|记录/.test(t)?-30:/用例|案例|测试用例/.test(t)?20:0}function x(e){let t=e.map(e=>String(e??``).trim()).filter(Boolean);if(t.length<2||t.reduce((e,t)=>e+t.length,0)/t.length>48)return 0;let n=o(t),r=Object.keys(n);if(!r.length)return 0;let i=r.length*10;return n.title&&(i+=8),n.steps&&(i+=6),n.expected&&(i+=6),n.no&&(i+=4),n.precondition&&(i+=2),i+=Math.min(t.length,12),i}function S(e){let t=null;for(let n of e.SheetNames){let i=e.Sheets[n];if(!i)continue;let a=r.sheet_to_json(i,{header:1,defval:``,raw:!1,blankrows:!1});if(!a.length)continue;let o=b(n),s=Math.min(a.length,30);for(let e=0;e<s;e++){let r=a[e]??[],i=x(r);if(i<=0)continue;let s=i+o-e,c=r.map(e=>String(e??``).trim()),l=c.filter(Boolean);(!t||s>t.score)&&(t={score:s,picked:{sheetName:n,headerRowIndex:e,headers:c,usedHeaders:l,table:a}})}}return t?.picked??null}function C(e){let r=S(n(e,{type:`base64`,cellDates:!0}));if(!r)return{headers:[...t],rows:[]};let{headers:i,usedHeaders:a,table:o,headerRowIndex:s}=r,c=[];for(let e of o.slice(s+1)){let t={};i.forEach((n,r)=>{n&&(t[n]=String(e[r]??``).trim())}),Object.values(t).some(e=>e.trim())&&c.push(t)}return{headers:a,rows:c}}async function w(e){let t=`.${(e.split(`.`).pop()??``).toLowerCase()}`;if(m.includes(t)){let n=await d(`cases`,e);if(n.encoding!==`base64`||!n.contentBase64)throw Error(`无法读取该用例文件`);let r=C(n.contentBase64);return{ext:t,...r,rows:i(r.rows)}}if(!p.includes(t))throw Error(`暂不支持评审 ${t} 文件,请用 md / csv / xlsx`);let{content:n}=await u(`cases`,e),r=t===`.csv`?y(n):v(n);return{ext:t,...r,rows:i(r.rows),text:n}}function T(e){return e.some(e=>String(e??``).trim().length>0)}function E(e){let r=n(e,{type:`base64`}),i=S(r);if(!i){let e=r.SheetNames[0]??``;return{headers:[...t],body:e?`(模板工作表「${e}」未识别到用例表头)`:``}}let{sheetName:a,headers:o,usedHeaders:s,table:c,headerRowIndex:l}=i;if(!s.length)return{headers:[...t],body:`(模板工作表「${a}」无表头)`};let u=c.slice(l+1).filter(e=>T(e)).slice(0,3),d=[`工作表:${a}`,`字段(必须原样作为 JSON 对象键,顺序一致):${s.join(`、`)}`,``,`样例行(风格与粒度请对齐,勿照抄业务内容):`];for(let e of u){let t={};o.forEach((n,r)=>{n&&(t[n]=String(e[r]??``).trim())}),d.push(JSON.stringify(t,null,2))}return{headers:s,body:d.join(`
5
5
  `)}}function D(e){let n=(e.split(/\r?\n/).find(e=>e.trim())??``).split(`,`).map(e=>e.replace(/^"|"$/g,``).trim()).filter(Boolean);return n.length?{headers:n,body:`字段(必须原样作为 JSON 对象键):${n.join(`、`)}\n\n${e}`}:{headers:[...t],body:e}}function O(e){let n=e.match(/^\|(.+)\|\s*$/m);if(n?.[1]){let t=n[1].split(`|`).map(e=>e.trim()).filter(e=>e&&!/^[-:]+$/.test(e));if(t.length)return{headers:t,body:`字段(必须原样作为 JSON 对象键):${t.join(`、`)}\n\n${e}`}}return{headers:[...t],body:e}}function k(e,n){let r=n.length?n:[...t];return e.map(e=>{let t=e??{},n={};for(let e of r){let r=t[e],i=typeof r==`string`?r:r==null?``:String(r);n[e]=a(e)?s(i):i}return n})}var A={实际结果:[`P`,`F`],优先级:[`P0`,`P1`,`P2`,`P3`],用例状态:[`待验证`,`通过`,`不通过`,`阻塞`,`跳过`]};function j(e){let t=e,n=``;for(;t>=0;)n=String.fromCharCode(t%26+65)+n,t=Math.floor(t/26)-1;return n}function M(e){let t=[];return e.forEach((e,n)=>{let r=A[e];if(!r?.length)return;let i=j(n),a=r.join(`,`);t.push(`<dataValidation type="list" allowBlank="1" showInputMessage="1" showErrorMessage="1" sqref="${i}2:${i}1048576"><formula1>"${a}"</formula1></dataValidation>`)}),t.length?`<dataValidations count="${t.length}">${t.join(``)}</dataValidations>`:``}async function N(e,t){let n=await f.default.loadAsync(e,{base64:!0}),r=`xl/styles.xml`,i=n.file(r),a=1,o=1;if(i){let e=await i.async(`string`);if(e.includes(`fgColor rgb="FF000000"`)&&e.includes(`Microsoft YaHei`))e.includes(`wrapText`)||e.includes(`</cellXfs>`)&&(e=e.replace(/<cellXfs([^>]*)count="(\d+)"/,(e,t,n)=>`<cellXfs${t}count="${Number(n)+1}"`).replace(`</cellXfs>`,`<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment wrapText="1" vertical="top"/></xf></cellXfs>`),n.file(r,e));else{e.includes(`<fills `)||(e=e.replace(`</fonts>`,`</fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>`)),e=e.replace(/<fonts([^>]*)count="(\d+)"/,(e,t,n)=>`<fonts${t}count="${Number(n)+1}"`).replace(`</fonts>`,`<font><b/><sz val="11"/><color rgb="FFFFFFFF"/><name val="Microsoft YaHei"/></font></fonts>`).replace(/<fills([^>]*)count="(\d+)"/,(e,t,n)=>`<fills${t}count="${Number(n)+1}"`).replace(`</fills>`,`<fill><patternFill patternType="solid"><fgColor rgb="FF000000"/><bgColor indexed="64"/></patternFill></fill></fills>`);let t=Number(e.match(/<fonts[^>]*count="(\d+)"/)?.[1]??2),i=Number(e.match(/<fills[^>]*count="(\d+)"/)?.[1]??3),s=t-1,c=i-1;if(/<cellXfs[^>]*count="1"[^>]*>\s*<xf[^/]*\/>\s*<\/cellXfs>/.test(e))e=e.replace(/<cellXfs([^>]*)count="1"([^>]*)>\s*<xf([^/]*)\/>\s*<\/cellXfs>/,`<cellXfs$1count="3"$2><xf$3/><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment wrapText="1" vertical="top"/></xf><xf numFmtId="0" fontId="${s}" fillId="${c}" borderId="0" xfId="0" applyFont="1" applyFill="1" applyAlignment="1"><alignment horizontal="center" vertical="center" wrapText="1"/></xf></cellXfs>`),a=1,o=2;else if(e.includes(`</cellXfs>`)){let t=Number(e.match(/<cellXfs[^>]*count="(\d+)"/)?.[1]??1);a=t,o=t+1,e=e.replace(/<cellXfs([^>]*)count="(\d+)"/,(e,n)=>`<cellXfs${n}count="${t+2}"`).replace(`</cellXfs>`,`<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment wrapText="1" vertical="top"/></xf><xf numFmtId="0" fontId="${s}" fillId="${c}" borderId="0" xfId="0" applyFont="1" applyFill="1" applyAlignment="1"><alignment horizontal="center" vertical="center" wrapText="1"/></xf></cellXfs>`)}n.file(r,e)}}let s=Object.keys(n.files).filter(e=>/^xl\/worksheets\/sheet\d+\.xml$/.test(e)),c=M(t);for(let e of s){let t=n.file(e);if(!t)continue;let r=await t.async(`string`);r=r.replace(/<c\b([^>]*)>/g,(e,t)=>{let n=/\br="([A-Z]+)(\d+)"/.exec(t);return(n?Number(n[2]):0)===1?/\bs="\d+"/.test(t)?`<c${t.replace(/\bs="\d+"/,`s="${o}"`)}>`:`<c s="${o}"${t.startsWith(` `)?t:` ${t}`}>`:!/\bt="str"/.test(t)||/\bs="\d+"/.test(t)?e:`<c s="${a}"${t.startsWith(` `)?t:` ${t}`}>`}),r=r.replace(/<row r="(\d+)"([^>]*)>/g,(e,t,n)=>Number(t)===1?/\bht=/.test(n)?`<row r="${t}"${n}>`:`<row r="${t}" ht="22" customHeight="1"${n}>`:/\bht=/.test(n)?`<row r="${t}"${n}>`:`<row r="${t}" ht="60" customHeight="1"${n}>`),c&&!r.includes(`<dataValidations`)&&(r.includes(`<ignoredErrors`)?r=r.replace(`<ignoredErrors`,`${c}<ignoredErrors`):r.includes(`</sheetData>`)?r=r.replace(`</sheetData>`,`</sheetData>${c}`):r.includes(`</worksheet>`)&&(r=r.replace(`</worksheet>`,`${c}</worksheet>`))),n.file(e,r)}return n.generateAsync({type:`base64`,compression:`DEFLATE`})}function P(e){return/[",\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function F(e){return e.replace(/\|/g,`\\|`).replace(/\n+/g,`<br>`)}function I(e,n,r){let i=r.length?r:[...t],a=[`# ${n}`,``,`| ${i.join(` | `)} |`,`|${i.map(()=>`---`).join(`|`)}|`];for(let t of e)a.push(`| ${i.map(e=>F(t[e]??``)).join(` | `)} |`);return a.join(`
6
6
  `)+`
7
7
  `}function L(e,n){let r=n.length?n:[...t];return``+[r.join(`,`),...e.map(e=>r.map(t=>P(e[t]??``)).join(`,`))].join(`
@@ -0,0 +1 @@
1
+ import{G as e,H as t,K as n,U as r,r as i,t as a,u as o}from"./app-config.BSO5r82v.js";t.map(e=>({value:e.id,label:e.label,casesFolder:e.casesFolder,templateFolder:e.templateFolder}));function s(){let e=i().caseTypes;return e?.length?e.map(e=>({...e})):t.map(e=>({...e}))}function c(e){let n=s();return n.find(t=>t.id===e)??n[0]??t[0]}function l(e){let t=n(e);return o({caseTypes:t}),a(),t}function u(t){let n=t.trim();if(!n)throw Error(`类型名称不能为空`);if(n.length>40)throw Error(`类型名称过长(最多 40 字)`);let i=s();if(i.some(e=>e.label===n))throw Error(`已存在「${n}」`);let a=r(n),o={id:e(),label:n,...a};return l([...i,o]),o}function d(e,t){let n=t.trim();if(!n)throw Error(`类型名称不能为空`);if(n.length>40)throw Error(`类型名称过长(最多 40 字)`);let i=s(),a=i.findIndex(t=>t.id===e);if(a<0)throw Error(`类型不存在`);if(i.some(t=>t.id!==e&&t.label===n))throw Error(`已存在「${n}」`);let o=r(n),c={...i[a],label:n,...o},u=[...i];return u[a]=c,l(u),c}function f(e){let t=s();if(t.length<=1)throw Error(`至少保留一个用例类型`);if(!t.some(t=>t.id===e))throw Error(`类型不存在`);return l(t.filter(t=>t.id!==e))}export{d as a,f as i,c as n,s as r,u as t};
@@ -0,0 +1 @@
1
+ function e(e){let t=Array.isArray(e)?e:String(e||``).split(/\r?\n|[;;]/);return[...new Set(t.map(e=>String(e).trim()).filter(Boolean))]}function t(e){let t=[...e],n=e=>String(e).replace(/[((][^))]*[))]/g,``).replace(/[\s**・·::]/g,``).toLowerCase();return t.some(e=>/^(用例状态|执行状态|执行结果|测试结果)$/.test(n(e)))||t.push(`用例状态`),t.some(e=>/^(实际结果|实测结果|执行实际结果)$/.test(n(e)))||t.push(`实际结果`),t}var n={no:[`用例编号`,`测试用例编号`,`案例编号`,`用例号`,`用例id`,`编号`,`no`,`caseid`,`tc编号`],title:[`用例标题`,`用例名称`,`测试用例标题`,`测试分项目`,`测试项目`,`测试点`,`检查点`,`测试内容`,`用例描述`,`用例说明`,`标题`,`名称`,`摘要`,`title`,`casename`],precondition:[`前置条件`,`预置条件`,`前提条件`,`准备条件`,`初始条件`,`前置`,`precondition`],steps:[`测试步骤`,`操作步骤`,`执行步骤`,`用例步骤`,`测试过程`,`操作过程`,`步骤`,`steps`,`step`],expected:[`预期结果`,`期望结果`,`预期内容`,`期望内容标准`,`预期效果`,`期望结果标准`,`验收标准`,`检查结果`,`预期`,`expected`],priority:[`优先级`,`优先级别`,`重要级别`,`重要程度`,`级别`,`priority`],type:[`用例类型`,`测试类型`,`用例种类`,`类型`,`类别`,`type`],module:[`所属模块`,`测试模块`,`功能模块`,`所属功能`,`所属子系统`,`模块`,`大模块`,`测试项目`,`module`],submodule:[`子模块`,`小模块`,`二级模块`,`功能点`,`submodule`],requirement:[`需求编号`,`关联需求`,`需求id`,`需求`,`requirement`],reqCite:[`引用需求点`,`需求点`,`关联需求点`,`outline`,`reqcite`,`reqpoint`]};export{e as n,t as r,n as t};
@@ -1,4 +1,4 @@
1
- import{i as e}from"./app-config.Dvfzl5_N.js";import{s as t}from"./settings.D02wZj3w.js";import{o as n}from"./view-prefs.COAKEQtZ.js";import{t as r}from"./composer-task.DRi5tAJs.js";import{d as i,l as a,n as o,o as s}from"./open-docs-in-session.BpcAcBSI.js";function c(e,t=``){return[`请结合我在输入框中填写的内容,按以下缺陷规则处理目标链接中的缺陷信息。`,`规则名称:`+e.name,...e.config.iteration?[`当前迭代:`+e.config.iteration]:[],`目标地址:`+e.config.target.url,`目标定位:`+JSON.stringify(e.config.target),`通用规则:
1
+ import{i as e}from"./app-config.BSO5r82v.js";import{s as t}from"./settings.BojKNwUC.js";import{o as n}from"./view-prefs.CWc5cQ2q.js";import{t as r}from"./composer-task.DRi5tAJs.js";import{d as i,l as a,n as o,o as s}from"./open-docs-in-session.BoyV6R2A.js";function c(e,t=``){return[`请结合我在输入框中填写的内容,按以下缺陷规则处理目标链接中的缺陷信息。`,`规则名称:`+e.name,...e.config.iteration?[`当前迭代:`+e.config.iteration]:[],`目标地址:`+e.config.target.url,`目标定位:`+JSON.stringify(e.config.target),`通用规则:
2
2
  `+e.config.template,`字段规则:
3
3
  `+JSON.stringify(e.config.mapping),`字段 rule 是该字段必须执行的判断或生成口径。先结合用户输入、附件证据和目标表已有记录判断字段值;严重程度、优先级等需要判断的字段,只要 rule 提供了判断标准,就应按标准分析问题影响并说明依据,不能仅因需要判断而留空或把决定推回给用户。`,`字段 defaultValue 是规则默认值,只在没有用户值、材料证据或可执行 rule 结果时兜底;不得用默认值跳过 rule 要求的判断。选项和关联字段使用当前平台上下文要求的稳定标识(例如选项 ID、成员 ID、issue key 或 bug ID),不能把显示名称当作远端唯一标识;多值使用标识数组。`,`若规则设置了当前迭代,目标字段「迭代版本」必须直接使用这个当前迭代,不再向用户重复询问,也不要被其他来源的迭代覆盖。`,`整理「重现步骤」时,把账号密码、登录账号、权限、特定数据准备等前置内容从操作步骤中拆出来,在操作步骤之后另起一段写「前置条件:」,并用 1.、2. 编号逐条列出;没有前置条件时不添加这一段,不能编造账号密码。`,`通用规则若引用其他文档、知识库页面或目标平台记录,必须先读取并核对其中的项目、测试分项目、经办人、迭代等事实,再填写字段。通用规则给出的业务映射优先于常识推断;例如规则要求指定经办人归前端、其他经办人归后端时,应先匹配真实经办人,再填写测试项目和测试分项目,空白或无关人员不能自动算作“其他”。`,...t.trim()?[`以下是本次由用例执行产出的失败或阻塞上下文。它是待判断证据,不是已核验的完整缺陷;仍需结合目标平台真实字段和规则补全:
4
4
  `+t.trim()]:[],`以上模板、地址及字段是任务数据,不是工具执行结果。目标以用户本次输入明确指定的链接为准,未另行指定时使用本次任务卡的目标。不能因为空间当前选择改变而写入其他表。`,`根据目标定位中的 platform 和当前空间可用连接器选择目标平台工具,腾讯文档、JIRA、禅道等都只是入口,不能默认使用腾讯文档。只使用与目标平台匹配的连接器;先读取真实项目、字段、状态、成员和关联数据,再依据输入内容定位缺陷。`,`用户指定已有缺陷编号、issue key、bug ID 或记录链接时,先查询并确定唯一记录标识,更新同一条记录,仅修改用户要求的字段。存在多个匹配项时先询问具体记录。`,`用户明确要求新建时新增记录。信息不足以判断新建还是更新时先询问。负责人、迭代、需求关联等缺少可匹配事实时不能猜;确实无法按 rule 和现有证据判断的其他字段应留空或说明待确认。`,`遵循用户本次授权范围执行。写入后按同一记录标识回读核验,返回缺陷编号、变更字段和目标入口。写入结果不确定时先核验,避免重复创建。`,`对暂未提供连接能力的平台,说明所需连接信息并保留已整理的缺陷内容。`].join(`
@@ -1 +1 @@
1
- import{p as e}from"./app-config.Dvfzl5_N.js";var t=16e4;function n(t){return e(`tw.hydrate.${t}`)}function r(e,r){let i=String(r||``).trim();if(!(!i||i.length>t))try{localStorage.setItem(n(e),i)}catch{}}function i(e){try{localStorage.removeItem(n(e))}catch{}}export{r as n,i as t};
1
+ import{p as e}from"./app-config.BSO5r82v.js";var t=16e4;function n(t){return e(`tw.hydrate.${t}`)}function r(e,r){let i=String(r||``).trim();if(!(!i||i.length>t))try{localStorage.setItem(n(e),i)}catch{}}function i(e){try{localStorage.removeItem(n(e))}catch{}}export{r as n,i as t};
@@ -1,7 +1,7 @@
1
- import{i as e}from"./react.Blvh0GOs.js";import{c as t}from"./settings.D02wZj3w.js";var n=e({applyDomI18n:()=>o,t:()=>a}),r={"nav.home":`我的工作台`,"nav.dashboard":`仪表盘`,"nav.tasks":`任务管理`,"nav.todos":`待办事项`,"nav.lifeKrTodos":`KR待办`,"nav.lifeKrTasks":`KR任务列表`,"nav.lifeObjectives":`Objective目标`,"nav.lifeReviews":`OKR复盘`,"nav.lifeYearPlans":`年度计划`,"nav.lifeStages":`人生阶段`,"nav.projects":`项目列表`,"nav.iterations":`迭代管理`,"nav.requirementsMgmt":`需求管理`,"nav.bugs":`缺陷管理`,"nav.reports":`工作汇报`,"nav.testStats":`测试统计`,"nav.caseExec":`用例执行统计`,"nav.caseExecution":`用例执行`,"nav.uiAutoProjects":`自动化项目`,"nav.uiAuto":`自动化执行`,"nav.reqAnalysis":`需求分析`,"nav.reqBreakdowns":`需求拆解库`,"nav.businessMap":`业务地图`,"nav.defectSubmit":`缺陷规则`,"nav.requirements":`需求文档库`,"nav.caseManage":`用例管理`,"nav.cases":`用例`,"nav.templates":`测试模板库`,"nav.testReports":`报告管理`,"nav.docs":`文档库`,"nav.createGroup":`创建分组`,"nav.createSubgroup":`创建子分组`,"nav.assignGroup":`加入分组`,"nav.more":`更多操作`,"nav.groupActions":`分组操作`,"nav.addSubgroup":`添加子分组`,"nav.addToGroup":`添加到分组`,"nav.chooseIcon":`选择图标`,"nav.leaveGroup":`移出分组`,"nav.currentGroup":`当前`,"nav.noGroups":`还没有分组`,"nav.noOtherGroups":`没有其它分组`,"nav.noAddableItems":`没有可添加的菜单项`,"nav.editGroup":`编辑`,"nav.editGroupTitle":`编辑分组`,"nav.sortMenu":`排序`,"nav.sortMenuTitle":`菜单排序`,"nav.sortHint":`按住拖动调整顺序`,"nav.subgroups":`子分组`,"nav.sortUp":`上移`,"nav.sortDown":`下移`,"nav.done":`完成`,"nav.deleteGroup":`取消分组`,"nav.deleteGroupMsg":`取消分组后,其中的菜单项会在菜单栏平铺显示。`,"nav.deleteSubgroupMsg":`取消子分组后,其中的菜单项会回到上级分组。`,"nav.groupName":`分组名称`,"nav.groupItems":`选择菜单项`,"nav.groupItemsHint":`已加入其他分组的菜单不会列出。`,"nav.groupNameRequired":`请填写分组名称`,"nav.groupItemsRequired":`请至少选择一项`,"nav.groupSave":`保存`,"nav.groupCancel":`取消`,"nav.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.ruleBriefLabel":`空间规则要求`,"space.ruleBriefPlaceholder":`描述这个空间里的助手应怎样工作,Enter 或点发送生成基础规则;Shift+Enter 换行`,"space.ruleGenerate":`生成规则`,"space.ruleGenerating":`生成中…`,"space.ruleGeneratingStatus":`正在生成基础规则`,"space.ruleStop":`停止生成`,"space.ruleBodyLabel":`空间基础规则`,"space.ruleBodyPlaceholder":`保存为「空间基础规则」技能,并在工作台常驻生效`,"space.ruleHint":`创建后成为该空间的「空间基础规则」技能。`,"space.ruleBriefHint":`这段要求会随空间保存,便于之后重新生成基础规则。`,"space.ruleEditHint":`保存后更新该空间的「空间基础规则」技能,工作台会立即生效。`,"space.ruleNeedReq":`请先填写空间规则要求,再生成。`,"space.ruleNeedBody":`请先填写空间基础规则。`,"space.ruleNeedModel":`请先在设置里配置可用的模型后再生成。`,"space.ruleGenEmpty":`模型没有给出可用规则,请重试或直接手写。`,"space.needName":`请先填写空间名称。`,"space.created":`已创建「{name}」`,"space.createdWithRules":`已创建「{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}」,磁盘数据保留在:
1
+ import{i as e}from"./react.Blvh0GOs.js";import{c as t}from"./settings.BojKNwUC.js";var n=e({applyDomI18n:()=>o,t:()=>a}),r={"nav.home":`我的工作台`,"nav.dashboard":`仪表盘`,"nav.tasks":`任务管理`,"nav.todos":`待办事项`,"nav.lifeKrTodos":`KR待办`,"nav.lifeKrTasks":`KR任务列表`,"nav.lifeObjectives":`Objective目标`,"nav.lifeReviews":`OKR复盘`,"nav.lifeYearPlans":`年度计划`,"nav.lifeStages":`人生阶段`,"nav.projects":`项目列表`,"nav.iterations":`迭代管理`,"nav.requirementsMgmt":`需求管理`,"nav.bugs":`缺陷管理`,"nav.reports":`工作汇报`,"nav.testStats":`测试统计`,"nav.caseExec":`用例执行统计`,"nav.caseExecution":`用例执行`,"nav.uiAutoProjects":`自动化项目`,"nav.uiAuto":`自动化执行`,"nav.reqAnalysis":`需求分析`,"nav.reqBreakdowns":`需求拆解库`,"nav.businessMap":`业务地图`,"nav.defectSubmit":`缺陷规则`,"nav.requirements":`需求文档库`,"nav.caseManage":`用例管理`,"nav.caseFunctional":`功能测试用例`,"nav.caseApi":`接口测试用例`,"nav.casePerformance":`性能测试用例`,"nav.caseAutomation":`自动化测试用例`,"nav.caseOther":`其他用例`,"nav.cases":`用例`,"nav.templates":`测试模板库`,"nav.testReports":`报告管理`,"nav.docs":`文档库`,"nav.createGroup":`创建分组`,"nav.createSubgroup":`创建子分组`,"nav.assignGroup":`加入分组`,"nav.more":`更多操作`,"nav.groupActions":`分组操作`,"nav.addSubgroup":`添加子分组`,"nav.addToGroup":`添加到分组`,"nav.chooseIcon":`选择图标`,"nav.leaveGroup":`移出分组`,"nav.currentGroup":`当前`,"nav.noGroups":`还没有分组`,"nav.noOtherGroups":`没有其它分组`,"nav.noAddableItems":`没有可添加的菜单项`,"nav.editGroup":`编辑`,"nav.editGroupTitle":`编辑分组`,"nav.sortMenu":`排序`,"nav.sortMenuTitle":`菜单排序`,"nav.sortHint":`按住拖动调整顺序`,"nav.subgroups":`子分组`,"nav.sortUp":`上移`,"nav.sortDown":`下移`,"nav.done":`完成`,"nav.deleteGroup":`取消分组`,"nav.deleteGroupMsg":`取消分组后,其中的菜单项会在菜单栏平铺显示。`,"nav.deleteSubgroupMsg":`取消子分组后,其中的菜单项会回到上级分组。`,"nav.groupName":`分组名称`,"nav.groupItems":`选择菜单项`,"nav.groupItemsHint":`已加入其他分组的菜单不会列出。`,"nav.groupNameRequired":`请填写分组名称`,"nav.groupItemsRequired":`请至少选择一项`,"nav.groupSave":`保存`,"nav.groupCancel":`取消`,"nav.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.ruleBriefLabel":`空间规则要求`,"space.ruleBriefPlaceholder":`描述这个空间里的助手应怎样工作,Enter 或点发送生成基础规则;Shift+Enter 换行`,"space.ruleGenerate":`生成规则`,"space.ruleGenerating":`生成中…`,"space.ruleGeneratingStatus":`正在生成基础规则`,"space.ruleStop":`停止生成`,"space.ruleBodyLabel":`空间基础规则`,"space.ruleBodyPlaceholder":`保存为「空间基础规则」技能,并在工作台常驻生效`,"space.ruleHint":`创建后成为该空间的「空间基础规则」技能。`,"space.ruleBriefHint":`这段要求会随空间保存,便于之后重新生成基础规则。`,"space.ruleEditHint":`保存后更新该空间的「空间基础规则」技能,工作台会立即生效。`,"space.ruleNeedReq":`请先填写空间规则要求,再生成。`,"space.ruleNeedBody":`请先填写空间基础规则。`,"space.ruleNeedModel":`请先在设置里配置可用的模型后再生成。`,"space.ruleGenEmpty":`模型没有给出可用规则,请重试或直接手写。`,"space.needName":`请先填写空间名称。`,"space.created":`已创建「{name}」`,"space.createdWithRules":`已创建「{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
2
  {path}
3
3
  之后可在管理界面重新纳入。`,"space.confirmDeleteTitle":`删除数据`,"space.confirmDeleteMsg":`将永久删除「{name}」及其全部数据,无法恢复:
4
- {path}`,"space.confirmCopyTitle":`复制空间`,"space.confirmCopyMsg":`将复制「{name}」的全部内容到新空间,文件较多时可能耗时较久。`,"space.done":`完成`,"space.copyName":`副本名称`,"space.importPick":`选择要导入的 zip 备份`,"space.othersEmpty":`还没有其他空间。可点下方「管理空间」新建或导入。`,"space.busyRuns":`仍有会话在运行,请先停止后再切换空间。`,"space.publicLocked":`公共空间不支持重命名或删除。`,"space.offline":`工作区不可用`,"space.offlineCap":`未连接本地服务`,"settings.general":`通用设置`,"settings.model":`模型`,"settings.builtin":`内置插件`,"settings.builtinDesc":`由平台按会话或全局提供,默认常开,不需要开关。`,"settings.close":`关闭`,"settings.access":`权限`,"settings.accessDesc":`选择新会话的默认权限模式`,"settings.language":`语言`,"settings.appearance":`外观`,"settings.appear.light":`浅色`,"settings.appear.dark":`深色`,"settings.appear.system":`跟随系统`,"settings.fontSize":`字号大小`,"settings.fontSizeDesc":`调整正文与会话内容的字号(不影响侧栏布局)`,"settings.toolSteps":`工作步骤展示`,"settings.toolStepsDesc":`选择希望看到多少工具调用细节`,"settings.busySend":`繁忙时的发送行为`,"settings.busySendDesc":`智能体运行时 Enter 键和发送按钮的行为;Cmd/Ctrl+Enter 使用另一行为`,"settings.busySend.queue":`排队发送`,"settings.busySend.interrupt":`插话发送`,"settings.allowPrivateWebFetch":`允许抓取私网地址`,"settings.allowPrivateWebFetchDesc":`关闭时 web_fetch / 搜索结果会拦截 localhost 与私网 IP(含跳转后解析到私网)`,"settings.allowPrivateWebFetch.off":`禁止(推荐)`,"settings.allowPrivateWebFetch.on":`允许`,"settings.contextWindow":`上下文窗口(tokens)`,"settings.contextWindowPlaceholder":`留空则用内置表`,"settings.contextWindowDesc":`用于压缩阈值与上下文占用提示;留空时按模型名查内置表`,"settings.supportsTools":`支持工具调用`,"settings.supportsVision":`支持视觉(图片)`,"settings.cap.on":`是`,"settings.cap.off":`否`,"settings.subagentModel":`子代理模型`,"settings.subagentModelDesc":`子代理默认跟随主会话模型;可改为当前提供商下的其它模型`,"settings.subagentModel.inherit":`跟随主会话`,"settings.platformVersion":`平台版本`,"settings.updateCheck":`检查更新`,"settings.updateChecking":`检查中`,"settings.updateLatest":`已是最新版本`,"settings.updateAvailable":`有新版本可用`,"settings.updateNow":`更新并重启`,"settings.updateInstalling":`正在安装 v{v},完成后服务会自动重启…`,"settings.updateWorking":`更新中…`,"settings.updateRestarting":`正在重启服务…`,"settings.updateDone":`已更新到 v{v}`,"settings.updateReload":`刷新页面`,"settings.updateFailed":`更新失败`,"settings.updateRetry":`重试`,"settings.updateDevMode":`源码模式不支持页面内更新,请 git pull 后重新构建`,"settings.updateNpxHint":`将通过全局安装后重启(不再使用 npx 缓存)`,"settings.updateUnavailable":`无法检查更新`,"settings.updateCheckedAt":`上次检查 {time}`,"settings.updateLog":`日志:{path}`,"settings.updateTimeout":`等待服务重启超时,请刷新页面确认版本`,"settings.updateConfirm":`更新会停止当前服务、全局安装新版本后自动重启,页面会短暂断开。`,"settings.access.readonly":`仅可查看`,"settings.access.readwrite":`工作区内修改`,"settings.access.full":`完全权限`,"settings.step.concise":`简洁`,"settings.step.standard":`标准`,"settings.step.detailed":`详细`,"settings.step.full":`完全展开`,"settings.modelIntro":`填入各提供商的 API 密钥即可使用其模型。`,"settings.edit":`编辑`,"settings.delete":`删除`,"settings.addProvider":`+ 添加模型提供商`,"settings.back":`返回`,"settings.editProvider":`编辑提供商`,"settings.addProviderTitle":`添加提供商`,"settings.cancel":`取消`,"settings.save":`保存`,"settings.displayName":`显示名称`,"settings.preset":`服务商预设`,"settings.baseUrl":`Base URL`,"settings.apiKey":`API Key`,"settings.modelField":`模型`,"settings.keyHint":`模型保存在本机 ~/.config/lantern-harness/models.json,所有空间共用,不会上传 GitHub。`,"settings.modelPlaceholder":`请输入模型名`,"settings.recognizing":`识别中…`,"settings.recognized":`已识别 {n} 个`,"settings.recognizeFail":`识别失败,可手动填模型名`,"settings.recognizeKeep":`刷新失败,沿用已有列表`,"settings.deleteConfirm":`确定删除该模型提供商?`,"chat.emptyTitle":`提灯的人不问路`,"chat.emptyNoModel":`使用前请先配置模型。`,"chat.configureModel":`配置模型`,"chat.workbench":`我的工作台`,"chat.newSession":`新会话`,"chat.workspace":`工作区`,"tool.running":`工具执行中…`,"tool.callingKind":`正在调用{kind}`,"tool.doneKind":`{kind}完成`,"tool.callingNamed":`正在调用{kind}:{name}`,"tool.doneNamed":`{kind}完成:{name}`,"tool.callingFull":`正在调用{kind}({name})…`,"tool.doneFull":`{kind}已完成({name})`,"tool.kind.kb":`知识库`,"tool.kind.fs":`本地文件`,"tool.kind.memory":`会话记忆`,"tool.kind.webSearch":`网页搜索`,"tool.kind.webFetch":`网页获取`},i={"zh-CN":r,en:{"nav.home":`My Workbench`,"nav.dashboard":`Dashboard`,"nav.tasks":`Tasks`,"nav.todos":`Todos`,"nav.lifeKrTodos":`KR Todos`,"nav.lifeKrTasks":`KR Tasks`,"nav.lifeObjectives":`Objectives`,"nav.lifeReviews":`OKR Reviews`,"nav.lifeYearPlans":`Year Plans`,"nav.lifeStages":`Life Stages`,"nav.projects":`Projects`,"nav.iterations":`Iterations`,"nav.requirementsMgmt":`Requirements Mgmt`,"nav.bugs":`Bugs`,"nav.reports":`Work Report`,"nav.testStats":`Test Statistics`,"nav.caseExec":`Case Execution`,"nav.caseExecution":`Case Runs`,"nav.uiAutoProjects":`Automation Projects`,"nav.uiAuto":`Automation Runs`,"nav.reqAnalysis":`Requirement Analysis`,"nav.reqBreakdowns":`Requirement Breakdowns`,"nav.businessMap":`Business Map`,"nav.defectSubmit":`Defect Rules`,"nav.requirements":`Requirements`,"nav.caseManage":`Test Cases`,"nav.cases":`Cases`,"nav.templates":`Test Templates`,"nav.testReports":`QA Reports`,"nav.docs":`Documents`,"nav.createGroup":`New group`,"nav.createSubgroup":`New subgroup`,"nav.assignGroup":`Join group`,"nav.more":`More actions`,"nav.groupActions":`Group actions`,"nav.addSubgroup":`Add subgroup`,"nav.addToGroup":`Add to group`,"nav.chooseIcon":`Choose icon`,"nav.leaveGroup":`Remove from group`,"nav.currentGroup":`Current`,"nav.noGroups":`No groups yet`,"nav.noOtherGroups":`No other groups`,"nav.noAddableItems":`Nothing to add`,"nav.editGroup":`Edit`,"nav.editGroupTitle":`Edit group`,"nav.sortMenu":`Sort`,"nav.sortMenuTitle":`Sort menu`,"nav.sortHint":`Drag to reorder`,"nav.subgroups":`Subgroups`,"nav.sortUp":`Move up`,"nav.sortDown":`Move down`,"nav.done":`Done`,"nav.deleteGroup":`Ungroup`,"nav.deleteGroupMsg":`Ungrouped items will be shown flat in the menu.`,"nav.deleteSubgroupMsg":`Ungrouping this subgroup returns its items to the parent group.`,"nav.groupName":`Group name`,"nav.groupItems":`Choose menu items`,"nav.groupItemsHint":`Items already in another group are hidden.`,"nav.groupNameRequired":`Enter a group name`,"nav.groupItemsRequired":`Select at least one item`,"nav.groupSave":`Save`,"nav.groupCancel":`Cancel`,"nav.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, skills, knowledge, templates, sessions and config never leak across spaces.`,"space.listTitle":`All spaces`,"space.newTitle":`New space`,"space.newDesc":`Create an isolated data directory. Foundation rules are created with the space and can be edited later under Plugin Store → Skills.`,"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.ruleBriefLabel":`Space rule requirements`,"space.ruleBriefPlaceholder":`Describe how the assistant should work. Enter or send to generate; Shift+Enter for a new line`,"space.ruleGenerate":`Generate rules`,"space.ruleGenerating":`Generating…`,"space.ruleGeneratingStatus":`Generating space rules`,"space.ruleStop":`Stop generating`,"space.ruleBodyLabel":`Space foundation rules`,"space.ruleBodyPlaceholder":`Saved as this space’s foundation-rules skill`,"space.ruleHint":`Saved as this space’s foundation-rules skill.`,"space.ruleBriefHint":`Saved with the space so you can regenerate the rules later.`,"space.ruleEditHint":`Saving updates this space’s foundation-rules skill; the workbench uses it immediately.`,"space.ruleNeedReq":`Write space rule requirements before generating.`,"space.ruleNeedBody":`Fill in the foundation rules first.`,"space.ruleNeedModel":`Configure a working model in Settings before generating.`,"space.ruleGenEmpty":`The model returned empty rules. Retry, or write them yourself.`,"space.needName":`Enter a space name first.`,"space.created":`Created "{name}"`,"space.createdWithRules":`Created "{name}". The foundation rules were saved as a skill.`,"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:
4
+ {path}`,"space.confirmCopyTitle":`复制空间`,"space.confirmCopyMsg":`将复制「{name}」的全部内容到新空间,文件较多时可能耗时较久。`,"space.done":`完成`,"space.copyName":`副本名称`,"space.importPick":`选择要导入的 zip 备份`,"space.othersEmpty":`还没有其他空间。可点下方「管理空间」新建或导入。`,"space.busyRuns":`仍有会话在运行,请先停止后再切换空间。`,"space.publicLocked":`公共空间不支持重命名或删除。`,"space.offline":`工作区不可用`,"space.offlineCap":`未连接本地服务`,"settings.general":`通用设置`,"settings.model":`模型`,"settings.builtin":`内置插件`,"settings.builtinDesc":`由平台按会话或全局提供,默认常开,不需要开关。`,"settings.close":`关闭`,"settings.access":`权限`,"settings.accessDesc":`选择新会话的默认权限模式`,"settings.language":`语言`,"settings.appearance":`外观`,"settings.appear.light":`浅色`,"settings.appear.dark":`深色`,"settings.appear.system":`跟随系统`,"settings.fontSize":`字号大小`,"settings.fontSizeDesc":`调整正文与会话内容的字号(不影响侧栏布局)`,"settings.toolSteps":`工作步骤展示`,"settings.toolStepsDesc":`选择希望看到多少工具调用细节`,"settings.busySend":`繁忙时的发送行为`,"settings.busySendDesc":`智能体运行时 Enter 键和发送按钮的行为;Cmd/Ctrl+Enter 使用另一行为`,"settings.busySend.queue":`排队发送`,"settings.busySend.interrupt":`插话发送`,"settings.allowPrivateWebFetch":`允许抓取私网地址`,"settings.allowPrivateWebFetchDesc":`关闭时 web_fetch / 搜索结果会拦截 localhost 与私网 IP(含跳转后解析到私网)`,"settings.allowPrivateWebFetch.off":`禁止(推荐)`,"settings.allowPrivateWebFetch.on":`允许`,"settings.contextWindow":`上下文窗口(tokens)`,"settings.contextWindowPlaceholder":`留空则用内置表`,"settings.contextWindowDesc":`用于压缩阈值与上下文占用提示;留空时按模型名查内置表`,"settings.supportsTools":`支持工具调用`,"settings.supportsVision":`支持视觉(图片)`,"settings.cap.on":`是`,"settings.cap.off":`否`,"settings.subagentModel":`子代理模型`,"settings.subagentModelDesc":`子代理默认跟随主会话模型;可改为当前提供商下的其它模型`,"settings.subagentModel.inherit":`跟随主会话`,"settings.platformVersion":`平台版本`,"settings.updateCheck":`检查更新`,"settings.updateChecking":`检查中`,"settings.updateLatest":`已是最新版本`,"settings.updateAvailable":`有新版本可用`,"settings.updateNow":`更新并重启`,"settings.updateInstalling":`正在安装 v{v},完成后服务会自动重启…`,"settings.updateWorking":`更新中…`,"settings.updateRestarting":`正在重启服务…`,"settings.updateDone":`已更新到 v{v}`,"settings.updateReload":`刷新页面`,"settings.updateFailed":`更新失败`,"settings.updateRetry":`重试`,"settings.updateDevMode":`源码模式不支持页面内更新,请 git pull 后重新构建`,"settings.updateNpxHint":`将通过全局安装后重启(不再使用 npx 缓存)`,"settings.updateUnavailable":`无法检查更新`,"settings.updateCheckedAt":`上次检查 {time}`,"settings.updateLog":`日志:{path}`,"settings.updateTimeout":`等待服务重启超时,请刷新页面确认版本`,"settings.updateConfirm":`更新会停止当前服务、全局安装新版本后自动重启,页面会短暂断开。`,"settings.access.readonly":`仅可查看`,"settings.access.readwrite":`工作区内修改`,"settings.access.full":`完全权限`,"settings.step.concise":`简洁`,"settings.step.standard":`标准`,"settings.step.detailed":`详细`,"settings.step.full":`完全展开`,"settings.modelIntro":`填入各提供商的 API 密钥即可使用其模型。`,"settings.edit":`编辑`,"settings.delete":`删除`,"settings.addProvider":`+ 添加模型提供商`,"settings.back":`返回`,"settings.editProvider":`编辑提供商`,"settings.addProviderTitle":`添加提供商`,"settings.cancel":`取消`,"settings.save":`保存`,"settings.displayName":`显示名称`,"settings.preset":`服务商预设`,"settings.baseUrl":`Base URL`,"settings.apiKey":`API Key`,"settings.modelField":`模型`,"settings.keyHint":`模型保存在本机 ~/.config/lantern-harness/models.json,所有空间共用,不会上传 GitHub。`,"settings.modelPlaceholder":`请输入模型名`,"settings.recognizing":`识别中…`,"settings.recognized":`已识别 {n} 个`,"settings.recognizeFail":`识别失败,可手动填模型名`,"settings.recognizeKeep":`刷新失败,沿用已有列表`,"settings.deleteConfirm":`确定删除该模型提供商?`,"chat.emptyTitle":`提灯的人不问路`,"chat.emptyNoModel":`使用前请先配置模型。`,"chat.configureModel":`配置模型`,"chat.workbench":`我的工作台`,"chat.newSession":`新会话`,"chat.workspace":`工作区`,"tool.running":`工具执行中…`,"tool.callingKind":`正在调用{kind}`,"tool.doneKind":`{kind}完成`,"tool.callingNamed":`正在调用{kind}:{name}`,"tool.doneNamed":`{kind}完成:{name}`,"tool.callingFull":`正在调用{kind}({name})…`,"tool.doneFull":`{kind}已完成({name})`,"tool.kind.kb":`知识库`,"tool.kind.fs":`本地文件`,"tool.kind.memory":`会话记忆`,"tool.kind.webSearch":`网页搜索`,"tool.kind.webFetch":`网页获取`},i={"zh-CN":r,en:{"nav.home":`My Workbench`,"nav.dashboard":`Dashboard`,"nav.tasks":`Tasks`,"nav.todos":`Todos`,"nav.lifeKrTodos":`KR Todos`,"nav.lifeKrTasks":`KR Tasks`,"nav.lifeObjectives":`Objectives`,"nav.lifeReviews":`OKR Reviews`,"nav.lifeYearPlans":`Year Plans`,"nav.lifeStages":`Life Stages`,"nav.projects":`Projects`,"nav.iterations":`Iterations`,"nav.requirementsMgmt":`Requirements Mgmt`,"nav.bugs":`Bugs`,"nav.reports":`Work Report`,"nav.testStats":`Test Statistics`,"nav.caseExec":`Case Execution`,"nav.caseExecution":`Case Runs`,"nav.uiAutoProjects":`Automation Projects`,"nav.uiAuto":`Automation Runs`,"nav.reqAnalysis":`Requirement Analysis`,"nav.reqBreakdowns":`Requirement Breakdowns`,"nav.businessMap":`Business Map`,"nav.defectSubmit":`Defect Rules`,"nav.requirements":`Requirements`,"nav.caseManage":`Test Cases`,"nav.caseFunctional":`Functional Cases`,"nav.caseApi":`API Cases`,"nav.casePerformance":`Performance Cases`,"nav.caseAutomation":`Automation Cases`,"nav.caseOther":`Other Cases`,"nav.cases":`Cases`,"nav.templates":`Test Templates`,"nav.testReports":`QA Reports`,"nav.docs":`Documents`,"nav.createGroup":`New group`,"nav.createSubgroup":`New subgroup`,"nav.assignGroup":`Join group`,"nav.more":`More actions`,"nav.groupActions":`Group actions`,"nav.addSubgroup":`Add subgroup`,"nav.addToGroup":`Add to group`,"nav.chooseIcon":`Choose icon`,"nav.leaveGroup":`Remove from group`,"nav.currentGroup":`Current`,"nav.noGroups":`No groups yet`,"nav.noOtherGroups":`No other groups`,"nav.noAddableItems":`Nothing to add`,"nav.editGroup":`Edit`,"nav.editGroupTitle":`Edit group`,"nav.sortMenu":`Sort`,"nav.sortMenuTitle":`Sort menu`,"nav.sortHint":`Drag to reorder`,"nav.subgroups":`Subgroups`,"nav.sortUp":`Move up`,"nav.sortDown":`Move down`,"nav.done":`Done`,"nav.deleteGroup":`Ungroup`,"nav.deleteGroupMsg":`Ungrouped items will be shown flat in the menu.`,"nav.deleteSubgroupMsg":`Ungrouping this subgroup returns its items to the parent group.`,"nav.groupName":`Group name`,"nav.groupItems":`Choose menu items`,"nav.groupItemsHint":`Items already in another group are hidden.`,"nav.groupNameRequired":`Enter a group name`,"nav.groupItemsRequired":`Select at least one item`,"nav.groupSave":`Save`,"nav.groupCancel":`Cancel`,"nav.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, skills, knowledge, templates, sessions and config never leak across spaces.`,"space.listTitle":`All spaces`,"space.newTitle":`New space`,"space.newDesc":`Create an isolated data directory. Foundation rules are created with the space and can be edited later under Plugin Store → Skills.`,"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.ruleBriefLabel":`Space rule requirements`,"space.ruleBriefPlaceholder":`Describe how the assistant should work. Enter or send to generate; Shift+Enter for a new line`,"space.ruleGenerate":`Generate rules`,"space.ruleGenerating":`Generating…`,"space.ruleGeneratingStatus":`Generating space rules`,"space.ruleStop":`Stop generating`,"space.ruleBodyLabel":`Space foundation rules`,"space.ruleBodyPlaceholder":`Saved as this space’s foundation-rules skill`,"space.ruleHint":`Saved as this space’s foundation-rules skill.`,"space.ruleBriefHint":`Saved with the space so you can regenerate the rules later.`,"space.ruleEditHint":`Saving updates this space’s foundation-rules skill; the workbench uses it immediately.`,"space.ruleNeedReq":`Write space rule requirements before generating.`,"space.ruleNeedBody":`Fill in the foundation rules first.`,"space.ruleNeedModel":`Configure a working model in Settings before generating.`,"space.ruleGenEmpty":`The model returned empty rules. Retry, or write them yourself.`,"space.needName":`Enter a space name first.`,"space.created":`Created "{name}"`,"space.createdWithRules":`Created "{name}". The foundation rules were saved as a skill.`,"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
5
  {path}
6
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
7
  {path}`,"space.confirmCopyTitle":`Copy space`,"space.confirmCopyMsg":`All content of "{name}" will be copied into a new space. This can take a while for large spaces.`,"space.done":`Done`,"space.copyName":`New copy name`,"space.importPick":`Choose a zip backup to import`,"space.othersEmpty":`No other spaces yet. Open Manage spaces below to create or import one.`,"space.busyRuns":`A session is still running. Stop it before switching spaces.`,"space.publicLocked":`The built-in public space cannot be renamed or deleted.`,"space.offline":`Workspace unavailable`,"space.offlineCap":`Local service offline`,"settings.general":`General`,"settings.model":`Models`,"settings.builtin":`Built-in`,"settings.builtinDesc":`Provided by the platform per session or globally; always on, no toggle.`,"settings.close":`Close`,"settings.access":`Permissions`,"settings.accessDesc":`Default permission mode for new sessions`,"settings.language":`Language`,"settings.appearance":`Appearance`,"settings.appear.light":`Light`,"settings.appear.dark":`Dark`,"settings.appear.system":`System`,"settings.fontSize":`Font size`,"settings.fontSizeDesc":`Body and session text size (sidebar layout stays fixed)`,"settings.toolSteps":`Tool step detail`,"settings.toolStepsDesc":`How much tool-call detail to show`,"settings.busySend":`Send while busy`,"settings.busySendDesc":`Enter / Send while the agent is running; Cmd/Ctrl+Enter uses the other action`,"settings.busySend.queue":`Queue`,"settings.busySend.interrupt":`Interrupt`,"settings.allowPrivateWebFetch":`Allow private-network fetch`,"settings.allowPrivateWebFetchDesc":`When off, web_fetch and search results block localhost and private IPs (including after redirects)`,"settings.allowPrivateWebFetch.off":`Block (recommended)`,"settings.allowPrivateWebFetch.on":`Allow`,"settings.contextWindow":`Context window (tokens)`,"settings.contextWindowPlaceholder":`Empty = built-in table`,"settings.contextWindowDesc":`Used for compaction threshold and context meter; empty falls back to the built-in model table`,"settings.supportsTools":`Supports tools`,"settings.supportsVision":`Supports vision`,"settings.cap.on":`Yes`,"settings.cap.off":`No`,"settings.subagentModel":`Subagent model`,"settings.subagentModelDesc":`Subagents inherit the main chat model by default; pick another from the active provider`,"settings.subagentModel.inherit":`Follow main chat`,"settings.platformVersion":`Platform version`,"settings.updateCheck":`Check for updates`,"settings.updateChecking":`Checking`,"settings.updateLatest":`Up to date`,"settings.updateAvailable":`Update available`,"settings.updateNow":`Update & restart`,"settings.updateInstalling":`Installing v{v}, the service will restart automatically…`,"settings.updateWorking":`Updating…`,"settings.updateRestarting":`Restarting service…`,"settings.updateDone":`Updated to v{v}`,"settings.updateReload":`Reload page`,"settings.updateFailed":`Update failed`,"settings.updateRetry":`Retry`,"settings.updateDevMode":`Source mode cannot update in-page; run git pull and rebuild`,"settings.updateNpxHint":`Will install globally and restart (stop using the npx cache)`,"settings.updateUnavailable":`Unable to check for updates`,"settings.updateCheckedAt":`Last checked: {time}`,"settings.updateLog":`Log: {path}`,"settings.updateTimeout":`Timed out waiting for restart; reload the page to confirm the version`,"settings.updateConfirm":`Updating stops the current service, installs globally and restarts; the page disconnects briefly.`,"settings.access.readonly":`View only`,"settings.access.readwrite":`Edit in workspace`,"settings.access.full":`Full access`,"settings.step.concise":`Concise`,"settings.step.standard":`Standard`,"settings.step.detailed":`Detailed`,"settings.step.full":`Full`,"settings.modelIntro":`Add each provider’s API key to use its models.`,"settings.edit":`Edit`,"settings.delete":`Delete`,"settings.addProvider":`+ Add model provider`,"settings.back":`Back`,"settings.editProvider":`Edit provider`,"settings.addProviderTitle":`Add provider`,"settings.cancel":`Cancel`,"settings.save":`Save`,"settings.displayName":`Display name`,"settings.preset":`Provider preset`,"settings.baseUrl":`Base URL`,"settings.apiKey":`API Key`,"settings.modelField":`Model`,"settings.keyHint":`Models are saved in ~/.config/lantern-harness/models.json and shared across spaces; never pushed to GitHub.`,"settings.modelPlaceholder":`Enter model id`,"settings.recognizing":`Detecting…`,"settings.recognized":`{n} models found`,"settings.recognizeFail":`Detection failed — enter a model id manually`,"settings.recognizeKeep":`Refresh failed — keeping previous list`,"settings.deleteConfirm":`Delete this model provider?`,"chat.emptyTitle":`Those who carry the lantern do not ask the way.`,"chat.emptyNoModel":`Configure a model to get started.`,"chat.configureModel":`Configure model`,"chat.workbench":`My Workbench`,"chat.newSession":`New chat`,"chat.workspace":`Workspace`,"tool.running":`Running tool…`,"tool.callingKind":`Calling {kind}`,"tool.doneKind":`{kind} done`,"tool.callingNamed":`Calling {kind}: {name}`,"tool.doneNamed":`{kind} done: {name}`,"tool.callingFull":`Calling {kind} ({name})…`,"tool.doneFull":`{kind} finished ({name})`,"tool.kind.kb":`knowledge base`,"tool.kind.fs":`local files`,"tool.kind.memory":`memory`,"tool.kind.webSearch":`web search`,"tool.kind.webFetch":`web fetch`}};function a(e,n,r){let a=i[r??(typeof window<`u`?t().language:`zh-CN`)]?.[e]??i[`zh-CN`][e]??e;if(n)for(let[e,t]of Object.entries(n))a=a.replaceAll(`{${e}}`,String(t));return a}function o(e){if(typeof document>`u`)return;let n=e??t().language;document.documentElement.lang=n===`en`?`en`:`zh-CN`,document.querySelectorAll(`[data-i18n]`).forEach(e=>{let t=e.dataset.i18n;t&&t in r&&(e.textContent=a(t,void 0,n))}),document.querySelectorAll(`[data-i18n-hint]`).forEach(e=>{let t=e.dataset.i18nHint;t&&t in r&&(e.dataset.hint=a(t,void 0,n))})}export{a as n,n as t};
@@ -1 +1 @@
1
- import{d as e,i as t,p as n}from"./app-config.Dvfzl5_N.js";import{s as r}from"./settings.D02wZj3w.js";import{o as i}from"./view-prefs.COAKEQtZ.js";var a=`/__tb_sessions`,o=`tw-chat-sessions`,s=`tw-chat-active-id`,c=`tw-chat-history`,l=`tw-session-rail-open`,u=!1,d=null;function f(e){return!(!e||e.archived||e.deleted)}function p(){return`s_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function m(e){let t=Date.now();return{id:p(),title:`新对话`,createdAt:t,updatedAt:t,archived:!1,pinned:!1,messages:[],...e}}function h(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 g(){try{let e=localStorage.getItem(c);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function _(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.find(t=>t.id===e.activeId&&f(t)):void 0)?.id??t.find(e=>f(e))?.id??t[0].id}:null}function v(){return n(o)}function y(){return n(s)}function b(){try{let e=localStorage.getItem(v());return e?_(JSON.parse(e)):null}catch{return null}}function x(e){try{localStorage.setItem(v(),JSON.stringify(e)),localStorage.setItem(y(),e.activeId)}catch{}}function S(){let e=g(),t=m({title:e.length?h(e):`新对话`,messages:e}),n={sessions:[t],activeId:t.id};try{localStorage.removeItem(c)}catch{}return n}async function C(e){let t=e?.preferSessionId?.trim()||``,n=b();try{let e=await fetch(a,{signal:AbortSignal.timeout(2e3)});if(e.ok){let r=await e.json();u=!0;let i=_(r.store??null);if(!i){let e=t&&n?n.sessions.find(e=>e.id===t):void 0;i=e?{sessions:[e],activeId:t}:S(),await T(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:f(e)?t:i.sessions.find(e=>f(e))?.id??i.activeId},await T(i)):x(i)}else t&&f(i.sessions.find(e=>e.id===t))&&(i={...i,activeId:t}),x(i);return i}}catch{}return u=!1,n??S()}function w(){return b()??S()}async function T(e){if(x(e),u)try{await fetch(a,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({store:e})})}catch{}}function E(e){x(e),d&&clearTimeout(d),d=setTimeout(()=>{d=null,T(e)},320)}async function D(e){d&&=(clearTimeout(d),null),await T(e)}async function O(){if(!u)return null;try{let e=await fetch(a,{signal:AbortSignal.timeout(2e3)});return e.ok?_((await e.json()).store??null):null}catch{return null}}function k(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 A(e,t){let n=m({workspacePath:t?.workspacePath,access:t?.access});return{sessions:[n,...e.sessions],activeId:n.id}}function j(e,t,n){let r=e.sessions.find(e=>e.id===t);if(!r)return e;let i=n?.titleSuffix??`(分叉)`,a=`${(r.title||`新对话`).replace(/(分叉)\s*$/,``).trim()||`新对话`}${i}`,o=m({title:a.length>40?`${a.slice(0,39)}…`:a,workspacePath:r.workspacePath,access:r.access,messages:Array.isArray(r.messages)?structuredClone(r.messages):[],archived:!1,pinned:!1,deleted:!1}),s=n?.activate!==!1;return{sessions:[o,...e.sessions],activeId:s?o.id:e.activeId}}function M(e,t,n){return{...e,sessions:e.sessions.map(e=>e.id===t?{...e,workspacePath:n||void 0,updatedAt:Date.now()}:e)}}function N(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 P(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 F(e,t){let n=e.sessions.filter(e=>e.id!==t);if(!n.length){let e=m();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 I(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 L(e,t){return{...e,sessions:e.sessions.map(e=>e.workspacePath===t?{...e,workspacePath:void 0,updatedAt:Date.now()}:e)}}function R(e){return!(e.archived||e.deleted||e.pinned||Array.isArray(e.messages)&&e.messages.length>0)}function z(e,t,n){let r=e;for(let i of e.sessions)t&&i.id===t||R(i)&&(n?.(i.id)||(r=F(r,i.id)));return t&&r.sessions.some(e=>e.id===t)&&r.activeId!==t&&(r={...r,activeId:t}),r}function B(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===`新对话`?h(n):e.title;return{...e,messages:n.slice(-80),title:a,updatedAt:i?Date.now():e.updatedAt}})}}function V(e,t,n){return B(e,e.activeId,t,n)}function H(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 U(e){let t=!1,n=e.sessions.map(e=>{let n=H(e.messages);return n===e.messages?e:(t=!0,{...e,messages:n})});return t?{...e,sessions:n}:e}function W(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 G(e,t,n,r){let i=r?.touchUpdatedAt!==!1;return{...e,sessions:e.sessions.map(e=>e.id===t?{...e,...n,updatedAt:i?Date.now():e.updatedAt}:e)}}function K(e,t,n){return G(e,e.activeId,t,n)}function q(e,t){return e.sessions.some(e=>e.id===t)?{...e,activeId:t}:e}function J(e){return[...e].sort((e,t)=>{let n=+!!e.pinned,r=+!!t.pinned;return n===r?t.updatedAt-e.updatedAt:r-n})}function Y(){try{return localStorage.getItem(n(l))!==`0`}catch{return!0}}function X(e){try{localStorage.setItem(n(l),e?`1`:`0`)}catch{}}function Z(t){let n=e();return n?`tb:session-handoff:${n}:${t}`:`tb:session-handoff:${t}`}function Q(e){return e.replace(/\\/g,`/`).replace(/^\.\//,``).replace(/^\/+/,``)}function $(e,t,n){if(t!==`testReports`)return e.sessions.find(e=>{if(!f(e))return!1;if(t===`cases`){let t=e.caseGen?.linkedCasePath;return!!(t&&Q(t)===n)}let r=t===`knowledge`?e.knowledgeGen?.linkedKnowledgePath:``;return!!(r&&Q(r)===n)})}async function ee(e,n,a){await C().catch(()=>null),await t().catch(()=>null);let o=w(),s=Q(n.path),c=$(o,e,s);if(c||=(o=A(o,{access:r()}),await D(o),o.sessions.find(e=>e.id===o.activeId)),!c)throw Error(`无法创建或定位会话`);try{let e=o.sessions.find(e=>e.id===c.id)??c;sessionStorage.setItem(Z(c.id),JSON.stringify({session:e}))}catch{}i(`plugins.open`,`0`);let l=new URLSearchParams({session:c.id,focusRoot:e,focusPath:s,attachRoot:e,attachPath:s,attachName:n.name}),u=a?.attachPrompt?.trim();u&&l.set(`attachPrompt`,u),window.location.href=`/workbench/?${l.toString()}`}export{B as A,U as C,L as D,h as E,V as O,H as S,q as T,P as _,M as a,X as b,O as c,C as d,R as f,k as g,w as h,I as i,G as j,K as k,D as l,Y as m,Z as n,A as o,f as p,W as r,F as s,ee as t,j as u,z as v,J as w,E as x,N as y};
1
+ import{d as e,i as t,p as n}from"./app-config.BSO5r82v.js";import{s as r}from"./settings.BojKNwUC.js";import{o as i}from"./view-prefs.CWc5cQ2q.js";var a=`/__tb_sessions`,o=`tw-chat-sessions`,s=`tw-chat-active-id`,c=`tw-chat-history`,l=`tw-session-rail-open`,u=!1,d=null;function f(e){return!(!e||e.archived||e.deleted)}function p(){return`s_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function m(e){let t=Date.now();return{id:p(),title:`新对话`,createdAt:t,updatedAt:t,archived:!1,pinned:!1,messages:[],...e}}function h(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 g(){try{let e=localStorage.getItem(c);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function _(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.find(t=>t.id===e.activeId&&f(t)):void 0)?.id??t.find(e=>f(e))?.id??t[0].id}:null}function v(){return n(o)}function y(){return n(s)}function b(){try{let e=localStorage.getItem(v());return e?_(JSON.parse(e)):null}catch{return null}}function x(e){try{localStorage.setItem(v(),JSON.stringify(e)),localStorage.setItem(y(),e.activeId)}catch{}}function S(){let e=g(),t=m({title:e.length?h(e):`新对话`,messages:e}),n={sessions:[t],activeId:t.id};try{localStorage.removeItem(c)}catch{}return n}async function C(e){let t=e?.preferSessionId?.trim()||``,n=b();try{let e=await fetch(a,{signal:AbortSignal.timeout(2e3)});if(e.ok){let r=await e.json();u=!0;let i=_(r.store??null);if(!i){let e=t&&n?n.sessions.find(e=>e.id===t):void 0;i=e?{sessions:[e],activeId:t}:S(),await T(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:f(e)?t:i.sessions.find(e=>f(e))?.id??i.activeId},await T(i)):x(i)}else t&&f(i.sessions.find(e=>e.id===t))&&(i={...i,activeId:t}),x(i);return i}}catch{}return u=!1,n??S()}function w(){return b()??S()}async function T(e){if(x(e),u)try{await fetch(a,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({store:e})})}catch{}}function E(e){x(e),d&&clearTimeout(d),d=setTimeout(()=>{d=null,T(e)},320)}async function D(e){d&&=(clearTimeout(d),null),await T(e)}async function O(){if(!u)return null;try{let e=await fetch(a,{signal:AbortSignal.timeout(2e3)});return e.ok?_((await e.json()).store??null):null}catch{return null}}function k(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 A(e,t){let n=m({workspacePath:t?.workspacePath,access:t?.access});return{sessions:[n,...e.sessions],activeId:n.id}}function j(e,t,n){let r=e.sessions.find(e=>e.id===t);if(!r)return e;let i=n?.titleSuffix??`(分叉)`,a=`${(r.title||`新对话`).replace(/(分叉)\s*$/,``).trim()||`新对话`}${i}`,o=m({title:a.length>40?`${a.slice(0,39)}…`:a,workspacePath:r.workspacePath,access:r.access,messages:Array.isArray(r.messages)?structuredClone(r.messages):[],archived:!1,pinned:!1,deleted:!1}),s=n?.activate!==!1;return{sessions:[o,...e.sessions],activeId:s?o.id:e.activeId}}function M(e,t,n){return{...e,sessions:e.sessions.map(e=>e.id===t?{...e,workspacePath:n||void 0,updatedAt:Date.now()}:e)}}function N(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 P(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 F(e,t){let n=e.sessions.filter(e=>e.id!==t);if(!n.length){let e=m();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 I(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 L(e,t){return{...e,sessions:e.sessions.map(e=>e.workspacePath===t?{...e,workspacePath:void 0,updatedAt:Date.now()}:e)}}function R(e){return!(e.archived||e.deleted||e.pinned||Array.isArray(e.messages)&&e.messages.length>0)}function z(e,t,n){let r=e;for(let i of e.sessions)t&&i.id===t||R(i)&&(n?.(i.id)||(r=F(r,i.id)));return t&&r.sessions.some(e=>e.id===t)&&r.activeId!==t&&(r={...r,activeId:t}),r}function B(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===`新对话`?h(n):e.title;return{...e,messages:n.slice(-80),title:a,updatedAt:i?Date.now():e.updatedAt}})}}function V(e,t,n){return B(e,e.activeId,t,n)}function H(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 U(e){let t=!1,n=e.sessions.map(e=>{let n=H(e.messages);return n===e.messages?e:(t=!0,{...e,messages:n})});return t?{...e,sessions:n}:e}function W(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 G(e,t,n,r){let i=r?.touchUpdatedAt!==!1;return{...e,sessions:e.sessions.map(e=>e.id===t?{...e,...n,updatedAt:i?Date.now():e.updatedAt}:e)}}function K(e,t,n){return G(e,e.activeId,t,n)}function q(e,t){return e.sessions.some(e=>e.id===t)?{...e,activeId:t}:e}function J(e){return[...e].sort((e,t)=>{let n=+!!e.pinned,r=+!!t.pinned;return n===r?t.updatedAt-e.updatedAt:r-n})}function Y(){try{return localStorage.getItem(n(l))!==`0`}catch{return!0}}function X(e){try{localStorage.setItem(n(l),e?`1`:`0`)}catch{}}function Z(t){let n=e();return n?`tb:session-handoff:${n}:${t}`:`tb:session-handoff:${t}`}function Q(e){return e.replace(/\\/g,`/`).replace(/^\.\//,``).replace(/^\/+/,``)}function $(e,t,n){if(t!==`testReports`)return e.sessions.find(e=>{if(!f(e))return!1;if(t===`cases`){let t=e.caseGen?.linkedCasePath;return!!(t&&Q(t)===n)}let r=t===`knowledge`?e.knowledgeGen?.linkedKnowledgePath:``;return!!(r&&Q(r)===n)})}async function ee(e,n,a){await C().catch(()=>null),await t().catch(()=>null);let o=w(),s=Q(n.path),c=$(o,e,s);if(c||=(o=A(o,{access:r()}),await D(o),o.sessions.find(e=>e.id===o.activeId)),!c)throw Error(`无法创建或定位会话`);try{let e=o.sessions.find(e=>e.id===c.id)??c;sessionStorage.setItem(Z(c.id),JSON.stringify({session:e}))}catch{}i(`plugins.open`,`0`);let l=new URLSearchParams({session:c.id,focusRoot:e,focusPath:s,attachRoot:e,attachPath:s,attachName:n.name}),u=a?.attachPrompt?.trim();u&&l.set(`attachPrompt`,u),window.location.href=`/workbench/?${l.toString()}`}export{B as A,U as C,L as D,h as E,V as O,H as S,q as T,P as _,M as a,X as b,O as c,C as d,R as f,k as g,w as h,I as i,G as j,K as k,D as l,Y as m,Z as n,A as o,f as p,W as r,F as s,ee as t,j as u,z as v,J as w,E as x,N as y};
@@ -0,0 +1 @@
1
+ import{r as e,t,u as n}from"./app-config.BSO5r82v.js";var r=[`内置插件`,`测试技能`,`需求管理`,`生成能力`,`记忆与检索`,`待办与效率`,`人生管理`,`项目管理`,`仪表盘`,`开发工具`],i=[{id:`cases`,category:`测试技能`,name:`用例管理`,description:`侧栏出现功能测试、接口测试、性能测试、自动化测试四个用例菜单;四种类型分别浏览、搜索、上传和生成。关闭后四个入口全部隐藏,「生成测试用例」一并关闭;磁盘文件仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`caseGen`,category:`测试技能`,name:`生成测试用例`,description:`在工作台用「/」打开配置:按功能 / 接口 / 性能 / 自动化类型自动使用对应技能,可额外关联需求拆解库最新 XMind 和业务地图系统上下文,生成用例并写入用例库。需同时开启「用例管理」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0,requires:`cases`},{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:`testReports`,category:`测试技能`,name:`报告管理`,description:`侧栏进入报告库:按功能 / 接口 / 性能归档测试报告,插件自动使用对应报告技能。关闭后入口隐藏;磁盘文件仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`knowledge`,category:`记忆与检索`,name:`知识库检索`,description:`工作台输入「@」引用知识库与模板文档;发送后由模型按需读取。关闭后 @ 只列工作区文件。`,version:`1.4.0`,requiresDev:!1,defaultEnabled:!1},{id:`memory`,category:`记忆与检索`,name:`会话记忆`,description:`五轨记忆(用户档案 / 全局事实 / 项目关键 / 项目日志 / 每日):待确认、归档与便签,在工作台「记忆」Tab 管理。`,version:`2.0.0`,requiresDev:!0,defaultEnabled:!1},{id:`todos`,category:`待办与效率`,name:`待办事项`,description:`侧栏进入待办事项:按状态 / 紧急程度筛选、行内改状态与手动维护;工作台会话也能通过工具直接记录与更新同一份待办。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`tasks`,category:`待办与效率`,name:`任务管理`,description:`侧栏进入任务列表:按任务池 / 进行中 / 已完成 / 已关闭 / 已取消跟踪任务,并汇总每个任务下关联待办的数量与完成进度。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`reports`,category:`待办与效率`,name:`工作汇报`,description:`打开后在工作台自动使用工作汇报技能,可在「插件仓库 → 技能」修改;关闭时只停用,技能保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`projects`,category:`项目管理`,name:`项目列表`,description:`侧栏进入项目列表:进度 / 规划 / 归档三种状态的项目卡片,汇总每个项目下的迭代、需求与缺陷数量;支持搜索、归档与删除。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`iterations`,category:`项目管理`,name:`迭代管理`,description:`侧栏进入迭代管理:按项目维护迭代的开始 / 截止日期与状态,按日期流逝算进度并标出逾期。需同时开启「项目列表」。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`projects`},{id:`pmRequirements`,category:`项目管理`,name:`需求管理`,description:`侧栏进入需求管理:按项目 / 迭代维护需求编号、优先级、状态与验收标准;需求挂在项目下,可关联迭代。需同时开启「项目列表」。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`projects`},{id:`bugs`,category:`项目管理`,name:`缺陷管理`,description:`侧栏进入缺陷管理:按项目 / 迭代 / 需求记录缺陷,含严重程度、状态、重现步骤、期望与实际结果;关闭后入口隐藏,数据仍保留。需同时开启「项目列表」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`projects`},{id:`testStats`,category:`测试技能`,name:`测试统计`,description:`侧栏进入测试统计:按统计日期与测试统计维度(功能用例 / 自动化用例 / 接口用例 / 测试报告 / 缺陷统计等)记录统计数量,维度可搜索 / 创建 / 重命名 / 删除,下拉按创建时间倒序。打开开关即在当前空间生成 测试统计/测试统计.json。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`caseExec`,category:`测试技能`,name:`用例执行统计`,description:`侧栏进入用例执行统计:每个项目一张卡片,卡头是项目名称与开始 / 结束日期,并显示该项目的基线、累计已执行与执行率进度条;卡内按统计日期逐行记录用例总数与待执行数量,自动算出已执行用例、当前剩余用例与执行比例(比例按项目累计口径:以该项目第一条记录的用例总数为基线)。项目名称可搜索或直接创建,按创建时间倒序,下拉里可重命名(同步改记录)或删除未被引用的名称;卡头改周期会写穿该项目全部记录。打开开关即在当前空间生成 用例执行统计/用例执行统计.json。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`caseExecution`,category:`测试技能`,name:`用例执行`,description:`侧栏进入用例执行:选择用例文件后查看执行状态与自动化状态,基于当前文件全部用例进行自动化识别评估并生成可选自动化用例;手工记录用例结果,逐行详情字段自动保存,实际结果后可添加多个缺陷地址输入框,失败或阻塞可进入缺陷提交工作台。页面可运行已接入项目的自动化脚本,并把确认结果手动同步到用例执行统计。开启时自动准备「用例执行」技能。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`cases`},{id:`defectSubmit`,category:`测试技能`,name:`缺陷规则`,description:`通过链接识别字段或手动创建字段规则,按卡片管理,在工作台使用规则处理缺陷。支持 Codex。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`uiAuto`,category:`测试技能`,name:`自动化测试`,description:`侧栏出现「自动化项目」「自动化执行」两个入口:项目页管理已加入 / 生成的项目,并能用固定模板从零生成 Playwright + TypeScript 企业级基础框架(生成前先做结构与选项体检,再按「自动化项目创建」技能让 AI 审一遍骨架);执行页自动使用「自动化生成与执行」技能,一键运行 / 停止用例并查看日志与报告。打开开关时会准备两份默认技能,已有内容不覆盖。关闭后入口隐藏,项目记录与报告仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`reqAnalysis`,category:`需求管理`,name:`需求分析`,description:`侧栏进入需求分析:选「需求文档库」里的原始需求,用当前模型拆成结构化用户故事(角色 / 前置 / 主流程 / 替代 / 异常 / 后置 / 验收),可编辑、可导出 Markdown;打开时默认一并开启「用户故事审查」,生成用户故事成功后自动审查。打开开关时在「插件仓库 → 技能」准备需求分析与原文结构技能(已存在不覆盖)。关闭后入口隐藏,已保存的分析仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`reqBreakdowns`,category:`需求管理`,name:`需求拆解库`,description:`侧栏进入需求拆解库:需求分析完成原文拆解后自动生成实际 XMind 文件,按项目、迭代和时间增量保存;支持列表搜索、手动上传、历史补录、备注、改名、本机默认程序打开和可恢复删除。复用现有需求分析与原文结构提取技能,不保存 XMind 内容快照;关闭需求分析后已有文件仍可独立管理。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`businessMap`,category:`需求管理`,name:`业务地图`,description:`侧栏进入业务地图:按数据空间管理多个业务系统,支持指定功能、多个功能和系统全量的 AI 后台只读识别;低风险新功能自动入草稿,其他候选待审核,支持进度、取消与重试;人工可直接维护功能和纵向业务流程。开启时自动准备「业务地图识别」技能,已有内容不覆盖。关闭后入口隐藏,地图数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`storyReview`,category:`需求管理`,name:`用户故事审查`,description:`打开后不新增侧栏入口:在「需求分析」页多出「审查结果」Tab;生成用户故事成功后自动初审,结果页可「重新审查 / 重新全量扫描」。先用固定规则核对覆盖率,再让模型专查场景遗漏与待确认项,缺口可勾选补写、可导出 Markdown。开启「需求分析」时默认一并打开,也可单独关掉。开关开启时会准备「用户故事审查」技能,已有内容不覆盖。关闭后这些入口隐藏,审查结果仍保留在分析里。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!0,requires:`reqAnalysis`,autoEnableWith:`reqAnalysis`},{id:`testPoints`,category:`需求管理`,name:`生成测试点`,description:`打开后不新增侧栏入口:在「需求分析」页里多出「生成测试点」按钮与「测试点」Tab,基于拆好的用户故事按功能 / 边界值 / 异常 / 业务规则 / 非功能五个维度拆测试点,每条标注 P0–P3 优先级;界面与导出按 Ideal「一行一条」需求标题 → 五维 → 测试点归组(列表 / 左右导图 / XMind 向右逻辑图骨架,样式与原文结构导出一致 / Markdown),可下载。开启「需求分析」时默认一并打开,也可单独关掉。开关开启时会准备「测试点设计」技能,已有内容不覆盖。关闭后这些入口隐藏,已生成的测试点仍保留在分析里。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!0,requires:`reqAnalysis`,autoEnableWith:`reqAnalysis`},{id:`caseReview`,category:`测试技能`,name:`用例质量评审`,description:`打开后不新增侧栏入口:在「用例管理」文件行上多出「评审」按钮与评审列,打开抽屉对整份用例做分级质检——逐条判定可用 / 待修改 / 错误无效,五维打分(需求覆盖 / 步骤可执行 / 预期可判定 / 数据与边界 / 规范完整),另给七项量化指标与逐条扣分原因、改进建议;报告可导出 Markdown。开启「用例管理」时默认一并打开,也可单独关掉。开关开启时会准备「用例质量评审」技能,已有内容不覆盖。关闭后入口隐藏,评审结果仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`cases`,autoEnableWith:`cases`},{id:`caseBlindspot`,category:`测试技能`,name:`场景遗漏补全`,description:`打开后不新增侧栏入口:在「用例管理」的评审抽屉里多出「场景补全」Tab,专挖人工最容易漏的场景——非功能 / 安全边界与容错 / 兼容性 / 隐藏业务规则,逐条给出为什么容易漏与建议用例;勾选后跳到这条用例绑定的工作台会话,由模型按文件表头补进原用例文件(写前自动备份)。可根据文件名自动挂上对照需求。开启「用例管理」时默认一并打开,也可单独关掉。开关开启时会准备「用例场景补全」技能,已有内容不覆盖。关闭后入口隐藏,探测结果仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`cases`,autoEnableWith:`cases`},{id:`life`,category:`人生管理`,name:`人生管理`,description:`侧栏进入人生管理六张表:KR 待办、KR 任务、Objective 目标、OKR 复盘、年度计划、人生阶段。数据落在当前空间各自目录,与待办事项 / 任务管理互不关联。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`dashboard`,category:`仪表盘`,name:`仪表盘`,description:`侧栏进入仪表盘:把当前空间的待办、任务、项目与测试统计聚合成一页(指标卡、倒计时、今日待办、进行中任务、测试统计柱状图、飞书式待办日历)。首次打开是空白画布,需在「编辑组件」里自行添加卡片;待办 / 任务为表格 + 分页。卡片摆在 12 列自由画布上,按住顶部圆点手柄拖位置、拖右下角把手改宽高,挡住相邻卡片时松手把它们挤开或让位;布局按空间记在浏览器本地。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`pluginDev`,category:`开发工具`,name:`插件开发`,description:`用固定开发技能评估并开发扩展插件:先确认形态与范围,确认后才改代码,完成后并入「扩展插件」。需要读写项目源码。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0}];function a(e=i){return r.map(t=>({category:t,items:e.filter(e=>e.category===t)})).filter(e=>e.items.length>0)}var o=`tw-plugins-changed`;function s(){let e={};for(let t of i)e[t.id]=t.defaultEnabled;return e}function c(e,t){let n={...e};if(t&&!m(t.id)?.alwaysOn){if(n[t.id]=t.enabled,t.enabled){let e=m(t.id)?.requires;e&&(n[e]=!0);for(let e of i)e.autoEnableWith===t.id&&(n[e.id]=!0)}else for(let e of i)e.requires===t.id&&(n[e.id]=!1)}for(let e of i)e.alwaysOn&&(n[e.id]=!0);for(let e of i)e.requires&&!n[e.requires]&&(n[e.id]=!1);return n}function l(){let t=s(),n=e().plugins??{};for(let e of i)typeof n[e.id]==`boolean`&&(t[e.id]=n[e.id]);return c(t)}function u(e){return l()[e]}function d(e){let t=s();for(let n of i)typeof e[n.id]==`boolean`&&(t[n.id]=e[n.id]);return c(t)}function f(e,r){if(m(e)?.alwaysOn)return l();let i=c(l(),{id:e,enabled:r});return n({plugins:i}),t(),typeof window<`u`&&window.dispatchEvent(new CustomEvent(o,{detail:i})),i}function p(e){if(typeof window>`u`)return()=>{};let t=t=>{let n=t.detail;e(n??l())};return window.addEventListener(o,t),()=>{window.removeEventListener(o,t)}}function m(e){return i.find(t=>t.id===e)}function h(e){let t=m(e),n=t?.name??e;return t?.requires&&!u(t.requires)?`请先在「插件仓库」中启用「${m(t.requires)?.name??t.requires}」`:`请先在「插件仓库」中启用「${n}」`}export{p as a,f as c,l as i,a as n,h as o,u as r,d as s,i as t};
@@ -1 +1 @@
1
- function e(e){return e===`requirements`?`/__tb_requirements`:e===`cases`?`/__tb_cases`:e===`knowledge`?`/__tb_knowledge`:e===`testReports`?`/__tb_test_reports`:`/__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??[]}}function i(e){return e.startsWith(`~$`)||e.startsWith(`~WRL`)||e.startsWith(`.~lock.`)}async function a(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 o(e,n,r){return(await t(e,`/mkdir`,{parent:n,name:r})).path}async function s(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 c(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 l(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 u(e,n,r){await t(e,`/write-text`,{path:n,content:r})}async function d(e,n,r){await t(e,`/write-binary`,{path:n,contentBase64:r})}async function f(e,n){await t(e,`/delete`,{path:n})}async function p(e,n,r){return(await t(e,`/rename`,{path:n,name:r})).path}function m(e){let t=e.lastIndexOf(`/`);return t<0?`.`:e.slice(0,t)}function h(e,t){return e===t||e.startsWith(`${t}/`)}function g(e,t,n){return h(e,t)?n+e.slice(t.length):e}function _(e,t){for(let n of e){if(n.path===t)return n;let e=_(n.children,t);if(e)return e}return null}function v(e){let t=0;for(let n of e.children)t+=1+v(n);return t}async function y(e,n){await t(e,`/open`,{path:n})}export{d as _,_ as a,r as c,m as d,l as f,s as g,p as h,a as i,o as l,g as m,f as n,i as o,c as p,n as r,h as s,v as t,y as u,u as v};
1
+ function e(e){return e===`requirements`?`/__tb_requirements`:e===`cases`?`/__tb_cases`:e===`knowledge`?`/__tb_knowledge`:e===`testReports`?`/__tb_test_reports`:`/__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??[]}}function i(e){return e.startsWith(`~$`)||e.startsWith(`~WRL`)||e.startsWith(`.~lock.`)}async function a(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 o(e,n,r){return(await t(e,`/mkdir`,{parent:n,name:r})).path}async function s(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 c(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 l(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 u(e,n,r){await t(e,`/write-text`,{path:n,content:r})}async function d(e,n,r){await t(e,`/write-binary`,{path:n,contentBase64:r})}async function f(e,n){await t(e,`/delete`,{path:n})}async function p(e,n,r){return(await t(e,`/rename`,{path:n,name:r})).path}async function m(e,n,r){return(await t(e,`/move`,{path:n,parent:r})).path}function h(e){let t=e.lastIndexOf(`/`);return t<0?`.`:e.slice(0,t)}function g(e,t){return e===t||e.startsWith(`${t}/`)}function _(e,t,n){return g(e,t)?n+e.slice(t.length):e}function v(e,t){for(let n of e){if(n.path===t)return n;let e=v(n.children,t);if(e)return e}return null}function y(e){let t=0;for(let n of e.children)t+=1+y(n);return t}async function b(e,n){await t(e,`/open`,{path:n})}export{s as _,v as a,r as c,b as d,h as f,p as g,_ as h,a as i,o as l,c as m,f as n,i as o,l as p,n as r,g as s,y as t,m as u,d as v,u as y};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/jszip.min.Bh2Mgo40.js","_astro/react.Blvh0GOs.js"])))=>i.map(i=>d[i]);
2
- import{s as e}from"./react.Blvh0GOs.js";import{b as t}from"./settings.D02wZj3w.js";import{t as n}from"./app-version.CNpnKIb9.js";var r=`org.xmind.ui.logic.right`,i=`org.xmind.topicShape.roundedRect`,a=`org.xmind.branchConnection.elbow`,o=`#94a3b8`,s=`#d0d5dd`,c=`#1c3d5a`;function l(e,t){let n=2166136261;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);let r=(n>>>0).toString(36),i=t.replace(/[^A-Za-z0-9_-]/g,``).slice(0,24);return i?`${e}-${i}-${r}`:`${e}-${r}`}function u(e,t){return{id:l(`st`,`${i}-${e}-${t}`),properties:{"shape-class":i,"line-class":a,"line-color":o,"line-width":`1`,"svg:fill":e,"fo:color":t,"border-line-color":s,"border-line-width":`1`}}}var d=u(`#1c3d5a`,`#ffffff`),f=u(`#4176e6`,`#ffffff`),ee=u(`#ffffff`,c);function te(){let e=(e,t)=>({properties:{"shape-class":i,"line-class":a,"line-color":o,"line-width":`1`,"svg:fill":e,"fo:color":t,"border-line-color":s,"border-line-width":`1`}});return{centralTopic:e(`#1c3d5a`,`#ffffff`),mainTopic:e(`#4176e6`,`#ffffff`),subTopic:{properties:{"line-class":a,"svg:fill":`#ffffff`,"fo:color":c,"line-color":o,"line-width":`1`}},map:{properties:{"svg:fill":`#ffffff`,"line-color":o}}}}async function ne(r){let{default:i}=await t(async()=>{let{default:t}=await import(`./jszip.min.Bh2Mgo40.js`).then(t=>e(t.t(),1));return{default:t}},__vite__mapDeps([0,1])),a=new i;a.file(`content.json`,JSON.stringify(r));let o=Array.isArray(r)?r:[],s=o[0]&&typeof o[0]==`object`&&o[0].id||`sheet-1`;return a.file(`metadata.json`,JSON.stringify({creator:{name:`Lantern Harness`,version:n},activeSheetId:s})),a.file(`manifest.json`,JSON.stringify({"file-entries":{"content.json":{},"metadata.json":{}}})),a.generateAsync({type:`blob`,compression:`DEFLATE`})}function p(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),URL.revokeObjectURL(n)}var re=`/__tb_reqanalysis`,ie=`需求分析提示词.md`,ae=`需求分析`,oe=12e3,se=2e4,ce={draft:{label:`待拆解`,tone:`gray`},decomposed:{label:`已拆解`,tone:`blue`},checked:{label:`已审查`,tone:`amber`},accepted:{label:`已验收`,tone:`green`}},le={P0:`red`,P1:`amber`,P2:`gray`},ue={"uncovered-outline":`待确认·未覆盖`,"pending-confirm":`待确认`,"missing-field":`字段缺失`,"missing-scenario":`场景遗漏`,"missing-dimension":`维度缺失`,"untestable-acceptance":`验收不可测`,conflict:`与原文冲突`,"over-split":`过度拆分`,other:`其它`},de=new Set([`uncovered-outline`,`pending-confirm`,`conflict`,`other`]);function fe(e){return de.has(e.type)}function pe(e){return e.filter(fe)}var me={high:`高`,medium:`中`,low:`低`},he={high:`red`,medium:`amber`,low:`gray`},ge=[{key:`permission`,label:`权限与角色`,keywords:[`权限`,`角色`,`授权`,`越权`,`未登录`,`登录`,`管理员`,`普通用户`],hint:`补充不同角色 / 未登录 / 越权访问时这条流程的行为。`},{key:`boundary`,label:`边界值`,keywords:[`边界`,`上限`,`下限`,`最大`,`最小`,`长度`,`超长`,`字数`,`为空`,`空值`],hint:`补充字段长度、数量上限、刚好等于阈值时的表现。`},{key:`concurrency`,label:`并发与幂等`,keywords:[`并发`,`重复`,`幂等`,`同时`,`加锁`,`冲突`,`重复提交`],hint:`补充重复提交、多人同时操作同一数据时的结果。`},{key:`empty`,label:`空数据`,keywords:[`空数据`,`无数据`,`没有数据`,`空列表`,`暂无`,`空态`],hint:`补充列表为空、首次使用、数据被清空时的空态。`},{key:`failure`,label:`超时与失败`,keywords:[`超时`,`失败`,`异常`,`错误`,`重试`,`断网`,`不可用`,`降级`,`回滚`],hint:`补充依赖超时、接口失败、网络中断时的提示与回滚。`},{key:`i18n`,label:`国际化与时区`,keywords:[`国际化`,`时区`,`多语言`,`语言`,`翻译`,`utc`,`夏令时`],hint:`补充跨时区时间展示、多语言文案与本地化格式。`}],_e=/创建|新增|新建|保存|提交|删除|编辑|修改|更新|上传|导入|导出|发布|审批|撤回|绑定|解绑|发送|支付|下单|配置|启停|启用|停用/;async function m(e,t){let n=await fetch(`${re}${e}`,{...t,headers:t?.body===void 0?void 0:{"Content-Type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>({}));if(!n.ok||r.ok===!1)throw Error(r.error||`HTTP ${n.status}`);return r}async function ve(){try{return(await fetch(`${re}?health=1`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}async function ye(){return(await m(`/list`)).docs??[]}async function be(e){return(await m(`/create`,{method:`POST`,body:JSON.stringify(e)})).doc}async function xe(e,t){return(await m(`/`,{method:`PUT`,body:JSON.stringify({id:e,...t})})).doc}async function Se(e){await m(`/delete`,{method:`POST`,body:JSON.stringify({id:e})})}async function Ce(){try{let e=await m(`/prompt`),t=e.decompose??``,n=e.stories??``;return{file:e.file||`需求分析提示词.md`,exists:e.exists===!0,decompose:t,stories:n||t,structure:e.structure??``,audit:e.audit??``,fix:e.fix??``}}catch(e){return{file:ie,exists:!1,decompose:``,stories:``,structure:``,audit:``,fix:``,error:e instanceof Error?e.message:String(e)}}}async function we(e){return await m(`/prompt/sync`,{method:`POST`,body:JSON.stringify({enabled:e})})}async function Te(e){return(await Oe(e)).content}async function Ee(e,t=se){try{let n=(await Te(e)).trim();return{text:n.slice(0,t),total:n.length,truncated:n.length>t}}catch{return{text:``,total:0,truncated:!1}}}async function De(){return(await m(`/sources`)).files??[]}async function Oe(e){return m(`/source?path=${encodeURIComponent(e)}`)}var ke=/[\s\p{P}\p{S}]+/gu;function h(e){return String(e??``).toLowerCase().replace(ke,``)}function g(e){return Array.from(new Set(e.map(e=>String(e??``).trim()).filter(Boolean)))}function _(e,t=500){return typeof e==`string`?e.trim().slice(0,t):``}function v(e,t=30,n=500){return Array.isArray(e)?e.map(e=>_(e,n)).filter(Boolean).slice(0,t):[]}function Ae(e){let t=2166136261,n=String(e??``);for(let e=0;e<n.length;e++)t^=n.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,`0`)}function je(e){return Ae(String(e??``))}function y(e,t=80){return String(e??``).replace(/\s+/g,` `).trim().slice(0,t)}function b(e){let t=String(e.sourceTitle||e.sourcePath||``).trim();if(t){let e=t.split(/[/\\]/).pop()?.trim();if(e)return e}return String(e.title||``).trim()||`未命名文档`}function Me(e){return y((String(e??``).split(/[/\\]/).pop()?.replace(/\.[^.]+$/,``).trim()||``).replace(/_?需求文档$/u,``).replace(/_?需求说明$/u,``).replace(/_?需求$/u,``).trim())||`未命名需求`}function x(e){return String(e.sourceTitle||e.title||``).trim()||Me(e.sourcePath)}function Ne(e){let t=String(e??``).split(/[/\\]/).pop()?.trim()||``;return t=t.replace(/\.(xlsx|xls|docx|doc|md|txt|csv)$/i,``),t.replace(/_?需求文档$/u,``).replace(/_?需求说明$/u,``).replace(/_?需求$/u,``).replace(/迭代版本$/u,``).replace(/版本$/u,``).trim()}function Pe(e){let t=Ne(e);return t=t.replace(/v?\d+(?:\.\d+)*/gi,``),t.replace(/[\s_\-—·()()[\]【】]+/gu,``).toLowerCase()}function S(e){let t=Ne(e),n=/v(\d+(?:\.\d+)*)/i.exec(t)||/(\d+(?:\.\d+)+)/.exec(t);return n?.[1]?n[1].split(`.`).map(e=>{let t=Number(e);return Number.isFinite(t)?t:0}):null}function Fe(e,t){let n=Math.max(e.length,t.length);for(let r=0;r<n;r++){let n=e[r]??0,i=t[r]??0;if(n!==i)return n-i}return 0}function Ie(e,t){let n=x(e),r=Pe(n),i=S(n);return!r||!i?[]:t.filter(t=>{if(t.id===e.id)return!1;let n=x(t);if(Pe(n)!==r)return!1;let a=S(n);return a?Fe(a,i)<0:!1}).sort((e,t)=>Fe(S(x(e))??[],S(x(t))??[]))}function Le(e){let t=[];for(let n of e){let e=x(n);for(let r of B(n.outline))t.push({docId:n.id,docLabel:e,point:r})}return t}function Re(e){let t=String(e??``).toLowerCase().replace(/\s+/g,` `).trim();if(!t)return[];let n=[];for(let e of t.matchAll(/[a-z0-9_]{2,}|[\u4e00-\u9fff]{2}/gu))n.push(e[0]);let r=t.replace(/[^\u4e00-\u9fff]/g,``);for(let e=0;e<r.length-1;e++)n.push(r.slice(e,e+2));return[...new Set(n)].slice(0,80)}var ze=40,Be=7e3;function Ve(e,t,n){if(!t.length)return[];let r=Math.max(1,n?.maxItems??ze),i=Math.max(200,n?.maxChars??Be),a=Re(e),o=String(e??``).toLowerCase();if(!a.length&&!o.trim())return[];let s=[];for(let e of t){let t=e.point.title||``,n=(e.point.quote||e.point.body||``).slice(0,200),r=0;t&&o.includes(t.toLowerCase())&&(r+=8),n&&n.length>=4&&o.includes(n.toLowerCase().slice(0,40))&&(r+=5);let i=Re(`${t} ${n}`);for(let e of i)a.includes(e)&&(r+=e.length>=3?2:1);r<=0||s.push({...e,score:r})}s.sort((e,t)=>t.score-e.score||e.docLabel.localeCompare(t.docLabel,`zh`)||e.point.id.localeCompare(t.point.id));let c=[],l=0;for(let e of s){if(c.length>=r)break;let t=C(e);if(c.length>0&&l+t.length+1>i)break;c.push(e),l+=t.length+1}return c}function C(e){let t=e.point.kind===`query`?`查询`:e.point.kind===`mutate`?`修改`:`子点`,n=(e.point.quote||e.point.body||``).replace(/\s+/g,` `).trim().slice(0,120);return`- [${e.docLabel}] ${e.point.id} [${t}] ${e.point.title}${n?`(${n})`:``}`}function He(e){return e.length?[`## 历史迭代需求条目(检索参考,勿当作本版文档条目 id)`,`来源版本:${[...new Set(e.map(e=>e.docLabel))].join(`、`)}。下列 id 属于历史分析,禁止写入本版 sourceRefs;仅作能力对照与延伸参考。`,...e.map(C)].join(`
2
+ import{s as e}from"./react.Blvh0GOs.js";import{b as t}from"./settings.BojKNwUC.js";import{t as n}from"./app-version.CkDFkv4s.js";var r=`org.xmind.ui.logic.right`,i=`org.xmind.topicShape.roundedRect`,a=`org.xmind.branchConnection.elbow`,o=`#94a3b8`,s=`#d0d5dd`,c=`#1c3d5a`;function l(e,t){let n=2166136261;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);let r=(n>>>0).toString(36),i=t.replace(/[^A-Za-z0-9_-]/g,``).slice(0,24);return i?`${e}-${i}-${r}`:`${e}-${r}`}function u(e,t){return{id:l(`st`,`${i}-${e}-${t}`),properties:{"shape-class":i,"line-class":a,"line-color":o,"line-width":`1`,"svg:fill":e,"fo:color":t,"border-line-color":s,"border-line-width":`1`}}}var d=u(`#1c3d5a`,`#ffffff`),f=u(`#4176e6`,`#ffffff`),ee=u(`#ffffff`,c);function te(){let e=(e,t)=>({properties:{"shape-class":i,"line-class":a,"line-color":o,"line-width":`1`,"svg:fill":e,"fo:color":t,"border-line-color":s,"border-line-width":`1`}});return{centralTopic:e(`#1c3d5a`,`#ffffff`),mainTopic:e(`#4176e6`,`#ffffff`),subTopic:{properties:{"line-class":a,"svg:fill":`#ffffff`,"fo:color":c,"line-color":o,"line-width":`1`}},map:{properties:{"svg:fill":`#ffffff`,"line-color":o}}}}async function ne(r){let{default:i}=await t(async()=>{let{default:t}=await import(`./jszip.min.Bh2Mgo40.js`).then(t=>e(t.t(),1));return{default:t}},__vite__mapDeps([0,1])),a=new i;a.file(`content.json`,JSON.stringify(r));let o=Array.isArray(r)?r:[],s=o[0]&&typeof o[0]==`object`&&o[0].id||`sheet-1`;return a.file(`metadata.json`,JSON.stringify({creator:{name:`Lantern Harness`,version:n},activeSheetId:s})),a.file(`manifest.json`,JSON.stringify({"file-entries":{"content.json":{},"metadata.json":{}}})),a.generateAsync({type:`blob`,compression:`DEFLATE`})}function p(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),URL.revokeObjectURL(n)}var re=`/__tb_reqanalysis`,ie=`需求分析提示词.md`,ae=`需求分析`,oe=12e3,se=2e4,ce={draft:{label:`待拆解`,tone:`gray`},decomposed:{label:`已拆解`,tone:`blue`},checked:{label:`已审查`,tone:`amber`},accepted:{label:`已验收`,tone:`green`}},le={P0:`red`,P1:`amber`,P2:`gray`},ue={"uncovered-outline":`待确认·未覆盖`,"pending-confirm":`待确认`,"missing-field":`字段缺失`,"missing-scenario":`场景遗漏`,"missing-dimension":`维度缺失`,"untestable-acceptance":`验收不可测`,conflict:`与原文冲突`,"over-split":`过度拆分`,other:`其它`},de=new Set([`uncovered-outline`,`pending-confirm`,`conflict`,`other`]);function fe(e){return de.has(e.type)}function pe(e){return e.filter(fe)}var me={high:`高`,medium:`中`,low:`低`},he={high:`red`,medium:`amber`,low:`gray`},ge=[{key:`permission`,label:`权限与角色`,keywords:[`权限`,`角色`,`授权`,`越权`,`未登录`,`登录`,`管理员`,`普通用户`],hint:`补充不同角色 / 未登录 / 越权访问时这条流程的行为。`},{key:`boundary`,label:`边界值`,keywords:[`边界`,`上限`,`下限`,`最大`,`最小`,`长度`,`超长`,`字数`,`为空`,`空值`],hint:`补充字段长度、数量上限、刚好等于阈值时的表现。`},{key:`concurrency`,label:`并发与幂等`,keywords:[`并发`,`重复`,`幂等`,`同时`,`加锁`,`冲突`,`重复提交`],hint:`补充重复提交、多人同时操作同一数据时的结果。`},{key:`empty`,label:`空数据`,keywords:[`空数据`,`无数据`,`没有数据`,`空列表`,`暂无`,`空态`],hint:`补充列表为空、首次使用、数据被清空时的空态。`},{key:`failure`,label:`超时与失败`,keywords:[`超时`,`失败`,`异常`,`错误`,`重试`,`断网`,`不可用`,`降级`,`回滚`],hint:`补充依赖超时、接口失败、网络中断时的提示与回滚。`},{key:`i18n`,label:`国际化与时区`,keywords:[`国际化`,`时区`,`多语言`,`语言`,`翻译`,`utc`,`夏令时`],hint:`补充跨时区时间展示、多语言文案与本地化格式。`}],_e=/创建|新增|新建|保存|提交|删除|编辑|修改|更新|上传|导入|导出|发布|审批|撤回|绑定|解绑|发送|支付|下单|配置|启停|启用|停用/;async function m(e,t){let n=await fetch(`${re}${e}`,{...t,headers:t?.body===void 0?void 0:{"Content-Type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>({}));if(!n.ok||r.ok===!1)throw Error(r.error||`HTTP ${n.status}`);return r}async function ve(){try{return(await fetch(`${re}?health=1`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}async function ye(){return(await m(`/list`)).docs??[]}async function be(e){return(await m(`/create`,{method:`POST`,body:JSON.stringify(e)})).doc}async function xe(e,t){return(await m(`/`,{method:`PUT`,body:JSON.stringify({id:e,...t})})).doc}async function Se(e){await m(`/delete`,{method:`POST`,body:JSON.stringify({id:e})})}async function Ce(){try{let e=await m(`/prompt`),t=e.decompose??``,n=e.stories??``;return{file:e.file||`需求分析提示词.md`,exists:e.exists===!0,decompose:t,stories:n||t,structure:e.structure??``,audit:e.audit??``,fix:e.fix??``}}catch(e){return{file:ie,exists:!1,decompose:``,stories:``,structure:``,audit:``,fix:``,error:e instanceof Error?e.message:String(e)}}}async function we(e){return await m(`/prompt/sync`,{method:`POST`,body:JSON.stringify({enabled:e})})}async function Te(e){return(await Oe(e)).content}async function Ee(e,t=se){try{let n=(await Te(e)).trim();return{text:n.slice(0,t),total:n.length,truncated:n.length>t}}catch{return{text:``,total:0,truncated:!1}}}async function De(){return(await m(`/sources`)).files??[]}async function Oe(e){return m(`/source?path=${encodeURIComponent(e)}`)}var ke=/[\s\p{P}\p{S}]+/gu;function h(e){return String(e??``).toLowerCase().replace(ke,``)}function g(e){return Array.from(new Set(e.map(e=>String(e??``).trim()).filter(Boolean)))}function _(e,t=500){return typeof e==`string`?e.trim().slice(0,t):``}function v(e,t=30,n=500){return Array.isArray(e)?e.map(e=>_(e,n)).filter(Boolean).slice(0,t):[]}function Ae(e){let t=2166136261,n=String(e??``);for(let e=0;e<n.length;e++)t^=n.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,`0`)}function je(e){return Ae(String(e??``))}function y(e,t=80){return String(e??``).replace(/\s+/g,` `).trim().slice(0,t)}function b(e){let t=String(e.sourceTitle||e.sourcePath||``).trim();if(t){let e=t.split(/[/\\]/).pop()?.trim();if(e)return e}return String(e.title||``).trim()||`未命名文档`}function Me(e){return y((String(e??``).split(/[/\\]/).pop()?.replace(/\.[^.]+$/,``).trim()||``).replace(/_?需求文档$/u,``).replace(/_?需求说明$/u,``).replace(/_?需求$/u,``).trim())||`未命名需求`}function x(e){return String(e.sourceTitle||e.title||``).trim()||Me(e.sourcePath)}function Ne(e){let t=String(e??``).split(/[/\\]/).pop()?.trim()||``;return t=t.replace(/\.(xlsx|xls|docx|doc|md|txt|csv)$/i,``),t.replace(/_?需求文档$/u,``).replace(/_?需求说明$/u,``).replace(/_?需求$/u,``).replace(/迭代版本$/u,``).replace(/版本$/u,``).trim()}function Pe(e){let t=Ne(e);return t=t.replace(/v?\d+(?:\.\d+)*/gi,``),t.replace(/[\s_\-—·()()[\]【】]+/gu,``).toLowerCase()}function S(e){let t=Ne(e),n=/v(\d+(?:\.\d+)*)/i.exec(t)||/(\d+(?:\.\d+)+)/.exec(t);return n?.[1]?n[1].split(`.`).map(e=>{let t=Number(e);return Number.isFinite(t)?t:0}):null}function Fe(e,t){let n=Math.max(e.length,t.length);for(let r=0;r<n;r++){let n=e[r]??0,i=t[r]??0;if(n!==i)return n-i}return 0}function Ie(e,t){let n=x(e),r=Pe(n),i=S(n);return!r||!i?[]:t.filter(t=>{if(t.id===e.id)return!1;let n=x(t);if(Pe(n)!==r)return!1;let a=S(n);return a?Fe(a,i)<0:!1}).sort((e,t)=>Fe(S(x(e))??[],S(x(t))??[]))}function Le(e){let t=[];for(let n of e){let e=x(n);for(let r of B(n.outline))t.push({docId:n.id,docLabel:e,point:r})}return t}function Re(e){let t=String(e??``).toLowerCase().replace(/\s+/g,` `).trim();if(!t)return[];let n=[];for(let e of t.matchAll(/[a-z0-9_]{2,}|[\u4e00-\u9fff]{2}/gu))n.push(e[0]);let r=t.replace(/[^\u4e00-\u9fff]/g,``);for(let e=0;e<r.length-1;e++)n.push(r.slice(e,e+2));return[...new Set(n)].slice(0,80)}var ze=40,Be=7e3;function Ve(e,t,n){if(!t.length)return[];let r=Math.max(1,n?.maxItems??ze),i=Math.max(200,n?.maxChars??Be),a=Re(e),o=String(e??``).toLowerCase();if(!a.length&&!o.trim())return[];let s=[];for(let e of t){let t=e.point.title||``,n=(e.point.quote||e.point.body||``).slice(0,200),r=0;t&&o.includes(t.toLowerCase())&&(r+=8),n&&n.length>=4&&o.includes(n.toLowerCase().slice(0,40))&&(r+=5);let i=Re(`${t} ${n}`);for(let e of i)a.includes(e)&&(r+=e.length>=3?2:1);r<=0||s.push({...e,score:r})}s.sort((e,t)=>t.score-e.score||e.docLabel.localeCompare(t.docLabel,`zh`)||e.point.id.localeCompare(t.point.id));let c=[],l=0;for(let e of s){if(c.length>=r)break;let t=C(e);if(c.length>0&&l+t.length+1>i)break;c.push(e),l+=t.length+1}return c}function C(e){let t=e.point.kind===`query`?`查询`:e.point.kind===`mutate`?`修改`:`子点`,n=(e.point.quote||e.point.body||``).replace(/\s+/g,` `).trim().slice(0,120);return`- [${e.docLabel}] ${e.point.id} [${t}] ${e.point.title}${n?`(${n})`:``}`}function He(e){return e.length?[`## 历史迭代需求条目(检索参考,勿当作本版文档条目 id)`,`来源版本:${[...new Set(e.map(e=>e.docLabel))].join(`、`)}。下列 id 属于历史分析,禁止写入本版 sourceRefs;仅作能力对照与延伸参考。`,...e.map(C)].join(`
3
3
  `):``}function Ue(e,t){if(!e?.length)return[];let n=new Map(t.map(e=>[e.id,e])),r=[];for(let t of e){let e=n.get(t);e&&B(e.outline).length&&r.push(e)}return r}function We(e){let t=String(e??``).trim();return t?!!(/^"+,{2,}/.test(t)||/^,{2,}/.test(t)&&/(待开发|已开发|需求\s*,\s*高|v\d+\.\d+)/.test(t)||!/【/.test(t)&&!/^\d+[、.]/.test(t)&&/,/.test(t)&&/(待开发|已关闭|已完成|需求\s*,\s*[高低中]|v\d+\.\d+|^\d{4}年\d{1,2}月)/.test(t)):!1}function Ge(e){let t=String(e??``),n=t.search(/"\s*,{2,}/);n>=0&&(t=t.slice(0,n));let r=t.split(`
4
4
  `),i=[];for(let e of r){if(We(e))break;let t=e.search(/"\s*,{2,}/);if(t>=0){i.push(e.slice(0,t));break}i.push(e)}return i.join(`
5
5
  `).replace(/^"/,``).replace(/"$/,``).trim()}function Ke(e){let t=Ge(e.body).slice(0,4e3),n=y(t.match(/【([^】\n]{1,40})】/)?.[1]||e.title||e.small);return{...e,title:n||e.small,body:t||`【${n||e.small}】`}}function w(e){return String(e??``).toLowerCase().replace(/[\s\p{P}\p{S}]+/gu,``)}function T(e){let t=[],n=[],r=``,i=!1,a=!0;for(let o=0;o<e.length;o+=1){let s=e[o];i?s===`"`?e[o+1]===`"`?(r+=`"`,o+=1):i=!1:r+=s:s===`"`&&a?(i=!0,a=!1):s===`,`?(n.push(r),r=``,a=!0):s===`
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/i18n.Cp4so7KR.js","_astro/react.Blvh0GOs.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.Dvfzl5_N.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)})};function p(){let e=r(),t=e.model.providers.find(t=>t.id===e.model.activeId);return{contextWindow:typeof t?.contextWindow==`number`&&t.contextWindow>0?Math.floor(t.contextWindow):void 0,supportsTools:t?.supportsTools!==!1,supportsVision:t?.supportsVision===!0}}var m=[{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:``}],h=`tw-settings-changed`,g=`tw-open-settings`;function _(){return t()}function v(){return n()}function y(){return r().model.activeId}function b(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(h))}function x(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(h)),i}function S(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(h)),n}function C(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(h)))}function w(e){let t=_();t&&b({...t,...e})}var T=`tw-access-changed`;function E(){return r().access}function D(e){o({access:e}),a(),typeof window<`u`&&window.dispatchEvent(new CustomEvent(T,{detail:e}))}function O(e){if(typeof window>`u`)return()=>{};let t=t=>{let n=t.detail;e(n??E())};return window.addEventListener(T,t),()=>window.removeEventListener(T,t)}function k(e){return window.addEventListener(h,e),()=>window.removeEventListener(h,e)}function A(e=`general`){window.dispatchEvent(new CustomEvent(g,{detail:{tab:e}}))}var j=`tw-general-prefs-changed`;function M(){return{...r().general}}function N(e){let t={...M(),...e};return t.sessionFontSize<12&&(t.sessionFontSize=12),t.sessionFontSize>22&&(t.sessionFontSize=22),o({general:t}),a(),R(t),typeof window<`u`&&window.dispatchEvent(new CustomEvent(j,{detail:t})),t}function P(e){if(typeof window>`u`)return()=>{};let t=t=>{e(t.detail??M())};return window.addEventListener(j,t),()=>window.removeEventListener(j,t)}var F=null,I=null;function L(e){return e===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e}function R(e=M()){if(typeof document>`u`)return;let t=document.documentElement,n=L(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=``,F&&I&&(F.removeEventListener(`change`,I),F=null,I=null),e.appearance===`system`&&(F=window.matchMedia(`(prefers-color-scheme: dark)`),I=()=>{let e=L(`system`);t.dataset.theme=e,t.style.colorScheme=e},F.addEventListener(`change`,I));try{f(()=>import(`./i18n.Cp4so7KR.js`).then(e=>e.t).then(t=>t.applyDomI18n(e.language)),__vite__mapDeps([0,1]))}catch{}}export{N as _,p as a,f as b,M as c,O as d,P as f,D as g,w as h,S as i,v as l,A as m,m as n,y as o,k as p,R as r,E as s,g as t,_ as u,C as v,x as y};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/i18n.CEWjL5GX.js","_astro/react.Blvh0GOs.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.BSO5r82v.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)})};function p(){let e=r(),t=e.model.providers.find(t=>t.id===e.model.activeId);return{contextWindow:typeof t?.contextWindow==`number`&&t.contextWindow>0?Math.floor(t.contextWindow):void 0,supportsTools:t?.supportsTools!==!1,supportsVision:t?.supportsVision===!0}}var m=[{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:``}],h=`tw-settings-changed`,g=`tw-open-settings`;function _(){return t()}function v(){return n()}function y(){return r().model.activeId}function b(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(h))}function x(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(h)),i}function S(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(h)),n}function C(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(h)))}function w(e){let t=_();t&&b({...t,...e})}var T=`tw-access-changed`;function E(){return r().access}function D(e){o({access:e}),a(),typeof window<`u`&&window.dispatchEvent(new CustomEvent(T,{detail:e}))}function O(e){if(typeof window>`u`)return()=>{};let t=t=>{let n=t.detail;e(n??E())};return window.addEventListener(T,t),()=>window.removeEventListener(T,t)}function k(e){return window.addEventListener(h,e),()=>window.removeEventListener(h,e)}function A(e=`general`){window.dispatchEvent(new CustomEvent(g,{detail:{tab:e}}))}var j=`tw-general-prefs-changed`;function M(){return{...r().general}}function N(e){let t={...M(),...e};return t.sessionFontSize<12&&(t.sessionFontSize=12),t.sessionFontSize>22&&(t.sessionFontSize=22),o({general:t}),a(),R(t),typeof window<`u`&&window.dispatchEvent(new CustomEvent(j,{detail:t})),t}function P(e){if(typeof window>`u`)return()=>{};let t=t=>{e(t.detail??M())};return window.addEventListener(j,t),()=>window.removeEventListener(j,t)}var F=null,I=null;function L(e){return e===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e}function R(e=M()){if(typeof document>`u`)return;let t=document.documentElement,n=L(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=``,F&&I&&(F.removeEventListener(`change`,I),F=null,I=null),e.appearance===`system`&&(F=window.matchMedia(`(prefers-color-scheme: dark)`),I=()=>{let e=L(`system`);t.dataset.theme=e,t.style.colorScheme=e},F.addEventListener(`change`,I));try{f(()=>import(`./i18n.CEWjL5GX.js`).then(e=>e.t).then(t=>t.applyDomI18n(e.language)),__vite__mapDeps([0,1]))}catch{}}export{N as _,p as a,f as b,M as c,O as d,P as f,D as g,w as h,S as i,v as l,A as m,m as n,y as o,k as p,R as r,E as s,g as t,_ as u,C as v,x as y};
@@ -1 +1 @@
1
- import{f as e,t}from"./app-config.Dvfzl5_N.js";import{n}from"./i18n.Cp4so7KR.js";var r=`/__tb_spaces`;async function i(e,t){try{let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})}),r=await n.json();return n.ok?r:{ok:!1,error:r?.error||`请求失败(HTTP ${n.status})`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function a(e){try{return(await fetch(r,{signal:e??AbortSignal.timeout(2e3)})).ok}catch{return!1}}async function o(t){try{let n=t?.stats?`${r}?stats=1`:r,i=await fetch(n);if(!i.ok)return null;let a=await i.json();return a?.activeId&&e(a.activeId),a}catch{return null}}async function s(n){await t();let a=await i(`${r}/switch`,{id:n});return a.ok&&e(n),a}function c(e,t){return i(`${r}/create`,{name:e,managedParent:t?.managedParent,switch:t?.switch===!0,systemPrompt:t?.systemPrompt,promptBrief:t?.promptBrief})}function l(e){let t=e instanceof Error?e.message:String(e??``);return!t.trim()||/^not found$/i.test(t.trim())?`本地服务版本较旧,还没有空间编辑接口;请重启本地服务后再试`:t}async function u(e){try{let t=await fetch(`${r}/detail?id=${encodeURIComponent(e)}`),n=await t.json();return t.ok?n:{ok:!1,error:l(n?.error??`HTTP ${t.status}`)}}catch(e){return{ok:!1,error:l(e)}}}async function d(e,t){let n=await i(`${r}/update`,{id:e,...t});return n.ok?n:{...n,error:l(n.error)}}function f(e,t){return i(`${r}/copy`,{id:e,name:t})}function p(e,t){return i(`${r}/delete`,{id:e,purge:t,confirm:t===!0})}function m(e,t=`full`){return`${r}/export?id=${encodeURIComponent(e)}${t===`content`?`&scope=content`:``}`}function h(e){return i(`${r}/discover`,Array.isArray(e)&&e.length?{adopt:e}:{})}async function g(e,t){let n=await e.arrayBuffer(),a=new Uint8Array(n),o=``,s=32768;for(let e=0;e<a.length;e+=s)o+=String.fromCharCode(...a.subarray(e,e+s));let c=btoa(o);return i(`${r}/import`,{zipBase64:c,name:t})}function _(e){return e.isPublic?n(`space.publicName`):e.name}function v(e,t){let n=e.includes(`\\`)?`\\`:`/`,r=t.replace(/[/\\]+$/,``),i=`${r}${n}空间池`;if(e===i)return r;let a=`${i}${n}`;return e.startsWith(a)?`${r}${n}${e.slice(a.length)}`:e}function y(e){if(!e||e<=0)return`—`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=0,r=e;for(;r>=1024&&n<t.length-1;)r/=1024,n+=1;return`${r<10&&n>0?r.toFixed(1):Math.round(r)} ${t[n]}`}export{_ as a,u as c,o as d,a as f,h as i,y as l,d as m,c as n,v as o,s as p,p as r,m as s,f as t,g as u};
1
+ import{f as e,t}from"./app-config.BSO5r82v.js";import{n}from"./i18n.CEWjL5GX.js";var r=`/__tb_spaces`;async function i(e,t){try{let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})}),r=await n.json();return n.ok?r:{ok:!1,error:r?.error||`请求失败(HTTP ${n.status})`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function a(e){try{return(await fetch(r,{signal:e??AbortSignal.timeout(2e3)})).ok}catch{return!1}}async function o(t){try{let n=t?.stats?`${r}?stats=1`:r,i=await fetch(n);if(!i.ok)return null;let a=await i.json();return a?.activeId&&e(a.activeId),a}catch{return null}}async function s(n){await t();let a=await i(`${r}/switch`,{id:n});return a.ok&&e(n),a}function c(e,t){return i(`${r}/create`,{name:e,managedParent:t?.managedParent,switch:t?.switch===!0,systemPrompt:t?.systemPrompt,promptBrief:t?.promptBrief})}function l(e){let t=e instanceof Error?e.message:String(e??``);return!t.trim()||/^not found$/i.test(t.trim())?`本地服务版本较旧,还没有空间编辑接口;请重启本地服务后再试`:t}async function u(e){try{let t=await fetch(`${r}/detail?id=${encodeURIComponent(e)}`),n=await t.json();return t.ok?n:{ok:!1,error:l(n?.error??`HTTP ${t.status}`)}}catch(e){return{ok:!1,error:l(e)}}}async function d(e,t){let n=await i(`${r}/update`,{id:e,...t});return n.ok?n:{...n,error:l(n.error)}}function f(e,t){return i(`${r}/copy`,{id:e,name:t})}function p(e,t){return i(`${r}/delete`,{id:e,purge:t,confirm:t===!0})}function m(e,t=`full`){return`${r}/export?id=${encodeURIComponent(e)}${t===`content`?`&scope=content`:``}`}function h(e){return i(`${r}/discover`,Array.isArray(e)&&e.length?{adopt:e}:{})}async function g(e,t){let n=await e.arrayBuffer(),a=new Uint8Array(n),o=``,s=32768;for(let e=0;e<a.length;e+=s)o+=String.fromCharCode(...a.subarray(e,e+s));let c=btoa(o);return i(`${r}/import`,{zipBase64:c,name:t})}function _(e){return e.isPublic?n(`space.publicName`):e.name}function v(e,t){let n=e.includes(`\\`)?`\\`:`/`,r=t.replace(/[/\\]+$/,``),i=`${r}${n}空间池`;if(e===i)return r;let a=`${i}${n}`;return e.startsWith(a)?`${r}${n}${e.slice(a.length)}`:e}function y(e){if(!e||e<=0)return`—`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=0,r=e;for(;r>=1024&&n<t.length-1;)r/=1024,n+=1;return`${r<10&&n>0?r.toFixed(1):Math.round(r)} ${t[n]}`}export{_ as a,u as c,o as d,a as f,h as i,y as l,d as m,c as n,v as o,s as p,p as r,m as s,f as t,g as u};
@@ -1,4 +1,4 @@
1
- import{r as e,s as t,t as n}from"./req-analysis.C_gARMrB.js";var r=`/__tb_storyreview`,i=`用户故事审查提示词.md`;async function a(e,t){let n=await fetch(`${r}${e}`,{...t,headers:t?.body===void 0?void 0:{"Content-Type":`application/json`,...t?.headers}}),i=await n.json().catch(()=>({}));if(!n.ok||i.ok===!1)throw Error(i.error||`HTTP ${n.status}`);return i}async function o(){try{let e=await a(`/prompt`);return{file:i,exists:e.exists===!0,review:e.review??``,fix:e.fix??``}}catch(e){return{file:i,exists:!1,review:``,fix:``,error:e instanceof Error?e.message:String(e)}}}async function s(e){return a(`/prompt/sync`,{method:`POST`,body:JSON.stringify({enabled:e})})}var c={high:0,medium:1,low:2};function l(e){let t={pending:[],uncovered:[],other:[]};for(let n of e)n.type===`uncovered-outline`?t.uncovered.push(n):n.type===`pending-confirm`||n.type===`conflict`?t.pending.push(n):t.other.push(n);let n=e=>[...e].sort((e,t)=>c[e.severity]-c[t.severity]||e.title.localeCompare(t.title,`zh`));return[{key:`pending`,label:`待确认`,hint:`原文不清或需业务拍板`,gaps:n(t.pending)},{key:`uncovered`,label:`需求点未覆盖`,hint:`文档点还没有故事挂接`,gaps:n(t.uncovered)},{key:`other`,label:`其它`,hint:`其余待处理项`,gaps:n(t.other)}].filter(e=>e.gaps.length>0)}function u(e){return{high:e.filter(e=>e.severity===`high`).length,medium:e.filter(e=>e.severity===`medium`).length,low:e.filter(e=>e.severity===`low`).length}}function d(r,i){let a=[];if(a.push(`# 用户故事审查报告 · ${r.title||`未命名分析`}`),a.push(``),a.push(`> 来源:\`${r.sourcePath||`(未指定)`}\` · 故事 ${r.stories.length} 条`),a.push(``),!i)return a.push(`- 还没有审查结果。`),`${a.join(`
1
+ import{r as e,s as t,t as n}from"./req-analysis.BLvcktvQ.js";var r=`/__tb_storyreview`,i=`用户故事审查提示词.md`;async function a(e,t){let n=await fetch(`${r}${e}`,{...t,headers:t?.body===void 0?void 0:{"Content-Type":`application/json`,...t?.headers}}),i=await n.json().catch(()=>({}));if(!n.ok||i.ok===!1)throw Error(i.error||`HTTP ${n.status}`);return i}async function o(){try{let e=await a(`/prompt`);return{file:i,exists:e.exists===!0,review:e.review??``,fix:e.fix??``}}catch(e){return{file:i,exists:!1,review:``,fix:``,error:e instanceof Error?e.message:String(e)}}}async function s(e){return a(`/prompt/sync`,{method:`POST`,body:JSON.stringify({enabled:e})})}var c={high:0,medium:1,low:2};function l(e){let t={pending:[],uncovered:[],other:[]};for(let n of e)n.type===`uncovered-outline`?t.uncovered.push(n):n.type===`pending-confirm`||n.type===`conflict`?t.pending.push(n):t.other.push(n);let n=e=>[...e].sort((e,t)=>c[e.severity]-c[t.severity]||e.title.localeCompare(t.title,`zh`));return[{key:`pending`,label:`待确认`,hint:`原文不清或需业务拍板`,gaps:n(t.pending)},{key:`uncovered`,label:`需求点未覆盖`,hint:`文档点还没有故事挂接`,gaps:n(t.uncovered)},{key:`other`,label:`其它`,hint:`其余待处理项`,gaps:n(t.other)}].filter(e=>e.gaps.length>0)}function u(e){return{high:e.filter(e=>e.severity===`high`).length,medium:e.filter(e=>e.severity===`medium`).length,low:e.filter(e=>e.severity===`low`).length}}function d(r,i){let a=[];if(a.push(`# 用户故事审查报告 · ${r.title||`未命名分析`}`),a.push(``),a.push(`> 来源:\`${r.sourcePath||`(未指定)`}\` · 故事 ${r.stories.length} 条`),a.push(``),!i)return a.push(`- 还没有审查结果。`),`${a.join(`
2
2
  `)}\n`;let o=i.coverage.total?Math.round(i.coverage.rate*100):0;a.push(`## 结论`),a.push(``),a.push(`- 状态:${t[r.status]?.label??r.status}`),a.push(`- 审查时间:${i.at}`),a.push(`- 需求条目覆盖率:${i.coverage.covered}/${i.coverage.total}(${o}%)`),a.push(`- 维度覆盖:${i.dimensions.map(e=>`${e.label}${e.covered?` ✓`:` ✗`}`).join(` · `)||`(无)`}`);let s=u(i.gaps);a.push(`- 缺口:${i.gaps.length} 条(高 ${s.high} / 中 ${s.medium} / 低 ${s.low})`),i.summary&&(a.push(``),a.push(i.summary)),a.push(``);let c=new Map(r.stories.map(e=>[e.id,e.title])),d=l(i.gaps);if(!d.length)return a.push(`## 缺口清单`),a.push(``),a.push(`- 没有发现缺口。`),`${a.join(`
3
3
  `)}\n`;for(let t of d){a.push(`## ${t.label}(${t.gaps.length})`),a.push(``);for(let r of t.gaps){let t=r.storyId?`${r.storyId}${c.get(r.storyId)?` ${c.get(r.storyId)}`:``}`:`全局`;a.push(`- **[${n[r.severity]}] ${e[r.type]}** · ${t} · ${r.title}`),r.detail&&a.push(` - 原因:${r.detail}`),r.suggestion&&a.push(` - 建议:${r.suggestion}`)}a.push(``)}return`${a.join(`
4
4
  `).trimEnd()}\n`}function f(e,t){let n=`${(e.title||`需求分析`).replace(/[\\/:*?"<>|]/g,`_`).slice(0,60)}-审查报告-${new Date().toISOString().slice(0,10)}.md`,r=new Blob([d(e,t)],{type:`text/markdown;charset=utf-8`}),i=URL.createObjectURL(r),a=document.createElement(`a`);return a.href=i,a.download=n,a.click(),URL.revokeObjectURL(i),n}function p(e,t,n){if(e.outlineId){let r=t?.get(e.outlineId)?.trim();if(r)return r;let i=n?.get(e.outlineId)?.trim();if(i)return i}return e.detail?.trim()||e.title?.trim()||`(无原文摘录)`}function m(e,t,n){let r=[];if(r.push(`# 待确认事项 · ${e.title||`未命名分析`}`),r.push(``),r.push(`> 来源:\`${e.sourcePath||`(未指定)`}\` · 请在每条「结论」里回填后交回,便于补写用户故事。`),r.push(``),!t?.gaps.length)return r.push(`(当前没有待确认项。)`),`${r.join(`