dsh-plugin-tool-management 0.21.3 → 0.21.4
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 +24 -0
- package/README.md +2 -4
- package/README_EN.md +2 -2
- package/docs/UPDATE.md +1 -0
- package/lib/client.js +465 -178
- package/lib/index.js +37 -13
- package/lib/memories/archive-engine.js +1 -1
- package/lib/op-registry.js +5 -1
- package/lib/ops/scope.js +114 -11
- package/lib/scope/intent.js +6 -5
- package/lib/tools/mcp.js +1 -1
- package/package.json +2 -2
package/lib/client.js
CHANGED
|
@@ -170,7 +170,7 @@ button.dsm-qty:disabled{cursor:default}
|
|
|
170
170
|
铁律:**同一行 / 同一组按钮必须同高** —— 行里有实心或常规动作就整行 30px(弹窗脚、
|
|
171
171
|
页头动作条),整行都是行内小动作才整行 24px(列表行、回收站行、分段组)。
|
|
172
172
|
(CSS 注释里别写反引号:这段整体在 JS 模板字符串里,反引号会把字符串截断。) */
|
|
173
|
-
.dsm-btn{box-sizing:border-box;display:inline-flex;min-height:30px;align-items:center;justify-content:center;padding:0 12px;border:1px solid transparent;border-radius:var(--dsm-radius-m);background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);font:inherit;font-size:13px;font-weight:600;white-space:nowrap;cursor:pointer}.dsm-btn:hover:not(:disabled){opacity:.9}.dsm-btn:disabled{opacity:.48;cursor:default}.dsm-btn-secondary{border-color:var(--dsw-alias-border-l2);background:transparent;color:var(--dsw-alias-label-primary)}.dsm-btn-quiet{border-color:var(--dsw-alias-border-l2);background:transparent;color:var(--dsw-alias-label-primary);min-height:24px;padding:0 8px;font-size:12px;font-weight:400}.dsm-btn-danger{border-color:transparent;background:var(--dsw-alias-state-error-primary);color:#fff}.dsm-btn-lock{background:transparent;color:var(--dsm-warn)}/* 焦点环**分三项写、不写 outline 简写**(PR #18 指出的问题,2026-10-17 实测确认):
|
|
173
|
+
.dsm-btn{box-sizing:border-box;display:inline-flex;min-height:30px;align-items:center;justify-content:center;padding:0 12px;border:1px solid transparent;border-radius:var(--dsm-radius-m);background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);font:inherit;font-size:13px;font-weight:600;white-space:nowrap;cursor:pointer}.dsm-btn:hover:not(:disabled){opacity:.9}.dsm-btn:disabled{opacity:.48;cursor:default}.dsm-btn-secondary{border-color:var(--dsw-alias-border-l2);background:transparent;color:var(--dsw-alias-label-primary)}.dsm-btn-quiet{border-color:var(--dsw-alias-border-l2);background:transparent;color:var(--dsw-alias-label-primary);min-height:24px;padding:0 8px;font-size:12px;font-weight:400}.dsm-btn-danger{border-color:transparent;background:var(--dsw-alias-state-error-primary);color:#fff}.dsm-btn-danger-outline{border-color:var(--dsw-alias-state-error-primary);background:transparent;color:var(--dsw-alias-state-error-primary)}.dsm-btn-danger-outline:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger);color:var(--dsw-alias-state-error-primary)}.dsm-btn-lock{background:transparent;color:var(--dsm-warn)}/* 焦点环**分三项写、不写 outline 简写**(PR #18 指出的问题,2026-10-17 实测确认):
|
|
174
174
|
宿主 focus.css 只声明 outline-color / outline-width、刻意不声明 outline-style,
|
|
175
175
|
好让「控件自己设了 outline:none 就真的不画」。outline:2px solid <色> 这种简写会把
|
|
176
176
|
outline-style 一起重置成 solid,等于替宿主"重新打开"那些本该没有环的控件。
|
|
@@ -2192,15 +2192,13 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2192
2192
|
}
|
|
2193
2193
|
|
|
2194
2194
|
/**
|
|
2195
|
-
* 把 `update-status`
|
|
2195
|
+
* 把 `update-status` 的答案压成一句话。
|
|
2196
2196
|
*
|
|
2197
|
-
*
|
|
2198
|
-
*
|
|
2199
|
-
* 「更新检查暂不可用」,而用户会在同一屏看到两个互相矛盾的结论。
|
|
2197
|
+
* 单独抽出来是为了让状态判定只有一处:`update-check.ts` 里新增一个 status 时,
|
|
2198
|
+
* 缺分支会显式落到「更新检查暂不可用」,不会散在各调用点各猜一套。
|
|
2200
2199
|
*
|
|
2201
2200
|
* 取词器**由调用方传入**(`t`):本函数在 factory 作用域(4 空格),按闭包边界纪律不能
|
|
2202
|
-
* 引用 apply 作用域绑定的那份 `t
|
|
2203
|
-
* 传进来即可,两处文案仍然同源。
|
|
2201
|
+
* 引用 apply 作用域绑定的那份 `t`。传进来即可,文案仍然同源。
|
|
2204
2202
|
*
|
|
2205
2203
|
* @param {object|null} info `update-status` 的返回;缺字段一律按 `?` 兜底,不抛错
|
|
2206
2204
|
* @param {(key: string, params?: object) => string} t 取词器
|
|
@@ -2362,11 +2360,15 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2362
2360
|
* (颜色统一为绿/灰,这个标记只留给"来源点"与统计用)。全局层恒 `scoped: false`。
|
|
2363
2361
|
*/
|
|
2364
2362
|
function scopeFlag(domain, key, globalValue) {
|
|
2365
|
-
//
|
|
2363
|
+
// 全局 blocked(旧版「统一关闭」留下的持久停机)压过一切会话层(与后端 `resolveResource` 同一条):会话里的覆盖、
|
|
2366
2364
|
// 场景勾选、逐工具 / 单条技能的推导都不能把它显成开着 —— 否则开关是绿的、模型调不到。
|
|
2367
|
-
//
|
|
2365
|
+
// 技能还要看所在来源:来源被 blocked 时,技能级开着也加载不到。
|
|
2368
2366
|
if (domain === 'mcp' || domain === 'skills' || domain === 'skillSources') {
|
|
2369
|
-
|
|
2367
|
+
var intentState = scopeIntentOf(domain, key)
|
|
2368
|
+
if (intentState === 'blocked') return { value: false, scoped: false }
|
|
2369
|
+
// 意图比列表里那份 `globalOn` 新:写完统一关闭后列表还没重读,全局开关也该立刻翻过去。
|
|
2370
|
+
if (intentState === 'on') globalValue = true
|
|
2371
|
+
else if (intentState === 'off') globalValue = false
|
|
2370
2372
|
}
|
|
2371
2373
|
if (domain === 'mcpTools') {
|
|
2372
2374
|
var mt = String(key).indexOf('/')
|
|
@@ -2385,7 +2387,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2385
2387
|
//
|
|
2386
2388
|
// MCP 服务器与技能来源两格的全局开关**不是**补丁 / 来源状态,而是意图:
|
|
2387
2389
|
// on —— 全局启用;off —— 全局关闭(有会话还在用就保持运行,即租约);
|
|
2388
|
-
// blocked ——
|
|
2390
|
+
// blocked —— 持久停机(旧版统一关闭;压过租约与一切会话层)。
|
|
2389
2391
|
// 界面上的全局开关读意图;"临时运行 · N 个对话"来自 `leases`,它是全局 off 却能跑的
|
|
2390
2392
|
// 唯一解释。会话层不显示意图(那一层只回答"这个对话看不看得到")。
|
|
2391
2393
|
/** 某一格的全局意图:`'on' | 'off' | 'blocked' | null`(没记录 = 跟随运行态)。 */
|
|
@@ -2401,6 +2403,79 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2401
2403
|
var n = leases && typeof leases === 'object' ? Number(leases[key]) : 0
|
|
2402
2404
|
return Number.isFinite(n) && n > 0 ? Math.floor(n) : 0
|
|
2403
2405
|
}
|
|
2406
|
+
/** 这一域此刻有租约的键(全局层专用;会话层返回空)。「全部关闭」按它取目标集。 */
|
|
2407
|
+
function scopeLeaseKeys(domain) {
|
|
2408
|
+
if (scopeIsSession()) return []
|
|
2409
|
+
var leases = scopeState.global && scopeState.global.leases ? scopeState.global.leases[domain] : null
|
|
2410
|
+
if (!leases || typeof leases !== 'object') return []
|
|
2411
|
+
return Object.keys(leases).filter(function (key) { return Number(leases[key]) > 0 })
|
|
2412
|
+
}
|
|
2413
|
+
/**
|
|
2414
|
+
* 统一关闭成功后**就地**摘掉本地快照里的租约与意图,不等 `scope-get` 回来。
|
|
2415
|
+
*
|
|
2416
|
+
* 为什么不能改成再拉一次:服务端快照有短 TTL,紧接着的 `scope-get` 可能仍是写前的
|
|
2417
|
+
* 那一份 —— 徽章会先消失又冒回来;而且整层重拉会让列表按新状态重新定序,用户刚打开的
|
|
2418
|
+
* 几条会被顶到最前。这里只改这次操作真正碰到的那几格。
|
|
2419
|
+
*/
|
|
2420
|
+
function scopeForgetLeases(domain, keys) {
|
|
2421
|
+
if (scopeIsSession()) return
|
|
2422
|
+
var global = scopeState.global
|
|
2423
|
+
if (!global) return
|
|
2424
|
+
var list = (Array.isArray(keys) ? keys : [keys]).map(function (key) { return String(key) })
|
|
2425
|
+
if (!list.length) return
|
|
2426
|
+
var patch = {}
|
|
2427
|
+
var leases = global.leases || {}
|
|
2428
|
+
var domainLeases = Object.assign({}, leases[domain] || {})
|
|
2429
|
+
var leasesChanged = false
|
|
2430
|
+
list.forEach(function (key) {
|
|
2431
|
+
if (domainLeases[key] !== undefined) { delete domainLeases[key]; leasesChanged = true }
|
|
2432
|
+
})
|
|
2433
|
+
if (leasesChanged) {
|
|
2434
|
+
var nextLeases = Object.assign({}, leases)
|
|
2435
|
+
nextLeases[domain] = domainLeases
|
|
2436
|
+
patch.leases = nextLeases
|
|
2437
|
+
}
|
|
2438
|
+
if (domain === 'mcp' || domain === 'skills' || domain === 'skillSources') {
|
|
2439
|
+
var intent = global.intent || {}
|
|
2440
|
+
var nextDomainIntent = Object.assign({}, intent[domain] || {})
|
|
2441
|
+
list.forEach(function (key) { nextDomainIntent[key] = 'off' })
|
|
2442
|
+
var nextIntent = Object.assign({}, intent)
|
|
2443
|
+
nextIntent[domain] = nextDomainIntent
|
|
2444
|
+
patch.intent = nextIntent
|
|
2445
|
+
}
|
|
2446
|
+
if (patch.leases === undefined && patch.intent === undefined) return
|
|
2447
|
+
setScopeState({ global: Object.assign({}, global, patch) })
|
|
2448
|
+
}
|
|
2449
|
+
/** 有多少个会话 / 工作区进入了场景(全局层专用;会话层返回 0)。传场景名只数那一个。 */
|
|
2450
|
+
function scopeSceneLeaseCount(sceneName) {
|
|
2451
|
+
if (scopeIsSession()) return 0
|
|
2452
|
+
var global = scopeState.global
|
|
2453
|
+
if (!global) return 0
|
|
2454
|
+
var raw = sceneName === undefined
|
|
2455
|
+
? global.sceneLeases
|
|
2456
|
+
: (global.sceneLeaseCounts || {})[String(sceneName)]
|
|
2457
|
+
var n = Number(raw)
|
|
2458
|
+
return Number.isFinite(n) && n > 0 ? Math.floor(n) : 0
|
|
2459
|
+
}
|
|
2460
|
+
/** 统一关闭某个(或全部)场景后,就地改本地计数 —— 理由同 `scopeForgetLeases`。 */
|
|
2461
|
+
function scopeForgetSceneLeases(sceneName) {
|
|
2462
|
+
if (scopeIsSession()) return
|
|
2463
|
+
var global = scopeState.global
|
|
2464
|
+
if (!global) return
|
|
2465
|
+
var counts = Object.assign({}, global.sceneLeaseCounts || {})
|
|
2466
|
+
var total = Number(global.sceneLeases) || 0
|
|
2467
|
+
if (sceneName === undefined) {
|
|
2468
|
+
counts = {}
|
|
2469
|
+
total = 0
|
|
2470
|
+
} else {
|
|
2471
|
+
var key = String(sceneName)
|
|
2472
|
+
var n = Number(counts[key]) || 0
|
|
2473
|
+
if (n <= 0) return
|
|
2474
|
+
delete counts[key]
|
|
2475
|
+
total = Math.max(0, total - n)
|
|
2476
|
+
}
|
|
2477
|
+
setScopeState({ global: Object.assign({}, global, { sceneLeaseCounts: counts, sceneLeases: total }) })
|
|
2478
|
+
}
|
|
2404
2479
|
/** 全局开关的**显示值**:意图优先(blocked 也是关),没记录才落到运行态。 */
|
|
2405
2480
|
function scopeGlobalOn(domain, key, runningOn) {
|
|
2406
2481
|
var state = scopeIntentOf(domain, key)
|
|
@@ -3161,9 +3236,6 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
3161
3236
|
const [liveCopied, setLiveCopied] = React.useState(false)
|
|
3162
3237
|
// 功能总览(B6):按功能点看"现在到底能不能用"。数据来自 feature-overview(只读聚合)。
|
|
3163
3238
|
const [features, setFeatures] = React.useState(null)
|
|
3164
|
-
// 更新检查(0.21.2):只读、可缓存。取不到就整行不显示 —— 它不参与"能不能安全动数据"的结论。
|
|
3165
|
-
const [updateInfo, setUpdateInfo] = React.useState(null)
|
|
3166
|
-
const [updateCopied, setUpdateCopied] = React.useState(false)
|
|
3167
3239
|
// 诊断包(0.21.2):一段可复制的纯文本,不含密钥 / 正文 / 日志内容。
|
|
3168
3240
|
const [diagCopied, setDiagCopied] = React.useState(false)
|
|
3169
3241
|
const [busy, setBusy] = React.useState(false)
|
|
@@ -3677,13 +3749,6 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
3677
3749
|
.then(function (r) { if (alive !== false && r && r.ok) setFeatures(r) })
|
|
3678
3750
|
.catch(function () { /* 同上 */ })
|
|
3679
3751
|
}
|
|
3680
|
-
// 更新检查:只回答"有没有与**本宿主**兼容的新版",不改任何配置。
|
|
3681
|
-
// 失败(无网 / 代理 / registry 故障)不弹错误横幅 —— 这一行只是信息,不是体检结论。
|
|
3682
|
-
const loadUpdate = function (alive, force) {
|
|
3683
|
-
apiCall('update-status', force ? { refresh: true } : {})
|
|
3684
|
-
.then(function (r) { if (alive !== false && r && r.ok) setUpdateInfo(r) })
|
|
3685
|
-
.catch(function () { /* 静默:没有更新信息不影响本页任何结论 */ })
|
|
3686
|
-
}
|
|
3687
3752
|
/** 复制诊断包:服务端只回白名单字段拼成的纯文本,界面不自己拼(避免两处口径分家)。 */
|
|
3688
3753
|
const copyDiagnostics = function () {
|
|
3689
3754
|
apiCall('diagnostics', {}).then(function (r) {
|
|
@@ -3721,7 +3786,6 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
3721
3786
|
loadSlash(alive)
|
|
3722
3787
|
loadLive(alive)
|
|
3723
3788
|
loadFeatures(alive)
|
|
3724
|
-
loadUpdate(alive)
|
|
3725
3789
|
loadToken(alive)
|
|
3726
3790
|
loadBackups(alive)
|
|
3727
3791
|
return function () { alive = false }
|
|
@@ -4745,38 +4809,6 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
4745
4809
|
.replace('{verified}', String(data.verifiedVersion))))
|
|
4746
4810
|
}
|
|
4747
4811
|
|
|
4748
|
-
// 更新检查(0.21.2):只报"有没有与**本宿主**兼容的新版",不改配置、不自动更新。
|
|
4749
|
-
// 与体检结论分开显示:它是一条信息,不是"能不能安全动数据"的一部分。
|
|
4750
|
-
//
|
|
4751
|
-
// `local-ahead` 整行不渲染(用户 2026-10-22 裁定:删掉「本地版本 X 比 registry 上
|
|
4752
|
-
// 兼容的最高版 Y 更新」+「复制安装命令」)。本地比 registry 最高兼容版还新时,
|
|
4753
|
-
// registry 上没有任何**可装**的版本 —— 这句话没有下文可执行;更糟的是右边那颗
|
|
4754
|
-
// 按钮仍然会出来,而它的命令 pin 的是 `bestCompatible`(见 update-check.ts 的
|
|
4755
|
-
// `finish()`:只要 bestCompatible 存在就拼 command),点下去是**降级**。既然这一
|
|
4756
|
-
// 行没有可做的事,就不要占位。
|
|
4757
|
-
if (updateInfo && String(updateInfo.status || '') !== 'local-ahead') {
|
|
4758
|
-
const st = String(updateInfo.status || 'unknown')
|
|
4759
|
-
// 文案由 `updateStatusText` 一处生成:顶部栏那颗 GitHub 图标点击后说的是**同一句**
|
|
4760
|
-
// (见 20 片)。这里只留"语气"这一层判断 —— 有更新时整行标黄。
|
|
4761
|
-
const updateText = updateStatusText(updateInfo, t)
|
|
4762
|
-
const copyCmd = function () {
|
|
4763
|
-
if (!updateInfo.command) return
|
|
4764
|
-
try {
|
|
4765
|
-
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
4766
|
-
navigator.clipboard.writeText(String(updateInfo.command)).then(function () {
|
|
4767
|
-
setUpdateCopied(true)
|
|
4768
|
-
setTimeout(function () { setUpdateCopied(false) }, 1500)
|
|
4769
|
-
})
|
|
4770
|
-
}
|
|
4771
|
-
} catch (e) { /* 剪贴板不可用:命令仍可手动选中复制 */ }
|
|
4772
|
-
}
|
|
4773
|
-
push(React.createElement('p', { className: 'dsm-help' + (st === 'update-available' ? ' dsm-help-warn' : '') },
|
|
4774
|
-
updateText,
|
|
4775
|
-
updateInfo.command ? React.createElement('button', {
|
|
4776
|
-
type: 'button', className: 'dsm-btn dsm-btn-quiet', title: String(updateInfo.command), onClick: copyCmd,
|
|
4777
|
-
}, updateCopied ? t('compat.update.copied') : t('compat.update.copy')) : null))
|
|
4778
|
-
}
|
|
4779
|
-
|
|
4780
4812
|
// 功能总览(B6):一行一个功能点,状态 = 装配层 + 宿主能力层 + 用户配置层 的合成
|
|
4781
4813
|
// (服务端聚合,见 feature-overview)。行可点,跳到该功能所在的页签。
|
|
4782
4814
|
if (features && Array.isArray(features.rows) && features.rows.length) {
|
|
@@ -5607,7 +5639,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5607
5639
|
const DICT = {
|
|
5608
5640
|
zh: {
|
|
5609
5641
|
"title": "技能", "desc": "管理技能:启停、导入、创建、回收站。", "link.project": "GitHub", "link.feedback": "问题反馈",
|
|
5610
|
-
"btn.create": "新增", "btn.import": "导入", "btn.refresh": "刷新", "btn.refreshing": "刷新中…", "btn.cancel": "取消", "btn.close": "关闭", "stale.write.conflict": "文件已在别处被修改:重新加载后再改,或选择覆盖保存。", "stale.write.conflictApply": "全局 AGENTS.md 已在别处被修改,已拒绝应用。请刷新页面确认内容后再试。", "stale.write.reload": "重新加载", "stale.write.overwrite": "覆盖保存", "row.menu": "「{name}」的更多操作", "export.hint": "导出为 zip,写入指定目录;只读不改。", "export.outDir": "导出目录", "export.pickDir": "选择导出目录", "export.submit": "导出", "export.busy": "导出中…", "export.done": "已导出 {count} 个文件到 {path}", "scenes.lock.lock": "锁定", "scenes.lock.unlock": "解锁", "scenes.lock.tag": "已锁定", "scenes.lock.hint": "锁定后五个管理域(MCP / 技能 / 子智能体 / 记忆 / 提示词)整体只读;场景启停不受影响", "scenes.lock.blockedEdit": "场景已锁定:先解锁再修改", "scenes.lock.notActive": "场景未启动:先启动再锁定", "scenes.lock.blockedExit": "场景已锁定:先解锁再关闭", "lock.banner": "有场景处于锁定状态:MCP / 技能 / 子智能体 / 记忆 / 提示词已整体冻结,先到场景页解锁再修改。", "scene.switch.banner": "处于「{scene}」场景:依旧可以更改配置,改动会同步档案,退出后状态还原。", "scene.sync.failed": "注意:改动已生效,但没能同步写进场景档案({error})——本次进场景期间有效,重新进这个场景时会按旧档案应用。", "state.sync.failed": "注意:启停状态没能写入({error})——受影响的条目可能停在启用态、下一轮进入模型上下文,请在本页确认开关。", "agm.apply.rebindScene": "场景「{scene}」接管中:应用这一份会把该场景改绑到它(同步写入场景档案)", "export.empty": "没有可导出的条目", "export.pickAll": "全选", "export.pickNone": "取消全选", "export.group.count": "{count} 项", "export.missing": ";跳过 {count} 项(文件不存在):{names}", "export.skills": "导出", "export.subagents": "导出", "export.presets": "导出", "export.memories": "导出", "btn.detail": "详情", "btn.trash": "删除", "btn.restore": "恢复", "btn.delete.forever": "永久删除", "btn.file.pick": "选择文件", "btn.folder.pick": "选择文件夹", "btn.create.now": "
|
|
5642
|
+
"btn.create": "新增", "btn.import": "导入", "btn.refresh": "刷新", "btn.refreshing": "刷新中…", "btn.cancel": "取消", "btn.close": "关闭", "stale.write.conflict": "文件已在别处被修改:重新加载后再改,或选择覆盖保存。", "stale.write.conflictApply": "全局 AGENTS.md 已在别处被修改,已拒绝应用。请刷新页面确认内容后再试。", "stale.write.reload": "重新加载", "stale.write.overwrite": "覆盖保存", "row.menu": "「{name}」的更多操作", "export.hint": "导出为 zip,写入指定目录;只读不改。", "export.outDir": "导出目录", "export.pickDir": "选择导出目录", "export.submit": "导出", "export.busy": "导出中…", "export.done": "已导出 {count} 个文件到 {path}", "scenes.lock.lock": "锁定", "scenes.lock.unlock": "解锁", "scenes.lock.tag": "已锁定", "scenes.lock.hint": "锁定后五个管理域(MCP / 技能 / 子智能体 / 记忆 / 提示词)整体只读;场景启停不受影响", "scenes.lock.blockedEdit": "场景已锁定:先解锁再修改", "scenes.lock.notActive": "场景未启动:先启动再锁定", "scenes.lock.blockedExit": "场景已锁定:先解锁再关闭", "lock.banner": "有场景处于锁定状态:MCP / 技能 / 子智能体 / 记忆 / 提示词已整体冻结,先到场景页解锁再修改。", "scene.switch.banner": "处于「{scene}」场景:依旧可以更改配置,改动会同步档案,退出后状态还原。", "scene.sync.failed": "注意:改动已生效,但没能同步写进场景档案({error})——本次进场景期间有效,重新进这个场景时会按旧档案应用。", "state.sync.failed": "注意:启停状态没能写入({error})——受影响的条目可能停在启用态、下一轮进入模型上下文,请在本页确认开关。", "agm.apply.rebindScene": "场景「{scene}」接管中:应用这一份会把该场景改绑到它(同步写入场景档案)", "export.empty": "没有可导出的条目", "export.pickAll": "全选", "export.pickNone": "取消全选", "export.group.count": "{count} 项", "export.missing": ";跳过 {count} 项(文件不存在):{names}", "export.skills": "导出", "export.subagents": "导出", "export.presets": "导出", "export.memories": "导出", "btn.detail": "详情", "btn.edit": "编辑", "btn.save": "保存", "btn.trash": "删除", "btn.restore": "恢复", "btn.delete.forever": "永久删除", "btn.file.pick": "选择文件", "btn.folder.pick": "选择文件夹", "btn.create.now": "创建", "btn.disable": "停用", "btn.enable": "启用", "btn.open.editor": "编辑器查看", "btn.activate": "启用这个", "btn.activate.title": "把当前来源的版本设为同名技能的首选并启用(不改动任何源文件)", "btn.unprefer": "取消首选", "btn.unprefer.title": "取消同名首选,回到按来源优先级自动选择",
|
|
5611
5643
|
"btn.custom.add": "添加目录", "btn.custom.remove": "移除", "btn.openDir": "选择",
|
|
5612
5644
|
"btn.source.remove": "移除来源", "btn.source.remove.title": "不再读取这个来源(源文件不动,之后可在回收站里恢复)", "btn.source.restore": "恢复", "btn.source.forget": "永久删除",
|
|
5613
5645
|
"trash.section.dirs": "目录", "trash.section.skills": "技能", "trash.section.dirs.sub": "只是不再读取,磁盘文件一个字节都不动", "trash.section.dirs.empty": "没有被移除的来源", "trash.section.skills.sub": "文件真的被移走了:恢复能还原,永久删除会删掉文件", "trash.section.presets.sub": "预设目录已移走:恢复能还原,永久删除会删掉文件", "trash.section.scenes.sub": "场景记录、档案与它的记忆都在这里:恢复会整条放回", "trash.section.agents.sub": "人设文件已移走:恢复能还原,永久删除会删掉文件", "trash.section.memories.sub": "记忆正文已移走:恢复会放回索引,永久删除会删掉正文",
|
|
@@ -5635,7 +5667,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5635
5667
|
"empty.search": "没有匹配的技能", "empty.source": "该来源不存在或暂无技能", "loading": "正在加载技能…", "note.missing": "未提供简介", "source.toggle": "启停来源", "skill.toggle": "启停技能",
|
|
5636
5668
|
"source.external.note": "只读接入,启停不改写源文件", "source.dsh.note": "可创建、导入、移到回收站;默认来源必须读取,不能移除或停用",
|
|
5637
5669
|
"detail.title": "技能详情", "detail.body": "正文", "detail.frontmatter": "元数据", "detail.noFrontmatter": "该技能未提供元数据。", "detail.diagnostics": "诊断", "detail.path": "源文件", "detail.noIssues": "未发现诊断问题。",
|
|
5638
|
-
"create.title": "创建技能", "create.target": "创建位置", "create.name": "名称", "create.name.placeholder": "例如 code-review-helper", "create.description": "简介", "create.description.placeholder": "一句话说明什么时候使用", "create.body": "正文(Markdown)", "create.body.placeholder": "写下技能要遵循的指令、步骤和边界…",
|
|
5670
|
+
"create.title": "创建技能", "skill.editTitle": "编辑技能", "skill.edit.nameLocked": "技能名不可改:注入键与场景绑定都按它寻址。", "skill.edit.done": "已保存技能「{name}」。", "create.target": "创建位置", "create.name": "名称", "create.name.placeholder": "例如 code-review-helper", "create.description": "简介", "create.description.placeholder": "一句话说明什么时候使用", "create.body": "正文(Markdown)", "create.body.placeholder": "写下技能要遵循的指令、步骤和边界…",
|
|
5639
5671
|
"skill.attach.label": "附件(可选)", "skill.attach.new": "新建附件", "skill.attach.pick": "选择附件", "skill.attach.dir": "文件夹(可选)", "skill.attach.dir.placeholder": "例如 references", "skill.attach.name": "文件名", "skill.attach.name.placeholder": "例如 api.md", "skill.attach.files": "要导入的文件", "skill.attach.drop.copy": "可多选", "skill.attach.done": "完成", "skill.attach.content": "内容", "skill.attach.content.placeholder": "把这个文件的内容写在这里(可留空)", "skill.attach.add": "加入", "skill.attach.edit": "编辑", "skill.attach.remove": "移除附件", "skill.attach.dup": "已有同名附件:{path}", "skill.attach.nameRequired": "文件名不能为空", "skill.attach.baddir": "文件夹名不合法:不能含 ..", "skill.attach.badname": "文件名不合法:不能以 / 结尾,也不能含 ..", "skill.attach.reserved": "SKILL.md 是技能正文,不能作为附件加进来:{path}", "skill.attach.tooLarge": "{name} 超过 {limit} MB", "detail.attachments": "附件",
|
|
5640
5672
|
"import.title": "导入技能", "upload.drop.title": "点击或拖入此处", "upload.drop.copy": "支持 .zip、技能文件夹或单个 SKILL.md", "upload.drop.mzip": "支持 .md 或 .zip", "upload.drop.prompt": "支持 .md", "upload.drop.session": "支持 .jsonl / .json / .md / .txt", "upload.req.mdzip": "支持 .md / .zip,同名自动跳过", "upload.req.skills": "zip 或文件夹,需含 SKILL.md", "upload.req.prompt": "支持 .md,同名自动跳过", "upload.req.session": "一次一个:.jsonl / .json / .md / .txt", "upload.selected.one": "{count} 个文件 · {size}", "upload.selected.other": "{count} 个文件 · {size}", "upload.remove": "移除所选内容", "upload.requirements": "文件要求", "upload.requirement.skill": "压缩包或文件夹需包含 SKILL.md", "upload.requirement.frontmatter": "SKILL.md 需包含 YAML 格式的技能名称和描述", "upload.requirement.copy": "导入时复制完整内容,不修改原始来源", "upload.requirement.persona.1": "支持 .md / .zip(可多选、可拖入)", "upload.requirement.persona.2": "一个 .md = 一个人设,文件名即人设名", "upload.requirement.persona.3": "同名自动跳过,绝不覆盖原有文件", "upload.requirement.memory.1": "支持 .md / .zip(可多选、可拖入)", "upload.requirement.memory.2": "一个 .md = 一条记忆,文件名即记忆名", "upload.requirement.memory.3": "带 SKILL.md 的目录 = bundle 记忆(附件一起进来)", "upload.requirement.memory.4": "zip 里的目录名即场景;没有目录时用下面「导入到场景」的值(留空 = 全局)", "upload.requirement.prompt.1": "支持 .md(可多选、可拖入)", "upload.requirement.prompt.2": "一个 .md = 一份预设,文件名即 id(目录名)", "upload.requirement.prompt.3": "同名已存在则跳过,绝不覆盖", "upload.requirement.session.1": "支持 .jsonl / .json / .md / .txt(一次一个)", "upload.requirement.session.2": "Claude Code / Cursor / Codex 的转录文件,或任意文本", "upload.requirement.session.3": "工作区可留空 = 归入未分组;留空不影响导入", "upload.importing": "正在导入…", "status.selected": "已选择", "select.file.invalid": "请选择 .zip 或单个 SKILL.md", "select.folder.invalid": "该文件夹里没有 SKILL.md", "error.browse.absolute": "目录路径必须是绝对路径:{path}", "error.browse.unreadable": "无法读取目录:{path}", "error.browse.notDirectory": "不是目录:{path}",
|
|
5641
5673
|
// F-029:服务端错误码补词条(zh 逐字复现服务端文案,命中词条前后中文显示不变;EN 不再回退中文原文)。
|
|
@@ -5769,13 +5801,13 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5769
5801
|
"mcp.live.notLoaded": "未加载", "mcp.live.failed": "启动失败", "mcp.live.stopped": "未启用", "mcp.live.loading": "加载中", "mcp.live.noTools": "无可用工具", "mcp.live.running": "已启用",
|
|
5770
5802
|
"mcp.live.failedHint": "启动失败,检查配置后重新尝试", "mcp.live.offlineHint": "启动失败,检查配置后重新尝试", "mcp.live.neverHint": "启动失败,检查配置后重新尝试", "mcp.live.allOffHint": "工具全部被停用:当前没有可调用的工具(取消停用即恢复)",
|
|
5771
5803
|
"mcp.note.prefix": "备注:", "mcp.toggleServer": "启停服务", "mcp.toggleTool": "启停工具", "mcp.session.startGlobal": "全局关着:打开后仅为这个对话临时运行,全局设置不变。",
|
|
5772
|
-
"mcp.intent.
|
|
5804
|
+
"mcp.intent.blockedHint": "全局已统一关闭这台服务器:会话层也不能打开它。先在全局重新打开。",
|
|
5773
5805
|
"mcp.intent.lease": "临时运行 · {count} 个对话", "mcp.intent.leaseHint": "全局是关的;{count} 个对话在用它,连接保持运行。",
|
|
5774
|
-
"mcp.intent.keptRunning": "已全局关闭;还有 {count}
|
|
5775
|
-
"mcp.intent.onOk": "已全局启用「{name}」。", "mcp.intent.offOk": "已全局关闭「{name}」。", "mcp.intent.stopped": "
|
|
5776
|
-
"mcp.intent.
|
|
5777
|
-
"mcp.intent.stopTitle": "
|
|
5778
|
-
"mcp.intent.stopDesc": "「{name}
|
|
5806
|
+
"mcp.intent.keptRunning": "已全局关闭;还有 {count} 个对话在用,连接保持运行(要立即关闭用「统一关闭」)。",
|
|
5807
|
+
"mcp.intent.onOk": "已全局启用「{name}」。", "mcp.intent.offOk": "已全局关闭「{name}」。", "mcp.intent.stopped": "已统一关闭「{name}」:正在使用它的对话 / 工作区也已关闭。",
|
|
5808
|
+
"mcp.intent.stop": "统一关闭",
|
|
5809
|
+
"mcp.intent.stopTitle": "统一关闭?",
|
|
5810
|
+
"mcp.intent.stopDesc": "「{name}」会立即关闭,正在使用它的对话 / 工作区也会一并关闭(它们的开关会变成关闭);之后可以重新打开。",
|
|
5779
5811
|
"mcp.tools.serverOff": "这台服务器在本会话里看不到:先在上面打开它,再拨工具",
|
|
5780
5812
|
"mcp.msg.ok": "操作成功", "mcp.msg.failed": "操作失败", "mcp.msg.loadFailed": "加载失败", "mcp.msg.warn": "操作完成,但加载器有提示:{warning}", "mcp.msg.toolsRefreshed": "已取到 {count} 个工具", "mcp.msg.restartWarn": "已重启,但有告警:{warning}", "mcp.msg.restarted": "已重启:{name}",
|
|
5781
5813
|
"mcp.form.addTitle": "新增 MCP", "mcp.form.editTitle": "编辑 MCP 服务:",
|
|
@@ -5900,14 +5932,13 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5900
5932
|
"compat.update.localAhead": "本地版本 {current} 比 registry 上兼容的最高版 {best} 更新", "compat.update.none": "registry 上没有与宿主 {host} 兼容的版本",
|
|
5901
5933
|
"compat.update.incompatible": "当前插件版本 {current} 与本宿主 {host} 不兼容", "compat.update.hostUnknown": "取不到宿主版本,已跳过更新检查",
|
|
5902
5934
|
"compat.update.proxy": "检测到代理环境,已跳过更新检查(不穿透代理)", "compat.update.unknown": "更新检查暂不可用",
|
|
5903
|
-
|
|
5904
|
-
//
|
|
5905
|
-
// 键本身的标签、进行态、重试提示,以及"安装命令在哪"那一句。
|
|
5935
|
+
// 顶部栏那颗「检查更新」键:结论句复用上面那批 compat.update.*,这里只补键本身的
|
|
5936
|
+
// 标签、进行态与重试提示。
|
|
5906
5937
|
"update.check": "检查更新", "update.checking": "正在检查更新…", "update.recheck": "点击重新检查",
|
|
5907
|
-
"update.
|
|
5938
|
+
"update.failed": "检查更新失败:{error}",
|
|
5908
5939
|
// 有兼容更新时那颗键**外观不变**(只多一个红点),但无障碍名换成「更新」——
|
|
5909
|
-
//
|
|
5910
|
-
"update.action": "更新",
|
|
5940
|
+
// 读屏该读到"有更新",而不是泛泛的"检查"。
|
|
5941
|
+
"update.action": "更新",
|
|
5911
5942
|
"compat.diag.copy": "复制诊断信息", "compat.diag.copied": "已复制诊断信息",
|
|
5912
5943
|
"compat.host": "宿主版本", "compat.verified": "插件适配版本",
|
|
5913
5944
|
"compat.caps": "可用能力", "compat.caps.degraded": "{count} 项不可用",
|
|
@@ -6299,7 +6330,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6299
6330
|
"memory.mode.current": "当前模式", "memory.mode.exit": "退出模式",
|
|
6300
6331
|
"memory.archive.edit": "档案", "memory.archive.title": "场景档案",
|
|
6301
6332
|
"memory.archive.tools": "MCP 工具集", "memory.archive.skills": "技能集", "memory.archive.subagents": "子智能体集", "memory.archive.memories": "记忆集", "memory.archive.applyFailed": "运行时未能应用:{reason}",
|
|
6302
|
-
"memory.archive.removeSection": "移除段", "memory.archive.save": "
|
|
6333
|
+
"memory.archive.removeSection": "移除段", "memory.archive.save": "保存",
|
|
6303
6334
|
"memory.archive.addTools": "+ 添加 MCP 工具集", "memory.archive.addSkills": "+ 添加技能集", "memory.archive.addSubagents": "+ 添加子智能体集",
|
|
6304
6335
|
"memory.archive.stale": "已跳过 {items}(已不存在,或被同名技能覆盖 / 结构不完整——本就不生效)",
|
|
6305
6336
|
"memory.result.archiveSaved": "已保存场景档案:{name}", "memory.result.modeSet": "已进入模式:{name}", "memory.result.modeSwitched": "已切换 {mcp} 台服务器 / {skills} 个来源", "memory.result.modeExited": "已退出模式",
|
|
@@ -6505,18 +6536,17 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6505
6536
|
"scope.view.leaseHint": "全局是关的,但还有 {count} 个对话单独把它拨开了 —— 这只影响它们各自看到的内容,全局设置没变。",
|
|
6506
6537
|
"scope.warn.dismiss": "知道了",
|
|
6507
6538
|
"scope.intent.globalOnly": "全局意图只能在全局层修改",
|
|
6508
|
-
"scope.intent.blocked": "
|
|
6509
|
-
"scope.intent.lease": "临时运行 · {count} 个对话", "scope.intent.leaseHint": "全局是关的,但还有 {count} 个对话在用它 ——
|
|
6510
|
-
"scope.intent.keptRunning": "全局已关闭;还有 {count}
|
|
6511
|
-
"scope.intent.onOk": "已全局启用「{name}」。", "scope.intent.offOk": "已全局关闭「{name}」。",
|
|
6512
|
-
"scope.intent.resume": "恢复启用",
|
|
6513
|
-
"scope.
|
|
6514
|
-
"scope.
|
|
6515
|
-
"scope.intent.stopDesc": "「{name}」会立即停止,正在使用它的对话也会失去它(普通关闭只影响新对话)。之后可以恢复启用。",
|
|
6539
|
+
"scope.intent.blocked": "已统一关闭", "scope.intent.blockedHint": "全局已「统一关闭」:任何会话都不能再用它(包括在会话层打开)。要恢复,先在全局改回启用。",
|
|
6540
|
+
"scope.intent.lease": "临时运行 · {count} 个对话", "scope.intent.leaseHint": "全局是关的,但还有 {count} 个对话在用它 —— 它保持启用,只有这些对话看得到。",
|
|
6541
|
+
"scope.intent.keptRunning": "全局已关闭;还有 {count} 个对话在用,来源保持启用(只有这些对话看得到)。",
|
|
6542
|
+
"scope.intent.onOk": "已全局启用「{name}」。", "scope.intent.offOk": "已全局关闭「{name}」。",
|
|
6543
|
+
"scope.intent.resume": "恢复启用",
|
|
6544
|
+
"scope.unifiedClose": "统一关闭", "scope.unifiedClose.desc": "「{name}」会立即关闭,正在使用它的对话 / 工作区也会一并关闭;之后可以重新打开。", "scope.unifiedClose.done": "已统一关闭「{name}」。", "scope.unifiedClose.viewDesc": "会把各对话 / 工作区里单独打开的「{name}」一并关掉(全局设置不动);之后可以重新打开。", "scope.unifiedClose.viewDone": "已统一关闭「{name}」(各对话 / 工作区的单独设置已清除)。", "scope.unifiedClose.sceneDesc": "会退出所有进入「{name}」的对话 / 工作区,回到各自进入前的样子;全局正在用的场景不受影响。", "scope.unifiedClose.sceneDone": "已统一关闭场景「{name}」。",
|
|
6545
|
+
"scope.stopAll": "全部关闭", "scope.stopAll.done": "已全部关闭({count} 项)。",
|
|
6516
6546
|
},
|
|
6517
6547
|
en: {
|
|
6518
6548
|
"title": "Skills", "desc": "Manage skills: enable, import, create, trash.", "link.project": "GitHub", "link.feedback": "Issues",
|
|
6519
|
-
"btn.create": "New", "btn.import": "Import", "btn.refresh": "Refresh", "btn.refreshing": "Refreshing…", "btn.cancel": "Cancel", "btn.close": "Close", "stale.write.conflict": "This file changed elsewhere: reload and edit again, or overwrite it.", "stale.write.conflictApply": "The global AGENTS.md changed elsewhere, so the apply was refused. Refresh the page and check the content before retrying.", "stale.write.reload": "Reload", "stale.write.overwrite": "Overwrite", "row.menu": "More actions for {name}", "export.hint": "Exports a zip into the chosen directory; read-only, changes nothing.", "export.outDir": "Output directory", "export.pickDir": "Choose output directory", "export.submit": "Export", "export.busy": "Exporting…", "export.done": "Exported {count} file(s) to {path}", "scenes.lock.lock": "Lock", "scenes.lock.unlock": "Unlock", "scenes.lock.tag": "Locked", "scenes.lock.hint": "Locking makes all five domains (MCP / skills / subagents / memories / prompts) read-only; starting or stopping scenes still works", "scenes.lock.blockedEdit": "Scene is locked — unlock it to make changes", "scenes.lock.notActive": "Scene is not active — start it before locking", "scenes.lock.blockedExit": "Scene is locked — unlock it before turning it off", "lock.banner": "A scene is locked: MCP, skills, subagents, memories and prompts are frozen. Unlock it on the Scenes page to make changes.", "scene.switch.banner": "In scene “{scene}”: you can still change settings — edits sync to the profile and the state is restored when you leave.", "scene.sync.failed": "Heads-up: the change took effect, but it could not be written into the scene profile ({error}) — it holds for this visit only; re-entering this scene will apply the older profile.", "state.sync.failed": "Heads-up: the enable/disable state could not be written ({error}) — affected items may be left enabled and enter the model context next turn; please check the toggles on this page.", "agm.apply.rebindScene": "Scene “{scene}” is driving the baseline: applying this preset rebinds that scene to it (written into the scene profile as well)", "export.empty": "Nothing to export", "export.pickAll": "Select all", "export.pickNone": "Deselect all", "export.group.count": "{count}", "export.missing": "; skipped {count} (missing on disk): {names}", "export.skills": "Export", "export.subagents": "Export", "export.presets": "Export", "export.memories": "Export", "btn.detail": "Details", "btn.trash": "Delete", "btn.restore": "Restore", "btn.delete.forever": "Delete forever", "btn.file.pick": "Choose file", "btn.folder.pick": "Choose folder", "btn.create.now": "Create
|
|
6549
|
+
"btn.create": "New", "btn.import": "Import", "btn.refresh": "Refresh", "btn.refreshing": "Refreshing…", "btn.cancel": "Cancel", "btn.close": "Close", "stale.write.conflict": "This file changed elsewhere: reload and edit again, or overwrite it.", "stale.write.conflictApply": "The global AGENTS.md changed elsewhere, so the apply was refused. Refresh the page and check the content before retrying.", "stale.write.reload": "Reload", "stale.write.overwrite": "Overwrite", "row.menu": "More actions for {name}", "export.hint": "Exports a zip into the chosen directory; read-only, changes nothing.", "export.outDir": "Output directory", "export.pickDir": "Choose output directory", "export.submit": "Export", "export.busy": "Exporting…", "export.done": "Exported {count} file(s) to {path}", "scenes.lock.lock": "Lock", "scenes.lock.unlock": "Unlock", "scenes.lock.tag": "Locked", "scenes.lock.hint": "Locking makes all five domains (MCP / skills / subagents / memories / prompts) read-only; starting or stopping scenes still works", "scenes.lock.blockedEdit": "Scene is locked — unlock it to make changes", "scenes.lock.notActive": "Scene is not active — start it before locking", "scenes.lock.blockedExit": "Scene is locked — unlock it before turning it off", "lock.banner": "A scene is locked: MCP, skills, subagents, memories and prompts are frozen. Unlock it on the Scenes page to make changes.", "scene.switch.banner": "In scene “{scene}”: you can still change settings — edits sync to the profile and the state is restored when you leave.", "scene.sync.failed": "Heads-up: the change took effect, but it could not be written into the scene profile ({error}) — it holds for this visit only; re-entering this scene will apply the older profile.", "state.sync.failed": "Heads-up: the enable/disable state could not be written ({error}) — affected items may be left enabled and enter the model context next turn; please check the toggles on this page.", "agm.apply.rebindScene": "Scene “{scene}” is driving the baseline: applying this preset rebinds that scene to it (written into the scene profile as well)", "export.empty": "Nothing to export", "export.pickAll": "Select all", "export.pickNone": "Deselect all", "export.group.count": "{count}", "export.missing": "; skipped {count} (missing on disk): {names}", "export.skills": "Export", "export.subagents": "Export", "export.presets": "Export", "export.memories": "Export", "btn.detail": "Details", "btn.edit": "Edit", "btn.save": "Save", "btn.trash": "Delete", "btn.restore": "Restore", "btn.delete.forever": "Delete forever", "btn.file.pick": "Choose file", "btn.folder.pick": "Choose folder", "btn.create.now": "Create", "btn.disable": "Disable", "btn.enable": "Enable", "btn.open.editor": "Open in editor", "btn.activate": "Use this one", "btn.activate.title": "Make this source's copy the active one for this shared name and enable it (source files are never touched)", "btn.unprefer": "Auto again", "btn.unprefer.title": "Clear the manual choice and go back to automatic source priority",
|
|
6520
6550
|
"btn.custom.add": "Add folder",
|
|
6521
6551
|
"btn.custom.remove": "Remove",
|
|
6522
6552
|
"btn.source.remove": "Remove source", "btn.source.remove.title": "Stop reading this source (files stay on disk; restore it later from the trash)", "btn.source.restore": "Restore", "btn.source.forget": "Delete forever",
|
|
@@ -6551,7 +6581,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6551
6581
|
"empty.search": "No matching skills", "empty.source": "This source is missing or has no skills", "loading": "Loading skills…", "note.missing": "No description provided", "source.toggle": "Toggle source", "skill.toggle": "Toggle skill",
|
|
6552
6582
|
"source.external.note": "Read-only; toggles never rewrite source files", "source.dsh.note": "Create, import, trash; a default source, always read — it cannot be removed or toggled off",
|
|
6553
6583
|
"detail.title": "Skill details", "detail.body": "Body", "detail.frontmatter": "Metadata", "detail.noFrontmatter": "This skill provides no metadata.", "detail.diagnostics": "Diagnostics", "detail.path": "Source file", "detail.noIssues": "No diagnostic issues found.",
|
|
6554
|
-
"create.title": "Create skill", "create.target": "Create in", "create.name": "Name", "create.name.placeholder": "e.g. code-review-helper", "create.description": "Description", "create.description.placeholder": "One sentence describing when to use it", "create.body": "Body (Markdown)", "create.body.placeholder": "Write the instructions, steps, and boundaries…",
|
|
6584
|
+
"create.title": "Create skill", "skill.editTitle": "Edit skill", "skill.edit.nameLocked": "The skill name cannot be changed: injection keys and scene bindings address it.", "skill.edit.done": "Saved skill “{name}”.", "create.target": "Create in", "create.name": "Name", "create.name.placeholder": "e.g. code-review-helper", "create.description": "Description", "create.description.placeholder": "One sentence describing when to use it", "create.body": "Body (Markdown)", "create.body.placeholder": "Write the instructions, steps, and boundaries…",
|
|
6555
6585
|
"skill.attach.label": "Attachments (optional)", "skill.attach.new": "New attachment", "skill.attach.pick": "Choose attachments", "skill.attach.dir": "Folder (optional)", "skill.attach.dir.placeholder": "e.g. references", "skill.attach.name": "File name", "skill.attach.name.placeholder": "e.g. api.md", "skill.attach.files": "Files to import", "skill.attach.drop.copy": "Multiple files OK", "skill.attach.done": "Done", "skill.attach.content": "Content", "skill.attach.content.placeholder": "Write this file's content here (may stay empty)", "skill.attach.add": "Add", "skill.attach.edit": "Edit", "skill.attach.remove": "Remove attachment", "skill.attach.dup": "An attachment with this path is already listed: {path}", "skill.attach.nameRequired": "A file name is required", "skill.attach.baddir": "Invalid folder name: no .. segments", "skill.attach.badname": "Invalid file name: no trailing / and no .. segments", "skill.attach.reserved": "SKILL.md is the skill body and cannot be added as an attachment: {path}", "skill.attach.tooLarge": "{name} exceeds {limit} MB", "detail.attachments": "Attachments",
|
|
6556
6586
|
"import.title": "Import skill", "upload.drop.title": "Click or drop here", "upload.drop.copy": "Supported: .zip, a skill folder, or one SKILL.md", "upload.drop.mzip": "Supported: .md or .zip", "upload.drop.prompt": "Supported: .md", "upload.drop.session": "Supported: .jsonl / .json / .md / .txt", "upload.req.mdzip": "Supports .md / .zip; same-name files are skipped", "upload.req.skills": "A zip or folder containing SKILL.md", "upload.req.prompt": "Supports .md; same-name files are skipped", "upload.req.session": "One at a time: .jsonl / .json / .md / .txt", "upload.selected.one": "{count} file · {size}", "upload.selected.other": "{count} files · {size}", "upload.remove": "Remove selection", "upload.requirements": "File requirements", "upload.requirement.skill": "Archives and folders must contain SKILL.md", "upload.requirement.frontmatter": "SKILL.md must include a YAML name and description", "upload.requirement.copy": "Import copies all content and never modifies the source", "upload.requirement.persona.1": "Accepts .md / .zip (multi-select or drag in)", "upload.requirement.persona.2": "One .md = one persona; the file name is the persona name", "upload.requirement.persona.3": "Same names are skipped, never overwritten", "upload.requirement.memory.1": "Accepts .md / .zip (multi-select or drag in)", "upload.requirement.memory.2": "One .md = one memory; the file name is the memory name", "upload.requirement.memory.3": "A folder with SKILL.md becomes a bundle memory (attachments included)", "upload.requirement.memory.4": "Folder names inside the zip are scenes; otherwise the scene field below applies (blank = global)", "upload.requirement.prompt.1": "Accepts .md (multi-select or drag in)", "upload.requirement.prompt.2": "One .md = one preset; the file name is the id", "upload.requirement.prompt.3": "A preset with the same name is skipped, never overwritten", "upload.requirement.session.1": "Accepts .jsonl / .json / .md / .txt (one file at a time)", "upload.requirement.session.2": "Transcripts from Claude Code / Cursor / Codex, or any plain text", "upload.requirement.session.3": "The workspace may be left blank (the session goes to Ungrouped)", "upload.importing": "Importing…", "status.selected": "Selected", "select.file.invalid": "Choose a .zip archive or one SKILL.md.", "select.folder.invalid": "No SKILL.md was found in the selected folder.", "error.browse.absolute": "Folder path must be absolute: {path}", "error.browse.unreadable": "Could not read folder: {path}", "error.browse.notDirectory": "Not a folder: {path}",
|
|
6557
6587
|
"error.custom.absolute": "The folder path must be absolute: {path}", "error.custom.notDirectory": "Not a folder: {path}", "error.custom.unreadable": "Could not read the folder: {path}", "error.custom.overlap": "The folder overlaps an existing skill source: {path} ↔ {other}", "error.custom.invalidKey": "Invalid custom source key: {key}", "error.custom.notFound": "Custom source not found: {key}",
|
|
@@ -6675,13 +6705,13 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6675
6705
|
"mcp.live.notLoaded": "not loaded", "mcp.live.failed": "start failed", "mcp.live.stopped": "disabled", "mcp.live.loading": "loading", "mcp.live.noTools": "no usable tools", "mcp.live.running": "enabled",
|
|
6676
6706
|
"mcp.live.failedHint": "Start failed — check the configuration, then try again", "mcp.live.offlineHint": "Start failed — check the configuration, then try again", "mcp.live.neverHint": "Start failed — check the configuration, then try again", "mcp.live.allOffHint": "All tools are disabled: nothing is callable right now (re-enable them to restore)",
|
|
6677
6707
|
"mcp.note.prefix": "Note: ", "mcp.toggleServer": "Toggle server", "mcp.toggleTool": "Toggle tool", "mcp.session.startGlobal": "Off globally: turning it on runs it temporarily for this conversation only; the global setting stays off.",
|
|
6678
|
-
"mcp.intent.
|
|
6708
|
+
"mcp.intent.blockedHint": "Stopped machine-wide: even this conversation cannot switch it on. Turn it back on from the global layer first.",
|
|
6679
6709
|
"mcp.intent.lease": "temporary · {count} conversation(s)", "mcp.intent.leaseHint": "Off globally; {count} conversation(s) still use it, so the connection keeps running.",
|
|
6680
|
-
"mcp.intent.keptRunning": "Disabled globally; {count} conversation(s) still use it, so the connection keeps running (use “
|
|
6681
|
-
"mcp.intent.onOk": "Enabled “{name}” globally.", "mcp.intent.offOk": "Disabled “{name}” globally.", "mcp.intent.stopped": "
|
|
6682
|
-
"mcp.intent.
|
|
6683
|
-
"mcp.intent.stopTitle": "
|
|
6684
|
-
"mcp.intent.stopDesc": "“{name}”
|
|
6710
|
+
"mcp.intent.keptRunning": "Disabled globally; {count} conversation(s) still use it, so the connection keeps running (use “Close everywhere” to close them now).",
|
|
6711
|
+
"mcp.intent.onOk": "Enabled “{name}” globally.", "mcp.intent.offOk": "Disabled “{name}” globally.", "mcp.intent.stopped": "Closed “{name}” everywhere; conversations and workspaces using it were switched off too.",
|
|
6712
|
+
"mcp.intent.stop": "Close everywhere",
|
|
6713
|
+
"mcp.intent.stopTitle": "Close everywhere?",
|
|
6714
|
+
"mcp.intent.stopDesc": "“{name}” closes immediately, and the conversations / workspaces using it are switched off too (their switches turn off). You can turn it back on later.",
|
|
6685
6715
|
"mcp.tools.serverOff": "This server is hidden in this conversation: switch the server on above first",
|
|
6686
6716
|
"mcp.msg.ok": "Done", "mcp.msg.failed": "Operation failed", "mcp.msg.loadFailed": "Load failed", "mcp.msg.warn": "Done, but the loader reported: {warning}", "mcp.msg.toolsRefreshed": "Fetched {count} tool(s)", "mcp.msg.restartWarn": "Restarted with warnings: {warning}", "mcp.msg.restarted": "Restarted: {name}",
|
|
6687
6717
|
"mcp.form.addTitle": "Add MCP server", "mcp.form.editTitle": "Edit MCP server: ",
|
|
@@ -6805,10 +6835,9 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6805
6835
|
"compat.update.localAhead": "Local version {current} is newer than the newest compatible release ({best})", "compat.update.none": "No release on the registry is compatible with host {host}",
|
|
6806
6836
|
"compat.update.incompatible": "Plugin {current} is not compatible with this host ({host})", "compat.update.hostUnknown": "Host version unavailable — update check skipped",
|
|
6807
6837
|
"compat.update.proxy": "Proxy environment detected — update check skipped (no proxy bypass)", "compat.update.unknown": "Update check unavailable",
|
|
6808
|
-
"compat.update.copy": "Copy install command", "compat.update.copied": "Copied",
|
|
6809
6838
|
"update.check": "Check for updates", "update.checking": "Checking for updates…", "update.recheck": "Click to check again",
|
|
6810
|
-
"update.
|
|
6811
|
-
"update.action": "Update",
|
|
6839
|
+
"update.failed": "Update check failed: {error}",
|
|
6840
|
+
"update.action": "Update",
|
|
6812
6841
|
"compat.diag.copy": "Copy diagnostics", "compat.diag.copied": "Diagnostics copied",
|
|
6813
6842
|
"compat.host": "Host version", "compat.verified": "Verified against",
|
|
6814
6843
|
"compat.caps": "Usable capabilities", "compat.caps.degraded": "{count} unavailable",
|
|
@@ -7190,7 +7219,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7190
7219
|
"memory.archive.edit": "Profile", "memory.archive.title": "Scene profile",
|
|
7191
7220
|
"memory.archive.tools": "MCP tools", "memory.archive.skills": "Skills", "memory.archive.subagents": "Subagent set", "memory.archive.memories": "Memory set", "memory.archive.applyFailed": "Could not apply at runtime: {reason}",
|
|
7192
7221
|
"memory.archive.addTools": "+ Tools", "memory.archive.addSkills": "+ Skills", "memory.archive.addSubagents": "+ Subagent set",
|
|
7193
|
-
"memory.archive.removeSection": "Remove section", "memory.archive.save": "Save
|
|
7222
|
+
"memory.archive.removeSection": "Remove section", "memory.archive.save": "Save",
|
|
7194
7223
|
"memory.archive.stale": "Skipped {items} (missing, shadowed by a same-name skill, or structurally broken — it could never take effect)",
|
|
7195
7224
|
"memory.result.archiveSaved": "Scene profile saved: {name}", "memory.result.modeSet": "Entered mode: {name}", "memory.result.modeSwitched": "{mcp} server(s) / {skills} source(s) switched", "memory.result.modeExited": "Exited mode",
|
|
7196
7225
|
"memory.desc": "Manage memories: enabled memories enter the system prompt; enable them per scene.",
|
|
@@ -7390,14 +7419,13 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7390
7419
|
"scope.view.leaseHint": "Off globally, but {count} conversation(s) switched it on for themselves — that only changes what they see; the global setting is unchanged.",
|
|
7391
7420
|
"scope.warn.dismiss": "Dismiss",
|
|
7392
7421
|
"scope.intent.globalOnly": "Global intent can only be changed from the global layer",
|
|
7393
|
-
"scope.intent.blocked": "
|
|
7394
|
-
"scope.intent.lease": "temporary · {count} conversation(s)", "scope.intent.leaseHint": "Off globally, but {count} conversation(s) still use it —
|
|
7395
|
-
"scope.intent.keptRunning": "Disabled globally; {count} conversation(s) still use it, so the
|
|
7396
|
-
"scope.intent.onOk": "Enabled “{name}” globally.", "scope.intent.offOk": "Disabled “{name}” globally.",
|
|
7397
|
-
"scope.intent.resume": "Turn back on",
|
|
7398
|
-
"scope.
|
|
7399
|
-
"scope.
|
|
7400
|
-
"scope.intent.stopDesc": "“{name}” stops immediately, and conversations still using it lose it (a normal disable only affects new conversations). You can turn it back on later.",
|
|
7422
|
+
"scope.intent.blocked": "closed everywhere", "scope.intent.blockedHint": "Closed globally: no conversation can use it, even by switching it on locally. Set it back to on/off globally to allow it again.",
|
|
7423
|
+
"scope.intent.lease": "temporary · {count} conversation(s)", "scope.intent.leaseHint": "Off globally, but {count} conversation(s) still use it — it stays enabled and only they see it.",
|
|
7424
|
+
"scope.intent.keptRunning": "Disabled globally; {count} conversation(s) still use it, so the source stays enabled for them.",
|
|
7425
|
+
"scope.intent.onOk": "Enabled “{name}” globally.", "scope.intent.offOk": "Disabled “{name}” globally.",
|
|
7426
|
+
"scope.intent.resume": "Turn back on",
|
|
7427
|
+
"scope.unifiedClose": "Close everywhere", "scope.unifiedClose.desc": "“{name}” closes immediately, and the conversations / workspaces using it are switched off too; you can turn it back on later.", "scope.unifiedClose.done": "Closed “{name}” everywhere.", "scope.unifiedClose.viewDesc": "Switches off “{name}” in every conversation / workspace that turned it on locally (global settings stay untouched); you can turn it back on later.", "scope.unifiedClose.viewDone": "Closed “{name}” everywhere (local overrides cleared).", "scope.unifiedClose.sceneDesc": "Exits “{name}” in every conversation / workspace using it, restoring each to its state before entering; the globally active scene is left alone.", "scope.unifiedClose.sceneDone": "Closed scene “{name}” everywhere.",
|
|
7428
|
+
"scope.stopAll": "Close all", "scope.stopAll.done": "Closed all ({count}).",
|
|
7401
7429
|
}
|
|
7402
7430
|
};
|
|
7403
7431
|
|
|
@@ -8056,9 +8084,8 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8056
8084
|
// · GitHub 图标——原样保留,仓库入口一个都不能少。
|
|
8057
8085
|
//
|
|
8058
8086
|
// 交互约定:
|
|
8059
|
-
// ·
|
|
8060
|
-
//
|
|
8061
|
-
// · 「更新」态点击 = 送去「兼容」页那一行(安装命令 + 复制键在那里)。插件跑在宿主的
|
|
8087
|
+
// · 点击 = 查一次(只读 op `update-status` + `refresh:true`)—— 不安装、不改配置、
|
|
8088
|
+
// 不碰 `@latest`,`update-check.ts` 那几条硬约束照旧。插件跑在宿主的
|
|
8062
8089
|
// node_modules 里,装不了自己 —— 这颗键**不许**承诺自动更新;
|
|
8063
8090
|
// · 答案用 toast 说,不弹窗:它是一句话结论,弹窗要压暗整页、还得再点一次才关。
|
|
8064
8091
|
//
|
|
@@ -8091,14 +8118,6 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8091
8118
|
|
|
8092
8119
|
var check = function () {
|
|
8093
8120
|
if (busy) return
|
|
8094
|
-
// 已经知道有新版本:这一下要的是"怎么装",不是再查一遍。插件不自动更新(装不了 ——
|
|
8095
|
-
// 它跑在宿主的 node_modules 里),能给的是那条确切版本的命令,而命令在「兼容」页
|
|
8096
|
-
// 那一行(带「复制安装命令」),所以直接把人送过去。
|
|
8097
|
-
if (hasUpdate) {
|
|
8098
|
-
showPluginToast(t('update.hintCompat', { tab: t('tabs.compat') }), 'warn')
|
|
8099
|
-
jumpToTab('compat')
|
|
8100
|
-
return
|
|
8101
|
-
}
|
|
8102
8121
|
setState({ busy: true, info: info })
|
|
8103
8122
|
// `refresh:true`:点这一下就是要一个**现在**的答案。读 12 小时前的缓存等于骗人
|
|
8104
8123
|
// ——「已是最新」可能是在某个版本发布之前算出来的。
|
|
@@ -8107,22 +8126,17 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8107
8126
|
updateProbe.info = r
|
|
8108
8127
|
setState({ busy: false, info: r })
|
|
8109
8128
|
var s = String(r.status || 'unknown')
|
|
8110
|
-
|
|
8111
|
-
// 有更新时多说一句"命令在哪":用户不必去猜安装命令藏在哪一页。
|
|
8112
|
-
if (s === 'update-available') text += ' · ' + t('update.hintCompat', { tab: t('tabs.compat') })
|
|
8113
|
-
// 语气与兼容页那一行一致:有更新 / 不知道 = warn,已最新 = ok。
|
|
8114
|
-
showPluginToast(text, s === 'up-to-date' ? 'ok' : 'warn')
|
|
8129
|
+
showPluginToast(updateStatusText(r, t), s === 'up-to-date' ? 'ok' : 'warn')
|
|
8115
8130
|
}).catch(function (e) {
|
|
8116
8131
|
setState({ busy: false, info: info })
|
|
8117
8132
|
showPluginToast(t('update.failed', { error: errMsg(e) }), 'err')
|
|
8118
8133
|
})
|
|
8119
8134
|
}
|
|
8120
8135
|
|
|
8121
|
-
// 标题就是"这一下会做什么"
|
|
8136
|
+
// 标题就是"这一下会做什么":没有答案时是"查一次",有答案时是"再查一遍"。
|
|
8122
8137
|
var tip = busy ? t('update.checking')
|
|
8123
|
-
:
|
|
8124
|
-
:
|
|
8125
|
-
: t('update.check')
|
|
8138
|
+
: info ? updateStatusText(info, t) + ' · ' + t('update.recheck')
|
|
8139
|
+
: t('update.check')
|
|
8126
8140
|
return React.createElement('div', { className: 'dsm-feedback-links' },
|
|
8127
8141
|
// 版本号在最左:它回答的是"我现在装的是哪个版本",与右边两颗键各自回答的问题不同,
|
|
8128
8142
|
// 所以不并进按钮文字里(并进去就成了"要变成哪个版本",两件事会混)。
|
|
@@ -8177,7 +8191,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8177
8191
|
// 详情弹窗的请求序号:见 openDetail / closeDetail(晚到响应不得复活弹窗)。
|
|
8178
8192
|
const detailSeqRef = React.useRef(0)
|
|
8179
8193
|
const [confirmRow, setConfirmRow] = React.useState(null)
|
|
8180
|
-
//
|
|
8194
|
+
// 「统一关闭」确认:与删除不同,它切断的是**正在用它的会话** —— 必须问一次。
|
|
8181
8195
|
const [stopConfirm, setStopConfirm] = React.useState(null)
|
|
8182
8196
|
const [reveal, setReveal] = React.useState(false)
|
|
8183
8197
|
const [settings, setSettings] = React.useState(null)
|
|
@@ -8342,7 +8356,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8342
8356
|
return
|
|
8343
8357
|
}
|
|
8344
8358
|
// 全局层 = 写**意图**(0.21.2):off 不再立刻停 —— 还在用它的会话按租约继续跑,
|
|
8345
|
-
//
|
|
8359
|
+
// 只有「统一关闭」才切断。撤销按操作前的意图值逐台写回。
|
|
8346
8360
|
setMsg(null)
|
|
8347
8361
|
setBusy('setall')
|
|
8348
8362
|
apiCall('scope-intent-set', { domain: 'mcp', keys: changed.map((item) => item.serverName), value: turnOn ? 'on' : 'off' })
|
|
@@ -8566,7 +8580,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8566
8580
|
return
|
|
8567
8581
|
}
|
|
8568
8582
|
// 全局层(0.21.2)= 写**意图**,不是补丁:off 之后仍被会话认领的服务器保持运行
|
|
8569
|
-
//
|
|
8583
|
+
// (租约),只有「统一关闭」才切断它们。开关读的也是意图(见 `serverGlobalOn`)。
|
|
8570
8584
|
const name = String(row.serverName || row.id)
|
|
8571
8585
|
const nextOn = !serverGlobalOn(row)
|
|
8572
8586
|
// 翻开 = 先按「启动中」显示(宿主拉起进程要几秒);关掉 = 销账。
|
|
@@ -8605,19 +8619,41 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8605
8619
|
}
|
|
8606
8620
|
|
|
8607
8621
|
/**
|
|
8608
|
-
*
|
|
8609
|
-
*
|
|
8622
|
+
* MCP「统一关闭」是一次性动作:全局意图写 off,并把正在认领它的会话 / 工作区
|
|
8623
|
+
* 一并写成显式关闭 —— 这样租约不会把它重新拉起来,也不会留下「恢复启用」状态。
|
|
8624
|
+
* 走 op 而不是 `scope-intent-set`:后者只能写意图,写不到那些层的开关。
|
|
8610
8625
|
*/
|
|
8611
|
-
const
|
|
8626
|
+
const stopServerNow = (row) => {
|
|
8612
8627
|
const name = String(row.serverName || row.id)
|
|
8613
8628
|
setMsg(null)
|
|
8614
8629
|
setBusy(row.id + ':intent')
|
|
8615
|
-
|
|
8630
|
+
apiCall('scope-stop-now', { domain: 'mcp', key: name }).then((res) => {
|
|
8616
8631
|
if (res && res.ok === false) { setMsg({ kind: 'err', text: (res && res.error) || mt('mcp.msg.failed') }); return }
|
|
8617
8632
|
if (res && res.warnings && res.warnings.length) setMsg({ kind: 'warn', text: res.warnings.join(';') })
|
|
8618
|
-
else setMsg({ kind: 'ok', text: mt(
|
|
8619
|
-
|
|
8620
|
-
|
|
8633
|
+
else setMsg({ kind: 'ok', text: mt('mcp.intent.stopped', { name: name }) })
|
|
8634
|
+
// 租约徽章 / 行菜单立即跟着消失。不重拉整层:紧接着的 `scope-get` 可能读到写前
|
|
8635
|
+
// 的短 TTL 快照,而且整层重拉会按新状态重排列表。
|
|
8636
|
+
scopeForgetLeases('mcp', [name])
|
|
8637
|
+
}).catch((e) => { setMsg({ kind: 'err', text: errMsg(e) }) }).then(() => setBusy(null))
|
|
8638
|
+
}
|
|
8639
|
+
|
|
8640
|
+
/**
|
|
8641
|
+
* 页头「全部关闭」:逐台走同一个 op,与行菜单里的「统一关闭」是一回事 ——
|
|
8642
|
+
* 只改意图停不掉正在认领它的场景 / 工作区,那些层的开关也得写成显式关闭。
|
|
8643
|
+
* 只在真有临时运行时出现(`scopeLeaseKeys` 非空),没东西可停就不占页头。
|
|
8644
|
+
*/
|
|
8645
|
+
const stopAllServers = () => {
|
|
8646
|
+
const keys = scopeLeaseKeys('mcp')
|
|
8647
|
+
if (!keys.length) return
|
|
8648
|
+
setMsg(null)
|
|
8649
|
+
setBusy('stopall')
|
|
8650
|
+
apiCall('scope-stop-now', { domain: 'mcp', keys }).then((res) => {
|
|
8651
|
+
if (res && res.ok === false) { setMsg({ kind: 'err', text: (res && res.error) || mt('mcp.msg.failed') }); return }
|
|
8652
|
+
if (res && res.warnings && res.warnings.length) setMsg({ kind: 'warn', text: res.warnings.join(';') })
|
|
8653
|
+
else setMsg({ kind: 'ok', text: mt('scope.stopAll.done', { count: keys.length }) })
|
|
8654
|
+
// 页头按钮、行内徽章与开关都靠本地快照这一改立刻收掉;列表状态由 5 秒轮询跟上。
|
|
8655
|
+
scopeForgetLeases('mcp', keys)
|
|
8656
|
+
}).catch((e) => setMsg({ kind: 'err', text: errMsg(e) })).then(() => setBusy(null))
|
|
8621
8657
|
}
|
|
8622
8658
|
|
|
8623
8659
|
const toggleReveal = () => {
|
|
@@ -8943,17 +8979,16 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8943
8979
|
if (toolCount) meta.push(React.createElement('span', { key: 'tools', className: 'dsm-listrow-meta-info' }, toolCount))
|
|
8944
8980
|
// 备注可能很长:给可收缩的 desc 类(min-width:0 + 省略号),超宽时截断而不是把行撑爆。
|
|
8945
8981
|
if (row.notes) meta.push(React.createElement('span', { key: 'note', className: 'dsm-listrow-meta-desc', title: row.notes }, mt('mcp.note.prefix') + row.notes))
|
|
8946
|
-
//
|
|
8947
|
-
//
|
|
8982
|
+
// 全局层的意图状态只挂**临时运行 · N 个对话** —— 它是"全局 off 却仍在跑"的
|
|
8983
|
+
// 唯一解释,不标出来,用户会以为全局开关坏了。
|
|
8984
|
+
// 统一关闭不挂标签:开关本身就是关的,标签会长期占着这一行;状态由开关的
|
|
8985
|
+
// 悬浮说明承担。
|
|
8948
8986
|
// 同名两层行只标在**第一行**上(两行说同一件事,标两遍只是噪声)。
|
|
8949
8987
|
if (!scopeIsSession()) {
|
|
8950
8988
|
const rowName = String(row.serverName || row.id)
|
|
8951
8989
|
const firstOfName = rows.find((item) => String(item.serverName || item.id) === rowName) === row
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
meta.push(React.createElement('span', { key: 'intent', className: 'dsm-tag dsm-tag-off', title: mt('mcp.intent.blockedHint') }, mt('mcp.intent.blocked')))
|
|
8955
|
-
} else if (firstOfName) {
|
|
8956
|
-
// 六域共用的租约徽章出口(0.21.2):同一 HTML / class / tooltip。
|
|
8990
|
+
if (firstOfName) {
|
|
8991
|
+
// 六域共用的租约徽章出口:同一 HTML / class / tooltip。
|
|
8957
8992
|
meta.push(leaseTag({ t: mt, tagKey: 'intent', domain: 'mcp', key: rowName, runtime: true }))
|
|
8958
8993
|
}
|
|
8959
8994
|
}
|
|
@@ -8966,11 +9001,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8966
9001
|
key: 'menu',
|
|
8967
9002
|
label: mt('row.menu', { name: row.serverName }),
|
|
8968
9003
|
items: [
|
|
8969
|
-
//
|
|
9004
|
+
// 全局层的「统一关闭」:只在真有其他对话 / 工作区在临时用它时出现(没有租约时
|
|
9005
|
+
// 普通开关就能停,菜单不必多一项)。它是一次性动作,不在菜单里留「恢复启用」。
|
|
8970
9006
|
// 会话层没有这一项 —— 会话只能"看不到它",停整台机器是全局动作。
|
|
8971
|
-
...(scopeIsSession()
|
|
8972
|
-
? { key: 'intent-resume', label: mt('mcp.intent.resume'), disabled: actDisabled, onClick: () => setServerIntent(row, 'on') }
|
|
8973
|
-
: { key: 'intent-stop', label: mt('mcp.intent.stop'), danger: true, disabled: actDisabled, onClick: () => setStopConfirm(row) }]),
|
|
9007
|
+
...(scopeIsSession() || scopeLeaseCount('mcp', String(row.serverName || row.id)) <= 0 ? [] : [{ key: 'intent-stop', label: mt('mcp.intent.stop'), danger: true, disabled: actDisabled, onClick: () => setStopConfirm(row) }]),
|
|
8974
9008
|
{ key: 'edit', label: mt('mcp.btn.edit'), disabled: actDisabled, onClick: () => openEdit(row) },
|
|
8975
9009
|
{ key: 'remove', label: mt('mcp.btn.remove'), danger: true, disabled: actDisabled, onClick: () => setConfirmRow(row) },
|
|
8976
9010
|
],
|
|
@@ -9011,7 +9045,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9011
9045
|
// 会话层的开关是**服务器级**(同名两层行合并后只有一个状态)。
|
|
9012
9046
|
var globalOn = serverGlobalOn(row)
|
|
9013
9047
|
var flag = scopeFlag('mcp', String(row.serverName || row.id), globalOn)
|
|
9014
|
-
//
|
|
9048
|
+
// 旧的全局 blocked 记录压过会话层:那颗开关拨了也会被服务端拒掉,直接置灰并说明。
|
|
9015
9049
|
var blockedHere = scopeIntentOf('mcp', String(row.serverName || row.id)) === 'blocked'
|
|
9016
9050
|
// 全局关着的服务器也能在本会话拨开(0.21.2):成为本会话的租约(仅本对话可见)。
|
|
9017
9051
|
return React.createElement(Switch, {
|
|
@@ -9295,8 +9329,8 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9295
9329
|
React.createElement('div', { className: 'dsm-modal-actions' },
|
|
9296
9330
|
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-danger', onClick: confirmRemove }, mt('mcp.btn.remove'))))
|
|
9297
9331
|
|
|
9298
|
-
//
|
|
9299
|
-
//
|
|
9332
|
+
// 「统一关闭」确认:它会**立即**停掉连接,还会把正在用它的会话 / 工作区的开关
|
|
9333
|
+
// 一并关掉 —— 与普通关闭不是一回事,必须问一次,并把影响说清。
|
|
9300
9334
|
const stopNode = stopConfirm && React.createElement(Modal, {
|
|
9301
9335
|
key: 'mcp-stop',
|
|
9302
9336
|
title: mt('mcp.intent.stopTitle'),
|
|
@@ -9308,7 +9342,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9308
9342
|
React.createElement('button', {
|
|
9309
9343
|
type: 'button',
|
|
9310
9344
|
className: 'dsm-btn dsm-btn-danger',
|
|
9311
|
-
onClick: () => { const row = stopConfirm; setStopConfirm(null);
|
|
9345
|
+
onClick: () => { const row = stopConfirm; setStopConfirm(null); stopServerNow(row) },
|
|
9312
9346
|
}, mt('mcp.intent.stop'))))
|
|
9313
9347
|
|
|
9314
9348
|
return React.createElement('section', { className: 'dsm-section' },
|
|
@@ -9339,6 +9373,9 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9339
9373
|
// 会话层只能藏不能连:全局关着的那几台本来就不可能亮起来,判"是不是全开"
|
|
9340
9374
|
// 要把它们排除 —— 否则全部可见之后按钮仍写着「全部启用」,点了什么也不发生。
|
|
9341
9375
|
bulkAllOn ? mt('mcp.btn.disableAll') : mt('mcp.btn.enableAll')),
|
|
9376
|
+
// 只在有临时运行时出现(会话 / 场景 / 工作区正在认领某几台);
|
|
9377
|
+
// 与行菜单的「统一关闭」同一个 op,别在这里另写一条只改意图的路径。
|
|
9378
|
+
scopeLeaseKeys('mcp').length > 0 ? React.createElement('button', { key: 'stopall', type: 'button', className: 'dsm-btn dsm-btn-danger-outline', disabled: busy !== null || state.loading || state.locked === true, onClick: stopAllServers }, mt('scope.stopAll')) : null,
|
|
9342
9379
|
],
|
|
9343
9380
|
}),
|
|
9344
9381
|
// 场景锁只冻结全局写入;会话层改的是本对话的可见性,照样能改 —— 不显示这条。
|
|
@@ -9419,6 +9456,8 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9419
9456
|
var quick = qs[0], setQuick = qs[1]
|
|
9420
9457
|
var qk = React.useState(null), quickEdit = qk[0], setQuickEdit = qk[1]
|
|
9421
9458
|
var qf = React.useState(null), quickConfirm = qf[0], setQuickConfirm = qf[1]
|
|
9459
|
+
// 单条快捷提示词的「统一关闭」确认(`{ id }`):切断的是各对话 / 工作区正在单独用它的那份。
|
|
9460
|
+
var qz = React.useState(null), quickStop = qz[0], setQuickStop = qz[1]
|
|
9422
9461
|
// 三个弹窗(新增预设 / 编辑预设 / 编辑快捷提示词)各自一份关窗暂存(见 42-shared-ui.js:
|
|
9423
9462
|
// 关窗存、打开取,成功提交不走这条路,所以没有"成功后要记得清"那一步)。
|
|
9424
9463
|
useFormDraftScope('prompt:')
|
|
@@ -9866,6 +9905,20 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9866
9905
|
else if (res) actionFailed(res)
|
|
9867
9906
|
}).catch(function (e) { setBusy(null); setQuickConfirm(null); actionFailed(e) })
|
|
9868
9907
|
}
|
|
9908
|
+
/**
|
|
9909
|
+
* 单条快捷提示词的「统一关闭」:清掉各对话 / 工作区单独打开它的覆盖。
|
|
9910
|
+
* 全局启停不动(页面那颗开关管的是它),这里只收临时的那一份。
|
|
9911
|
+
*/
|
|
9912
|
+
function doQuickStop(id) {
|
|
9913
|
+
beginAction()
|
|
9914
|
+
setBusy('quick-stop')
|
|
9915
|
+
apiCall('scope-stop-now', { domain: 'quickPrompts', key: id }).then(function (res) {
|
|
9916
|
+
setBusy(null); setQuickStop(null)
|
|
9917
|
+
if (res && res.ok === false) { actionFailed(res); return }
|
|
9918
|
+
setState(function (s) { return Object.assign({}, s, { notice: { kind: 'ok', text: t('scope.unifiedClose.viewDone', { name: id }) } }) })
|
|
9919
|
+
scopeForgetLeases('quickPrompts', [id])
|
|
9920
|
+
}).catch(function (e) { setBusy(null); setQuickStop(null); actionFailed(e) })
|
|
9921
|
+
}
|
|
9869
9922
|
/**
|
|
9870
9923
|
* 那颗开关:只改"这条在不在对话框 `/` 菜单里出现",正文与备注一个字不动。
|
|
9871
9924
|
* 与子智能体那一档同一条口径:成功不弹提示(列表重读后开关自己翻过来),失败要说人话。
|
|
@@ -9995,6 +10048,28 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9995
10048
|
})
|
|
9996
10049
|
}
|
|
9997
10050
|
var quickAllOn = visibleQuick.length > 0 && visibleQuick.every(function (p) { return scopeFlag('quickPrompts', p.id, p.enabled !== false).value })
|
|
10051
|
+
/**
|
|
10052
|
+
* 页头「全部关闭」:把各会话 / 工作区 / 场景里单独开着的快捷提示词一并停掉 ——
|
|
10053
|
+
* 「本对话关掉、别的对话还开着」不算全部关闭,所以走统一关闭 op 清各层认领,
|
|
10054
|
+
* 而不是只写全局 `meta.json`。全局那一档是单选基线,没有"临时运行"可言。
|
|
10055
|
+
*/
|
|
10056
|
+
function stopAllQuick() {
|
|
10057
|
+
var keys = scopeLeaseKeys('quickPrompts')
|
|
10058
|
+
if (!keys.length) return
|
|
10059
|
+
beginAction()
|
|
10060
|
+
setBusy('quick-stopall')
|
|
10061
|
+
apiCall('scope-stop-now', { domain: 'quickPrompts', keys: keys }).then(function (res) {
|
|
10062
|
+
setBusy(null)
|
|
10063
|
+
if (res && res.ok === false) { actionFailed(res); return }
|
|
10064
|
+
if (res && res.warnings && res.warnings.length) {
|
|
10065
|
+
setState(function (s) { return Object.assign({}, s, { notice: { kind: 'warn', text: res.warnings.join(';') } }) })
|
|
10066
|
+
return
|
|
10067
|
+
}
|
|
10068
|
+
setState(function (s) { return Object.assign({}, s, { notice: { kind: 'ok', text: t('scope.stopAll.done', { count: keys.length }) } }) })
|
|
10069
|
+
// 本地摘掉租约:页头按钮与行内「单独设置」徽章立刻消失,不重拉整层。
|
|
10070
|
+
scopeForgetLeases('quickPrompts', keys)
|
|
10071
|
+
}).catch(function (e) { setBusy(null); actionFailed(e) })
|
|
10072
|
+
}
|
|
9998
10073
|
/**
|
|
9999
10074
|
* **预设库**(新建 / 导入 / 编辑 / 删除 / 回收站恢复)是全局资产:
|
|
10000
10075
|
* · 会话层:一律置灰并提示切到全局默认(预设库写口不随对话走);
|
|
@@ -10052,6 +10127,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
10052
10127
|
key: 'menu',
|
|
10053
10128
|
label: t('row.menu', { name: p.id }),
|
|
10054
10129
|
items: [
|
|
10130
|
+
...(scopeLeaseCount('quickPrompts', p.id) > 0 ? [{ key: 'stop', label: t('scope.unifiedClose'), danger: true, disabled: busy !== null || state.anyLocked === true, onClick: function () { setQuickStop({ id: p.id }) } }] : []),
|
|
10055
10131
|
{ key: 'edit', label: t('agm.btn.edit'), disabled: busy !== null || scopeIsSession(), title: scopeIsSession() ? promptBlockTitle : undefined, onClick: function () { openQuickEdit(p) } },
|
|
10056
10132
|
{ key: 'delete', label: t('agm.btn.delete'), danger: true, disabled: busy !== null || promptWriteBlocked, title: promptWriteBlocked ? promptBlockTitle : undefined, onClick: function () { setQuickConfirm({ id: p.id }) } },
|
|
10057
10133
|
],
|
|
@@ -10225,6 +10301,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
10225
10301
|
React.createElement('button', { key: 'import', type: 'button', className: 'dsm-btn dsm-btn-secondary', disabled: busy !== null || promptWriteBlocked, title: promptWriteBlocked ? promptBlockTitle : undefined, onClick: function () { setImportResult(null); setImportOpen(true) } }, t('agm.btn.import')),
|
|
10226
10302
|
React.createElement('button', { key: 'export', type: 'button', className: 'dsm-btn dsm-btn-secondary', disabled: busy !== null || !(state.presets.length || quick.prompts.length), onClick: function () { setExportState({ busy: false, result: null }) } }, t('export.presets')),
|
|
10227
10303
|
React.createElement('button', { key: 'trash', type: 'button', className: 'dsm-btn dsm-btn-secondary', onClick: function () { setTrash(true) } }, t('trash.btn.open')),
|
|
10304
|
+
scopeLeaseKeys('quickPrompts').length > 0 ? React.createElement('button', { key: 'stopall', type: 'button', className: 'dsm-btn dsm-btn-danger-outline', disabled: busy !== null || state.anyLocked === true, onClick: stopAllQuick }, t('scope.stopAll')) : null,
|
|
10228
10305
|
],
|
|
10229
10306
|
}),
|
|
10230
10307
|
state.anyLocked === true && !scopeIsSession() ? React.createElement('div', { className: 'dsm-feedback dsm-warning', role: 'status' }, t('lock.banner')) : null,
|
|
@@ -10458,6 +10535,11 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
10458
10535
|
React.createElement('div', { className: 'dsm-modal-actions' },
|
|
10459
10536
|
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-quiet', disabled: busy !== null, onClick: function () { setQuickConfirm(null) } }, t('btn.cancel')),
|
|
10460
10537
|
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-danger', disabled: busy !== null, onClick: function () { doQuickRemove(quickConfirm.id) } }, t('agm.btn.confirmRemove')))) : null,
|
|
10538
|
+
quickStop ? React.createElement(Modal, { key: 'quick-stop', className: 'dsm-modal-sm', title: t('scope.unifiedClose'), closeLabel: t('btn.close'), onClose: function () { setQuickStop(null) } },
|
|
10539
|
+
React.createElement('p', { className: 'dsm-help' }, t('scope.unifiedClose.viewDesc', { name: quickStop.id })),
|
|
10540
|
+
React.createElement('div', { className: 'dsm-modal-actions' },
|
|
10541
|
+
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-quiet', disabled: busy !== null, onClick: function () { setQuickStop(null) } }, t('btn.cancel')),
|
|
10542
|
+
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-danger', disabled: busy !== null, onClick: function () { doQuickStop(quickStop.id) } }, t('scope.unifiedClose')))) : null,
|
|
10461
10543
|
// 新建撞名确认窗。放在最后渲染 = 盖在新建弹窗之上(两个弹窗都开着,用户确认/取消
|
|
10462
10544
|
// 之后回到那张还填着内容的表单,不用重新输入)。
|
|
10463
10545
|
dupAsk ? React.createElement(DupNameDialog, {
|
|
@@ -12981,6 +13063,9 @@ function enabledMemoryCount(rules) {
|
|
|
12981
13063
|
var dups = react.useState(null), dupAsk = dups[0], setDupAsk = dups[1];
|
|
12982
13064
|
var us = react.useState(null), upload = us[0], setUpload = us[1];
|
|
12983
13065
|
var ds = react.useState(null), detail = ds[0], setDetail = ds[1];
|
|
13066
|
+
// 编辑弹窗:`{ root, name, description, body, loading, error }`。名字只读 —— 注入键与
|
|
13067
|
+
// 场景绑定都按它寻址,改名会静默切断这些引用。
|
|
13068
|
+
var efs = react.useState(null), editForm = efs[0], setEditForm = efs[1];
|
|
12984
13069
|
var cs = react.useState({ path: "", label: "" }), customForm = cs[0], setCustomForm = cs[1];
|
|
12985
13070
|
// 技能附件(用户 2026-10-16 裁定 A:技能不止名字 + 简介 + 正文,`references/`、`lib/`
|
|
12986
13071
|
// 这类参考资料也要能在界面里直接给,而且**能在界面里写**,不只是从本机挑文件):
|
|
@@ -13023,8 +13108,8 @@ function enabledMemoryCount(rules) {
|
|
|
13023
13108
|
return scopeIsSession() ? scopeFlag('skillSources', String(root.key), globalOn).value : globalOn
|
|
13024
13109
|
}
|
|
13025
13110
|
/**
|
|
13026
|
-
*
|
|
13027
|
-
*
|
|
13111
|
+
* 写来源的全局意图:`off` 只是"默认不要"—— 还有会话在用就保持启用(租约),
|
|
13112
|
+
* 不切断正在用它的对话。技能来源没有逐条「统一关闭」这一档(页头「全部关闭」可一次收掉)。
|
|
13028
13113
|
*/
|
|
13029
13114
|
function setSourceIntent(root, value) {
|
|
13030
13115
|
var key = String(root.key || '')
|
|
@@ -13036,9 +13121,8 @@ function enabledMemoryCount(rules) {
|
|
|
13036
13121
|
if (res && res.ok === false) { setResult({ ok: false, text: translateError(t, res) }); return }
|
|
13037
13122
|
var warnings = res && res.warnings && res.warnings.length ? res.warnings.join(';') : ''
|
|
13038
13123
|
var leases = scopeLeaseCount('skillSources', key)
|
|
13039
|
-
var text = value === '
|
|
13040
|
-
:
|
|
13041
|
-
: leases > 0 ? t('scope.intent.keptRunning', { count: leases }) : t('done.disabled', { name: name })
|
|
13124
|
+
var text = value === 'on' ? t('done.enabled', { name: name })
|
|
13125
|
+
: leases > 0 ? t('scope.intent.keptRunning', { count: leases }) : t('done.disabled', { name: name })
|
|
13042
13126
|
setResult({ ok: true, text: text + (warnings ? ' ' + warnings : '') })
|
|
13043
13127
|
refreshScope()
|
|
13044
13128
|
refresh(true)
|
|
@@ -13069,6 +13153,58 @@ function enabledMemoryCount(rules) {
|
|
|
13069
13153
|
/** 关闭本页弹窗:先作废在途的详情响应(否则晚到的那份会把弹窗重新打开),再清 modal。 */
|
|
13070
13154
|
function closeModal() { detailSeqRef.current += 1; setModal(null); }
|
|
13071
13155
|
function openSource() { if (!detail || !detail.path) return; setBusy(true); setResult(null); apiCall("skill-open", { path: detail.path }).then(function (res) { if (res && res.ok) setResult({ ok: true, text: t("result.opened", { path: detail.path }) }); else setResult({ ok: false, text: t("error.action", { error: translateError(t, res) }) }); }).catch(function (error) { setResult({ ok: false, text: t("error.action", { error: translateError(t, error) }) }); }).finally(function () { setBusy(false); }); }
|
|
13156
|
+
/**
|
|
13157
|
+
* 编辑技能:先读详情拿正文。能改的只有简介与正文(`skill-update` op 的能力边界);
|
|
13158
|
+
* 名字只读。
|
|
13159
|
+
*/
|
|
13160
|
+
function openSkillEdit(root, skill) {
|
|
13161
|
+
var declared = skill.declaredName || skill.name;
|
|
13162
|
+
setModal("edit");
|
|
13163
|
+
setEditForm({ root: root.key, name: declared, description: skill.description || "", body: "", loading: true, error: null });
|
|
13164
|
+
callApi("/detail", { body: JSON.stringify({ root: root.key, name: skill.name, sessionId: scopeSessionId() }) })
|
|
13165
|
+
.then(function (data) {
|
|
13166
|
+
var fm = (data && data.frontmatter) || {};
|
|
13167
|
+
var desc = typeof fm.description === "string" ? fm.description : (skill.description || "");
|
|
13168
|
+
setEditForm(function (prev) { return prev ? Object.assign({}, prev, { description: desc, body: String((data && data.body) || ""), loading: false }) : prev; });
|
|
13169
|
+
})
|
|
13170
|
+
.catch(function (error) {
|
|
13171
|
+
setEditForm(function (prev) { return prev ? Object.assign({}, prev, { loading: false, error: translateError(t, error) }) : prev; });
|
|
13172
|
+
});
|
|
13173
|
+
}
|
|
13174
|
+
function submitSkillEdit() {
|
|
13175
|
+
if (!editForm || editForm.loading || busy) return;
|
|
13176
|
+
var description = String(editForm.description || "").trim(), body = String(editForm.body || "");
|
|
13177
|
+
if (!description || !body.trim()) return;
|
|
13178
|
+
setBusy(true); setResult(null);
|
|
13179
|
+
apiCall("skill-update", { name: editForm.name, description: description, body: body })
|
|
13180
|
+
.then(function (res) {
|
|
13181
|
+
if (res && res.ok === false) {
|
|
13182
|
+
var text = translateError(t, res);
|
|
13183
|
+
setEditForm(function (prev) { return prev ? Object.assign({}, prev, { error: text }) : prev; });
|
|
13184
|
+
return;
|
|
13185
|
+
}
|
|
13186
|
+
var saved = editForm.name;
|
|
13187
|
+
setModal(null); setEditForm(null);
|
|
13188
|
+
setResult({ ok: true, text: t("skill.edit.done", { name: saved }) });
|
|
13189
|
+
refresh(true);
|
|
13190
|
+
})
|
|
13191
|
+
.catch(function (error) { setResult({ ok: false, text: errMsg(error) }); })
|
|
13192
|
+
.finally(function () { setBusy(false); });
|
|
13193
|
+
}
|
|
13194
|
+
/** 统一关闭一条技能:一次性写 off + 清掉正在用它那几层的开关。 */
|
|
13195
|
+
function stopSkillNow(target) {
|
|
13196
|
+
setBusy(true); setResult(null);
|
|
13197
|
+
apiCall("scope-stop-now", { domain: "skills", key: target.key })
|
|
13198
|
+
.then(function (res) {
|
|
13199
|
+
if (res && res.ok === false) { setResult({ ok: false, text: translateError(t, res) }); return; }
|
|
13200
|
+
var warnings = res && res.warnings && res.warnings.length ? res.warnings.join(";") : "";
|
|
13201
|
+
setResult({ ok: true, text: t("scope.unifiedClose.done", { name: target.name }) + (warnings ? " " + warnings : "") });
|
|
13202
|
+
// 本地摘掉租约与意图:徽章 / 菜单项 / 开关立即跟着变,不重拉整层(会按新状态重排)。
|
|
13203
|
+
scopeForgetLeases("skills", [target.key]);
|
|
13204
|
+
})
|
|
13205
|
+
.catch(function (error) { setResult({ ok: false, text: errMsg(error) }); })
|
|
13206
|
+
.finally(function () { setBusy(false); });
|
|
13207
|
+
}
|
|
13072
13208
|
function updateForm(key, value) { setForm(Object.assign({}, form, { [key]: value })); }
|
|
13073
13209
|
// 自定义技能目录:添加 / 移除(走 skill-custom-* ops,成功后静默刷新)。
|
|
13074
13210
|
function openCustomDir() {
|
|
@@ -13454,12 +13590,16 @@ function enabledMemoryCount(rules) {
|
|
|
13454
13590
|
// 名字摆在上面 —— 每一行重复一遍没有任何新信息,2026-10-12 删掉。)
|
|
13455
13591
|
root.mutable && !root.deletable ? h("span", { key: "notDeletable", className: "dsm-listrow-meta-info", title: t("status.notDeletable.hint") }, t("status.notDeletable")) : null,
|
|
13456
13592
|
];
|
|
13457
|
-
//
|
|
13458
|
-
//
|
|
13459
|
-
//
|
|
13460
|
-
|
|
13593
|
+
// 行尾:详情常驻,其余动作收进 ⋯(与 MCP 页同一套口径):
|
|
13594
|
+
// 统一关闭 —— 真有其他对话 / 工作区在临时用它时才出现;
|
|
13595
|
+
// 编辑 / 删除 —— 官方内置与只读来源没有这两项(`mutable` / `deletable` 由服务端给)。
|
|
13596
|
+
// 锁定期间只有「详情」还活着:其余都会改配置,一律置灰。
|
|
13461
13597
|
var actions = [];
|
|
13462
13598
|
var menuItems = [];
|
|
13599
|
+
var stopLease = scopeLeaseCount('skills', skillKey);
|
|
13600
|
+
if (stopLease > 0) menuItems.push({ key: "stop", label: t("scope.unifiedClose"), danger: true, disabled: busy || scopeWriteLocked(anyLocked), onClick: function () { setModal({ type: "skill-stop-confirm", key: skillKey, name: skillName }); } });
|
|
13601
|
+
if (root.mutable === true && !skill.shadowedBy) menuItems.push({ key: "edit", label: t("btn.edit"), disabled: busy || anyLocked, onClick: function () { openSkillEdit(root, skill); } });
|
|
13602
|
+
if (root.deletable === true) menuItems.push({ key: "trash", label: t("btn.trash"), danger: true, disabled: busy || anyLocked, onClick: function () { setModal({ type: "trash-confirm", root: root.key, name: skill.name }); } });
|
|
13463
13603
|
/**
|
|
13464
13604
|
* 「启用这个」写的是「同名技能该用哪个**来源**」的首选表(`/prefer` →
|
|
13465
13605
|
* `preferredSkills[名] = 来源 key`,`shadowedBy.root === 本行来源` 即表示撞名发生在
|
|
@@ -13474,9 +13614,6 @@ function enabledMemoryCount(rules) {
|
|
|
13474
13614
|
if (canToggle && canPrefer) menuItems.push({ key: "activate", label: t("btn.activate"), title: t("btn.activate.title"), disabled: busy || anyLocked || scopeIsSession(), onClick: function () { activateShadowed(root, skill); } });
|
|
13475
13615
|
if (skill.preferred === true) menuItems.push({ key: "unprefer", label: t("btn.unprefer"), title: t("btn.unprefer.title"), disabled: busy || anyLocked || scopeIsSession(), onClick: function () { clearPreferred(root, skill); } });
|
|
13476
13616
|
actions.push(h("button", { key: "detail", type: "button", className: "dsm-btn dsm-btn-quiet", onClick: function () { openDetail(root, skill); } }, t("btn.detail")));
|
|
13477
|
-
// 「删除」留在行内(用户 2026-10-16 第四轮:「技能把删除拿出来」,与会话页同一口径):
|
|
13478
|
-
// 这一页的行本来就靠这颗收尾,藏进 ⋯ 反而要多点一次才找得到。
|
|
13479
|
-
if (root.deletable === true) actions.push(h("button", { key: "trash", type: "button", className: "dsm-btn dsm-btn-quiet dsm-btn-danger", disabled: busy || anyLocked, onClick: function () { setModal({ type: "trash-confirm", root: root.key, name: skill.name }); } }, t("btn.trash")));
|
|
13480
13617
|
if (menuItems.length) actions.push(h(RowMenu, { key: "menu", label: t("row.menu", { name: skill.declaredName || skill.name }), items: menuItems }));
|
|
13481
13618
|
return h(ListRow, {
|
|
13482
13619
|
key: skill.name,
|
|
@@ -13516,11 +13653,11 @@ function enabledMemoryCount(rules) {
|
|
|
13516
13653
|
var open = baseOpen || !!dq;
|
|
13517
13654
|
var rootCount = root.count == null ? root.skills.length : root.count;
|
|
13518
13655
|
var srcOnHere = srcOnInLayer(root);
|
|
13519
|
-
// 全局意图 /
|
|
13656
|
+
// 全局意图 / 租约:来源关闭后还有会话在用时挂「临时运行 · N 个对话」;
|
|
13657
|
+
// 旧版本留下的 blocked 仍显示「已统一关闭」,并给一个恢复入口。
|
|
13520
13658
|
// 会话层不显示(那一层只回答"这个对话看得到哪些技能")。
|
|
13521
13659
|
var rootKeyHere = String(root.key || "");
|
|
13522
13660
|
var intentHere = scopeIntentOf('skillSources', rootKeyHere);
|
|
13523
|
-
var leaseHere = scopeLeaseCount('skillSources', rootKeyHere);
|
|
13524
13661
|
var intentTag = scopeIsSession() || root.defaultSource === true ? null
|
|
13525
13662
|
: intentHere === 'blocked' ? h("span", { key: "intent", className: "dsm-tag dsm-tag-off", title: t("scope.intent.blockedHint") }, t("scope.intent.blocked"))
|
|
13526
13663
|
: h(react.Fragment, { key: "intent" }, leaseTag({ t: t, domain: 'skillSources', key: rootKeyHere, runtime: true }));
|
|
@@ -13545,7 +13682,7 @@ function enabledMemoryCount(rules) {
|
|
|
13545
13682
|
// 服务端会先在**全局**启用它(来源关着时技能级开关被 core 吞掉),警告挂作用域条。
|
|
13546
13683
|
var srcFlag = scopeFlag('skillSources', String(root.key), typeof root.globalOn === 'boolean' ? root.globalOn : root.enabled !== false);
|
|
13547
13684
|
var srcOn = scopeIsSession() ? srcFlag.value : srcOnHere;
|
|
13548
|
-
//
|
|
13685
|
+
// 旧的全局 blocked 记录压过会话层:会话开关置灰并说明(拨了也会被服务端拒掉)。
|
|
13549
13686
|
var blockedHere = intentHere === 'blocked';
|
|
13550
13687
|
acts.push(h(Switch, {
|
|
13551
13688
|
key: "sw",
|
|
@@ -13566,18 +13703,15 @@ function enabledMemoryCount(rules) {
|
|
|
13566
13703
|
return
|
|
13567
13704
|
}
|
|
13568
13705
|
// 全局层 = 写**意图**(0.21.2):off 之后仍被会话认领的来源保持启用(租约),
|
|
13569
|
-
//
|
|
13706
|
+
// 只有「统一关闭」才切断它们。
|
|
13570
13707
|
setSourceIntent(root, srcOn ? 'off' : 'on');
|
|
13571
13708
|
},
|
|
13572
13709
|
}));
|
|
13573
|
-
//
|
|
13574
|
-
|
|
13575
|
-
|
|
13576
|
-
|
|
13577
|
-
|
|
13578
|
-
} else if (intentHere === 'off' || leaseHere > 0) {
|
|
13579
|
-
acts.push(h("button", { key: "intent", type: "button", className: "dsm-btn dsm-btn-quiet dsm-btn-danger", disabled: busy || scopeWriteLocked(anyLocked), title: t("scope.intent.stopHint"), onClick: function () { setModal({ type: "source-stop-confirm", key: root.key, name: displayName }); } }, t("scope.intent.stop")));
|
|
13580
|
-
}
|
|
13710
|
+
// 技能来源没有逐条「统一关闭」:关闭只改默认,正在用它的会话 / 工作区照旧运行(租约),
|
|
13711
|
+
// 页头「全部关闭」才把两格(技能 + 来源)的租约一起收掉。
|
|
13712
|
+
// 旧版本留下的 blocked 仍要给出口 —— 那颗开关在 blocked 下是灰的,只能从这里恢复。
|
|
13713
|
+
if (!scopeIsSession() && intentHere === 'blocked') {
|
|
13714
|
+
acts.push(h("button", { key: "intent", type: "button", className: "dsm-btn dsm-btn-quiet", disabled: busy || scopeWriteLocked(anyLocked), onClick: function () { setSourceIntent(root, 'on'); } }, t("scope.intent.resume")));
|
|
13581
13715
|
}
|
|
13582
13716
|
// 「移除来源」只要文字,放在开关**右侧**(用户裁定 2026-10-15,连续推翻两次:
|
|
13583
13717
|
// 2026-09-17 的「只留图标」与当天早些时候的「图标 + 文字」—— 图标在这颗 quiet
|
|
@@ -13754,7 +13888,41 @@ function enabledMemoryCount(rules) {
|
|
|
13754
13888
|
};
|
|
13755
13889
|
});
|
|
13756
13890
|
}
|
|
13891
|
+
/**
|
|
13892
|
+
* 页头「全部关闭」:只在该页真有临时运行时出现。技能与来源两格各自有意图与运行态,
|
|
13893
|
+
* 所以逐域调用同一个 op;任一域失败就停下,把原因说清。
|
|
13894
|
+
*/
|
|
13895
|
+
function stopAllLeases() {
|
|
13896
|
+
var jobs = [];
|
|
13897
|
+
var skillKeys = scopeLeaseKeys('skills');
|
|
13898
|
+
var sourceKeys = scopeLeaseKeys('skillSources');
|
|
13899
|
+
if (skillKeys.length) jobs.push({ domain: 'skills', keys: skillKeys });
|
|
13900
|
+
if (sourceKeys.length) jobs.push({ domain: 'skillSources', keys: sourceKeys });
|
|
13901
|
+
if (!jobs.length) return;
|
|
13902
|
+
setBusy(true); setResult(null);
|
|
13903
|
+
var fail = null, count = 0;
|
|
13904
|
+
var chain = Promise.resolve();
|
|
13905
|
+
jobs.forEach(function (job) {
|
|
13906
|
+
chain = chain.then(function () {
|
|
13907
|
+
if (fail) return null;
|
|
13908
|
+
return apiCall('scope-stop-now', job).then(function (res) {
|
|
13909
|
+
if (res && res.ok === false) { fail = translateError(t, res); return; }
|
|
13910
|
+
if (res && res.warnings && res.warnings.length) { fail = res.warnings.join(';'); return; }
|
|
13911
|
+
count += job.keys.length;
|
|
13912
|
+
});
|
|
13913
|
+
});
|
|
13914
|
+
});
|
|
13915
|
+
chain.then(function () {
|
|
13916
|
+
setResult(fail ? { ok: false, text: fail } : { ok: true, text: t('scope.stopAll.done', { count: count }) });
|
|
13917
|
+
if (!fail) {
|
|
13918
|
+
// 「全部关闭」点完按钮自己就该消失:本地把两格的租约一起摘掉,不重拉整层。
|
|
13919
|
+
if (skillKeys.length) scopeForgetLeases('skills', skillKeys);
|
|
13920
|
+
if (sourceKeys.length) scopeForgetLeases('skillSources', sourceKeys);
|
|
13921
|
+
}
|
|
13922
|
+
}).catch(function (error) { setResult({ ok: false, text: errMsg(error) }); }).finally(function () { setBusy(false); });
|
|
13923
|
+
}
|
|
13757
13924
|
var bulkAll = bulkState();
|
|
13925
|
+
var stopAllLeaseCount = scopeLeaseKeys('skills').length + scopeLeaseKeys('skillSources').length;
|
|
13758
13926
|
// 页头一行化(REDESIGN §3 + §6):新增(实底) · 导入 · 导出 · 添加目录 · 全选 · 回收站(恒最右);
|
|
13759
13927
|
// 统计内联进页头(tabular-nums)。
|
|
13760
13928
|
// 「全选」2026-10-12 从列表工具条**再上移一格**到页头、紧挨回收站左侧(用户:「这个地方的
|
|
@@ -13765,8 +13933,8 @@ function enabledMemoryCount(rules) {
|
|
|
13765
13933
|
// 三格:技能「启用 / 总数」比例 · 来源目录数 · 诊断项数。第一格此前只给总数
|
|
13766
13934
|
// ("12 个技能"),答不了"有几个是开着的";分母服务端一直在给(summary.total)。
|
|
13767
13935
|
// 诊断项 >0 时整格转错误色(dsm-stat-over),让"有没有问题"一眼可见。
|
|
13768
|
-
stats: [[
|
|
13769
|
-
actions: [h("button", { key: "new", type: "button", className: "dsm-btn", disabled: anyLocked, onClick: openCreate }, t("btn.create")), h("button", { key: "import", type: "button", className: "dsm-btn dsm-btn-secondary", disabled: anyLocked, onClick: function () { setResult(null); setUpload(null); setModal("import"); } }, t("btn.import")), h("button", { key: "export", type: "button", className: "dsm-btn dsm-btn-secondary", disabled: busy, onClick: function () { setResult(null); setModal("export"); } }, t("export.skills")), h("button", { key: "custom", type: "button", className: "dsm-btn dsm-btn-secondary", disabled: busy, onClick: function () { setResult(null); setCustomForm({ path: "", label: "" }); setModal("custom-add"); } }, t("btn.custom.add")), h("button", { key: "bulk", type: "button", className: "dsm-btn dsm-btn-secondary dsm-btn-bulk", disabled: busy || scopeWriteLocked(anyLocked) || !bulkAll.targets.length, title: t("bulk.head.title"), onClick: function () { submitBulk(bulkAll.targets, !bulkAll.on, null) } }, bulkPair(bulkAll.on ? t("bulk.unselectAll") : t("bulk.selectAll"), bulkAll.on ? t("bulk.selectAll") : t("bulk.unselectAll"))), h("button", { key: "trash", type: "button", className: "dsm-btn dsm-btn-secondary", onClick: function () { setModal("trash"); } }, t("trash.btn.open"))] }), anyLocked && !scopeIsSession() ? h("div", { key: "lockbanner", className: "dsm-feedback dsm-warning", role: "status" }, t("lock.banner")) : null,
|
|
13936
|
+
stats: [[skillView.enabledCount + "/" + summary.total, statLabel("summary.total", summary.total)], [roots.length, statLabel("summary.sources", roots.length)], [summary.issues, statLabel("summary.issues", summary.issues), summary.issues > 0 ? "dsm-stat-over" : ""]],
|
|
13937
|
+
actions: [h("button", { key: "new", type: "button", className: "dsm-btn", disabled: anyLocked, onClick: openCreate }, t("btn.create")), h("button", { key: "import", type: "button", className: "dsm-btn dsm-btn-secondary", disabled: anyLocked, onClick: function () { setResult(null); setUpload(null); setModal("import"); } }, t("btn.import")), h("button", { key: "export", type: "button", className: "dsm-btn dsm-btn-secondary", disabled: busy, onClick: function () { setResult(null); setModal("export"); } }, t("export.skills")), h("button", { key: "custom", type: "button", className: "dsm-btn dsm-btn-secondary", disabled: busy, onClick: function () { setResult(null); setCustomForm({ path: "", label: "" }); setModal("custom-add"); } }, t("btn.custom.add")), h("button", { key: "bulk", type: "button", className: "dsm-btn dsm-btn-secondary dsm-btn-bulk", disabled: busy || scopeWriteLocked(anyLocked) || !bulkAll.targets.length, title: t("bulk.head.title"), onClick: function () { submitBulk(bulkAll.targets, !bulkAll.on, null) } }, bulkPair(bulkAll.on ? t("bulk.unselectAll") : t("bulk.selectAll"), bulkAll.on ? t("bulk.selectAll") : t("bulk.unselectAll"))), h("button", { key: "trash", type: "button", className: "dsm-btn dsm-btn-secondary", onClick: function () { setModal("trash"); } }, t("trash.btn.open")), stopAllLeaseCount > 0 ? h("button", { key: "stopall", type: "button", className: "dsm-btn dsm-btn-danger-outline", disabled: busy || scopeWriteLocked(anyLocked), onClick: stopAllLeases }, t("scope.stopAll")) : null] }), anyLocked && !scopeIsSession() ? h("div", { key: "lockbanner", className: "dsm-feedback dsm-warning", role: "status" }, t("lock.banner")) : null,
|
|
13770
13938
|
// 锁定期间不显示场景那条长句:开关全是灰的,"改动会同步写进档案"没有落点,
|
|
13771
13939
|
// 两条并排还会互相矛盾(用户 2026-09-19)。
|
|
13772
13940
|
// 会话层不显示(同 MCP 页):本层开关写的是会话覆盖,不同步档案。
|
|
@@ -13785,6 +13953,21 @@ function enabledMemoryCount(rules) {
|
|
|
13785
13953
|
h("div", { className: "dsm-form-seg", role: "group", "aria-label": t("create.target") },
|
|
13786
13954
|
createOptions.map(function (o) { return h("button", { key: o.value, type: "button", "aria-pressed": form.root === o.value ? "true" : "false", onClick: function () { updateForm("root", o.value); } }, o.label); }))),
|
|
13787
13955
|
[["name", "create.name", "create.name.placeholder"], ["description", "create.description", "create.description.placeholder"]].map(function (field) { return h("label", { key: field[0], className: "dsm-field" }, h("div", { className: "dsm-budget-meta" }, h("span", { className: "dsm-label" }, t(field[1])), field[0] === "description" ? h("span", { className: "dsm-char-count" }, String(form.description || "").length + " / " + CATALOG_DESC_MAX) : null), h("input", { className: "dsm-control", value: form[field[0]], placeholder: t(field[2]), maxLength: field[0] === "description" ? CATALOG_DESC_MAX : undefined, onChange: function (e) { updateForm(field[0], e.target.value); } })); }), h("label", { className: "dsm-field" }, h("span", { className: "dsm-label" }, t("create.body")), h("textarea", { className: "dsm-control", value: form.body, placeholder: t("create.body.placeholder"), onChange: function (e) { updateForm("body", e.target.value); } })), renderAttachField()), h("div", { className: "dsm-modal-actions" }, h("button", { className: "dsm-btn", disabled: busy || !form.name.trim() || !form.description.trim() || !form.body.trim(), onClick: submitCreate }, t("btn.create.now")))));
|
|
13956
|
+
if (modal === "edit") content.push(h(Modal, { key: "edit", title: t("skill.editTitle"), closeLabel: t("btn.close"), onClose: function () { setModal(null); setEditForm(null); } }, h("div", { className: "dsm-form" },
|
|
13957
|
+
h("label", { className: "dsm-field" }, h("span", { className: "dsm-label" }, t("create.name")),
|
|
13958
|
+
h("input", { className: "dsm-control", value: editForm ? editForm.name : "", readOnly: true, disabled: true })),
|
|
13959
|
+
h("p", { className: "dsm-help" }, t("skill.edit.nameLocked")),
|
|
13960
|
+
editForm && editForm.loading
|
|
13961
|
+
? h("div", { className: "dsm-empty" }, t("loading"))
|
|
13962
|
+
: h(react.Fragment, null,
|
|
13963
|
+
h("label", { className: "dsm-field" }, h("span", { className: "dsm-label" }, t("create.description")),
|
|
13964
|
+
h("input", { className: "dsm-control", value: editForm ? editForm.description : "", maxLength: CATALOG_DESC_MAX, onChange: function (e) { var v = e.target.value; setEditForm(function (prev) { return prev ? Object.assign({}, prev, { description: v, error: null }) : prev; }); } })),
|
|
13965
|
+
h("label", { className: "dsm-field" }, h("span", { className: "dsm-label" }, t("create.body")),
|
|
13966
|
+
h("textarea", { className: "dsm-control dsm-textarea-md", value: editForm ? editForm.body : "", onChange: function (e) { var v = e.target.value; setEditForm(function (prev) { return prev ? Object.assign({}, prev, { body: v, error: null }) : prev; }); } }))),
|
|
13967
|
+
editForm && editForm.error ? h("div", { className: "dsm-feedback dsm-error", role: "alert" }, editForm.error) : null),
|
|
13968
|
+
h("div", { className: "dsm-modal-actions" },
|
|
13969
|
+
h("button", { type: "button", className: "dsm-btn dsm-btn-secondary", onClick: function () { setModal(null); setEditForm(null); } }, t("btn.cancel")),
|
|
13970
|
+
h("button", { type: "button", className: "dsm-btn", disabled: busy || !editForm || editForm.loading || !String(editForm.description || "").trim() || !String(editForm.body || "").trim(), onClick: submitSkillEdit }, t("btn.save")))));
|
|
13788
13971
|
// 附件小窗(两种模式共用最上面那格文件夹名):
|
|
13789
13972
|
// new = 文件名 + 内容,在界面里写一份;
|
|
13790
13973
|
// pick = 一块拖放区,挑进来的文件都挂在那格文件夹下(留空 = 技能目录根)。
|
|
@@ -13866,9 +14049,9 @@ function enabledMemoryCount(rules) {
|
|
|
13866
14049
|
// (2026-10-10「全选要拆成两部分」的裁定由分组标题 + 分组批量条承接)。
|
|
13867
14050
|
if (modal === "trash") content.push(h(TrashModal, { key: "trash-modal", t: t, domain: "skills", onClose: function () { setModal(null); }, onReload: function () { refresh(true); } }));
|
|
13868
14051
|
if (modal && modal.type === "trash-confirm") content.push(h(Modal, { key: "trash-confirm", title: t("confirm.trash.title"), closeLabel: t("btn.close"), className: "dsm-modal-sm", onClose: function () { setModal(null); } }, h("p", { className: "dsm-desc" }, t("confirm.trash.desc", { name: modal.name })), h("div", { className: "dsm-modal-actions" }, h("button", { className: "dsm-btn", disabled: busy, onClick: function () { post("/delete", { root: modal.root, name: modal.name }, "result.trashed", { name: modal.name }).then(function () { setModal(null); }).catch(swallowPostError); } }, t("btn.trash")))));
|
|
14052
|
+
if (modal && modal.type === "skill-stop-confirm") content.push(h(Modal, { key: "skill-stop-confirm", title: t("scope.unifiedClose"), closeLabel: t("btn.close"), className: "dsm-modal-sm", onClose: function () { setModal(null); } }, h("p", { className: "dsm-desc" }, t("scope.unifiedClose.desc", { name: modal.name })), h("div", { className: "dsm-modal-actions" }, h("button", { className: "dsm-btn dsm-btn-danger", disabled: busy, onClick: function () { var target = modal; setModal(null); stopSkillNow(target); } }, t("scope.unifiedClose")))));
|
|
13869
14053
|
if (modal === "custom-add") content.push(h(Modal, { key: "custom-add", title: t("custom.add.title"), closeLabel: t("btn.close"), onClose: function () { setModal(null); } }, h("div", { className: "dsm-form" }, h("label", { className: "dsm-field" }, h("span", { className: "dsm-label" }, t("custom.add.path")), h("div", { className: "dsm-dir-row" }, h("input", { className: "dsm-control", value: customForm.path, placeholder: defaultIoDir(), onChange: function (e) { setCustomForm(Object.assign({}, customForm, { path: e.target.value })); } }), h("button", { type: "button", className: "dsm-btn dsm-btn-secondary", disabled: busy, onClick: openCustomDir, title: t("custom.add.openDir.title") }, t("btn.openDir")))), h("label", { className: "dsm-field" }, h("span", { className: "dsm-label" }, t("custom.add.label")), h("input", { className: "dsm-control", value: customForm.label, placeholder: t("custom.add.label.placeholder"), onChange: function (e) { setCustomForm(Object.assign({}, customForm, { label: e.target.value })); } })), h("p", { className: "dsm-help" }, t("custom.add.help")), result ? h("div", { className: "dsm-feedback" + (result.warning ? " dsm-warning" : result.ok ? "" : " dsm-error"), role: "alert" }, result.text) : null), customForm.picking ? h(DirPickerModal, { key: "custom-dir-picker", title: t("custom.add.picker.title"), initial: String(customForm.path || ""), closeLabel: t("btn.close"), onClose: function () { setCustomForm(Object.assign({}, customForm, { picking: false })); }, onPick: function (path) { setCustomForm(Object.assign({}, customForm, { path: path, picking: false })); } }) : null, h("div", { className: "dsm-modal-actions" }, h("button", { type: "button", className: "dsm-btn", disabled: busy || !String(customForm.path || "").trim(), onClick: submitCustomAdd }, t("custom.add.submit")))));
|
|
13870
14054
|
if (modal && modal.type === "source-remove-confirm") content.push(h(Modal, { key: "source-remove-confirm", title: t("confirm.source.remove.title"), closeLabel: t("btn.close"), className: "dsm-modal-sm", onClose: function () { setModal(null); } }, h("p", { className: "dsm-desc" }, t("confirm.source.remove.desc", { name: modal.name })), h("p", { className: "dsm-help" }, t("confirm.source.remove.hint")), h("div", { className: "dsm-modal-actions" }, h("button", { className: "dsm-btn dsm-btn-danger", disabled: busy, onClick: function () { post("/source-remove", { root: modal.key }, "result.sourceRemoved", { name: modal.name }).then(function () { setModal(null); }).catch(swallowPostError); } }, t("btn.source.remove")))));
|
|
13871
|
-
if (modal && modal.type === "source-stop-confirm") content.push(h(Modal, { key: "source-stop-confirm", title: t("scope.intent.stopTitle"), closeLabel: t("btn.close"), className: "dsm-modal-sm", onClose: function () { setModal(null); } }, h("p", { className: "dsm-desc" }, t("scope.intent.stopDesc", { name: modal.name })), h("div", { className: "dsm-modal-actions" }, h("button", { className: "dsm-btn dsm-btn-danger", disabled: busy, onClick: function () { var key = modal.key, name = modal.name; setModal(null); setSourceIntent({ key: key, label: name }, 'blocked'); } }, t("scope.intent.stop")))));
|
|
13872
14055
|
if (modal && modal.type === "custom-remove-confirm") content.push(h(Modal, { key: "custom-remove-confirm", title: t("confirm.custom.remove.title"), closeLabel: t("btn.close"), className: "dsm-modal-sm", onClose: function () { setModal(null); } }, h("p", { className: "dsm-desc" }, t("confirm.custom.remove.desc", { name: modal.name })), h("div", { className: "dsm-modal-actions" }, h("button", { className: "dsm-btn dsm-btn-danger", disabled: busy, onClick: function () { submitCustomRemove(modal.key, modal.name); } }, t("btn.custom.remove")))));
|
|
13873
14056
|
// 「已存在同名技能」小窗:叠在「创建技能」弹窗之上(`Modal` 自带 gateModalDepth 计数)。
|
|
13874
14057
|
// 取消 → 回到创建弹窗改名字,简介与正文一个字都不动。
|
|
@@ -15086,7 +15269,7 @@ function enabledMemoryCount(rules) {
|
|
|
15086
15269
|
* 编辑器唯一的保存动作:场景本体(名字 / 描述 / 三个绑定)+ 档案四组一起落盘。
|
|
15087
15270
|
* 创建:rules-create-scene 成功后,若四组里有任何一段已定义,接着 scene-archive-save
|
|
15088
15271
|
* 把档案写进新场景 —— 原先「创建时顺手绑好」的语义不变;档案没存上时弹窗**不关**、
|
|
15089
|
-
*
|
|
15272
|
+
* 转为编辑态(主按钮变「保存」),错误挂在弹窗顶部可重试。
|
|
15090
15273
|
*/
|
|
15091
15274
|
function submitSceneEditor() {
|
|
15092
15275
|
if (!modal || modal.type !== 'scene-editor') return
|
|
@@ -15145,7 +15328,7 @@ function enabledMemoryCount(rules) {
|
|
|
15145
15328
|
apiCall('scene-archive-save', { scene: name, archive: archivePayload }).then(function (ares) {
|
|
15146
15329
|
if (ares && ares.ok) flushPendingMemories(name, isEdit, res, ares)
|
|
15147
15330
|
else {
|
|
15148
|
-
//
|
|
15331
|
+
// 场景已建/已改、档案没存上:留在编辑器里如实报错,主按钮变「保存」可重试。
|
|
15149
15332
|
setBusy(false)
|
|
15150
15333
|
setModal(Object.assign({}, modal, { name: name, error: translateError(t, ares) }))
|
|
15151
15334
|
}
|
|
@@ -15293,9 +15476,9 @@ function enabledMemoryCount(rules) {
|
|
|
15293
15476
|
// 与记忆页同一个写入口(`rules-toggle`)。于是「记忆页开了 → 档案页显示开启」
|
|
15294
15477
|
// 天然成立,不存在两套状态、也不需要双向同步代码。
|
|
15295
15478
|
//
|
|
15296
|
-
//
|
|
15479
|
+
// 已存在记忆的勾选**立即提交**(不等「保存」):它是全局状态,不属于场景档案。
|
|
15297
15480
|
// 本次新配的记忆是**草稿**,走另一条路 —— 存在 `modal.pendingMems` 里,点「创建 /
|
|
15298
|
-
//
|
|
15481
|
+
// 保存」时才落盘(见 flushPendingMemories),所以两种时机的行为没有分叉。
|
|
15299
15482
|
//
|
|
15300
15483
|
// **只列被编辑场景自己的记忆**:保留场景 `global` 恒定注入(任何对话都生效),
|
|
15301
15484
|
// 不需要在这里配置,列出来只会让人以为「不勾就不注入」。
|
|
@@ -15379,7 +15562,7 @@ function enabledMemoryCount(rules) {
|
|
|
15379
15562
|
/**
|
|
15380
15563
|
* 组 4:记忆集。两段内容拼在一张清单里:
|
|
15381
15564
|
* · 已存在的记忆 —— 勾选**立即提交**(P5:单一真相源 = `rules[*].enabled`,不随「保存」落盘);
|
|
15382
|
-
* · 本次新配的草稿 —— 只存在于编辑器里,随「创建 /
|
|
15565
|
+
* · 本次新配的草稿 —— 只存在于编辑器里,随「创建 / 保存」一起落盘(`pendingMems`)。
|
|
15383
15566
|
*/
|
|
15384
15567
|
/**
|
|
15385
15568
|
* 附件标记(回形针 + 个数)。两种来源同一副长相:已落盘的真记忆读宿主在
|
|
@@ -15479,7 +15662,7 @@ function enabledMemoryCount(rules) {
|
|
|
15479
15662
|
* 场景选择器** —— 场景由编辑器上下文定死,以只读一行显示。
|
|
15480
15663
|
*
|
|
15481
15664
|
* 与其余三组同一条模型:**弹窗里建出来的都只是草稿**,存在 `modal.pendingMems` 里,
|
|
15482
|
-
* 点「创建 /
|
|
15665
|
+
* 点「创建 / 保存」那一刻才真正落盘(`flushPendingMemories`)。创建态如此,
|
|
15483
15666
|
* 编辑态也一样(用户 2026-10-14:「已经存在的场景,本次创建记忆应该也能编辑、移除,
|
|
15484
15667
|
* 也是未创建的记录」)—— 于是两种时机只有**落点**不同,行为不再分叉:草稿行一律
|
|
15485
15668
|
* 可勾选、可编辑、可移除。
|
|
@@ -15603,7 +15786,7 @@ function enabledMemoryCount(rules) {
|
|
|
15603
15786
|
* 弹窗的提交动作:**先问一句再退号**(用户 2026-10-14 第二轮)。
|
|
15604
15787
|
*
|
|
15605
15788
|
* 原来这里静默退号 —— 输入框里写着「测」,草稿行上却是「测(1)」。现在撞名先弹一个
|
|
15606
|
-
* 小窗说明,确认后才按 `测(1)` 攒草稿。落盘仍然是点「创建 /
|
|
15789
|
+
* 小窗说明,确认后才按 `测(1)` 攒草稿。落盘仍然是点「创建 / 保存」那一刻
|
|
15607
15790
|
* (见 flushPendingMemories):这里一个请求都不发。
|
|
15608
15791
|
*/
|
|
15609
15792
|
function submitMemoryCreate() {
|
|
@@ -16059,7 +16242,7 @@ function enabledMemoryCount(rules) {
|
|
|
16059
16242
|
/**
|
|
16060
16243
|
* 场景编辑器(新建 / 编辑 / 档案三弹窗融合,REDESIGN §6.2):L=720 列表壳。
|
|
16061
16244
|
* 一行两格(场景名 | 描述)→ 绑定行(三下拉并排)→ 摘要行 → 四组 2×2 →
|
|
16062
|
-
* footer [删除场景(仅编辑态,左)] [取消] [
|
|
16245
|
+
* footer [删除场景(仅编辑态,左)] [取消] [保存/创建]。
|
|
16063
16246
|
* MCP 服务器编辑弹窗渲染在外层:不能放进列表 Modal 的滚动容器里(会被裁掉)。
|
|
16064
16247
|
*/
|
|
16065
16248
|
function editorNode() {
|
|
@@ -16091,7 +16274,7 @@ function enabledMemoryCount(rules) {
|
|
|
16091
16274
|
: (quickOptions || []).filter(function (p) { return p.enabled !== false }).length
|
|
16092
16275
|
// 「删除场景」已从编辑页移除(用户 2026-10-12):删除是**场景卡片**上那一颗
|
|
16093
16276
|
// (行内二次确认弹窗),编辑页的主职责是改内容 —— 左下角再挂一颗红键,和
|
|
16094
|
-
// 「取消 /
|
|
16277
|
+
// 「取消 / 保存」并排,误触代价又最大(会带走该场景下的全部记忆)。
|
|
16095
16278
|
var main = React.createElement(Modal, { key: 'sedit', list: true, className: 'dsm-modal-list dsm-modal-editor',
|
|
16096
16279
|
// 档案摘要挂在**标题旁边**(2026-10-12 重排):它是一句"现在配了多少"的概览,
|
|
16097
16280
|
// 原来单占一行(24px + 12px 间距)把四组往下顶;并入标题后这一行省给清单体。
|
|
@@ -16487,6 +16670,32 @@ function enabledMemoryCount(rules) {
|
|
|
16487
16670
|
refresh(true)
|
|
16488
16671
|
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
16489
16672
|
}
|
|
16673
|
+
/**
|
|
16674
|
+
* 页头「全部关闭」:把所有仍在场景里的会话 / 工作区退出场景,回到各自进入前的样子。
|
|
16675
|
+
* 只在真有临时运行时出现 —— 全局层那条「退出模式」只退当前运行态,管不到别的对话。
|
|
16676
|
+
*/
|
|
16677
|
+
function stopAllScenes() {
|
|
16678
|
+
var count = scopeSceneLeaseCount()
|
|
16679
|
+
if (!count) return
|
|
16680
|
+
setBusy(true); setResult(null)
|
|
16681
|
+
apiCall('scope-stop-now', { domain: 'scene' }).then(function (res) {
|
|
16682
|
+
setBusy(false)
|
|
16683
|
+
if (res && res.ok === false) { setResult({ ok: false, text: translateError(t, res) }); return }
|
|
16684
|
+
setResult({ ok: true, text: t('scope.stopAll.done', { count: Number((res && res.cleared) || count) }) })
|
|
16685
|
+
// 本地清零:页头按钮立刻消失,不重拉整层(会重排列表)。
|
|
16686
|
+
scopeForgetSceneLeases()
|
|
16687
|
+
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
16688
|
+
}
|
|
16689
|
+
/** 单张场景卡的「统一关闭」:只退出进入过这一场的对话 / 工作区。 */
|
|
16690
|
+
function stopOneScene(name) {
|
|
16691
|
+
setBusy(true); setResult(null)
|
|
16692
|
+
apiCall('scope-stop-now', { domain: 'scene', key: name }).then(function (res) {
|
|
16693
|
+
setBusy(false)
|
|
16694
|
+
if (res && res.ok === false) { setResult({ ok: false, text: translateError(t, res) }); return }
|
|
16695
|
+
setResult({ ok: true, text: t('scope.unifiedClose.sceneDone', { name: name }) })
|
|
16696
|
+
scopeForgetSceneLeases(name)
|
|
16697
|
+
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
16698
|
+
}
|
|
16490
16699
|
/** 锁 / 解锁本会话的覆盖(0.21.2,决策 12):只冻结这一层,与场景锁互不干扰。 */
|
|
16491
16700
|
function toggleSessionLock() {
|
|
16492
16701
|
if (busy) return
|
|
@@ -16613,6 +16822,7 @@ function enabledMemoryCount(rules) {
|
|
|
16613
16822
|
onClick: function () { saveEnterPreview(!enterPreview) },
|
|
16614
16823
|
}, enterPreview ? t('scenes.preview.toggle.off') : t('scenes.preview.toggle.on')),
|
|
16615
16824
|
React.createElement('button', { key: 'trash', type: 'button', className: 'dsm-btn dsm-btn-secondary', onClick: function () { setTrash(true) } }, t('trash.btn.open')),
|
|
16825
|
+
scopeSceneLeaseCount() > 0 ? React.createElement('button', { key: 'stopall', type: 'button', className: 'dsm-btn dsm-btn-danger-outline', disabled: busy || sceneStats.locked > 0, onClick: stopAllScenes }, t('scope.stopAll')) : null,
|
|
16616
16826
|
],
|
|
16617
16827
|
}),
|
|
16618
16828
|
// 列表工具条(REDESIGN §3.3,切片四):搜索住 children;场景页没有批量动作与筛选下拉。
|
|
@@ -16799,6 +17009,7 @@ function enabledMemoryCount(rules) {
|
|
|
16799
17009
|
key: 'menu',
|
|
16800
17010
|
label: t('row.menu', { name: label }),
|
|
16801
17011
|
items: [
|
|
17012
|
+
...(scopeIsSession() || scopeSceneLeaseCount(name) <= 0 ? [] : [{ key: 'stop', label: t('scope.unifiedClose'), danger: true, disabled: busy || sceneStats.locked > 0, title: sceneStats.locked > 0 ? t('scenes.lock.blockedEdit') : undefined, onClick: function () { setModal({ type: 'scene-stop', name: name }) } }]),
|
|
16802
17013
|
{ key: 'edit', label: t('scenes.row.edit'), disabled: busy || sceneLocked, title: sceneLocked ? t('scenes.lock.blockedEdit') : undefined, onClick: function () { openEditor(scene) } },
|
|
16803
17014
|
].concat(locked ? [] : [
|
|
16804
17015
|
{ key: 'delete', label: t('scenes.row.delete'), danger: true, disabled: busy || sceneLocked, title: sceneLocked ? t('scenes.lock.blockedEdit') : undefined, onClick: function () { setModal({ type: 'scene-delete', name: name }) } },
|
|
@@ -16810,6 +17021,11 @@ function enabledMemoryCount(rules) {
|
|
|
16810
17021
|
React.createElement('div', { className: 'dsm-modal-actions' },
|
|
16811
17022
|
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-secondary', disabled: busy, onClick: function () { setModal(null) } }, t('btn.cancel')),
|
|
16812
17023
|
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-danger', disabled: busy, onClick: function () { submitDeleteScene(modal.name) } }, t('memory.btn.deleteScene')))) : null,
|
|
17024
|
+
modal && modal.type === 'scene-stop' ? React.createElement(Modal, { key: 'sstop', className: 'dsm-modal-sm', title: t('scope.unifiedClose'), closeLabel: t('btn.close'), onClose: function () { setModal(null) } },
|
|
17025
|
+
React.createElement('p', { className: 'dsm-help' }, t('scope.unifiedClose.sceneDesc', { name: modal.name })),
|
|
17026
|
+
React.createElement('div', { className: 'dsm-modal-actions' },
|
|
17027
|
+
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-quiet', disabled: busy, onClick: function () { setModal(null) } }, t('btn.cancel')),
|
|
17028
|
+
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-danger', disabled: busy, onClick: function () { var name = modal.name; setModal(null); stopOneScene(name) } }, t('scope.unifiedClose')))) : null,
|
|
16813
17029
|
// 「进入场景」的改动预览卡(askEnter)。预览拿不到时不拦进入这条路 ——
|
|
16814
17030
|
// 这是一张说明卡,不是一道新门禁;把它做成前置条件就等于新增了"进不去场景"。
|
|
16815
17031
|
//
|
|
@@ -16985,6 +17201,35 @@ function enabledMemoryCount(rules) {
|
|
|
16985
17201
|
} else if (r) setResult({ ok: false, text: translateError(t, r) })
|
|
16986
17202
|
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
16987
17203
|
}
|
|
17204
|
+
/**
|
|
17205
|
+
* 页头「全部关闭」:把各会话 / 工作区 / 场景里单独开着的人设一并停掉。
|
|
17206
|
+
* 与快捷提示词同一条:只改全局启停名单停不到别的对话,得走统一关闭 op 清各层认领。
|
|
17207
|
+
*/
|
|
17208
|
+
function stopAllSubagents() {
|
|
17209
|
+
var keys = scopeLeaseKeys('subagents')
|
|
17210
|
+
if (!keys.length) return
|
|
17211
|
+
setResult(null)
|
|
17212
|
+
setBusy(true)
|
|
17213
|
+
apiCall('scope-stop-now', { domain: 'subagents', keys: keys }).then(function (res) {
|
|
17214
|
+
setBusy(false)
|
|
17215
|
+
if (res && res.ok === false) { setResult({ ok: false, text: translateError(t, res) }); return }
|
|
17216
|
+
if (res && res.warnings && res.warnings.length) { setResult({ ok: false, warning: true, text: res.warnings.join(';') }); return }
|
|
17217
|
+
setResult({ ok: true, text: t('scope.stopAll.done', { count: keys.length }) })
|
|
17218
|
+
// 本地摘掉租约:页头按钮与行内「单独设置」徽章立刻消失,不重拉整层。
|
|
17219
|
+
scopeForgetLeases('subagents', keys)
|
|
17220
|
+
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
17221
|
+
}
|
|
17222
|
+
/** 单条人设的「统一关闭」:清掉各对话 / 工作区单独打开它的覆盖,全局启停不动。 */
|
|
17223
|
+
function stopOnePersona(name) {
|
|
17224
|
+
setResult(null)
|
|
17225
|
+
setBusy(true)
|
|
17226
|
+
apiCall('scope-stop-now', { domain: 'subagents', key: name }).then(function (res) {
|
|
17227
|
+
setBusy(false)
|
|
17228
|
+
if (res && res.ok === false) { setResult({ ok: false, text: translateError(t, res) }); return }
|
|
17229
|
+
setResult({ ok: true, text: t('scope.unifiedClose.viewDone', { name: name }) })
|
|
17230
|
+
scopeForgetLeases('subagents', [name])
|
|
17231
|
+
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
17232
|
+
}
|
|
16988
17233
|
/**
|
|
16989
17234
|
* 人设表单的候选数据(模型目录 / 全体预设工具并集)只在**首次展开高级选项**时拉取:
|
|
16990
17235
|
* 宿主枚举预设需要为尚未挂载的预设建立 standing mount,不该在打开弹窗时就付这个代价。
|
|
@@ -17613,6 +17858,7 @@ function enabledMemoryCount(rules) {
|
|
|
17613
17858
|
React.createElement('button', { key: 'import', type: 'button', className: 'dsm-btn dsm-btn-secondary', disabled: busy || anyLocked, onClick: function () { setResult(null); setModal({ type: 'import' }) } }, t('subagents.import')),
|
|
17614
17859
|
React.createElement('button', { key: 'export', type: 'button', className: 'dsm-btn dsm-btn-secondary', disabled: busy || !data.subagents.length, onClick: function () { setResult(null); setModal({ type: 'export' }) } }, t('export.subagents')),
|
|
17615
17860
|
React.createElement('button', { key: 'trash', type: 'button', className: 'dsm-btn dsm-btn-secondary', onClick: function () { setTrash(true) } }, t('trash.btn.open')),
|
|
17861
|
+
scopeLeaseKeys('subagents').length > 0 ? React.createElement('button', { key: 'stopall', type: 'button', className: 'dsm-btn dsm-btn-danger-outline', disabled: busy || anyLocked, onClick: stopAllSubagents }, t('scope.stopAll')) : null,
|
|
17616
17862
|
],
|
|
17617
17863
|
}),
|
|
17618
17864
|
anyLocked === true && !scopeIsSession() ? React.createElement('div', { className: 'dsm-feedback dsm-warning', role: 'status' }, t('lock.banner')) : null,
|
|
@@ -17683,6 +17929,7 @@ function enabledMemoryCount(rules) {
|
|
|
17683
17929
|
key: 'menu',
|
|
17684
17930
|
label: t('row.menu', { name: p.name }),
|
|
17685
17931
|
items: [
|
|
17932
|
+
...(scopeLeaseCount('subagents', String(p.name)) > 0 ? [{ key: 'stop', label: t('scope.unifiedClose'), danger: true, disabled: busy || anyLocked, onClick: function () { setModal({ type: 'stop', name: p.name }) } }] : []),
|
|
17686
17933
|
{ key: 'edit', label: t('memory.edit'), disabled: busy, onClick: function () { openEditor(p.name) } },
|
|
17687
17934
|
{ key: 'delete', label: t('memory.delete'), danger: true, disabled: busy || anyLocked, onClick: function () { setModal({ type: 'delete', name: p.name }) } },
|
|
17688
17935
|
],
|
|
@@ -17877,6 +18124,11 @@ function enabledMemoryCount(rules) {
|
|
|
17877
18124
|
React.createElement('p', { className: 'dsm-help' }, t('subagents.delete.desc', { name: modal.name })),
|
|
17878
18125
|
React.createElement('div', { className: 'dsm-modal-actions' },
|
|
17879
18126
|
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-danger', disabled: busy, onClick: function () { submitDelete(modal.name) } }, t('memory.btn.delete.confirm')))) : null,
|
|
18127
|
+
modal && modal.type === 'stop' ? React.createElement(Modal, { key: 'sstop', className: 'dsm-modal-sm', title: t('scope.unifiedClose'), closeLabel: t('btn.close'), onClose: function () { setModal(null) } },
|
|
18128
|
+
React.createElement('p', { className: 'dsm-help' }, t('scope.unifiedClose.viewDesc', { name: modal.name })),
|
|
18129
|
+
React.createElement('div', { className: 'dsm-modal-actions' },
|
|
18130
|
+
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-quiet', disabled: busy, onClick: function () { setModal(null) } }, t('btn.cancel')),
|
|
18131
|
+
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-danger', disabled: busy, onClick: function () { var name = modal.name; setModal(null); stopOnePersona(name) } }, t('scope.unifiedClose')))) : null,
|
|
17880
18132
|
modal && modal.type === 'import' ? React.createElement(ImportModal, { key: 'simp', t: t, title: t('subagents.import.title'), busy: busy, hint: t('upload.drop.mzip'), requirement: t('upload.req.mdzip'), requirementTitle: [t('upload.requirement.persona.1'), t('upload.requirement.persona.2'), t('upload.requirement.persona.3')].join('\n'), onClose: function () { setModal(null) }, onSubmit: submitImport }) : null,
|
|
17881
18133
|
modal && modal.type === 'export' ? React.createElement(ExportModal, {
|
|
17882
18134
|
key: 'export', t: t, title: t('export.subagents'),
|
|
@@ -18308,6 +18560,34 @@ function enabledMemoryCount(rules) {
|
|
|
18308
18560
|
refresh(true)
|
|
18309
18561
|
})
|
|
18310
18562
|
}
|
|
18563
|
+
/**
|
|
18564
|
+
* 页头「全部关闭」:把各会话 / 工作区 / 场景里单独开着的记忆一并停掉。
|
|
18565
|
+
* 只改全局索引停不到别的对话 —— 那些是各层自己的认领,得走统一关闭 op 清掉。
|
|
18566
|
+
*/
|
|
18567
|
+
function stopAllMemories() {
|
|
18568
|
+
var keys = scopeLeaseKeys('memory')
|
|
18569
|
+
if (!keys.length) return
|
|
18570
|
+
setBusy(true); setResult(null)
|
|
18571
|
+
apiCall('scope-stop-now', { domain: 'memory', keys: keys }).then(function (res) {
|
|
18572
|
+
setBusy(false)
|
|
18573
|
+
if (res && res.ok === false) { setResult({ ok: false, text: translateError(t, res) }); return }
|
|
18574
|
+
if (res && res.warnings && res.warnings.length) { setResult({ ok: false, text: res.warnings.join(';') }); return }
|
|
18575
|
+
setResult({ ok: true, text: t('scope.stopAll.done', { count: keys.length }) })
|
|
18576
|
+
// 本地摘掉租约:页头按钮与行内「单独设置」徽章立刻消失,不重拉整层。
|
|
18577
|
+
scopeForgetLeases('memory', keys)
|
|
18578
|
+
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
18579
|
+
}
|
|
18580
|
+
/** 单条记忆的「统一关闭」:清掉各对话 / 工作区单独打开它的覆盖,全局启停不动。 */
|
|
18581
|
+
function stopOneMemory(rule) {
|
|
18582
|
+
var id = String(rule.id)
|
|
18583
|
+
setBusy(true); setResult(null)
|
|
18584
|
+
apiCall('scope-stop-now', { domain: 'memory', key: id }).then(function (res) {
|
|
18585
|
+
setBusy(false)
|
|
18586
|
+
if (res && res.ok === false) { setResult({ ok: false, text: translateError(t, res) }); return }
|
|
18587
|
+
setResult({ ok: true, text: t('scope.unifiedClose.viewDone', { name: rule.name || id }) })
|
|
18588
|
+
scopeForgetLeases('memory', [id])
|
|
18589
|
+
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
18590
|
+
}
|
|
18311
18591
|
/** 可批量切换的记忆 = 非被同名 bundle 覆盖的(与行内 Switch 同一条件)。 */
|
|
18312
18592
|
function toggleableIds(rules) {
|
|
18313
18593
|
return (rules || []).filter(function (r) { return r.shadowed !== true }).map(function (r) { return String(r.id) })
|
|
@@ -18581,6 +18861,7 @@ function enabledMemoryCount(rules) {
|
|
|
18581
18861
|
// 「编辑」在锁定态**照常可点**(用户 2026-10-12:「场景锁定下改成子智能体、
|
|
18582
18862
|
// 提示词、记忆可以打开编辑页面,但是不能保存」):只读地看一眼内容不该被锁挡住,
|
|
18583
18863
|
// 真正写盘的那一步(弹窗里的保存键)才置灰。其余会写盘的动作照旧置灰。
|
|
18864
|
+
...(scopeLeaseCount('memory', String(r.id)) > 0 ? [{ key: 'stop', label: t('scope.unifiedClose'), danger: true, disabled: busy || scopeWriteLocked(anyLocked), onClick: function () { setModal({ type: 'stop', rule: r }) } }] : []),
|
|
18584
18865
|
{ key: 'edit', label: t('memory.edit'), disabled: busy || shadowed, onClick: function () { openEditor(r) } },
|
|
18585
18866
|
{ key: 'delete', label: t('memory.delete'), danger: true, disabled: busy || shadowed || anyLocked, onClick: function () { setModal({ type: 'delete', rule: r }) } },
|
|
18586
18867
|
],
|
|
@@ -18693,6 +18974,7 @@ function enabledMemoryCount(rules) {
|
|
|
18693
18974
|
// 同排读起来才成组;留在工具条会把搜索行挤窄,而那一行现在要让给搜索框。
|
|
18694
18975
|
React.createElement('button', { key: 'bulk', type: 'button', className: 'dsm-btn dsm-btn-secondary dsm-btn-bulk', disabled: busy || scopeWriteLocked(anyLocked) || !bulkIds.length, onClick: function () { setMemories(bulkIds, !bulkAllOn, null) } }, bulkPair(bulkAllOn ? t('bulk.unselectAll') : t('bulk.selectAll'), bulkAllOn ? t('bulk.selectAll') : t('bulk.unselectAll'))),
|
|
18695
18976
|
React.createElement('button', { key: 'trash', type: 'button', className: 'dsm-btn dsm-btn-secondary', disabled: busy, onClick: openTrash }, t('memory.trash.open')),
|
|
18977
|
+
scopeLeaseKeys('memory').length > 0 ? React.createElement('button', { key: 'stopall', type: 'button', className: 'dsm-btn dsm-btn-danger-outline', disabled: busy || scopeWriteLocked(anyLocked), onClick: stopAllMemories }, t('scope.stopAll')) : null,
|
|
18696
18978
|
],
|
|
18697
18979
|
}),
|
|
18698
18980
|
// 两条横幅(与 MCP / 技能 / 子智能体页同源、同位置、同顺序):
|
|
@@ -18732,6 +19014,11 @@ function enabledMemoryCount(rules) {
|
|
|
18732
19014
|
React.createElement('p', { className: 'dsm-help' }, t('memory.delete.desc', { name: modal.rule.name })),
|
|
18733
19015
|
React.createElement('div', { className: 'dsm-modal-actions' },
|
|
18734
19016
|
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-danger', disabled: busy, onClick: function () { submitDelete(modal.rule) } }, t('memory.btn.delete.confirm')))) : null,
|
|
19017
|
+
modal && modal.type === 'stop' ? React.createElement(Modal, { key: 'mstop', className: 'dsm-modal-sm', title: t('scope.unifiedClose'), closeLabel: t('btn.close'), onClose: function () { setModal(null) } },
|
|
19018
|
+
React.createElement('p', { className: 'dsm-help' }, t('scope.unifiedClose.viewDesc', { name: modal.rule.name || modal.rule.id })),
|
|
19019
|
+
React.createElement('div', { className: 'dsm-modal-actions' },
|
|
19020
|
+
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-quiet', disabled: busy, onClick: function () { setModal(null) } }, t('btn.cancel')),
|
|
19021
|
+
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-danger', disabled: busy, onClick: function () { var rule = modal.rule; setModal(null); stopOneMemory(rule) } }, t('scope.unifiedClose')))) : null,
|
|
18735
19022
|
modal && modal.type === 'import' ? React.createElement(ImportModal, {
|
|
18736
19023
|
key: 'mimp', t: t, title: t('memory.import.title'), busy: busy, hint: t('upload.drop.mzip'),
|
|
18737
19024
|
requirement: t('upload.req.mdzip'),
|