lantern-harness 0.1.32 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/builtin/session/mcp-client.mjs +291 -2
- package/dist/500.html +4 -4
- package/dist/_astro/{Base.astro_astro_type_script_index_0_lang.4j--gBo-.js → Base.astro_astro_type_script_index_0_lang.CuCwv2e7.js} +2 -2
- package/dist/_astro/Base.huFPH3Mp.css +1 -0
- package/dist/_astro/{CaseExecBoard.CTuf_Nom.js → CaseExecBoard.CTVdi8MV.js} +1 -1
- package/dist/_astro/CaseGenerateApp.BONj-skB.js +10 -0
- package/dist/_astro/{CasesLibrary.C-T3VrPa.js → CasesLibrary.e6nFqhN3.js} +10 -10
- package/dist/_astro/ChatApp.XcaVtt7c.js +226 -0
- package/dist/_astro/{ColumnResize.BgYkV9Iy.js → ColumnResize._Iq05ix_.js} +1 -1
- package/dist/_astro/{DashboardBoard.B5Qo5Y3e.js → DashboardBoard.BaJyXPXA.js} +1 -1
- package/dist/_astro/{DocsFileBrowser.DnxVsmed.js → DocsFileBrowser.D2Cff2LP.js} +1 -1
- package/dist/_astro/{KnowledgeLibrary.DARUegK8.js → KnowledgeLibrary.CWxIHa8I.js} +1 -1
- package/dist/_astro/{NavLibraries.FAj9zUuq.js → NavLibraries.CZlA6Z1w.js} +1 -1
- package/dist/_astro/PluginsPage.Ch3rrYRF.js +1 -0
- package/dist/_astro/PluginsPage.DOGWQcVc.js +17 -0
- package/dist/_astro/{PmBugsBoard.uNPzbw-N.js → PmBugsBoard.ChL0RBVn.js} +1 -1
- package/dist/_astro/{PmIterationsBoard.CjR8L71i.js → PmIterationsBoard.hTKVnMgh.js} +1 -1
- package/dist/_astro/{PmProjectDetail.Cpug99Lt.js → PmProjectDetail.Saj76lNM.js} +1 -1
- package/dist/_astro/{PmProjectsBoard.VLqrwucj.js → PmProjectsBoard.CCtClGM1.js} +1 -1
- package/dist/_astro/PmRequirementsBoard.BNNq671Z.js +1 -0
- package/dist/_astro/{PmRequirementsBoard.CdP4gEzq.js → PmRequirementsBoard.DGXYC1Te.js} +1 -1
- package/dist/_astro/{PmShared.ChKKU3Ww.js → PmShared.BuhrL7Gb.js} +1 -1
- package/dist/_astro/PromptsLibrary.C9F9RVpz.js +1 -0
- package/dist/_astro/{ReportsPage.iSM5TWMq.js → ReportsPage.BjD8w0zS.js} +1 -1
- package/dist/_astro/ReqAnalysisBoard.JfmIK2Bb.js +39 -0
- package/dist/_astro/{RequirementsLibrary.X89V8-QF.js → RequirementsLibrary.WxAFCP3X.js} +1 -1
- package/dist/_astro/{SettingsDialog.BlokCWBn.js → SettingsDialog.BpKHIbID.js} +1 -1
- package/dist/_astro/SpaceSwitcher.BCZbiL7o.js +7 -0
- package/dist/_astro/{TasksBoard.Z8rBCO1F.js → TasksBoard.CdWQSwlg.js} +1 -1
- package/dist/_astro/{TemplatesLibrary.DBHSAPQ0.js → TemplatesLibrary.y_RtSjYC.js} +1 -1
- package/dist/_astro/{TestStatsBoard.BtqoPuLc.js → TestStatsBoard.C3vkF9vc.js} +1 -1
- package/dist/_astro/{TodosBoard.ETI63YgA.js → TodosBoard.CSupMlTp.js} +1 -1
- package/dist/_astro/{UiAutoBoard.DxrlgvI7.js → UiAutoBoard._og5jRon.js} +3 -3
- package/dist/_astro/app-version.trTEbNVs.js +1 -0
- package/dist/_astro/{case-gen-run.BNNfA12U.js → case-gen-run.BSJ0o4Zq.js} +1 -1
- package/dist/_astro/{plugins.SqANn3ZB.js → plugins.CVnHeKyf.js} +1 -1
- package/dist/_astro/prompts-meta.Dnmq-SnF.js +2 -0
- package/dist/_astro/req-analysis.D-dTIxXF.js +31 -0
- package/dist/_astro/story-review.CvXvtZ90.js +14 -0
- package/dist/case-exec/index.html +5 -5
- package/dist/cases/generate/index.html +5 -5
- package/dist/cases/library/index.html +5 -5
- package/dist/dashboard/index.html +5 -5
- package/dist/docs/changelog/index.html +77 -38
- package/dist/docs/install/index.html +13 -7
- package/dist/docs/manual/index.html +29 -19
- package/dist/knowledge/index.html +5 -5
- package/dist/plugins/index.html +5 -5
- package/dist/pm/bugs/index.html +5 -5
- package/dist/pm/iterations/index.html +5 -5
- package/dist/pm/projects/detail/index.html +5 -5
- package/dist/pm/projects/index.html +5 -5
- package/dist/pm/requirements/index.html +5 -5
- package/dist/prompts/index.html +5 -5
- package/dist/reports/index.html +5 -5
- package/dist/requirement-analysis/index.html +5 -5
- package/dist/requirements/index.html +5 -5
- package/dist/tasks/index.html +5 -5
- package/dist/templates/index.html +5 -5
- package/dist/test-automation/index.html +5 -5
- package/dist/test-stats/index.html +5 -5
- package/dist/todos/index.html +5 -5
- package/dist/workbench/index.html +5 -5
- package/docs//345/205/250/345/261/200/346/217/222/344/273/266.md +3 -3
- package/docs//345/256/211/350/243/205/346/211/213/345/206/214.md +9 -3
- package/docs//346/223/215/344/275/234/346/211/213/345/206/214.md +32 -20
- package/lh-plugins/lh-mcp.mjs +67 -2
- package/lh-plugins/lh-req-analysis.mjs +60 -3
- package/lh-plugins/plugin-prompts.mjs +2 -0
- package/lh-plugins/req-analysis-prompt.mjs +30 -4
- package/package.json +1 -1
- package/dist/_astro/Base.9LLJ6KVG.css +0 -1
- package/dist/_astro/CaseGenerateApp.18SE0dLJ.js +0 -10
- package/dist/_astro/ChatApp.BpFXgd8K.js +0 -226
- package/dist/_astro/PluginsPage.DKPA2zw8.js +0 -1
- package/dist/_astro/PluginsPage.F0oMYJri.js +0 -7
- package/dist/_astro/PmRequirementsBoard.B5ypu68O.js +0 -1
- package/dist/_astro/PromptsLibrary.BlWPVm1Z.js +0 -1
- package/dist/_astro/ReqAnalysisBoard.CeQbq7Qh.js +0 -39
- package/dist/_astro/SpaceSwitcher.MmSkP3wb.js +0 -7
- package/dist/_astro/app-version.CLOjRiPN.js +0 -1
- package/dist/_astro/prompts-meta.C_MeYq8G.js +0 -2
- package/dist/_astro/req-analysis.Dbe_gqPz.js +0 -24
- package/dist/_astro/story-review.CNZnYMvW.js +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# 版本日志
|
|
2
2
|
|
|
3
|
+
## [0.1.34] - 2026-10-31
|
|
4
|
+
|
|
5
|
+
「我的插件」支持管理当前空间的外接 MCP:列表查看连接状态与工具数、表单 / JSON 双方式添加(兼容 Trae `mcpServers`)、腾讯文档一键配置;并收紧大屏留白、修弹层蒙版与刷新闪屏、记住插件面板开闭与 Tab。
|
|
6
|
+
|
|
7
|
+
### 新增
|
|
8
|
+
|
|
9
|
+
- **我的插件 · MCP Tab**:表格列出当前空间 `.lantern/local/mcp.json` 服务器(名称 / 类型 / 地址 / 工具数 / 状态);支持添加、编辑、删除;点「连接 / 已连接」可单台重连,顶栏可全部刷新
|
|
10
|
+
- **腾讯文档默认行**:列表常驻「腾讯文档」;未配 Token 时显示「需配置」,粘贴空间 MCP Token 即可(预填官方 HTTP 地址)
|
|
11
|
+
- **表单 / JSON 双编辑**:弹窗默认表单,可切换 JSON;兼容 Trae / Claude Desktop 的 `mcpServers` 与灵光 `servers[]`;stdio 支持 `env`(`KEY=VALUE`)
|
|
12
|
+
- **MCP 管理 API**:`GET/PUT/DELETE /__tb_mcp/servers`;敏感 headers / env 脱敏回写;配置变更按内容差异强制重连
|
|
13
|
+
|
|
14
|
+
### 修复
|
|
15
|
+
|
|
16
|
+
- **插件弹层蒙版未盖住左侧菜单**:改用 Headless UI Dialog(`z-110` portal),进出场淡入淡出
|
|
17
|
+
- **保存 / 刷新 MCP 列表闪屏**:已有数据时静默刷新,不再整表切成「加载中」
|
|
18
|
+
- **刷新后插件页被关掉、Tab 丢失**:工作台插件面板开闭与「扩展插件 / MCP」Tab 按数据空间记本机
|
|
19
|
+
|
|
20
|
+
### 优化
|
|
21
|
+
|
|
22
|
+
- **插件页大屏布局**:内容区加宽、左右留白收紧;页头统计含 MCP 数量卡(不可点);页面 Tab 改下划线样式,与状态筛选胶囊分开;Tab 切换带淡入动画
|
|
23
|
+
- **MCP 操作按钮**:添加为主色;行内「编辑 / 删除」改为文字链
|
|
24
|
+
|
|
25
|
+
## [0.1.33] - 2026-10-31
|
|
26
|
+
|
|
27
|
+
需求分析补齐「原文结构」导出与审查衔接:拆解时一并整理原文、XMind / Markdown 按步骤与编号导出,生成用户故事后自动初审;测试点 XMind 与原文结构同一套逻辑图样式;并修掉文档库列宽拖拽误重置。
|
|
28
|
+
|
|
29
|
+
### 新增
|
|
30
|
+
|
|
31
|
+
- **拆解时同步整理原文结构**:同一轮模型调用里再走 `req_set_source_export`(读「提示词管理」里的 `原文结构提示词.md`),结果记在分析的 `sourceExport`;页签右侧「原文 XMind / 原文 Markdown」直接导出,不再单独点「整理原文结构」
|
|
32
|
+
- **原文导出按步骤与编号成树**:本地切开 `1、` / `2.` 等步骤;有「编号 | XQ-…」时编号单独成父节点挂步骤;表尾「输入参数 / 输出参数 / 流程 / 提出人」等字段通用剥离
|
|
33
|
+
- **原文 XMind 向右逻辑图骨架**:折线竖脊接到各子项,根深蓝、大类蓝、标题与编号白底细边框,步骤不单独设样式;有子节点的主题都标 `logic.right`
|
|
34
|
+
- **生成用户故事后自动初审**:审查插件开着时,故事生成成功后自动接 `runAudit`,切到「审查结果」;左栏审查按钮去掉,结果页增加「重新审查」(仍保留「重新全量扫描」)
|
|
35
|
+
- **测试点 XMind 与原文结构同款样式**:共用 `xmind-pack` 主题与节点样式(逻辑图骨架、折线、配色)
|
|
36
|
+
|
|
37
|
+
### 修复
|
|
38
|
+
|
|
39
|
+
- **文档库列宽:拖「文件名」会重置其它已调列宽**:`useFlexColumnWidths` 在 sticky 外壳上量不到其它列时不再用兄弟下标顶掉快照,改为向上找到含全部 `data-col` 的祖先再量,并合并未量到的手动宽度
|
|
40
|
+
|
|
41
|
+
### 优化
|
|
42
|
+
|
|
43
|
+
- **需求条目 / 用户故事卡片悬停轻弹**:幅度很小,避免第一条顶边被 overflow 裁掉
|
|
44
|
+
- **操作手册 / 插件说明**:同步原文结构、自动审查、测试点 XMind 与列宽相关口径
|
|
45
|
+
|
|
3
46
|
## [0.1.32] - 2026-10-29
|
|
4
47
|
|
|
5
48
|
需求拆解改为一行一条、Word 文档不再丢标题结构,拆解结论条当场可见;生成用例与已有用例文件统一按「需求条目 → 测试点」排序,并新增用例管理里的「重排」。
|
|
@@ -115,6 +115,265 @@ export function loadMcpConfig(root = getDataRoot()) {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
const SENSITIVE_HEADER_RE = /^(authorization|x-api-key|api-key|token)$/i;
|
|
119
|
+
/** 列表脱敏占位前缀;客户端回写时以此识别「未改密钥」 */
|
|
120
|
+
export const MCP_HEADER_MASK_PREFIX = '••••';
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @param {string} key
|
|
124
|
+
*/
|
|
125
|
+
export function isSensitiveMcpHeader(key) {
|
|
126
|
+
return SENSITIVE_HEADER_RE.test(String(key || ''));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @param {string} value
|
|
131
|
+
*/
|
|
132
|
+
export function maskSecretValue(value) {
|
|
133
|
+
const v = String(value || '');
|
|
134
|
+
if (!v) return '';
|
|
135
|
+
if (v.length <= 4) return `${MCP_HEADER_MASK_PREFIX}${v}`;
|
|
136
|
+
return `${MCP_HEADER_MASK_PREFIX}${v.slice(-4)}`;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @param {Record<string, string> | undefined} headers
|
|
141
|
+
* @returns {Record<string, string> | undefined}
|
|
142
|
+
*/
|
|
143
|
+
export function redactMcpHeaders(headers) {
|
|
144
|
+
if (!headers || typeof headers !== 'object') return undefined;
|
|
145
|
+
/** @type {Record<string, string>} */
|
|
146
|
+
const out = {};
|
|
147
|
+
for (const [k, v] of Object.entries(headers)) {
|
|
148
|
+
if (typeof v !== 'string') continue;
|
|
149
|
+
out[k] = isSensitiveMcpHeader(k) ? maskSecretValue(v) : v;
|
|
150
|
+
}
|
|
151
|
+
return Object.keys(out).length ? out : undefined;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* 合并 headers:新值若为空或仍是脱敏串,则保留旧值。
|
|
156
|
+
* @param {Record<string, string> | undefined} prev
|
|
157
|
+
* @param {Record<string, string> | undefined} next
|
|
158
|
+
*/
|
|
159
|
+
export function mergeMcpHeaders(prev, next) {
|
|
160
|
+
if (!next || typeof next !== 'object') return prev;
|
|
161
|
+
/** @type {Record<string, string>} */
|
|
162
|
+
const out = { ...(prev && typeof prev === 'object' ? prev : {}) };
|
|
163
|
+
for (const [k, v] of Object.entries(next)) {
|
|
164
|
+
if (typeof v !== 'string') continue;
|
|
165
|
+
const trimmed = v.trim();
|
|
166
|
+
if (!trimmed) {
|
|
167
|
+
delete out[k];
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
if (isSensitiveMcpHeader(k) && trimmed.startsWith(MCP_HEADER_MASK_PREFIX)) {
|
|
171
|
+
if (prev && typeof prev[k] === 'string' && prev[k]) out[k] = prev[k];
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
out[k] = trimmed;
|
|
175
|
+
}
|
|
176
|
+
return Object.keys(out).length ? out : undefined;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const SENSITIVE_ENV_RE = /(api[_-]?key|token|secret|password|authorization)/i;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @param {string} key
|
|
183
|
+
*/
|
|
184
|
+
export function isSensitiveMcpEnvKey(key) {
|
|
185
|
+
return SENSITIVE_ENV_RE.test(String(key || ''));
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* @param {Record<string, string> | undefined} env
|
|
190
|
+
* @returns {Record<string, string> | undefined}
|
|
191
|
+
*/
|
|
192
|
+
export function redactMcpEnv(env) {
|
|
193
|
+
if (!env || typeof env !== 'object') return undefined;
|
|
194
|
+
/** @type {Record<string, string>} */
|
|
195
|
+
const out = {};
|
|
196
|
+
for (const [k, v] of Object.entries(env)) {
|
|
197
|
+
if (typeof v !== 'string') continue;
|
|
198
|
+
out[k] = isSensitiveMcpEnvKey(k) ? maskSecretValue(v) : v;
|
|
199
|
+
}
|
|
200
|
+
return Object.keys(out).length ? out : undefined;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* @param {Record<string, string> | undefined} prev
|
|
205
|
+
* @param {Record<string, string> | undefined} next
|
|
206
|
+
*/
|
|
207
|
+
export function mergeMcpEnv(prev, next) {
|
|
208
|
+
if (!next || typeof next !== 'object') return prev;
|
|
209
|
+
/** @type {Record<string, string>} */
|
|
210
|
+
const out = { ...(prev && typeof prev === 'object' ? prev : {}) };
|
|
211
|
+
for (const [k, v] of Object.entries(next)) {
|
|
212
|
+
if (typeof v !== 'string') continue;
|
|
213
|
+
const trimmed = v.trim();
|
|
214
|
+
if (!trimmed) {
|
|
215
|
+
delete out[k];
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
if (isSensitiveMcpEnvKey(k) && trimmed.startsWith(MCP_HEADER_MASK_PREFIX)) {
|
|
219
|
+
if (prev && typeof prev[k] === 'string' && prev[k]) out[k] = prev[k];
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
out[k] = trimmed;
|
|
223
|
+
}
|
|
224
|
+
return Object.keys(out).length ? out : undefined;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* 把 Claude Desktop / Trae 的 mcpServers、灵光 servers[]、单条对象统一成内部列表。
|
|
229
|
+
* @param {unknown} raw
|
|
230
|
+
*/
|
|
231
|
+
export function coerceMcpServersInput(raw) {
|
|
232
|
+
if (!raw || typeof raw !== 'object') return [];
|
|
233
|
+
const obj = /** @type {Record<string, unknown>} */ (raw);
|
|
234
|
+
if (obj.mcpServers && typeof obj.mcpServers === 'object' && !Array.isArray(obj.mcpServers)) {
|
|
235
|
+
const list = [];
|
|
236
|
+
for (const [name, conf] of Object.entries(
|
|
237
|
+
/** @type {Record<string, unknown>} */ (obj.mcpServers),
|
|
238
|
+
)) {
|
|
239
|
+
if (!conf || typeof conf !== 'object') continue;
|
|
240
|
+
list.push({ name, .../** @type {object} */ (conf) });
|
|
241
|
+
}
|
|
242
|
+
return normalizeMcpServers({ servers: list });
|
|
243
|
+
}
|
|
244
|
+
if (Array.isArray(obj.servers) || Array.isArray(raw)) {
|
|
245
|
+
return normalizeMcpServers(raw);
|
|
246
|
+
}
|
|
247
|
+
if ('command' in obj || 'url' in obj || 'transport' in obj) {
|
|
248
|
+
return normalizeMcpServers({
|
|
249
|
+
servers: [{ name: obj.name || 'mcp', ...obj }],
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
return [];
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* @param {string} root
|
|
257
|
+
* @param {ReturnType<typeof normalizeMcpServers>} servers
|
|
258
|
+
*/
|
|
259
|
+
export function saveMcpServers(root, servers) {
|
|
260
|
+
const p = mcpConfigPath(root);
|
|
261
|
+
fs.mkdirSync(path.dirname(p), { recursive: true });
|
|
262
|
+
const normalized = normalizeMcpServers({ servers });
|
|
263
|
+
const tmp = `${p}.${process.pid}.${Date.now()}.tmp`;
|
|
264
|
+
fs.writeFileSync(tmp, `${JSON.stringify({ servers: normalized }, null, 2)}\n`, 'utf8');
|
|
265
|
+
fs.renameSync(tmp, p);
|
|
266
|
+
return { path: p, servers: normalized };
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* @param {string} root
|
|
271
|
+
* @param {object} raw
|
|
272
|
+
* @param {{ previousName?: string }} [opts]
|
|
273
|
+
*/
|
|
274
|
+
export function upsertMcpServer(root, raw, opts = {}) {
|
|
275
|
+
const { servers, path: cfgPath, error } = loadMcpConfig(root);
|
|
276
|
+
if (error) throw new Error(error);
|
|
277
|
+
const previousName = opts.previousName ? sanitizeMcpSegment(opts.previousName) : '';
|
|
278
|
+
const existing =
|
|
279
|
+
(previousName && servers.find((s) => s.name === previousName)) ||
|
|
280
|
+
(raw?.name ? servers.find((s) => s.name === sanitizeMcpSegment(raw.name)) : undefined);
|
|
281
|
+
|
|
282
|
+
const transport = String(raw?.transport || (raw?.url ? 'http' : 'stdio'))
|
|
283
|
+
.trim()
|
|
284
|
+
.toLowerCase();
|
|
285
|
+
const name = sanitizeMcpSegment(raw?.name || existing?.name || '');
|
|
286
|
+
if (!NAME_RE.test(name)) throw new Error('invalid server name');
|
|
287
|
+
|
|
288
|
+
/** @type {object} */
|
|
289
|
+
let next;
|
|
290
|
+
if (transport === 'stdio') {
|
|
291
|
+
const command = String(raw?.command || existing?.command || '').trim();
|
|
292
|
+
if (!command) throw new Error('command is required for stdio');
|
|
293
|
+
next = {
|
|
294
|
+
name,
|
|
295
|
+
transport: 'stdio',
|
|
296
|
+
command,
|
|
297
|
+
args: Array.isArray(raw?.args)
|
|
298
|
+
? raw.args.map((a) => String(a))
|
|
299
|
+
: Array.isArray(existing?.args)
|
|
300
|
+
? existing.args
|
|
301
|
+
: [],
|
|
302
|
+
env:
|
|
303
|
+
raw?.env !== undefined
|
|
304
|
+
? mergeMcpEnv(
|
|
305
|
+
existing?.env,
|
|
306
|
+
raw.env && typeof raw.env === 'object'
|
|
307
|
+
? Object.fromEntries(
|
|
308
|
+
Object.entries(raw.env).filter(([, v]) => typeof v === 'string'),
|
|
309
|
+
)
|
|
310
|
+
: undefined,
|
|
311
|
+
)
|
|
312
|
+
: existing?.env,
|
|
313
|
+
};
|
|
314
|
+
} else if (transport === 'http' || transport === 'streamable-http' || transport === 'sse') {
|
|
315
|
+
const url = String(raw?.url || existing?.url || '').trim();
|
|
316
|
+
if (!url) throw new Error('url is required for http');
|
|
317
|
+
next = {
|
|
318
|
+
name,
|
|
319
|
+
transport: 'http',
|
|
320
|
+
url,
|
|
321
|
+
headers: mergeMcpHeaders(existing?.headers, raw?.headers),
|
|
322
|
+
};
|
|
323
|
+
} else {
|
|
324
|
+
throw new Error(`unsupported transport: ${transport}`);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const replaceNames = new Set([previousName, existing?.name].filter(Boolean));
|
|
328
|
+
if (servers.some((s) => s.name === name && !replaceNames.has(s.name))) {
|
|
329
|
+
throw new Error(`server already exists: ${name}`);
|
|
330
|
+
}
|
|
331
|
+
const list = servers.filter((s) => !replaceNames.has(s.name));
|
|
332
|
+
list.push(next);
|
|
333
|
+
return saveMcpServers(root, list);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* @param {string} root
|
|
338
|
+
* @param {string} name
|
|
339
|
+
*/
|
|
340
|
+
export function removeMcpServer(root, name) {
|
|
341
|
+
const target = sanitizeMcpSegment(name);
|
|
342
|
+
const { servers, error } = loadMcpConfig(root);
|
|
343
|
+
if (error) throw new Error(error);
|
|
344
|
+
if (!servers.some((s) => s.name === target)) throw new Error(`server not found: ${target}`);
|
|
345
|
+
return saveMcpServers(
|
|
346
|
+
root,
|
|
347
|
+
servers.filter((s) => s.name !== target),
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* 供 UI 列表:配置脱敏 + 连接状态字段由调用方补。
|
|
353
|
+
* @param {string} [root]
|
|
354
|
+
*/
|
|
355
|
+
export function listMcpServersForUi(root = getDataRoot()) {
|
|
356
|
+
const cfg = loadMcpConfig(root);
|
|
357
|
+
return {
|
|
358
|
+
path: cfg.path,
|
|
359
|
+
error: cfg.error,
|
|
360
|
+
servers: cfg.servers.map((s) => ({
|
|
361
|
+
name: s.name,
|
|
362
|
+
transport: s.transport,
|
|
363
|
+
command: s.command,
|
|
364
|
+
args: s.args,
|
|
365
|
+
env: redactMcpEnv(s.env),
|
|
366
|
+
url: s.url,
|
|
367
|
+
headers: redactMcpHeaders(s.headers),
|
|
368
|
+
hasSecrets: Boolean(
|
|
369
|
+
(s.headers &&
|
|
370
|
+
Object.keys(s.headers).some((k) => isSensitiveMcpHeader(k) && s.headers[k])) ||
|
|
371
|
+
(s.env && Object.keys(s.env).some((k) => isSensitiveMcpEnvKey(k) && s.env[k])),
|
|
372
|
+
),
|
|
373
|
+
})),
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
|
|
118
377
|
/** @type {Map<string, { client: import('@modelcontextprotocol/sdk/client/index.js').Client, conf: object, root: string }>} */
|
|
119
378
|
const pool = new Map();
|
|
120
379
|
/** @type {Map<string, { server: string, remoteName: string }>} */
|
|
@@ -164,12 +423,14 @@ async function connectServer(conf, root) {
|
|
|
164
423
|
|
|
165
424
|
/**
|
|
166
425
|
* @param {string} [root]
|
|
426
|
+
* @param {{ forceNames?: string[] }} [opts] 指定名称强制断开重连(配置未变也重连)
|
|
167
427
|
*/
|
|
168
|
-
export async function ensureMcpClients(root = getDataRoot()) {
|
|
428
|
+
export async function ensureMcpClients(root = getDataRoot(), opts = {}) {
|
|
169
429
|
if (poolRoot && poolRoot !== root) {
|
|
170
430
|
await closeAllMcpClients();
|
|
171
431
|
}
|
|
172
432
|
poolRoot = root;
|
|
433
|
+
const force = new Set((opts.forceNames || []).map((n) => sanitizeMcpSegment(n)));
|
|
173
434
|
const { servers, error } = loadMcpConfig(root);
|
|
174
435
|
const wanted = new Set(servers.map((s) => s.name));
|
|
175
436
|
for (const key of [...pool.keys()]) {
|
|
@@ -187,7 +448,17 @@ export async function ensureMcpClients(root = getDataRoot()) {
|
|
|
187
448
|
if (error) errors.push(error);
|
|
188
449
|
for (const conf of servers) {
|
|
189
450
|
const key = poolKey(root, conf.name);
|
|
190
|
-
|
|
451
|
+
const prev = pool.get(key);
|
|
452
|
+
const sameConf = prev && JSON.stringify(prev.conf) === JSON.stringify(conf);
|
|
453
|
+
if (sameConf && !force.has(conf.name)) continue;
|
|
454
|
+
if (prev) {
|
|
455
|
+
try {
|
|
456
|
+
await prev.client.close();
|
|
457
|
+
} catch {
|
|
458
|
+
// ignore
|
|
459
|
+
}
|
|
460
|
+
pool.delete(key);
|
|
461
|
+
}
|
|
191
462
|
try {
|
|
192
463
|
const client = await connectServer(conf, root);
|
|
193
464
|
pool.set(key, { client, conf, root });
|
|
@@ -198,6 +469,24 @@ export async function ensureMcpClients(root = getDataRoot()) {
|
|
|
198
469
|
return { servers, connected: [...pool.keys()].map((k) => k.slice(root.length + 2)), errors };
|
|
199
470
|
}
|
|
200
471
|
|
|
472
|
+
/**
|
|
473
|
+
* 强制重连一台(或全部)MCP 服务器。
|
|
474
|
+
* @param {string} [root]
|
|
475
|
+
* @param {string} [name] 缺省则强制重连配置里全部
|
|
476
|
+
*/
|
|
477
|
+
export async function reconnectMcpServer(root = getDataRoot(), name) {
|
|
478
|
+
const target = name ? sanitizeMcpSegment(name) : '';
|
|
479
|
+
if (target) {
|
|
480
|
+
const { servers } = loadMcpConfig(root);
|
|
481
|
+
if (!servers.some((s) => s.name === target)) {
|
|
482
|
+
throw new Error(`server not found: ${target}`);
|
|
483
|
+
}
|
|
484
|
+
return ensureMcpClients(root, { forceNames: [target] });
|
|
485
|
+
}
|
|
486
|
+
const { servers } = loadMcpConfig(root);
|
|
487
|
+
return ensureMcpClients(root, { forceNames: servers.map((s) => s.name) });
|
|
488
|
+
}
|
|
489
|
+
|
|
201
490
|
/**
|
|
202
491
|
* @param {string} [root]
|
|
203
492
|
*/
|
package/dist/500.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
try {
|
|
4
4
|
if ('scrollRestoration' in history) history.scrollRestoration = 'manual';
|
|
5
5
|
} catch (e) {}
|
|
6
|
-
</script><script type="module" src="/_astro/Base.astro_astro_type_script_index_0_lang.
|
|
6
|
+
</script><script type="module" src="/_astro/Base.astro_astro_type_script_index_0_lang.CuCwv2e7.js"></script><meta name="astro-view-transitions-enabled" content="true"><meta name="astro-view-transitions-fallback" content="animate"><script type="module" src="/_astro/ClientRouter.astro_astro_type_script_index_0_lang.CO1cjG9V.js"></script><script>
|
|
7
7
|
(function () {
|
|
8
8
|
try {
|
|
9
9
|
// 配置按空间分键(`tw.app.config.v1::<spaceId>`),主题必须从同一个键读,
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
}
|
|
99
99
|
} catch (e) {}
|
|
100
100
|
})();
|
|
101
|
-
</script><link rel="stylesheet" href="/_astro/Base.
|
|
101
|
+
</script><link rel="stylesheet" href="/_astro/Base.huFPH3Mp.css"><style>.tw-error-page[data-astro-cid-qnkxrarz]{text-align:center;background:var(--tw-surface-page);flex-direction:column;justify-content:center;align-items:center;gap:.75rem;min-height:100vh;padding:2rem 1.25rem;display:flex}.tw-error-title[data-astro-cid-qnkxrarz]{color:var(--tw-label-primary);margin:0;font-size:1.25rem;font-weight:650}.tw-error-desc[data-astro-cid-qnkxrarz]{color:var(--tw-label-secondary);margin:0;font-size:.875rem;line-height:1.5}.tw-error-pre[data-astro-cid-qnkxrarz]{border:1px solid var(--tw-border);background:color-mix(in srgb, var(--tw-surface-panel,#fff) 90%, transparent);text-align:left;max-width:28rem;max-height:8rem;color:var(--tw-label-secondary);white-space:pre-wrap;word-break:break-word;border-radius:.5rem;margin:.25rem 0 0;padding:.65rem .85rem;font-size:.7rem;line-height:1.5;overflow:auto}.tw-error-actions[data-astro-cid-qnkxrarz]{flex-wrap:wrap;justify-content:center;align-items:center;gap:.5rem;margin-top:.5rem;display:flex}.tw-error-btn[data-astro-cid-qnkxrarz]{cursor:pointer;border:1px solid #0000;border-radius:.5rem;justify-content:center;align-items:center;height:2.25rem;padding:0 1rem;font-size:.8125rem;font-weight:550;text-decoration:none;display:inline-flex}.tw-error-btn--primary[data-astro-cid-qnkxrarz]{color:#fff;background:#4176e6}.tw-error-btn--primary[data-astro-cid-qnkxrarz]:hover{background:#3565c7}.tw-error-btn--ghost[data-astro-cid-qnkxrarz]{color:var(--tw-label-secondary);border-color:var(--tw-border);background:0 0}.tw-error-btn--ghost[data-astro-cid-qnkxrarz]:hover{color:var(--tw-label-primary)}
|
|
102
102
|
</style><script type="module" src="/_astro/page.Bx2KSkeL.js"></script><style>[data-astro-transition-scope="astro-bbhp3f5g-3"] { view-transition-name: astro-bbhp3f5g-3; }@layer astro { ::view-transition-old(astro-bbhp3f5g-3) {
|
|
103
103
|
animation-duration: 180ms;
|
|
104
104
|
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
animation-duration: 180ms;
|
|
136
136
|
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
|
|
137
137
|
animation-fill-mode: both;
|
|
138
|
-
animation-name: astroFadeIn; }</style></head><body class="tw-body antialiased"><div class="tw-shell min-h-screen"><aside class="tw-nav-aside fixed inset-y-0 left-0 flex flex-col z-45" id="tw-nav-aside"><div class="tw-nav-brand"><div class="tw-nav-brand-row"><a href="/" class="tw-nav-brand-link min-w-0 flex-1" data-astro-reload><span class="tw-nav-brand-mark" aria-hidden="true"><img class="tw-nav-brand-mark-img" src="/brand/brand-mark.png" alt="" width="36" height="36"></span><span class="tw-nav-brand-text"><span class="tw-nav-brand-title-row"><span class="tw-nav-brand-title" data-i18n="nav.brand">Lantern Harness</span><span class="tw-nav-brand-ver" data-hint="平台版本 v0.1.32">v0.1.32<span class="tw-nav-brand-dot" id="tw-update-dot" role="button" tabindex="-1" aria-label="有新版本可更新" hidden></span></span></span></span></a></div></div><div class="tw-nav-space-slot"><div class="tw-nav-space tw-nav-space-ph" id="tw-nav-space-ph" aria-hidden="true"><div class="tw-nav-space-ph-box"><span class="tw-nav-space-ph-ico"></span><span class="tw-nav-space-ph-lines"><span class="tw-nav-space-ph-bar is-cap"></span><span class="tw-nav-space-ph-bar is-name"></span></span></div></div><style>astro-island,astro-slot,astro-static-slot{display:contents}</style><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).only=e,window.dispatchEvent(new Event(`astro:only`))})();</script><script>(function(){function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(t,n){if(e(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function n(n){var r=t(n,`string`);return e(r)==`symbol`?r:r+``}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let i=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);{let e={0:e=>a(e),1:e=>n(e),2:e=>new RegExp(e),3:e=>new Date(e),4:e=>new Map(n(e)),5:e=>new Set(n(e)),6:e=>BigInt(e),7:e=>new URL(e),8:e=>new Uint8Array(e),9:e=>new Uint16Array(e),10:e=>new Uint32Array(e),11:e=>1/0*e},t=t=>{let[n,r]=t;return n in e?e[n](r):void 0},n=e=>e.map(t),a=e=>typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)]));class o extends HTMLElement{constructor(...e){super(...e),r(this,`Component`,void 0),r(this,`hydrator`,void 0),r(this,`hydrate`,async()=>{var e;if(!this.hydrator||!this.isConnected)return;let t=(e=this.parentElement)==null?void 0:e.closest(`astro-island[ssr]`);if(t){t.addEventListener(`astro:hydrate`,this.hydrate,{once:!0});return}let n=this.querySelectorAll(`astro-slot`),r={},i=this.querySelectorAll(`template[data-astro-template]`);for(let e of i){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`data-astro-template`)||`default`]=e.innerHTML,e.remove())}for(let e of n){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`name`)||`default`]=e.innerHTML)}let o;try{o=this.hasAttribute(`props`)?a(JSON.parse(this.getAttribute(`props`))):{}}catch(e){let t=this.getAttribute(`component-url`)||`<unknown>`,n=this.getAttribute(`component-export`);throw n&&(t+=` (export ${n})`),console.error(`[hydrate] Error parsing props for component ${t}`,this.getAttribute(`props`),e),e}await this.hydrator(this)(this.Component,o,r,{client:this.getAttribute(`client`)}),this.removeAttribute(`ssr`),this.dispatchEvent(new CustomEvent(`astro:hydrate`))}),r(this,`unmount`,()=>{this.isConnected||this.dispatchEvent(new CustomEvent(`astro:unmount`))})}disconnectedCallback(){document.removeEventListener(`astro:after-swap`,this.unmount),document.addEventListener(`astro:after-swap`,this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute(`await-children`)||document.readyState===`interactive`||document.readyState===`complete`)this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener(`DOMContentLoaded`,e),t.disconnect(),this.childrenConnectedCallback()},t=new MutationObserver(()=>{var t;((t=this.lastChild)==null?void 0:t.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue===`astro:end`&&(this.lastChild.remove(),e())});t.observe(this,{childList:!0}),document.addEventListener(`DOMContentLoaded`,e)}}async childrenConnectedCallback(){let e=this.getAttribute(`before-hydration-url`);e&&await import(e),this.start()}getRetryImportUrl(e){let t=new URL(e,document.baseURI);return t.searchParams.set(`astro-retry`,Date.now().toString()),t.toString()}async importWithRetry(e){try{return await import(e)}catch(t){return await new Promise(e=>setTimeout(e,1e3)),import(this.getRetryImportUrl(e))}}handleHydrationError(e){let t=this.getAttribute(`component-url`),n=new CustomEvent(`astro:hydration-error`,{cancelable:!0,bubbles:!0,composed:!0,detail:{error:e,componentUrl:t}});this.dispatchEvent(n)&&console.error(`[astro-island] Error hydrating ${t}`,e)}async start(){let e=JSON.parse(this.getAttribute(`opts`)),t=this.getAttribute(`client`);if(Astro[t]===void 0)window.addEventListener(`astro:${t}`,()=>this.start(),{once:!0});else try{await Astro[t](async()=>{let e=this.getAttribute(`renderer-url`);try{let[t,{default:n}]=await Promise.all([this.importWithRetry(this.getAttribute(`component-url`)),e?this.importWithRetry(e):Promise.resolve({default:()=>()=>{}})]),r=this.getAttribute(`component-export`)||`default`;if(r.includes(`.`)){this.Component=t;for(let e of r.split(`.`)){if(i.has(e)||!this.Component||typeof this.Component!=`object`&&typeof this.Component!=`function`||!Object.hasOwn(this.Component,e))throw Error(`Invalid component export path: ${r}`);this.Component=this.Component[e]}}else{if(i.has(r))throw Error(`Invalid component export path: ${r}`);this.Component=t[r]}return this.hydrator=n,this.hydrate}catch(e){return this.handleHydrationError(e),()=>{}}},e,this)}catch(e){this.handleHydrationError(e)}}attributeChangedCallback(){this.hydrate()}}r(o,`observedAttributes`,[`props`]),customElements.get(`astro-island`)||customElements.define(`astro-island`,o)}})();</script><astro-island uid="2wH2Dz" component-url="/_astro/SpaceSwitcher.MmSkP3wb.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{"data-astro-transition-persist":[0,"astro-gyrtbwwo-1"]}" ssr client="only" opts="{"name":"SpaceSwitcher","value":"react"}" data-astro-transition-persist="astro-gyrtbwwo-1"></astro-island></div><button type="button" id="tw-nav-toggle" class="tw-nav-toggle" aria-label="收起或展开左侧导航" aria-expanded="true" aria-controls="tw-nav-aside"><svg class="tw-nav-toggle-icon is-collapse" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 6l-6 6 6 6"></path></svg><svg class="tw-nav-toggle-icon is-expand" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"></path></svg></button><nav class="tw-nav-list flex-1 overflow-y-auto"><a href="/workbench/" class="tw-nav-item" data-i18n-hint="nav.home" data-hint="我的工作台"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 10.5 12 3l9 7.5"></path><path d="M5 9.5V20h14V9.5"></path></svg><span class="tw-nav-label" data-i18n="nav.home">我的工作台</span></a><div class="tw-nav-libraries"><div class="tw-nav-libraries-ph"><a href="/dashboard/" class="tw-nav-item" data-plugin-nav="dashboard"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="3" width="7" height="7" rx="1.5"></rect><rect x="14" y="3" width="7" height="7" rx="1.5"></rect><rect x="3" y="14" width="7" height="7" rx="1.5"></rect><rect x="14" y="14" width="7" height="7" rx="1.5"></rect></svg><span class="tw-nav-label" data-i18n="nav.dashboard">仪表盘</span></a><a href="/tasks/" class="tw-nav-item" data-plugin-nav="tasks"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 5h10"></path><path d="M9 12h10"></path><path d="M9 19h10"></path><path d="M4 5h.01"></path><path d="M4 12h.01"></path><path d="M4 19h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.tasks">任务管理</span></a><a href="/todos/" class="tw-nav-item" data-plugin-nav="todos"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M8 6h13"></path><path d="M8 12h13"></path><path d="M8 18h13"></path><path d="M3 6h.01"></path><path d="M3 12h.01"></path><path d="M3 18h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.todos">待办事项</span></a><a href="/pm/projects/" class="tw-nav-item" data-plugin-nav="projects"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"></path></svg><span class="tw-nav-label" data-i18n="nav.projects">项目列表</span></a><a href="/pm/iterations/" class="tw-nav-item" data-plugin-nav="iterations"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="5" width="18" height="16" rx="2"></rect><path d="M8 3v4"></path><path d="M16 3v4"></path><path d="M3 10h18"></path></svg><span class="tw-nav-label" data-i18n="nav.iterations">迭代管理</span></a><a href="/pm/requirements/" class="tw-nav-item" data-plugin-nav="pmRequirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.requirementsMgmt">需求管理</span></a><a href="/pm/bugs/" class="tw-nav-item" data-plugin-nav="bugs"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="14" r="5"></circle><path d="M9 6l2 2"></path><path d="M15 6l-2 2"></path><path d="M7 11H4"></path><path d="M20 11h-3"></path><path d="M7 17H4"></path><path d="M20 17h-3"></path></svg><span class="tw-nav-label" data-i18n="nav.bugs">缺陷管理</span></a><a href="/reports/" class="tw-nav-item" data-plugin-nav="reports"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.reports">工作汇报</span></a><a href="/test-stats/" class="tw-nav-item" data-plugin-nav="testStats"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 20V10"></path><path d="M10 20V4"></path><path d="M16 20v-7"></path><path d="M22 20H2"></path></svg><span class="tw-nav-label" data-i18n="nav.testStats">测试统计</span></a><a href="/case-exec/" class="tw-nav-item" data-plugin-nav="caseExec"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="9"></circle><circle cx="12" cy="12" r="5"></circle><circle cx="12" cy="12" r="1.4"></circle></svg><span class="tw-nav-label" data-i18n="nav.caseExec">用例执行统计</span></a><a href="/cases/library/" class="tw-nav-item" data-plugin-nav="cases"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 11l3 3L22 4"></path><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg><span class="tw-nav-label" data-i18n="nav.caseManage">用例管理</span></a><a href="/knowledge/" class="tw-nav-item" data-plugin-nav="knowledgeLib"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path></svg><span class="tw-nav-label" data-i18n="nav.knowledge">知识库管理</span></a><a href="/requirements/" class="tw-nav-item" data-plugin-nav="requirements" data-i18n-hint="nav.requirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h6"></path></svg><span class="tw-nav-label" data-i18n="nav.requirements">需求文档库</span></a><a href="/templates/" class="tw-nav-item" data-plugin-nav="templates" data-i18n-hint="nav.templates"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 3 3 8l9 5 9-5-9-5z"></path><path d="m3 13 9 5 9-5"></path></svg><span class="tw-nav-label" data-i18n="nav.templates">测试模板库</span></a></div><astro-island uid="Z1lgSd4" component-url="/_astro/NavLibraries.FAj9zUuq.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{"data-astro-transition-persist":[0,"astro-iywf7oe7-2"]}" ssr client="only" opts="{"name":"NavLibraries","value":"react"}" data-astro-transition-persist="astro-iywf7oe7-2"></astro-island><script>(function(){const host = ".tw-nav-libraries";
|
|
138
|
+
animation-name: astroFadeIn; }</style></head><body class="tw-body antialiased"><div class="tw-shell min-h-screen"><aside class="tw-nav-aside fixed inset-y-0 left-0 flex flex-col z-45" id="tw-nav-aside"><div class="tw-nav-brand"><div class="tw-nav-brand-row"><a href="/" class="tw-nav-brand-link min-w-0 flex-1" data-astro-reload><span class="tw-nav-brand-mark" aria-hidden="true"><img class="tw-nav-brand-mark-img" src="/brand/brand-mark.png" alt="" width="36" height="36"></span><span class="tw-nav-brand-text"><span class="tw-nav-brand-title-row"><span class="tw-nav-brand-title" data-i18n="nav.brand">Lantern Harness</span><span class="tw-nav-brand-ver" data-hint="平台版本 v0.1.34">v0.1.34<span class="tw-nav-brand-dot" id="tw-update-dot" role="button" tabindex="-1" aria-label="有新版本可更新" hidden></span></span></span></span></a></div></div><div class="tw-nav-space-slot"><div class="tw-nav-space tw-nav-space-ph" id="tw-nav-space-ph" aria-hidden="true"><div class="tw-nav-space-ph-box"><span class="tw-nav-space-ph-ico"></span><span class="tw-nav-space-ph-lines"><span class="tw-nav-space-ph-bar is-cap"></span><span class="tw-nav-space-ph-bar is-name"></span></span></div></div><style>astro-island,astro-slot,astro-static-slot{display:contents}</style><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).only=e,window.dispatchEvent(new Event(`astro:only`))})();</script><script>(function(){function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(t,n){if(e(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function n(n){var r=t(n,`string`);return e(r)==`symbol`?r:r+``}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let i=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);{let e={0:e=>a(e),1:e=>n(e),2:e=>new RegExp(e),3:e=>new Date(e),4:e=>new Map(n(e)),5:e=>new Set(n(e)),6:e=>BigInt(e),7:e=>new URL(e),8:e=>new Uint8Array(e),9:e=>new Uint16Array(e),10:e=>new Uint32Array(e),11:e=>1/0*e},t=t=>{let[n,r]=t;return n in e?e[n](r):void 0},n=e=>e.map(t),a=e=>typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)]));class o extends HTMLElement{constructor(...e){super(...e),r(this,`Component`,void 0),r(this,`hydrator`,void 0),r(this,`hydrate`,async()=>{var e;if(!this.hydrator||!this.isConnected)return;let t=(e=this.parentElement)==null?void 0:e.closest(`astro-island[ssr]`);if(t){t.addEventListener(`astro:hydrate`,this.hydrate,{once:!0});return}let n=this.querySelectorAll(`astro-slot`),r={},i=this.querySelectorAll(`template[data-astro-template]`);for(let e of i){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`data-astro-template`)||`default`]=e.innerHTML,e.remove())}for(let e of n){let t=e.closest(this.tagName);t!=null&&t.isSameNode(this)&&(r[e.getAttribute(`name`)||`default`]=e.innerHTML)}let o;try{o=this.hasAttribute(`props`)?a(JSON.parse(this.getAttribute(`props`))):{}}catch(e){let t=this.getAttribute(`component-url`)||`<unknown>`,n=this.getAttribute(`component-export`);throw n&&(t+=` (export ${n})`),console.error(`[hydrate] Error parsing props for component ${t}`,this.getAttribute(`props`),e),e}await this.hydrator(this)(this.Component,o,r,{client:this.getAttribute(`client`)}),this.removeAttribute(`ssr`),this.dispatchEvent(new CustomEvent(`astro:hydrate`))}),r(this,`unmount`,()=>{this.isConnected||this.dispatchEvent(new CustomEvent(`astro:unmount`))})}disconnectedCallback(){document.removeEventListener(`astro:after-swap`,this.unmount),document.addEventListener(`astro:after-swap`,this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute(`await-children`)||document.readyState===`interactive`||document.readyState===`complete`)this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener(`DOMContentLoaded`,e),t.disconnect(),this.childrenConnectedCallback()},t=new MutationObserver(()=>{var t;((t=this.lastChild)==null?void 0:t.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue===`astro:end`&&(this.lastChild.remove(),e())});t.observe(this,{childList:!0}),document.addEventListener(`DOMContentLoaded`,e)}}async childrenConnectedCallback(){let e=this.getAttribute(`before-hydration-url`);e&&await import(e),this.start()}getRetryImportUrl(e){let t=new URL(e,document.baseURI);return t.searchParams.set(`astro-retry`,Date.now().toString()),t.toString()}async importWithRetry(e){try{return await import(e)}catch(t){return await new Promise(e=>setTimeout(e,1e3)),import(this.getRetryImportUrl(e))}}handleHydrationError(e){let t=this.getAttribute(`component-url`),n=new CustomEvent(`astro:hydration-error`,{cancelable:!0,bubbles:!0,composed:!0,detail:{error:e,componentUrl:t}});this.dispatchEvent(n)&&console.error(`[astro-island] Error hydrating ${t}`,e)}async start(){let e=JSON.parse(this.getAttribute(`opts`)),t=this.getAttribute(`client`);if(Astro[t]===void 0)window.addEventListener(`astro:${t}`,()=>this.start(),{once:!0});else try{await Astro[t](async()=>{let e=this.getAttribute(`renderer-url`);try{let[t,{default:n}]=await Promise.all([this.importWithRetry(this.getAttribute(`component-url`)),e?this.importWithRetry(e):Promise.resolve({default:()=>()=>{}})]),r=this.getAttribute(`component-export`)||`default`;if(r.includes(`.`)){this.Component=t;for(let e of r.split(`.`)){if(i.has(e)||!this.Component||typeof this.Component!=`object`&&typeof this.Component!=`function`||!Object.hasOwn(this.Component,e))throw Error(`Invalid component export path: ${r}`);this.Component=this.Component[e]}}else{if(i.has(r))throw Error(`Invalid component export path: ${r}`);this.Component=t[r]}return this.hydrator=n,this.hydrate}catch(e){return this.handleHydrationError(e),()=>{}}},e,this)}catch(e){this.handleHydrationError(e)}}attributeChangedCallback(){this.hydrate()}}r(o,`observedAttributes`,[`props`]),customElements.get(`astro-island`)||customElements.define(`astro-island`,o)}})();</script><astro-island uid="2wH2Dz" component-url="/_astro/SpaceSwitcher.BCZbiL7o.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{"data-astro-transition-persist":[0,"astro-gyrtbwwo-1"]}" ssr client="only" opts="{"name":"SpaceSwitcher","value":"react"}" data-astro-transition-persist="astro-gyrtbwwo-1"></astro-island></div><button type="button" id="tw-nav-toggle" class="tw-nav-toggle" aria-label="收起或展开左侧导航" aria-expanded="true" aria-controls="tw-nav-aside"><svg class="tw-nav-toggle-icon is-collapse" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 6l-6 6 6 6"></path></svg><svg class="tw-nav-toggle-icon is-expand" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"></path></svg></button><nav class="tw-nav-list flex-1 overflow-y-auto"><a href="/workbench/" class="tw-nav-item" data-i18n-hint="nav.home" data-hint="我的工作台"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 10.5 12 3l9 7.5"></path><path d="M5 9.5V20h14V9.5"></path></svg><span class="tw-nav-label" data-i18n="nav.home">我的工作台</span></a><div class="tw-nav-libraries"><div class="tw-nav-libraries-ph"><a href="/dashboard/" class="tw-nav-item" data-plugin-nav="dashboard"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="3" width="7" height="7" rx="1.5"></rect><rect x="14" y="3" width="7" height="7" rx="1.5"></rect><rect x="3" y="14" width="7" height="7" rx="1.5"></rect><rect x="14" y="14" width="7" height="7" rx="1.5"></rect></svg><span class="tw-nav-label" data-i18n="nav.dashboard">仪表盘</span></a><a href="/tasks/" class="tw-nav-item" data-plugin-nav="tasks"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 5h10"></path><path d="M9 12h10"></path><path d="M9 19h10"></path><path d="M4 5h.01"></path><path d="M4 12h.01"></path><path d="M4 19h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.tasks">任务管理</span></a><a href="/todos/" class="tw-nav-item" data-plugin-nav="todos"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M8 6h13"></path><path d="M8 12h13"></path><path d="M8 18h13"></path><path d="M3 6h.01"></path><path d="M3 12h.01"></path><path d="M3 18h.01"></path></svg><span class="tw-nav-label" data-i18n="nav.todos">待办事项</span></a><a href="/pm/projects/" class="tw-nav-item" data-plugin-nav="projects"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"></path></svg><span class="tw-nav-label" data-i18n="nav.projects">项目列表</span></a><a href="/pm/iterations/" class="tw-nav-item" data-plugin-nav="iterations"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><rect x="3" y="5" width="18" height="16" rx="2"></rect><path d="M8 3v4"></path><path d="M16 3v4"></path><path d="M3 10h18"></path></svg><span class="tw-nav-label" data-i18n="nav.iterations">迭代管理</span></a><a href="/pm/requirements/" class="tw-nav-item" data-plugin-nav="pmRequirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.requirementsMgmt">需求管理</span></a><a href="/pm/bugs/" class="tw-nav-item" data-plugin-nav="bugs"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="14" r="5"></circle><path d="M9 6l2 2"></path><path d="M15 6l-2 2"></path><path d="M7 11H4"></path><path d="M20 11h-3"></path><path d="M7 17H4"></path><path d="M20 17h-3"></path></svg><span class="tw-nav-label" data-i18n="nav.bugs">缺陷管理</span></a><a href="/reports/" class="tw-nav-item" data-plugin-nav="reports"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h5"></path></svg><span class="tw-nav-label" data-i18n="nav.reports">工作汇报</span></a><a href="/test-stats/" class="tw-nav-item" data-plugin-nav="testStats"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 20V10"></path><path d="M10 20V4"></path><path d="M16 20v-7"></path><path d="M22 20H2"></path></svg><span class="tw-nav-label" data-i18n="nav.testStats">测试统计</span></a><a href="/case-exec/" class="tw-nav-item" data-plugin-nav="caseExec"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="9"></circle><circle cx="12" cy="12" r="5"></circle><circle cx="12" cy="12" r="1.4"></circle></svg><span class="tw-nav-label" data-i18n="nav.caseExec">用例执行统计</span></a><a href="/cases/library/" class="tw-nav-item" data-plugin-nav="cases"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M9 11l3 3L22 4"></path><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg><span class="tw-nav-label" data-i18n="nav.caseManage">用例管理</span></a><a href="/knowledge/" class="tw-nav-item" data-plugin-nav="knowledgeLib"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path></svg><span class="tw-nav-label" data-i18n="nav.knowledge">知识库管理</span></a><a href="/requirements/" class="tw-nav-item" data-plugin-nav="requirements" data-i18n-hint="nav.requirements"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M14 3v5h5"></path><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"></path><path d="M8 13h8"></path><path d="M8 17h6"></path></svg><span class="tw-nav-label" data-i18n="nav.requirements">需求文档库</span></a><a href="/templates/" class="tw-nav-item" data-plugin-nav="templates" data-i18n-hint="nav.templates"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 3 3 8l9 5 9-5-9-5z"></path><path d="m3 13 9 5 9-5"></path></svg><span class="tw-nav-label" data-i18n="nav.templates">测试模板库</span></a></div><astro-island uid="Z1lgSd4" component-url="/_astro/NavLibraries.CZlA6Z1w.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{"data-astro-transition-persist":[0,"astro-iywf7oe7-2"]}" ssr client="only" opts="{"name":"NavLibraries","value":"react"}" data-astro-transition-persist="astro-iywf7oe7-2"></astro-island><script>(function(){const host = ".tw-nav-libraries";
|
|
139
139
|
const cacheKey = "tw.hydrate.nav";
|
|
140
140
|
const fixActive = true;
|
|
141
141
|
const capture = false;
|
|
@@ -365,7 +365,7 @@ const syncNavGroups = true;
|
|
|
365
365
|
// 缓存坏了就当没有
|
|
366
366
|
}
|
|
367
367
|
})();
|
|
368
|
-
})();</script></div><a href="/prompts/" class="tw-nav-item" data-plugin-nav="prompts" data-pinned-nav="prompts"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 20h9"></path><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg><span class="tw-nav-label" data-i18n="nav.prompts">提示词管理</span></a><a href="/docs/manual/" class="tw-nav-item" data-hint="帮助中心" data-i18n-hint="nav.helpCenter"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M5 4.5h9.5L19 9v10.5H5V4.5Z" stroke-linejoin="round"></path><path d="M14.5 4.5V9H19" stroke-linejoin="round"></path><path d="M8 13h8M8 16.5h6" stroke-linecap="round"></path></svg><span class="tw-nav-label" data-i18n="nav.helpCenter">帮助中心</span></a></nav><div class="tw-nav-foot"><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).load=e,window.dispatchEvent(new Event(`astro:load`))})();</script><astro-island uid="Z12jkyC" prefix="r1" component-url="/_astro/SettingsDialog.
|
|
368
|
+
})();</script></div><a href="/prompts/" class="tw-nav-item" data-plugin-nav="prompts" data-pinned-nav="prompts"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M12 20h9"></path><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg><span class="tw-nav-label" data-i18n="nav.prompts">提示词管理</span></a><a href="/docs/manual/" class="tw-nav-item" data-hint="帮助中心" data-i18n-hint="nav.helpCenter"><svg class="tw-nav-ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><path d="M5 4.5h9.5L19 9v10.5H5V4.5Z" stroke-linejoin="round"></path><path d="M14.5 4.5V9H19" stroke-linejoin="round"></path><path d="M8 13h8M8 16.5h6" stroke-linecap="round"></path></svg><span class="tw-nav-label" data-i18n="nav.helpCenter">帮助中心</span></a></nav><div class="tw-nav-foot"><script>(function(){let e=async e=>{await(await e())()};(self.Astro||(self.Astro={})).load=e,window.dispatchEvent(new Event(`astro:load`))})();</script><astro-island uid="Z12jkyC" prefix="r1" component-url="/_astro/SettingsDialog.BpKHIbID.js" component-export="default" renderer-url="/_astro/client.BHNTqLjv.js" props="{}" ssr client="load" opts="{"name":"SettingsDialog","value":true}" await-children><div class="tw-nav-foot-row"><button type="button" class="tw-nav-settings-btn" data-hint="设置"><svg class="tw-nav-ico w-4.5 h-4.5 shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9c.2.6.7 1 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"></path></svg><span data-i18n="nav.settings">设置</span></button><button type="button" class="tw-nav-provider-chip is-empty" data-hint="未配置模型"><span class="tw-nav-provider-dot" aria-hidden="true"></span><span class="tw-nav-provider-name">未配置</span></button></div><span hidden="" style="position:fixed;top:1px;left:1px;width:1px;height:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;display:none"></span><!--astro:end--></astro-island></div></aside><script data-astro-rerun>
|
|
369
369
|
(function () {
|
|
370
370
|
try {
|
|
371
371
|
var raw = localStorage.getItem('tw.app.model.v1');
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./app-config.Bg6v8zQQ.js";import{i as t,o as n}from"./plugins.
|
|
2
|
-
`)?`pre-wrap`:``,M(),N(),c.style.display=``,p||(c.dataset.closed=``),cancelAnimationFrame(m);let i=++y;m=requestAnimationFrame(()=>{m=requestAnimationFrame(()=>{c&&i===y&&d===e&&(p=!0,delete c.dataset.closed)})}),se(),g&&window.clearTimeout(g),g=window.setTimeout(()=>{g=0,d===e&&L()},ie)}function L(){A(),j(),y+=1,m&&=(cancelAnimationFrame(m),0),d=null,C=!1,b=null,g&&=(window.clearTimeout(g),0),c&&(p=!1,c.dataset.closed=``,h&&window.clearTimeout(h),h=window.setTimeout(()=>{h=0,!p&&c&&(c.style.display=`none`)},re))}function R(e){if(!(e instanceof Element))return null;let t=e.closest(`[data-hint]`);return t instanceof HTMLElement?t:null}function z(e){T=!0,(e.clientX!==0||e.clientY!==0)&&(w={x:e.clientX,y:e.clientY});let t=R(e.target);t!==d&&(!t||!F(t)?(j(),d&&L()):t!==x&&(j(),x=t,S=window.setTimeout(()=>{S=0;let e=x;x=null,e&&e!==d&&I(e,!0)},ae)))}function B(e){let t=R(e.target);if(t&&t===x&&j(),!t||t!==d)return;let n=e.relatedTarget;n instanceof Node&&t.contains(n)||L()}function V(e){if(T)return;let t=R(e.target);t!==d&&(!t||!F(t)?d&&L():I(t,!1))}function H(e){let t=R(e.target);if(!t||t!==d)return;let n=e.relatedTarget;n instanceof Node&&t.contains(n)||L()}function U(){j(),d&&L()}function W(){d&&(E(d)||k(d)||D(d)?L():O(d))}function de(e){w={x:e.clientX,y:e.clientY},T=!0}function fe(){T=!0,j(),d&&L()}function pe(e){T=!1,e.key===`Escape`&&d&&L()}function me(){typeof document>`u`||v||(v=!0,document.addEventListener(`mouseover`,z,!0),document.addEventListener(`mouseout`,B,!0),document.addEventListener(`pointermove`,de,{capture:!0,passive:!0}),document.addEventListener(`pointerdown`,fe,!0),document.addEventListener(`focusin`,V,!0),document.addEventListener(`focusout`,H,!0),document.addEventListener(`click`,U,!0),document.addEventListener(`keydown`,pe,!0),window.addEventListener(`scroll`,W,!0),window.addEventListener(`resize`,W),window.addEventListener(`blur`,()=>{d&&L()}),document.addEventListener(`visibilitychange`,()=>{document.hidden&&d&&L()}),document.documentElement.addEventListener(`mouseleave`,()=>{d&&L()}),document.addEventListener(`astro:after-swap`,()=>{A(),y+=1,m&&=(cancelAnimationFrame(m),0),g&&=(window.clearTimeout(g),0),d=null,p=!1,b=null,c?.isConnected&&c.remove(),c=null,l=null,u=null}))}var he=[`dashboard`,`tasks`,`todos`,`projects`,`iterations`,`pmRequirements`,`bugs`,`reports`,`testStats`,`caseExec`,`cases`,`prompts`,`knowledgeLib`,`requirements`,`templates`];function ge(e){return`pluginOff${e.charAt(0).toUpperCase()}${e.slice(1)}`}function G(){let e=document.documentElement;for(let n of he){let r=ge(n);t(n)?delete e.dataset[r]:e.dataset[r]=`1`}}function _e(){G(),n(()=>G()),e().then(()=>G()),document.addEventListener(`astro:page-load`,G)}var ve=`tw-update-dot`,ye=3e5,K=`tw.update.badge.checked-at.v1`,be=15e3,xe=4,q=0,J=null,Y=!1,X=`tw.update.stale.reload.v1`;function Se(e){let t=e.status?.phase;return t===`installing`||t===`restarting`}function Ce(e){if(e.mode===`dev`&&!Se(e)&&e.current&&e.current!==
|
|
1
|
+
import{i as e}from"./app-config.Bg6v8zQQ.js";import{i as t,o as n}from"./plugins.CVnHeKyf.js";import{t as r}from"./app-version.trTEbNVs.js";import{t as i}from"./settings.Cu00if4D.js";import{t as ee}from"./update.Fq2CGmCX.js";var a=100,te=1010,ne=420,o=14,re=150,s=6,ie=3200,ae=180,c=null,l=null,u=null,d=null,f=null,p=!1,m=0,h=0,g=0,_=0,v=!1,y=0,b=null,x=null,S=0,C=!1,w=null,T=!1;function E(e){if(!e.isConnected||e.closest(`[data-closed]`)||e.checkVisibility&&!e.checkVisibility({checkVisibilityCSS:!0}))return!0;let t=e.getBoundingClientRect();return t.width===0&&t.height===0}function D(e){let t=e.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2;if(n<0||r<0||n>window.innerWidth||r>window.innerHeight)return!1;let i=document.elementFromPoint(n,r);return i?!(i===e||e.contains(i)||i.contains(e)):!1}function O(e){let t=e.getBoundingClientRect();b&&b.left===t.left&&b.top===t.top&&b.width===t.width&&b.height===t.height||(M(),N())}function k(e){let t=e.getBoundingClientRect();return t.bottom<=0||t.top>=window.innerHeight||t.right<=0||t.left>=window.innerWidth}function oe(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom}function A(){_&&=(cancelAnimationFrame(_),0)}function j(){x=null,S&&=(window.clearTimeout(S),0)}function se(){A();let e=()=>{_=0;let t=d;t&&(E(t)||k(t)||D(t)||C&&w&&!oe(t.getBoundingClientRect(),w.x,w.y)||!C&&!t.contains(document.activeElement)?L():(O(t),_=requestAnimationFrame(e)))};_=requestAnimationFrame(e)}function ce(){c&&c.isConnected||(c=document.createElement(`div`),c.setAttribute(`role`,`tooltip`),c.className=`tw-tooltip tw-tooltip-anim pointer-events-none fixed rounded-md px-2 py-1 text-[12px] leading-5 break-all text-stone-700 shadow-lg`,c.style.zIndex=String(a),c.style.maxHeight=`40vh`,c.style.overflowY=`auto`,c.dataset.closed=``,l=document.createElement(`span`),l.setAttribute(`aria-hidden`,`true`),l.className=`tw-tooltip-arrow absolute h-2 w-2`,l.style.transform=`translateX(-50%) rotate(45deg)`,u=document.createTextNode(``),c.append(l,u),document.body.appendChild(c))}function M(){if(!d)return;let e=d.getBoundingClientRect(),t=Math.min(Math.max(e.width,160),ne),n=e.bottom+72>window.innerHeight-8,r=n?e.top-s:e.bottom+s,i=Math.max(8,Math.min(e.left,Math.max(8,window.innerWidth-t-8)));f={top:r,left:i,maxWidth:t,openUp:n,arrowLeft:Math.max(o,Math.min(e.left+e.width/2-i,t-o))},b={left:e.left,top:e.top,width:e.width,height:e.height}}function N(){if(!c||!l||!f)return;let e=d?.dataset.hintLayer===`popover`;c.style.zIndex=String(e?te:a),c.style.maxHeight=e?``:`40vh`,c.style.overflowY=e?`visible`:`auto`,c.style.top=`${f.top}px`,c.style.left=`${f.left}px`,c.style.maxWidth=`${f.maxWidth}px`,c.classList.toggle(`is-up`,f.openUp),c.classList.toggle(`is-down`,!f.openUp),l.classList.toggle(`is-up`,f.openUp),l.classList.toggle(`is-down`,!f.openUp),l.style.left=`${f.arrowLeft}px`,l.style.top=f.openUp?``:`-5px`,l.style.bottom=f.openUp?`-5px`:``}function le(e){let t=e.innerText||``;return e.querySelectorAll(`[class*="sr-only"]`).forEach(e=>{let n=e.innerText;n&&(t=t.replace(n,``))}),t.replace(/\s+/g,` `).trim()}function ue(e){return e.scrollWidth>e.clientWidth+1||e.scrollHeight>e.clientHeight+1}function P(e){return e.dataset.hintAlways!==void 0||e.dataset.hintFit===void 0&&!le(e)||ue(e)}function F(e){return!!e.dataset.hint&&P(e)}function I(e,t){let n=e.dataset.hint??``;if(!n||!P(e))return;let r=e.getBoundingClientRect();if(!r.width||!r.height||e.checkVisibility&&!e.checkVisibility({checkVisibilityCSS:!0})||D(e)||(ce(),!c||!u))return;d=e,C=t,h&&=(window.clearTimeout(h),0),u.data=n,c.style.whiteSpace=n.includes(`
|
|
2
|
+
`)?`pre-wrap`:``,M(),N(),c.style.display=``,p||(c.dataset.closed=``),cancelAnimationFrame(m);let i=++y;m=requestAnimationFrame(()=>{m=requestAnimationFrame(()=>{c&&i===y&&d===e&&(p=!0,delete c.dataset.closed)})}),se(),g&&window.clearTimeout(g),g=window.setTimeout(()=>{g=0,d===e&&L()},ie)}function L(){A(),j(),y+=1,m&&=(cancelAnimationFrame(m),0),d=null,C=!1,b=null,g&&=(window.clearTimeout(g),0),c&&(p=!1,c.dataset.closed=``,h&&window.clearTimeout(h),h=window.setTimeout(()=>{h=0,!p&&c&&(c.style.display=`none`)},re))}function R(e){if(!(e instanceof Element))return null;let t=e.closest(`[data-hint]`);return t instanceof HTMLElement?t:null}function z(e){T=!0,(e.clientX!==0||e.clientY!==0)&&(w={x:e.clientX,y:e.clientY});let t=R(e.target);t!==d&&(!t||!F(t)?(j(),d&&L()):t!==x&&(j(),x=t,S=window.setTimeout(()=>{S=0;let e=x;x=null,e&&e!==d&&I(e,!0)},ae)))}function B(e){let t=R(e.target);if(t&&t===x&&j(),!t||t!==d)return;let n=e.relatedTarget;n instanceof Node&&t.contains(n)||L()}function V(e){if(T)return;let t=R(e.target);t!==d&&(!t||!F(t)?d&&L():I(t,!1))}function H(e){let t=R(e.target);if(!t||t!==d)return;let n=e.relatedTarget;n instanceof Node&&t.contains(n)||L()}function U(){j(),d&&L()}function W(){d&&(E(d)||k(d)||D(d)?L():O(d))}function de(e){w={x:e.clientX,y:e.clientY},T=!0}function fe(){T=!0,j(),d&&L()}function pe(e){T=!1,e.key===`Escape`&&d&&L()}function me(){typeof document>`u`||v||(v=!0,document.addEventListener(`mouseover`,z,!0),document.addEventListener(`mouseout`,B,!0),document.addEventListener(`pointermove`,de,{capture:!0,passive:!0}),document.addEventListener(`pointerdown`,fe,!0),document.addEventListener(`focusin`,V,!0),document.addEventListener(`focusout`,H,!0),document.addEventListener(`click`,U,!0),document.addEventListener(`keydown`,pe,!0),window.addEventListener(`scroll`,W,!0),window.addEventListener(`resize`,W),window.addEventListener(`blur`,()=>{d&&L()}),document.addEventListener(`visibilitychange`,()=>{document.hidden&&d&&L()}),document.documentElement.addEventListener(`mouseleave`,()=>{d&&L()}),document.addEventListener(`astro:after-swap`,()=>{A(),y+=1,m&&=(cancelAnimationFrame(m),0),g&&=(window.clearTimeout(g),0),d=null,p=!1,b=null,c?.isConnected&&c.remove(),c=null,l=null,u=null}))}var he=[`dashboard`,`tasks`,`todos`,`projects`,`iterations`,`pmRequirements`,`bugs`,`reports`,`testStats`,`caseExec`,`cases`,`prompts`,`knowledgeLib`,`requirements`,`templates`];function ge(e){return`pluginOff${e.charAt(0).toUpperCase()}${e.slice(1)}`}function G(){let e=document.documentElement;for(let n of he){let r=ge(n);t(n)?delete e.dataset[r]:e.dataset[r]=`1`}}function _e(){G(),n(()=>G()),e().then(()=>G()),document.addEventListener(`astro:page-load`,G)}var ve=`tw-update-dot`,ye=3e5,K=`tw.update.badge.checked-at.v1`,be=15e3,xe=4,q=0,J=null,Y=!1,X=`tw.update.stale.reload.v1`;function Se(e){let t=e.status?.phase;return t===`installing`||t===`restarting`}function Ce(e){if(e.mode===`dev`&&!Se(e)&&e.current&&e.current!==r){try{let e=Number(localStorage.getItem(X))||0;if(Date.now()-e<6e4)return;localStorage.setItem(X,String(Date.now()))}catch{}window.location.reload()}}function we(){try{return Number(localStorage.getItem(K))||0}catch{return 0}}function Te(){try{localStorage.setItem(K,String(Date.now()))}catch{}}function Z(e,t,n){e.hidden=!n,e.closest(`.tw-nav-brand-ver`)?.classList.toggle(`has-update`,n),n&&e.setAttribute(`aria-label`,t?`有新版本可用 v${t}`:`有新版本可更新`)}function Ee(e,t){q>=xe||(q+=1,J!==null&&window.clearTimeout(J),J=window.setTimeout(()=>{J=null,Q(e,t)},be))}async function Q(e,t){if(!Y){Y=!0;try{let n=await ee(t);if(!n){Ee(e,t);return}q=0,Te();let i=!!n.current&&n.current!==r;Z(e,n.latest,!!n.hasUpdate||i),i&&Ce(n)}finally{Y=!1}}}function $(){let e=document.getElementById(ve);if(!e)return;e.dataset.bound!==`1`&&(e.dataset.bound=`1`,e.addEventListener(`click`,e=>{e.preventDefault(),e.stopPropagation(),window.dispatchEvent(new CustomEvent(i,{detail:{tab:`general`}}))}));let t=Date.now()-we()>ye;q=0,Q(e,t)}function De(){document.addEventListener(`astro:page-load`,$),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&$()}),document.readyState!==`loading`&&$()}me(),_e(),De();
|