dsh-plugin-tool-management 0.22.1 → 0.22.2
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 +47 -0
- package/README.md +8 -7
- package/README_EN.md +8 -7
- package/docs/UPDATE.md +1 -0
- package/lib/client.js +647 -206
- package/lib/compat/capability-specs.js +400 -1
- package/lib/compat/host-contracts.js +334 -3
- package/lib/compat/host-probe.js +40 -0
- package/lib/compat/host-roots.js +23 -8
- package/lib/compat/manual-review.js +55 -0
- package/lib/compat/probe.js +448 -25
- package/lib/desktop-cookie-prune.js +19 -3
- package/lib/index.js +100 -19
- package/lib/mcp/manager.js +2 -1
- package/lib/mcp/prompt-shadow.js +128 -0
- package/lib/mcp/tool-visibility.js +18 -6
- package/lib/memories/service.js +18 -5
- package/lib/op-registry.js +1 -1
- package/lib/ops/compat.js +31 -0
- package/lib/ops/scope.js +9 -9
- package/lib/scene-linkage.js +16 -1
- package/lib/scope/intent.js +1 -1
- package/lib/tool-table-switch.js +2 -2
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -220,19 +220,37 @@ button.dsm-qty:disabled{cursor:default}
|
|
|
220
220
|
.dsm-note{overflow:hidden;margin-top:4px;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:17px;text-overflow:ellipsis;white-space:nowrap}.dsm-tags{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.dsm-tag{display:inline-flex;min-height:20px;align-items:center;padding:0 8px;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsm-radius-s);color:var(--dsw-alias-label-secondary);font-size:12px;white-space:nowrap}.dsm-tag-on{border-color:var(--dsw-alias-state-success-primary);color:var(--dsw-alias-state-success-primary)}.dsm-tag-off{border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary)}.dsm-tag-warn{border-color:var(--dsm-warn);color:var(--dsm-warn)}.dsm-tag-lease{border-style:dashed;border-color:var(--dsw-alias-state-success-primary);color:var(--dsw-alias-state-success-primary)}
|
|
221
221
|
/* 中性标签:灰边框 + 主色字(用户 2026-11-06:MCP 的「未运行」不该是红的 —— 没跑起来不是故障)。 */
|
|
222
222
|
.dsm-tag-quiet{border-color:var(--dsw-alias-border-l3);color:var(--dsw-alias-label-primary)}
|
|
223
|
-
/* 租约浮窗(悬在「临时运行 · N
|
|
223
|
+
/* 租约浮窗(悬在「临时运行 · N 个对话」徽章上):一行一个认领者,对话标题在左、
|
|
224
|
+
工作区弱化成行尾后缀、放行按钮贴右边。早先按工作区分组时,组头与缩进各占一行,
|
|
225
|
+
只有一两个对话时整块像张空卡片(用户反馈「太多空白」)——分组只保留排序意义,不再占行。
|
|
224
226
|
固定定位 + 视口坐标 —— 徽章所在的列表行是 overflow:hidden,绝对定位会被裁掉
|
|
225
|
-
(与 SourceSelect 的菜单同一条理由)。
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
227
|
+
(与 SourceSelect 的菜单同一条理由)。
|
|
228
|
+
宽度上限 280px:标题与工作区都长时两边一起省略,边框不会跟着内容无限拉长。 */
|
|
229
|
+
.dsm-lease-pop{position:fixed;z-index:1200;box-sizing:border-box;display:flex;width:max-content;min-width:180px;max-width:min(88vw,280px);flex-direction:column;padding:0;overflow:visible;border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsm-radius-m);background:var(--dsw-alias-bg-layer-3);box-shadow:var(--dsw-shadow-lv2);color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px;white-space:normal;text-align:left}
|
|
230
|
+
/* 徽章与浮窗之间留了 6px 空档:用不可见的桥接条补上,指针从徽章移进浮窗时
|
|
231
|
+
不会经过"两边都不在"的位置 —— 因此一离开两者就能立刻收起,不必等关闭延迟。
|
|
232
|
+
浮窗在上方时桥接条改到下方(dsm-lease-pop-up),始终朝着徽章那一侧。
|
|
233
|
+
滚动必须放在内层:外层一旦 overflow:auto,伸出去 8px 的桥接条会被裁掉。 */
|
|
234
|
+
.dsm-lease-pop:not(.dsm-lease-pop-up)::before,.dsm-lease-pop-up::after{position:absolute;right:0;left:0;height:8px;content:""}
|
|
235
|
+
.dsm-lease-pop:not(.dsm-lease-pop-up)::before{top:-8px}
|
|
236
|
+
.dsm-lease-pop-up::after{bottom:-8px}
|
|
237
|
+
.dsm-lease-pop-body{box-sizing:border-box;min-height:0;flex:1 1 auto;padding:6px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-border-l2) transparent}
|
|
238
|
+
.dsm-lease-pop-body::-webkit-scrollbar{width:8px;height:8px}
|
|
239
|
+
.dsm-lease-pop-body::-webkit-scrollbar-track{background:transparent}
|
|
240
|
+
.dsm-lease-pop-body::-webkit-scrollbar-thumb{border-radius:99px;background:var(--dsw-alias-border-l2)}
|
|
241
|
+
.dsm-lease-pop-item{box-sizing:border-box;display:flex;gap:8px;align-items:center;min-height:28px;padding:2px 6px;border-radius:var(--dsm-radius-s)}
|
|
242
|
+
.dsm-lease-pop-item:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
243
|
+
/* 标题吃满剩余宽度:行尾的「×」才会贴住右边缘,而不是跟在短标题后面留一截空白。 */
|
|
244
|
+
.dsm-lease-pop-title{min-width:0;overflow:hidden;flex:1;color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px;text-overflow:ellipsis;white-space:nowrap}
|
|
245
|
+
/* 工作区后缀:弱化到辅助信息一档;上限 38% 是为了长路径不把标题挤没。 */
|
|
246
|
+
.dsm-lease-pop-ws{min-width:0;max-width:38%;overflow:hidden;flex:none;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px;text-overflow:ellipsis;white-space:nowrap}
|
|
232
247
|
/* 每行末尾那颗「×」:只放开这一个对话的临时运行,其余对话照旧(认领是逐个对话记的)。 */
|
|
233
|
-
.dsm-lease-pop-x{flex:none;box-sizing:border-box;width:24px;height:24px;padding:0;border:0;border-radius:var(--dsm-radius-s);background:transparent;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:
|
|
248
|
+
.dsm-lease-pop-x{flex:none;box-sizing:border-box;width:24px;height:24px;padding:0;border:0;border-radius:var(--dsm-radius-s);background:transparent;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:14px;line-height:24px;cursor:pointer}
|
|
249
|
+
.dsm-lease-pop-item:hover .dsm-lease-pop-x{color:var(--dsw-alias-label-secondary)}
|
|
234
250
|
.dsm-lease-pop-x:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
|
|
235
251
|
.dsm-lease-pop-x:disabled{cursor:default;opacity:.5}
|
|
252
|
+
/* 徽章与「×」都能用键盘操作(Enter/空格开合、Tab 进浮窗):焦点必须看得见。 */
|
|
253
|
+
.dsm-tag-lease:focus-visible,.dsm-lease-pop-x:focus-visible{outline-style:solid;outline-color:var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-width:var(--dsw-focus-ring-width,2px);outline-offset:1px}
|
|
236
254
|
/* 开关与官方同款(用户 2026-10-18:「switch 按键统一和官方一样的模板」→「改成完全一样」):
|
|
237
255
|
36×20 外壳 + 16px 拇指、内边距 2px、滑块位移 16px、开态用 brand-primary,
|
|
238
256
|
关态拇指用 switch-thumb —— 尺寸与配色照抄宿主设置面板那颗。
|
|
@@ -603,7 +621,12 @@ button.dsm-qty:disabled{cursor:default}
|
|
|
603
621
|
.dsm-compat-code{font-family:var(--ds-font-family-code,ui-monospace,SFMono-Regular,Consolas,monospace);font-size:11px}
|
|
604
622
|
.dsm-compat-list{margin:0;padding-left:16px}.dsm-compat-list li+li{margin-top:4px}
|
|
605
623
|
@container(max-width:640px){.dsm-compat-grid{grid-template-columns:1fr}}
|
|
606
|
-
|
|
624
|
+
/* 滚动条装订线只在面板挂载期间生效,两个落点各管一种布局:
|
|
625
|
+
· .dsm-settings-scroll-host —— 41 片按计算样式找出宿主真正的滚动容器,临时挂上这个类;
|
|
626
|
+
· html.dsm-scroll-stable —— 滚动落在视口上时(找不到祖先容器)由 41 片临时加类。
|
|
627
|
+
两段类名是为了压过宿主自己的选择器,替代原先的 !important —— 强制值会盖掉宿主的 overflow 语义。
|
|
628
|
+
以前这里是一条常驻的 html/body 规则:它改的是整个应用、卸载后也不会撤销,已删除。 */
|
|
629
|
+
.dsm-settings-scroll-host.dsm-settings-scroll-host{overflow-y:auto;scrollbar-gutter:stable}html.dsm-scroll-stable{scrollbar-gutter:stable}.dsm-panel-head{position:sticky;top:0;z-index:6;display:grid;grid-template-columns:minmax(0,1fr) max-content;grid-template-areas:"scope links" "tabs tabs";align-items:center;column-gap:8px;min-width:0;background:var(--dsm-surface,var(--dsw-alias-bg-layer-2))}.dsm-tabs-shell{display:flex;min-width:0;align-items:center;gap:4px;margin-bottom:0;padding-top:2px}.dsm-tabs{display:grid;min-width:0;flex:1;grid-template-columns:repeat(auto-fit,minmax(64px,1fr));gap:0;overflow:hidden;margin-bottom:0;border-bottom:1px solid var(--dsw-alias-border-l1)}.dsm-tab{box-sizing:border-box;width:100%;min-width:0;padding-right:4px;padding-left:4px;overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.dsm-feedback-link{width:30px;height:30px;box-sizing:border-box;padding:0;justify-content:center}.dsm-feedback-link svg{width:16px;height:16px}@container(max-width:620px){.dsm-tab{padding-right:4px;padding-left:4px;font-size:12px}}
|
|
607
630
|
/* 顶部栏右上角那一行(版本号 · 检查更新 · GitHub):排在**作用域行**的右端,页签行独占一行。
|
|
608
631
|
位置由 .dsm-panel-head 的网格排(area links)—— 它要和 GitHub 图标并排(用户 2026-10-22),
|
|
609
632
|
塞进 .dsm-tabs-shell 就只能挤在页签那一行里。 */
|
|
@@ -1011,7 +1034,7 @@ html,body{scrollbar-gutter:stable}.dsm-settings-scroll-host{overflow-y:scroll!im
|
|
|
1011
1034
|
.dsm-rowselect-compact .dsm-rowselect-main{flex-direction:row;align-items:baseline;gap:8px}
|
|
1012
1035
|
/* 单行版里**名字不缩**(用户 2026-11-06:「标题名字要全部展示」)—— 挤掉的是描述,
|
|
1013
1036
|
不是名字。 */
|
|
1014
|
-
.dsm-rowselect-compact .dsm-rowselect-name{flex:none}
|
|
1037
|
+
.dsm-rowselect-compact .dsm-rowselect-name{flex:none;max-width:100%}
|
|
1015
1038
|
.dsm-rowselect-compact .dsm-rowselect-desc{min-width:0;flex:1 1 auto}
|
|
1016
1039
|
.dsm-rowselect-name{overflow:hidden;font-size:13px;line-height:18px;text-overflow:ellipsis;white-space:nowrap}
|
|
1017
1040
|
.dsm-rowselect-desc{overflow:hidden;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:16px;text-overflow:ellipsis;white-space:nowrap}
|
|
@@ -1377,15 +1400,48 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
1377
1400
|
}).catch(function () { return ioDefaultDir })
|
|
1378
1401
|
}
|
|
1379
1402
|
|
|
1403
|
+
/**
|
|
1404
|
+
* 注入插件样式表(幂等,引用计数)。
|
|
1405
|
+
*
|
|
1406
|
+
* @returns 释放本次持有的那个 `<style>` 的清理函数(可重复调用)。
|
|
1407
|
+
*
|
|
1408
|
+
* 为什么要交出去:样式标签挂在 `document.head`,不随插件 fiber 销毁。热重载或停用之后
|
|
1409
|
+
* 规则仍然生效(`.dsm-*` 会命中残留 DOM,滚动条装订线也会留在宿主容器上),只能靠刷新
|
|
1410
|
+
* 页面才恢复。调用点(40 片)把它注册进 `ctx.effect`。
|
|
1411
|
+
*
|
|
1412
|
+
* 为什么按引用计数而不是"有就复用、没有就建":热重载时新旧实例可能同时持有一份样式
|
|
1413
|
+
* (新实例先 apply、旧 fiber 后 dispose)。直接删会让新实例当场失去样式;直接复用则
|
|
1414
|
+
* 旧实例一释放就把新实例的那份一起带走。计数只让**最后一个**持有者负责移除。
|
|
1415
|
+
*/
|
|
1380
1416
|
function ensureCss() {
|
|
1381
|
-
if (typeof document === 'undefined') return
|
|
1417
|
+
if (typeof document === 'undefined') return function () {}
|
|
1382
1418
|
const id = 'dsh-plugin-tool-management'
|
|
1383
|
-
|
|
1419
|
+
// 复用分支拿到的是 `Element`(没有 `dataset`),所以引用数走 attribute 读写,
|
|
1420
|
+
// 两个分支共用同一份实现。
|
|
1421
|
+
const REFS = 'data-plugin-css-refs'
|
|
1422
|
+
/** 把一个标签的引用数 +1,并返回只生效一次的释放函数。 */
|
|
1423
|
+
function retain(tag) {
|
|
1424
|
+
var released = false
|
|
1425
|
+
return function () {
|
|
1426
|
+
if (released) return
|
|
1427
|
+
released = true
|
|
1428
|
+
var left = Number(tag.getAttribute(REFS) || '1') - 1
|
|
1429
|
+
if (left > 0) { tag.setAttribute(REFS, String(left)); return }
|
|
1430
|
+
try { if (tag.parentNode) tag.parentNode.removeChild(tag) } catch (e) { /* 文档已卸载 */ }
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
const existing = document.querySelector('style[data-plugin-css="' + id + '"]')
|
|
1434
|
+
if (existing) {
|
|
1435
|
+
existing.setAttribute(REFS, String(Number(existing.getAttribute(REFS) || '1') + 1))
|
|
1436
|
+
return retain(existing)
|
|
1437
|
+
}
|
|
1384
1438
|
const tag = document.createElement('style')
|
|
1385
1439
|
tag.dataset.plugin = id
|
|
1386
1440
|
tag.dataset.pluginCss = id
|
|
1441
|
+
tag.setAttribute(REFS, '1')
|
|
1387
1442
|
tag.textContent = CSS
|
|
1388
1443
|
document.head.appendChild(tag)
|
|
1444
|
+
return retain(tag)
|
|
1389
1445
|
}
|
|
1390
1446
|
|
|
1391
1447
|
/**
|
|
@@ -2410,13 +2466,13 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2410
2466
|
* (颜色统一为绿/灰,这个标记只留给"来源点"与统计用)。全局层恒 `scoped: false`。
|
|
2411
2467
|
*/
|
|
2412
2468
|
function scopeFlag(domain, key, globalValue) {
|
|
2413
|
-
// 全局 blocked
|
|
2469
|
+
// 全局 blocked(旧版「全部关闭」留下的持久停机)压过一切会话层(与后端 `resolveResource` 同一条):会话里的覆盖、
|
|
2414
2470
|
// 场景勾选、逐工具 / 单条技能的推导都不能把它显成开着 —— 否则开关是绿的、模型调不到。
|
|
2415
2471
|
// 技能还要看所在来源:来源被 blocked 时,技能级开着也加载不到。
|
|
2416
2472
|
if (domain === 'mcp' || domain === 'skills' || domain === 'skillSources') {
|
|
2417
2473
|
var intentState = scopeIntentOf(domain, key)
|
|
2418
2474
|
if (intentState === 'blocked') return { value: false, scoped: false }
|
|
2419
|
-
// 意图比列表里那份 `globalOn`
|
|
2475
|
+
// 意图比列表里那份 `globalOn` 新:写完全部关闭后列表还没重读,全局开关也该立刻翻过去。
|
|
2420
2476
|
if (intentState === 'on') globalValue = true
|
|
2421
2477
|
else if (intentState === 'off') globalValue = false
|
|
2422
2478
|
}
|
|
@@ -2437,7 +2493,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2437
2493
|
//
|
|
2438
2494
|
// MCP 服务器与技能来源两格的全局开关**不是**补丁 / 来源状态,而是意图:
|
|
2439
2495
|
// on —— 全局启用;off —— 全局关闭(有会话还在用就保持运行,即租约);
|
|
2440
|
-
// blocked ——
|
|
2496
|
+
// blocked —— 持久停机(旧版全部关闭;压过租约与一切会话层)。
|
|
2441
2497
|
// 界面上的全局开关读意图;"临时运行 · N 个对话"来自 `leases`,它是全局 off 却能跑的
|
|
2442
2498
|
// 唯一解释。会话层不显示意图(那一层只回答"这个对话看不看得到")。
|
|
2443
2499
|
/** 某一格的全局意图:`'on' | 'off' | 'blocked' | null`(没记录 = 跟随运行态)。 */
|
|
@@ -2469,6 +2525,27 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2469
2525
|
var list = byKey && typeof byKey === 'object' ? byKey[key] : null
|
|
2470
2526
|
return Array.isArray(list) ? list : []
|
|
2471
2527
|
}
|
|
2528
|
+
/**
|
|
2529
|
+
* 这一格的认领**单位数**:工作区粒度按工作区计,会话粒度按对话计。
|
|
2530
|
+
*
|
|
2531
|
+
* 与徽章浮窗的分组同一口径(`leaseGroups`):有 cwd 的按归一化路径去重;没有 cwd 的
|
|
2532
|
+
* 会话各自算一个单位,不能并成一个「无工作区」。用于开关悬浮提示与操作回执,避免
|
|
2533
|
+
* 工作区粒度下文案说「N 个对话」而徽章说「N 个工作区」。
|
|
2534
|
+
*/
|
|
2535
|
+
function scopeLeaseUnitCount(domain, key) {
|
|
2536
|
+
var details = scopeLeaseDetails(domain, key)
|
|
2537
|
+
if (!scopeIsWorkspace()) return details.length
|
|
2538
|
+
var seen = Object.create(null)
|
|
2539
|
+
var n = 0
|
|
2540
|
+
details.forEach(function (d) {
|
|
2541
|
+
var cwd = String((d && d.cwd) || '')
|
|
2542
|
+
var unit = cwd === '' ? 'id:' + String((d && d.id) || '') : scopeWorkspacePathKey(cwd)
|
|
2543
|
+
if (seen[unit]) return
|
|
2544
|
+
seen[unit] = true
|
|
2545
|
+
n += 1
|
|
2546
|
+
})
|
|
2547
|
+
return n
|
|
2548
|
+
}
|
|
2472
2549
|
/** 这一域此刻有租约的键(全局层专用;会话层返回空)。「全部关闭」按它取目标集。 */
|
|
2473
2550
|
function scopeLeaseKeys(domain) {
|
|
2474
2551
|
if (scopeIsSession()) return []
|
|
@@ -2477,7 +2554,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2477
2554
|
return Object.keys(leases).filter(function (key) { return Number(leases[key]) > 0 })
|
|
2478
2555
|
}
|
|
2479
2556
|
/**
|
|
2480
|
-
*
|
|
2557
|
+
* 全部关闭成功后**就地**摘掉本地快照里的租约与意图,不等 `scope-get` 回来。
|
|
2481
2558
|
*
|
|
2482
2559
|
* 为什么不能改成再拉一次:服务端快照有短 TTL,紧接着的 `scope-get` 可能仍是写前的
|
|
2483
2560
|
* 那一份 —— 徽章会先消失又冒回来;而且整层重拉会让列表按新状态重新定序,用户刚打开的
|
|
@@ -2550,9 +2627,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2550
2627
|
if (String((d && d.id) || '') === id) { found = true; cwd = String((d && d.cwd) || '') }
|
|
2551
2628
|
})
|
|
2552
2629
|
if (!found) return
|
|
2630
|
+
var workspaceKey = scopeWorkspacePathKey(cwd)
|
|
2553
2631
|
var keep = list.filter(function (d) {
|
|
2554
2632
|
if (String((d && d.id) || '') === id) return false
|
|
2555
|
-
if (scopeIsWorkspace() &&
|
|
2633
|
+
if (scopeIsWorkspace() && workspaceKey !== '' && scopeWorkspacePathKey(d && d.cwd) === workspaceKey) return false
|
|
2556
2634
|
return true
|
|
2557
2635
|
})
|
|
2558
2636
|
var domainLeases = Object.assign({}, leases[domain] || {})
|
|
@@ -2591,7 +2669,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2591
2669
|
var list = all && typeof all === 'object' ? all[String(sceneName)] : null
|
|
2592
2670
|
return Array.isArray(list) ? list : []
|
|
2593
2671
|
}
|
|
2594
|
-
/**
|
|
2672
|
+
/** 全部关闭某个(或全部)场景后,就地改本地计数 —— 理由同 `scopeForgetLeases`。 */
|
|
2595
2673
|
function scopeForgetSceneLeases(sceneName) {
|
|
2596
2674
|
if (scopeIsSession()) return
|
|
2597
2675
|
var global = scopeState.global
|
|
@@ -2908,6 +2986,22 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2908
2986
|
var parts = trimmed.split(/[\\/]/)
|
|
2909
2987
|
return parts.length ? parts[parts.length - 1] : trimmed
|
|
2910
2988
|
}
|
|
2989
|
+
/**
|
|
2990
|
+
* 工作区路径比较键:与服务端 `sessions/path-key.ts` 的 `workspacePathKey` 同一口径 ——
|
|
2991
|
+
* Windows 盘符 / UNC 路径统一分隔符并小写,其余平台大小写敏感;去掉尾分隔符。
|
|
2992
|
+
*
|
|
2993
|
+
* 为什么客户端也要这一份:浮窗按 cwd 给认领分组,分组键必须与服务端 `ws:<cwd>` 的
|
|
2994
|
+
* 归一化一致,否则同一个工作区会显示成两块、计数与释放范围也对不上。改这里时同步改
|
|
2995
|
+
* 服务端那一份(它是会话挂回与工作区作用域键的唯一真相)。
|
|
2996
|
+
*/
|
|
2997
|
+
function scopeWorkspacePathKey(cwd) {
|
|
2998
|
+
var raw = String(cwd == null ? '' : cwd).trim()
|
|
2999
|
+
if (!raw) return ''
|
|
3000
|
+
var windows = /^[A-Za-z]:[\\/]/.test(raw) || raw.indexOf('\\\\') === 0
|
|
3001
|
+
var out = windows ? raw.replace(/\//g, '\\') : raw
|
|
3002
|
+
while (out.length > 1 && (out.charAt(out.length - 1) === '\\' || out.charAt(out.length - 1) === '/')) out = out.slice(0, -1)
|
|
3003
|
+
return windows ? out.toLowerCase() : out
|
|
3004
|
+
}
|
|
2911
3005
|
/** 工作区键(`ws:<cwd>`)→ 显示名(键里带完整路径,去掉前缀再取末段)。 */
|
|
2912
3006
|
function scopeWorkspaceNameFromKey(key) {
|
|
2913
3007
|
var raw = String(key || '')
|
|
@@ -3230,18 +3324,23 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
3230
3324
|
batch: 'compat.op.batch', delete: 'compat.op.delete',
|
|
3231
3325
|
}
|
|
3232
3326
|
/**
|
|
3233
|
-
*
|
|
3327
|
+
* 本插件依赖的**必备**宿主契约能力 id(capability-specs.ts 里没有等价兜底、缺席即功能
|
|
3328
|
+
* 少一半的那些)。
|
|
3234
3329
|
*
|
|
3235
3330
|
* 与上面那排 action 的区别:action 是"这个操作走哪条路",这些是"某个契约还在不在"。
|
|
3236
3331
|
* 它们缺了都不抛错、只是功能少一半,所以单独一块而不是混进 action 表 —— 混进去会让
|
|
3237
3332
|
* "删除不可用"和"工具限制失效"看起来一样严重,实际后者不影响你删任何东西。
|
|
3238
3333
|
*
|
|
3239
|
-
*
|
|
3240
|
-
*
|
|
3241
|
-
*
|
|
3334
|
+
* 与服务端 `CONTRACT_CAPABILITY_IDS` 的关系:那边只映射 feature-overview 里**有独立行**
|
|
3335
|
+
* 的四条;这里还包含没有独立行、但同属必备契约的能力。两处都按能力 id 过滤 findings,
|
|
3336
|
+
* 任一处改名都会让对应条目在界面上静默消失,所以改了能力 id 就一起登记。
|
|
3242
3337
|
*/
|
|
3243
3338
|
var CONTRACT_CAPABILITY_IDS = [
|
|
3244
3339
|
'agentPreset.register', 'tools.restrict-method', 'agent.created-event', 'connection.admit',
|
|
3340
|
+
'tools.get-method', 'tools.guard-dispatch', 'tools.mcp-resource-args', 'systemPrompt.mcp-section',
|
|
3341
|
+
'mcp-client.config-schema', 'skills.register-provider', 'agents.list', 'pluginInventory.list',
|
|
3342
|
+
'webServer.register', 'sandboxPolicy.resolve', 'projection.cached-title',
|
|
3343
|
+
'official-skill-assets', 'official-sandbox-asset',
|
|
3245
3344
|
]
|
|
3246
3345
|
/**
|
|
3247
3346
|
* 「最近改动」流水里 op 的人类名(0.15.0 B2)。
|
|
@@ -3357,20 +3456,27 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
3357
3456
|
const findings = (data && data.findings) || []
|
|
3358
3457
|
const byId = {}
|
|
3359
3458
|
findings.forEach(function (f) { byId[f.id] = f })
|
|
3360
|
-
|
|
3459
|
+
// 缺席的 id 不能当成满足:那说明能力表被删 / 改名了,路由却仍会走一条已不再被探测的
|
|
3460
|
+
// 破坏性路径。与服务端 routeFor 同口径(fail-closed),否则页面说"可用"、点下去被拒。
|
|
3461
|
+
const ok = function (id) { return byId[id] !== undefined && byId[id].state === 'ok' }
|
|
3361
3462
|
const routes = {}
|
|
3362
|
-
routes.list = ok('workspace.read-state') && ok('workspace.read-table') && ok('workspace.index-shape')
|
|
3463
|
+
routes.list = ok('workspace.read-state') && ok('workspace.read-table') && ok('workspace.index-shape')
|
|
3464
|
+
&& ok('persistence.list') ? 'adapter' : 'none'
|
|
3363
3465
|
routes.archive = ok('workspace.archive-native') ? 'native' : (ok('workspace.enqueue') && ok('workspace.set-state') ? 'adapter' : 'none')
|
|
3364
3466
|
routes.unarchive = ok('workspace.unarchive-native') ? 'native' : (ok('workspace.enqueue') && ok('workspace.set-state') ? 'adapter' : 'none')
|
|
3365
3467
|
routes.batch = ok('workspace.batch-native') ? 'native' : (ok('workspace.enqueue') && ok('workspace.set-state') ? 'adapter' : 'none')
|
|
3366
|
-
// 与服务端 OPERATION_ROUTES 同源(src/compat/
|
|
3468
|
+
// 与服务端 OPERATION_ROUTES 同源(src/compat/host-roots.ts):
|
|
3367
3469
|
// · delete 不要求 `projection.delete-native` —— 宿主自带删除屏障是可选槽位,
|
|
3368
3470
|
// 要求它会把 rc.2 上的删除显示成不可用(服务端有意不要求);
|
|
3369
|
-
// · 但要求 `projection.table-delete` ——
|
|
3471
|
+
// · 但要求 `projection.table-delete` —— 那是运行时的硬前提(表不可删就没法安全删行);
|
|
3472
|
+
// · 还要求 `workspace.read-header` / `sessions.live-access` / `persistence.list` /
|
|
3473
|
+
// `persistence.transcript-locate` —— 删除入口在破坏性步骤之前会硬检查它们,
|
|
3474
|
+
// 不算进路由就会「页面说可用、点下去在链路中段报错」。
|
|
3370
3475
|
routes.delete = ok('workspace.delete-native') ? 'native'
|
|
3371
3476
|
: (ok('workspace.enqueue') && ok('workspace.set-state') && ok('workspace.index-header')
|
|
3372
|
-
&& ok('
|
|
3373
|
-
&& ok('
|
|
3477
|
+
&& ok('workspace.read-header') && ok('sessions.detach-live') && ok('sessions.cold-announce')
|
|
3478
|
+
&& ok('sessions.live-access') && ok('persistence.list') && ok('persistence.transcript-locate')
|
|
3479
|
+
&& ok('projection.write') && ok('projection.table-delete') ? 'adapter' : 'none')
|
|
3374
3480
|
return routes
|
|
3375
3481
|
}
|
|
3376
3482
|
|
|
@@ -4019,6 +4125,22 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
4019
4125
|
loadBackups(alive)
|
|
4020
4126
|
return function () { alive = false }
|
|
4021
4127
|
}, [])
|
|
4128
|
+
// 页头的「重新检测」:与首挂载同一组请求,显式带 refresh 绕过服务端 5 秒缓存。
|
|
4129
|
+
// 契约 / 版本在宿主原地升级后可能已经变了,而用户不该为此退页重进。
|
|
4130
|
+
const refreshAll = function () {
|
|
4131
|
+
setBusy(true)
|
|
4132
|
+
setError(null)
|
|
4133
|
+
apiCall('compat-status', { refresh: true })
|
|
4134
|
+
.then(function (r) { apply(r, true) })
|
|
4135
|
+
.catch(function (e) { setError(errMsg(e)); setBusy(false) })
|
|
4136
|
+
loadReach(true)
|
|
4137
|
+
loadInject(true)
|
|
4138
|
+
loadSlash(true)
|
|
4139
|
+
loadLive(true)
|
|
4140
|
+
loadFeatures(true)
|
|
4141
|
+
loadToken(true)
|
|
4142
|
+
loadBackups(true)
|
|
4143
|
+
}
|
|
4022
4144
|
// 保存注入设置:先乐观更新界面(点一下就该有反馈),服务端返回值到达后以其为准;
|
|
4023
4145
|
// 失败则重新拉一次。可达性矩阵跟着刷新 —— 芯片要反映新的开关状态。
|
|
4024
4146
|
// `{ok:false}` 与网络异常分开处理:前者是服务端明确拒绝(坏侧车 / 令牌失效),
|
|
@@ -4087,6 +4209,18 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
4087
4209
|
+ blockers.length
|
|
4088
4210
|
+ unverified.length
|
|
4089
4211
|
+ Object.keys(sameAsHost).filter(function (name) { return sameAsHost[name] === false }).length
|
|
4212
|
+
// 契约漂移 / 缺失不一定让能力探测失败,但会让某项功能"看起来在跑、实际按旧契约跑"。
|
|
4213
|
+
// 页头必须把它算进结论,否则会出现「能力 18/18 全部可用」配一排黄色契约警告。
|
|
4214
|
+
// 可选包(宿主本就不提供)不算 —— 那条是部署形态,不是待复核。
|
|
4215
|
+
const contractReviewCount = [data && data.contracts && data.contracts.packages, data && data.behaviors && data.behaviors.packages, data && data.clientUi && data.clientUi.packages]
|
|
4216
|
+
.map(function (list) { return Array.isArray(list) ? list : [] })
|
|
4217
|
+
.reduce(function (sum, list) {
|
|
4218
|
+
return sum + list.filter(function (item) {
|
|
4219
|
+
return item && (item.resolved === null ? item.optional !== true : (item.missingMarkers || []).length > 0)
|
|
4220
|
+
}).length
|
|
4221
|
+
}, 0)
|
|
4222
|
+
// 三种结论:真问题(红) / 契约待复核(黄) / 全部可用(无标记)。
|
|
4223
|
+
const attention = blockedCount > 0 ? 'blocked' : contractReviewCount > 0 ? 'review' : 'ok'
|
|
4090
4224
|
const unavailableCount = Object.keys(OPERATION_LABELS).filter(function (op) { return routes[op] === 'none' }).length
|
|
4091
4225
|
|
|
4092
4226
|
const routeClass = function (via) {
|
|
@@ -4115,12 +4249,33 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
4115
4249
|
case 'workspace.delete-native': return t('compat.cap.workspaceDeleteNative')
|
|
4116
4250
|
case 'sessions.detach-live': return t('compat.cap.sessionsDetachLive')
|
|
4117
4251
|
case 'sessions.cold-announce': return t('compat.cap.sessionsColdAnnounce')
|
|
4252
|
+
case 'sessions.live-access': return t('compat.cap.sessionsLiveAccess')
|
|
4253
|
+
case 'persistence.list': return t('compat.cap.persistenceList')
|
|
4254
|
+
case 'persistence.transcript-locate': return t('compat.cap.persistenceTranscriptLocate')
|
|
4255
|
+
case 'persistence.transcript-read': return t('compat.cap.persistenceTranscriptRead')
|
|
4118
4256
|
case 'projection.write': return t('compat.cap.projectionWrite')
|
|
4119
4257
|
case 'projection.table-delete': return t('compat.cap.projectionTableDelete')
|
|
4120
4258
|
case 'agentPreset.register': return t('compat.cap.agentPresetRegister')
|
|
4121
4259
|
case 'tools.restrict-method': return t('compat.cap.toolsRestrictMethod')
|
|
4260
|
+
case 'tools.schema-list': return t('compat.cap.toolsSchemaList')
|
|
4261
|
+
case 'tools.get-method': return t('compat.cap.toolsGetMethod')
|
|
4262
|
+
case 'tools.guard-dispatch': return t('compat.cap.toolsGuardDispatch')
|
|
4263
|
+
case 'tools.mcp-resource-args': return t('compat.cap.toolsMcpResourceArgs')
|
|
4264
|
+
case 'systemPrompt.mcp-section': return t('compat.cap.systemPromptMcpSection')
|
|
4265
|
+
case 'mcp-client.config-schema': return t('compat.cap.mcpClientConfigSchema')
|
|
4266
|
+
case 'skills.register-provider': return t('compat.cap.skillsRegisterProvider')
|
|
4267
|
+
case 'agents.list': return t('compat.cap.agentsList')
|
|
4268
|
+
case 'pluginInventory.list': return t('compat.cap.pluginInventoryList')
|
|
4269
|
+
case 'webServer.register': return t('compat.cap.webServerRegister')
|
|
4270
|
+
case 'sandboxPolicy.resolve': return t('compat.cap.sandboxPolicyResolve')
|
|
4271
|
+
case 'projection.cached-title': return t('compat.cap.projectionCachedTitle')
|
|
4272
|
+
case 'official-skill-assets': return t('compat.cap.officialSkillAssets')
|
|
4273
|
+
case 'official-sandbox-asset': return t('compat.cap.officialSandboxAsset')
|
|
4122
4274
|
case 'agent.created-event': return t('compat.cap.agentCreatedEvent')
|
|
4123
4275
|
case 'connection.admit': return t('compat.cap.connectionAdmit')
|
|
4276
|
+
case 'subagents.runtime': return t('compat.cap.subagentsRuntime')
|
|
4277
|
+
case 'llm.model-catalog': return t('compat.cap.llmModelCatalog')
|
|
4278
|
+
case 'approval.effective-policy': return t('compat.cap.approvalEffectivePolicy')
|
|
4124
4279
|
case 'archive': return t('compat.cap.opArchive')
|
|
4125
4280
|
case 'unarchive': return t('compat.cap.opUnarchive')
|
|
4126
4281
|
case 'batch': return t('compat.cap.opBatch')
|
|
@@ -4154,6 +4309,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
4154
4309
|
case 'slash-commands': return t('compat.ov.slashCommands')
|
|
4155
4310
|
case 'native-delete': return t('compat.ov.nativeDelete')
|
|
4156
4311
|
case 'host-identity': return t('compat.ov.hostIdentity')
|
|
4312
|
+
case 'host-contracts': return t('compat.ov.hostContracts')
|
|
4157
4313
|
case 'memory': return t('compat.ov.memory')
|
|
4158
4314
|
case 'prompts': return t('compat.ov.prompts')
|
|
4159
4315
|
case 'subagents': return t('compat.ov.subagents')
|
|
@@ -4254,6 +4410,13 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
4254
4410
|
if (row.slashTools && row.slashQuickPrompts) return t('compat.ov.slashCommands.on')
|
|
4255
4411
|
return t(row.slashTools ? 'compat.ov.slashCommands.onTools' : 'compat.ov.slashCommands.onQuick')
|
|
4256
4412
|
}
|
|
4413
|
+
if (row.key === 'host-contracts') {
|
|
4414
|
+
if (row.state === 'ok') return t('compat.ov.hostContracts.ok')
|
|
4415
|
+
const items = (row.contracts || []).map(function (item) {
|
|
4416
|
+
return t('compat.ov.hostContracts.item', { package: item.package, feature: item.feature })
|
|
4417
|
+
})
|
|
4418
|
+
return t('compat.ov.hostContracts.degraded', { count: items.length, list: list(items) })
|
|
4419
|
+
}
|
|
4257
4420
|
if (row.key === 'host-identity') {
|
|
4258
4421
|
if (row.state === 'unknown') return t('compat.ov.route.unknown')
|
|
4259
4422
|
if (row.state === 'degraded') return t('compat.ov.hostIdentity.degraded', { list: list(row.blockers) })
|
|
@@ -4837,6 +5000,53 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
4837
5000
|
// 而且"出厂默认关掉"这件事用户不需要为此做什么 —— 要用就勾上,不用管它。
|
|
4838
5001
|
rows)))
|
|
4839
5002
|
}
|
|
5003
|
+
// 预设注入边界:五类内容(记忆 / 全局提示词 / 技能 / MCP / 子智能体)在**每个 Agent
|
|
5004
|
+
// 预设**下到不到得了模型。回答的是"面板标着已注入,模型真的看得到吗"——本插件的
|
|
5005
|
+
// 注入由它自己在每步发出(极简这类预设下默认不发,可用上面的「注入」块强制),
|
|
5006
|
+
// 而全局提示词与技能目录还要看官方那两条行挂没挂(极简都没挂)。紧挨模型工具表下方;
|
|
5007
|
+
// 取不到时这一节不显示,不影响上面的结论。
|
|
5008
|
+
//
|
|
5009
|
+
// 排版口径(用户裁定 2026-09-15):每格一枚描边标签,**绿框=能用、红框=不能用、
|
|
5010
|
+
// 灰框=判断不了**;不再出现 ✓/✗ 符号,也不再有任何整行的解释文字 —— 预设损坏与
|
|
5011
|
+
// 解析失败缩成预设名旁边的小标签。MCP 与子智能体两列由宿主侧的 preset-reach 给出。
|
|
5012
|
+
if (presetReach && Array.isArray(presetReach.rows) && presetReach.rows.length) {
|
|
5013
|
+
push(section(t('compat.reach'), null,
|
|
5014
|
+
React.createElement('div', { className: 'dsm-compat-mod-list dsm-compat-cards' },
|
|
5015
|
+
presetReach.rows.map(function (row) {
|
|
5016
|
+
// ok → 绿框;absent / suppressed → 红框;其余(unknown,含宿主还没回传该字段)
|
|
5017
|
+
// 一律灰框,绝不把"读不到"画成"不能用"。
|
|
5018
|
+
const chip = function (label, state) {
|
|
5019
|
+
const kind = state === 'ok' ? 'ok' : (state === 'absent' || state === 'suppressed') ? 'bad' : 'unknown'
|
|
5020
|
+
return React.createElement('span', { className: 'dsm-reach-chip dsm-reach-' + kind, key: label }, label)
|
|
5021
|
+
}
|
|
5022
|
+
const tags = []
|
|
5023
|
+
if (row.suppressing) tags.push(React.createElement('span', { className: 'dsm-tag dsm-tag-off', key: 'suppressing' }, t('compat.reach.suppressing')))
|
|
5024
|
+
if (row.broken) tags.push(React.createElement('span', { className: 'dsm-tag dsm-tag-off', key: 'broken' }, t('compat.reach.broken')))
|
|
5025
|
+
else if (row.reason) tags.push(React.createElement('span', { className: 'dsm-tag', key: 'reason' }, t('compat.reach.whyUnknown')))
|
|
5026
|
+
return React.createElement('div', { className: 'dsm-compat-mod-row', key: row.presetId },
|
|
5027
|
+
React.createElement('span', { className: 'dsm-compat-name dsm-reach-name' },
|
|
5028
|
+
React.createElement('span', null, (PRESET_MODE_NAME_KEYS[row.presetId] ? t(PRESET_MODE_NAME_KEYS[row.presetId]) : (row.name || row.presetId)) + (row.isDefault ? ' · ' + t('compat.reach.default') : '')),
|
|
5029
|
+
tags.length ? React.createElement('span', { className: 'dsm-tags' }, tags) : null),
|
|
5030
|
+
// 芯片顺序与「注入」块的勾选顺序一致(用户裁定 2026-09-16;2026-09-23 起
|
|
5031
|
+
// 场景与记忆是两个域,各占一枚):场景 → 记忆 → MCP → 技能 → 子智能体 → 提示词。
|
|
5032
|
+
React.createElement('span', { className: 'dsm-compat-reach-marks' },
|
|
5033
|
+
chip(t('compat.reach.mark.scene'), row.scene),
|
|
5034
|
+
chip(t('compat.reach.mark.memory'), row.memory),
|
|
5035
|
+
chip(t('compat.reach.mark.mcp'), row.mcp),
|
|
5036
|
+
chip(t('compat.reach.mark.skill'), row.skillCatalog),
|
|
5037
|
+
chip(t('compat.reach.mark.subagent'), row.subagent),
|
|
5038
|
+
chip(t('compat.reach.mark.agentsMd'), row.agentsMd)))
|
|
5039
|
+
}))))
|
|
5040
|
+
|
|
5041
|
+
// 页脚用「标题 + 条目」清单,与导入弹窗的「文件要求」同款结构与样式(用户裁定
|
|
5042
|
+
// 2026-09-16 第二版:条目要短、不列路径与内部机制,使用者知道"有这回事"就够)。
|
|
5043
|
+
push(React.createElement('div', { className: 'dsm-upload-requirements' },
|
|
5044
|
+
React.createElement('div', { className: 'dsm-label' }, t('compat.reach.tools.title')),
|
|
5045
|
+
React.createElement('ul', null,
|
|
5046
|
+
[1, 2, 3].map(function (n) {
|
|
5047
|
+
return React.createElement('li', { key: n }, t('compat.reach.tools.' + n))
|
|
5048
|
+
}))))
|
|
5049
|
+
}
|
|
4840
5050
|
// 注入实况:紧挨「注入」设置块下方。数据来自 `injection-live`(宿主读最近活跃会话的
|
|
4841
5051
|
// 可见表面),是"回放"不是"重算"—— 界面显示已注入而模型实际没收到时(场景接管、
|
|
4842
5052
|
// 压制型预设、开关被关、压缩后还没补发),这里一眼可见。
|
|
@@ -4988,27 +5198,34 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
4988
5198
|
// 它自带的 summary 是中文,直接渲染会让英文界面露出中文)。
|
|
4989
5199
|
const findingsN = Array.isArray(data.findings) ? data.findings.length : 0
|
|
4990
5200
|
const degradedN = Array.isArray(data.degraded) ? data.degraded.length : 0
|
|
4991
|
-
//
|
|
4992
|
-
// 「全部可用」——
|
|
4993
|
-
// (2026-09-30 桌面版实测)。
|
|
5201
|
+
// 摘要四形态:能力降级 / 仅身份待处理 / 契约待复核 / 全部可用。后两种都不能说
|
|
5202
|
+
// 「全部可用」—— 横幅已转黄或转红,摘要却报一切正常,两句自相矛盾。
|
|
4994
5203
|
const summaryKey = degradedN > 0 ? 'compat.summary.degraded'
|
|
4995
|
-
: blockedCount > 0 ? 'compat.summary.identity'
|
|
5204
|
+
: blockedCount > 0 ? 'compat.summary.identity'
|
|
5205
|
+
: contractReviewCount > 0 ? 'compat.summary.review' : 'compat.summary.ok'
|
|
5206
|
+
const summaryCount = degradedN > 0 ? degradedN : blockedCount > 0 ? blockedCount : contractReviewCount
|
|
4996
5207
|
const summaryText = findingsN === 0
|
|
4997
5208
|
? (data.summary || '')
|
|
4998
5209
|
: t(summaryKey)
|
|
4999
5210
|
.replace('{version}', String((data.host && data.host.version) || '?'))
|
|
5000
5211
|
.replace('{ok}', String(findingsN - degradedN))
|
|
5001
5212
|
.replace('{total}', String(findingsN))
|
|
5002
|
-
.replace('{count}', String(
|
|
5003
|
-
push(React.createElement('div', { className: 'dsm-compat-bar' + (
|
|
5004
|
-
React.createElement('span', { className: 'dsm-compat-dot' + (
|
|
5005
|
-
React.createElement('strong', null,
|
|
5213
|
+
.replace('{count}', String(summaryCount))
|
|
5214
|
+
push(React.createElement('div', { className: 'dsm-compat-bar' + (attention !== 'ok' ? ' dsm-compat-bar-warn' : '') },
|
|
5215
|
+
React.createElement('span', { className: 'dsm-compat-dot' + (attention !== 'ok' ? ' dsm-compat-dot-warn' : '') }),
|
|
5216
|
+
React.createElement('strong', null, attention === 'blocked' ? t('compat.state.blocked')
|
|
5217
|
+
: attention === 'review' ? t('compat.state.review') : t('compat.state.ok')),
|
|
5006
5218
|
React.createElement('span', { className: 'dsm-compat-sum' }, summaryText)))
|
|
5007
5219
|
// 诊断包:排障时用户能一键复制一份"环境 + 状态",不必逐项截图。
|
|
5008
5220
|
// 放在结论条下面而不是页脚:有阻塞项时它就在眼前。
|
|
5221
|
+
// 同时给出检测时间:compat-status 有 5s 短 TTL,用户得知道眼前这份结论有多旧。
|
|
5009
5222
|
push(React.createElement('div', { className: 'dsm-feedback-row' },
|
|
5010
5223
|
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-quiet', onClick: copyDiagnostics },
|
|
5011
|
-
diagCopied ? t('compat.diag.copied') : t('compat.diag.copy'))
|
|
5224
|
+
diagCopied ? t('compat.diag.copied') : t('compat.diag.copy')),
|
|
5225
|
+
data.generatedAt
|
|
5226
|
+
? React.createElement('span', { className: 'dsm-help' },
|
|
5227
|
+
t('compat.generatedAt').replace('{time}', new Date(Number(data.generatedAt)).toLocaleString()))
|
|
5228
|
+
: null))
|
|
5012
5229
|
|
|
5013
5230
|
// 指标卡:宿主 / 本插件适配版本 / 可用能力(含插件自补的 optional 槽位)。
|
|
5014
5231
|
// 三张卡都只在**有事要说**时带注脚:
|
|
@@ -5113,7 +5330,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5113
5330
|
React.createElement('div', { className: 'dsm-compat-mod-list dsm-compat-cards' },
|
|
5114
5331
|
degraded.map(function (item) {
|
|
5115
5332
|
return React.createElement('div', { className: 'dsm-compat-mod-row', key: item.id },
|
|
5116
|
-
React.createElement('span', { className: 'dsm-compat-name' }, item.label),
|
|
5333
|
+
React.createElement('span', { className: 'dsm-compat-name' }, capLabel(item.id, item.label)),
|
|
5117
5334
|
React.createElement('span', { className: 'dsm-compat-pill dsm-compat-pill-warn' },
|
|
5118
5335
|
item.fallback === 'native-entry' ? t('compat.fallback.native')
|
|
5119
5336
|
: item.fallback === 'refuse-operation' ? t('compat.fallback.refuse')
|
|
@@ -5138,8 +5355,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5138
5355
|
React.createElement('div', { className: 'dsm-compat-mod-list dsm-compat-cards' },
|
|
5139
5356
|
optionalAbsent.map(function (item) {
|
|
5140
5357
|
return React.createElement('div', { className: 'dsm-compat-mod-row', key: item.id },
|
|
5141
|
-
React.createElement('span', { className: 'dsm-compat-name' }, item.label),
|
|
5142
|
-
React.createElement('span', { className: 'dsm-compat-pill' },
|
|
5358
|
+
React.createElement('span', { className: 'dsm-compat-name' }, capLabel(item.id, item.label)),
|
|
5359
|
+
React.createElement('span', { className: 'dsm-compat-pill' }, item.fallback === 'inform-only'
|
|
5360
|
+
? t('compat.fallback.informOnly')
|
|
5361
|
+
: t('compat.fallback.substituted')),
|
|
5143
5362
|
React.createElement('span', { className: 'dsm-compat-mod dsm-compat-mod-self' },
|
|
5144
5363
|
React.createElement('span', { className: 'dsm-compat-label' }, t('compat.reason')),
|
|
5145
5364
|
item.detail))
|
|
@@ -5178,10 +5397,54 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5178
5397
|
React.createElement('span', { className: 'dsm-compat-pill ' + cls }, text))
|
|
5179
5398
|
}))))
|
|
5180
5399
|
|
|
5400
|
+
// 逐包版本:回答「升级后哪个官方包先变了、还在不在适配范围」。
|
|
5401
|
+
// 与上面模块实体那一块分开的:那里比的是**物理文件是不是同一份**,
|
|
5402
|
+
// 这里比的是**版本号与 peer 范围** —— 路径相同也可能版本已经变了(宿主原地升级)。
|
|
5403
|
+
const hostPackages = (data && data.packages) || []
|
|
5404
|
+
if (hostPackages.length) {
|
|
5405
|
+
const driftedPackages = hostPackages.filter(function (item) { return item.versionDrift === true }).length
|
|
5406
|
+
push(section(t('compat.packages'), driftedPackages > 0
|
|
5407
|
+
? t('compat.packages.hint', { count: driftedPackages })
|
|
5408
|
+
: t('compat.packages.allOk'),
|
|
5409
|
+
React.createElement('div', { className: 'dsm-compat-mod-list dsm-compat-cards' },
|
|
5410
|
+
hostPackages.map(function (item) {
|
|
5411
|
+
const known = Boolean(item.hostVersion)
|
|
5412
|
+
const optionalUnknown = !known && item.optional === true
|
|
5413
|
+
const outOfRange = item.inPeerRange === false
|
|
5414
|
+
const drifted = item.versionDrift === true
|
|
5415
|
+
const cls = optionalUnknown ? ''
|
|
5416
|
+
: outOfRange ? 'dsm-compat-pill-bad'
|
|
5417
|
+
: drifted ? 'dsm-compat-pill-warn'
|
|
5418
|
+
: known ? 'dsm-compat-pill-ok' : ''
|
|
5419
|
+
const pill = optionalUnknown ? t('compat.packages.optional')
|
|
5420
|
+
: outOfRange ? t('compat.packages.out')
|
|
5421
|
+
: drifted ? t('compat.packages.changed')
|
|
5422
|
+
: known ? t('compat.packages.baseline') : t('compat.packages.unknown')
|
|
5423
|
+
const detail = optionalUnknown
|
|
5424
|
+
? t('compat.packages.optionalDetail')
|
|
5425
|
+
: item.observed === true
|
|
5426
|
+
? t('compat.packages.detailObserved', {
|
|
5427
|
+
host: item.hostVersion || '—',
|
|
5428
|
+
baseline: item.baselineVersion || '—',
|
|
5429
|
+
})
|
|
5430
|
+
: t('compat.packages.detail', {
|
|
5431
|
+
host: item.hostVersion || '—',
|
|
5432
|
+
plugin: item.pluginVersion || '—',
|
|
5433
|
+
baseline: item.baselineVersion || '—',
|
|
5434
|
+
range: item.peerRange || '—',
|
|
5435
|
+
}) + (item.sameModule === false ? ' · ' + t('compat.packages.separate') : '')
|
|
5436
|
+
return React.createElement('div', { className: 'dsm-compat-mod-row', key: item.name },
|
|
5437
|
+
React.createElement('span', { className: 'dsm-compat-name dsm-compat-mod' }, item.name),
|
|
5438
|
+
React.createElement('span', { className: 'dsm-compat-pill ' + cls }, pill),
|
|
5439
|
+
React.createElement('span', { className: 'dsm-compat-mod dsm-compat-mod-self' },
|
|
5440
|
+
React.createElement('span', { className: 'dsm-compat-label' }, t('compat.reason')), detail))
|
|
5441
|
+
}))))
|
|
5442
|
+
}
|
|
5443
|
+
|
|
5181
5444
|
// 裸模块解析(与上面那一块的分工:上面比的是**同一份物理模块**,这里看的是**包还在不在**)。
|
|
5182
5445
|
//
|
|
5183
5446
|
// 为什么分开:上面那 6 个包是插件的 peerDependency,「两份不同拷贝」那种故障只可能发生在
|
|
5184
|
-
// 它们身上;而下面这
|
|
5447
|
+
// 它们身上;而下面这 5 个包是插件按**裸模块名**在运行时 require 的官方包,宿主不要求插件
|
|
5185
5448
|
// 依赖它们。官方撤掉其中一个,对应功能静默降级,而身份比对那一栏根本看不见它们 —— 所以
|
|
5186
5449
|
// 必须在这里列一行。canary 缺失不是「包坏了」,是「该人工复核这条契约」,显示成提示而非红色。
|
|
5187
5450
|
const contractPackages = (data && data.contracts && data.contracts.packages) || []
|
|
@@ -5203,7 +5466,77 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5203
5466
|
}))))
|
|
5204
5467
|
}
|
|
5205
5468
|
|
|
5206
|
-
//
|
|
5469
|
+
// 宿主行为契约:插件没有 require 这些包,但把事件名 / 磁盘布局 / 配置键 / 补丁方言
|
|
5470
|
+
// 写死在自己代码里。官方改掉其中一个不抛错,对应功能只是悄悄失效 —— 所以单独一块
|
|
5471
|
+
// 列出「守着什么、缺了会怎样」,而不是混进能力降级里。
|
|
5472
|
+
const behaviorPackages = (data && data.behaviors && data.behaviors.packages) || []
|
|
5473
|
+
if (behaviorPackages.length) {
|
|
5474
|
+
push(section(t('compat.behaviors'), t('compat.behaviors.hint'),
|
|
5475
|
+
React.createElement('div', { className: 'dsm-compat-mod-list dsm-compat-cards' },
|
|
5476
|
+
behaviorPackages.map(function (item) {
|
|
5477
|
+
const missing = item.resolved === null
|
|
5478
|
+
const optionalAbsent = missing && item.optional === true
|
|
5479
|
+
const drifted = !missing && (item.missingMarkers || []).length > 0
|
|
5480
|
+
const cls = optionalAbsent ? ''
|
|
5481
|
+
: missing ? 'dsm-compat-pill-bad'
|
|
5482
|
+
: drifted ? 'dsm-compat-pill-warn' : 'dsm-compat-pill-ok'
|
|
5483
|
+
const pill = optionalAbsent ? t('compat.behaviors.optional')
|
|
5484
|
+
: missing ? t('compat.behaviors.absent')
|
|
5485
|
+
: drifted ? t('compat.behaviors.drift') : t('compat.behaviors.present')
|
|
5486
|
+
const notes = item.missingMarkerNotes || []
|
|
5487
|
+
const markers = notes.length
|
|
5488
|
+
? notes.map(function (note) { return String(note.needle || '') + '(' + String(note.why || '') + ')' }).join(';')
|
|
5489
|
+
: (item.missingMarkers || []).join('、')
|
|
5490
|
+
const detail = optionalAbsent
|
|
5491
|
+
? t('compat.behaviors.optionalWhy', { feature: item.feature || '', impact: item.impact || '' })
|
|
5492
|
+
: missing
|
|
5493
|
+
? t('compat.behaviors.absentWhy', { feature: item.feature || '', impact: item.impact || '' })
|
|
5494
|
+
: drifted
|
|
5495
|
+
? t('compat.behaviors.driftWhy', { feature: item.feature || '', markers: markers, impact: item.impact || '' })
|
|
5496
|
+
: t('compat.behaviors.presentWhy', { feature: item.feature || '' })
|
|
5497
|
+
return React.createElement('div', { className: 'dsm-compat-mod-row', key: item.package },
|
|
5498
|
+
React.createElement('span', { className: 'dsm-compat-name dsm-compat-mod' }, item.package),
|
|
5499
|
+
React.createElement('span', { className: 'dsm-compat-pill ' + cls }, pill),
|
|
5500
|
+
React.createElement('span', { className: 'dsm-compat-mod dsm-compat-mod-self' },
|
|
5501
|
+
React.createElement('span', { className: 'dsm-compat-label' }, t('compat.reason')), detail))
|
|
5502
|
+
}))))
|
|
5503
|
+
}
|
|
5504
|
+
|
|
5505
|
+
// 宿主客户端 UI 契约:模块加载器 / 插槽名 / 客户端服务都在宿主客户端 bundle 里;
|
|
5506
|
+
// 服务端看不见浏览器,只能核对字符串标记。缺失只说明「该人工复核」,不是已坏。
|
|
5507
|
+
const clientUiPackages = (data && data.clientUi && data.clientUi.packages) || []
|
|
5508
|
+
if (clientUiPackages.length) {
|
|
5509
|
+
push(section(t('compat.clientUi'), t('compat.clientUi.hint'),
|
|
5510
|
+
React.createElement('div', { className: 'dsm-compat-mod-list dsm-compat-cards' },
|
|
5511
|
+
clientUiPackages.map(function (item) {
|
|
5512
|
+
const missing = item.resolved === null
|
|
5513
|
+
const optionalAbsent = missing && item.optional === true
|
|
5514
|
+
const drifted = !missing && (item.missingMarkers || []).length > 0
|
|
5515
|
+
const cls = optionalAbsent ? ''
|
|
5516
|
+
: missing ? 'dsm-compat-pill-bad'
|
|
5517
|
+
: drifted ? 'dsm-compat-pill-warn' : 'dsm-compat-pill-ok'
|
|
5518
|
+
const pill = optionalAbsent ? t('compat.clientUi.optional')
|
|
5519
|
+
: missing ? t('compat.clientUi.absent')
|
|
5520
|
+
: drifted ? t('compat.clientUi.drift') : t('compat.clientUi.present')
|
|
5521
|
+
const notes = item.missingMarkerNotes || []
|
|
5522
|
+
const markers = notes.length
|
|
5523
|
+
? notes.map(function (note) { return String(note.needle || '') + '(' + String(note.why || '') + ')' }).join(';')
|
|
5524
|
+
: (item.missingMarkers || []).join('、')
|
|
5525
|
+
const detail = optionalAbsent
|
|
5526
|
+
? t('compat.clientUi.optionalWhy', { feature: item.feature || '', impact: item.impact || '' })
|
|
5527
|
+
: missing
|
|
5528
|
+
? t('compat.clientUi.absentWhy', { feature: item.feature || '', impact: item.impact || '' })
|
|
5529
|
+
: drifted
|
|
5530
|
+
? t('compat.clientUi.driftWhy', { feature: item.feature || '', markers: markers, impact: item.impact || '' })
|
|
5531
|
+
: t('compat.clientUi.presentWhy', { feature: item.feature || '' })
|
|
5532
|
+
return React.createElement('div', { className: 'dsm-compat-mod-row', key: item.package },
|
|
5533
|
+
React.createElement('span', { className: 'dsm-compat-name dsm-compat-mod' }, item.package),
|
|
5534
|
+
React.createElement('span', { className: 'dsm-compat-pill ' + cls }, pill),
|
|
5535
|
+
React.createElement('span', { className: 'dsm-compat-mod dsm-compat-mod-self' },
|
|
5536
|
+
React.createElement('span', { className: 'dsm-compat-label' }, t('compat.reason')), detail))
|
|
5537
|
+
}))))
|
|
5538
|
+
}
|
|
5539
|
+
|
|
5207
5540
|
// 归档宿主的说明排最前 —— 它解释的正是这一排「无法比较」的成因,而且必须讲明白
|
|
5208
5541
|
// **不要去跑 host-deps --fix**:那条命令会把插件的依赖指向 npx 缓存里另一个版本。
|
|
5209
5542
|
if (asarNote) {
|
|
@@ -5257,54 +5590,6 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5257
5590
|
}
|
|
5258
5591
|
}
|
|
5259
5592
|
|
|
5260
|
-
// 预设注入边界:五类内容(记忆 / 全局提示词 / 技能 / MCP / 子智能体)在**每个 Agent
|
|
5261
|
-
// 预设**下到不到得了模型。回答的是"面板标着已注入,模型真的看得到吗"——本插件的
|
|
5262
|
-
// 注入由它自己在每步发出(极简这类预设下默认不发,可用上面的「注入」块强制),
|
|
5263
|
-
// 而全局提示词与技能目录还要看官方那两条行挂没挂(极简都没挂)。单独一块:取不到时
|
|
5264
|
-
// 这一节不显示,不影响上面的结论。
|
|
5265
|
-
//
|
|
5266
|
-
// 排版口径(用户裁定 2026-09-15):每格一枚描边标签,**绿框=能用、红框=不能用、
|
|
5267
|
-
// 灰框=判断不了**;不再出现 ✓/✗ 符号,也不再有任何整行的解释文字 —— 预设损坏与
|
|
5268
|
-
// 解析失败缩成预设名旁边的小标签。MCP 与子智能体两列由宿主侧的 preset-reach 给出。
|
|
5269
|
-
if (presetReach && Array.isArray(presetReach.rows) && presetReach.rows.length) {
|
|
5270
|
-
push(section(t('compat.reach'), null,
|
|
5271
|
-
React.createElement('div', { className: 'dsm-compat-mod-list dsm-compat-cards' },
|
|
5272
|
-
presetReach.rows.map(function (row) {
|
|
5273
|
-
// ok → 绿框;absent / suppressed → 红框;其余(unknown,含宿主还没回传该字段)
|
|
5274
|
-
// 一律灰框,绝不把"读不到"画成"不能用"。
|
|
5275
|
-
const chip = function (label, state) {
|
|
5276
|
-
const kind = state === 'ok' ? 'ok' : (state === 'absent' || state === 'suppressed') ? 'bad' : 'unknown'
|
|
5277
|
-
return React.createElement('span', { className: 'dsm-reach-chip dsm-reach-' + kind, key: label }, label)
|
|
5278
|
-
}
|
|
5279
|
-
const tags = []
|
|
5280
|
-
if (row.suppressing) tags.push(React.createElement('span', { className: 'dsm-tag dsm-tag-off', key: 'suppressing' }, t('compat.reach.suppressing')))
|
|
5281
|
-
if (row.broken) tags.push(React.createElement('span', { className: 'dsm-tag dsm-tag-off', key: 'broken' }, t('compat.reach.broken')))
|
|
5282
|
-
else if (row.reason) tags.push(React.createElement('span', { className: 'dsm-tag', key: 'reason' }, t('compat.reach.whyUnknown')))
|
|
5283
|
-
return React.createElement('div', { className: 'dsm-compat-mod-row', key: row.presetId },
|
|
5284
|
-
React.createElement('span', { className: 'dsm-compat-name dsm-reach-name' },
|
|
5285
|
-
React.createElement('span', null, (PRESET_MODE_NAME_KEYS[row.presetId] ? t(PRESET_MODE_NAME_KEYS[row.presetId]) : (row.name || row.presetId)) + (row.isDefault ? ' · ' + t('compat.reach.default') : '')),
|
|
5286
|
-
tags.length ? React.createElement('span', { className: 'dsm-tags' }, tags) : null),
|
|
5287
|
-
// 芯片顺序与「注入」块的勾选顺序一致(用户裁定 2026-09-16;2026-09-23 起
|
|
5288
|
-
// 场景与记忆是两个域,各占一枚):场景 → 记忆 → MCP → 技能 → 子智能体 → 提示词。
|
|
5289
|
-
React.createElement('span', { className: 'dsm-compat-reach-marks' },
|
|
5290
|
-
chip(t('compat.reach.mark.scene'), row.scene),
|
|
5291
|
-
chip(t('compat.reach.mark.memory'), row.memory),
|
|
5292
|
-
chip(t('compat.reach.mark.mcp'), row.mcp),
|
|
5293
|
-
chip(t('compat.reach.mark.skill'), row.skillCatalog),
|
|
5294
|
-
chip(t('compat.reach.mark.subagent'), row.subagent),
|
|
5295
|
-
chip(t('compat.reach.mark.agentsMd'), row.agentsMd)))
|
|
5296
|
-
}))))
|
|
5297
|
-
|
|
5298
|
-
// 页脚用「标题 + 条目」清单,与导入弹窗的「文件要求」同款结构与样式(用户裁定
|
|
5299
|
-
// 2026-09-16 第二版:条目要短、不列路径与内部机制,使用者知道"有这回事"就够)。
|
|
5300
|
-
push(React.createElement('div', { className: 'dsm-upload-requirements' },
|
|
5301
|
-
React.createElement('div', { className: 'dsm-label' }, t('compat.reach.tools.title')),
|
|
5302
|
-
React.createElement('ul', null,
|
|
5303
|
-
[1, 2, 3].map(function (n) {
|
|
5304
|
-
return React.createElement('li', { key: n }, t('compat.reach.tools.' + n))
|
|
5305
|
-
}))))
|
|
5306
|
-
}
|
|
5307
|
-
|
|
5308
5593
|
// ── 最近改动(0.15.0 B2)─────────────────────────────────────────────────
|
|
5309
5594
|
// 倒序列表 + 按域过滤 + 「同秒同来源」合并。落盘不去重(保真),合并只发生在展示层:
|
|
5310
5595
|
// 进一次场景会连写几条,逐条铺开会把「一次动作」读成「很多次改动」。
|
|
@@ -5821,6 +6106,14 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5821
6106
|
title: t('compat.title'),
|
|
5822
6107
|
desc: t('compat.desc'),
|
|
5823
6108
|
actions: [
|
|
6109
|
+
React.createElement('button', {
|
|
6110
|
+
key: 'refresh',
|
|
6111
|
+
type: 'button',
|
|
6112
|
+
className: 'dsm-btn dsm-btn-quiet',
|
|
6113
|
+
disabled: busy,
|
|
6114
|
+
title: t('compat.refresh.title'),
|
|
6115
|
+
onClick: refreshAll,
|
|
6116
|
+
}, t('compat.refresh')),
|
|
5824
6117
|
compatDialogButton('audit', t('compat.audit')),
|
|
5825
6118
|
compatDialogButton('snapshot', t('snapshot.title')),
|
|
5826
6119
|
compatDialogButton('live', t('compat.live.title')),
|
|
@@ -6032,7 +6325,9 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6032
6325
|
"mcp.note.prefix": "备注:", "mcp.toggleServer": "启停服务", "mcp.toggleTool": "启停工具", "mcp.session.startGlobal": "全局关着:打开后仅为这个对话临时运行,全局设置不变。",
|
|
6033
6326
|
"mcp.intent.blockedHint": "全局已全部关闭这台服务器:会话层也不能打开它。先在全局重新打开。",
|
|
6034
6327
|
"mcp.intent.lease": "临时运行 · {count} 个对话", "mcp.intent.leaseHint": "全局是关的;{count} 个对话在用它,连接保持运行。",
|
|
6328
|
+
"mcp.intent.leaseWs": "临时运行 · {count} 个工作区", "mcp.intent.leaseHintWs": "全局是关的;{count} 个工作区在用它,连接保持运行。",
|
|
6035
6329
|
"mcp.intent.keptRunning": "已全局关闭;还有 {count} 个对话在用,连接保持运行(要立即关闭用「全部关闭」)。",
|
|
6330
|
+
"mcp.intent.keptRunningWs": "已全局关闭;还有 {count} 个工作区在用,连接保持运行(要立即关闭用「全部关闭」)。",
|
|
6036
6331
|
"mcp.intent.onOk": "已全局启用「{name}」。", "mcp.intent.offOk": "已全局关闭「{name}」。", "mcp.intent.stopped": "已全部关闭「{name}」:正在使用它的对话 / 工作区也已关闭。",
|
|
6037
6332
|
"mcp.intent.stop": "全部关闭",
|
|
6038
6333
|
"mcp.intent.stopTitle": "全部关闭?",
|
|
@@ -6107,6 +6402,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6107
6402
|
"memory.title": "记忆",
|
|
6108
6403
|
"tabs.scenes": "场景", "tabs.skills": "技能", "tabs.subagents": "子智能体", "tabs.prompts": "提示词", "tabs.memory": "记忆", "tabs.sessions": "会话", "tabs.compat": "兼容",
|
|
6109
6404
|
"compat.title": "宿主兼容", "compat.desc": "本插件与 DSH 的对接体检(只读)。",
|
|
6405
|
+
"compat.refresh": "重新检测", "compat.refresh.title": "重新探测宿主能力、版本与契约(忽略 5 秒缓存)",
|
|
6110
6406
|
"compat.backups.btn": "清理旧备份", "compat.backups.btnCount": "清理旧备份 · {count} 份", "compat.backups.btnHint": "删掉多余的配置备份副本(它们含明文密钥)", "compat.backups.btnTitle": "现有 {count} 份配置备份(共 {size},含明文密钥)", "compat.backups.title": "清理旧备份",
|
|
6111
6407
|
// 侧栏入口的开关(按钮文字说"点下去会发生什么":开着 → 「关闭侧栏」)。
|
|
6112
6408
|
"compat.sidebar.hide": "关闭侧栏", "compat.sidebar.show": "开启侧栏", "compat.sidebar.hideHint": "把本插件的入口从侧栏撤掉(「设置 → 工具管理」照旧可用)", "compat.sidebar.showHint": "在侧栏里挂出本插件的入口,点一下就在这里打开同一套页面", "compat.sidebar.failed": "侧栏开关没保存成功",
|
|
@@ -6152,11 +6448,12 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6152
6448
|
"compat.backups.confirm": "删除", "compat.backups.confirm.ask": "确认永久删除 {count} 个文件?不可恢复。", "compat.backups.confirm.yes": "确认永久删除",
|
|
6153
6449
|
"compat.backups.done": "已删除 {removed} 份,保留 {kept} 份。", "compat.backups.warnFailed": "{count} 份没能删除(可能被占用):{names}",
|
|
6154
6450
|
"compat.backups.loading": "正在读取备份清单…", "compat.backups.loadFailed": "读取备份清单失败", "compat.backups.cleanFailed": "清理失败",
|
|
6155
|
-
"compat.state.ok": "一切正常", "compat.state.blocked": "有需要处理的问题",
|
|
6451
|
+
"compat.state.ok": "一切正常", "compat.state.blocked": "有需要处理的问题", "compat.state.review": "有契约待复核",
|
|
6156
6452
|
"compat.checking": "检查中…", "compat.empty": "尚未检查", "compat.failed": "检查失败",
|
|
6157
6453
|
"compat.save.failed": "保存失败",
|
|
6158
6454
|
"compat.summary.ok": "宿主 {version} · 能力 {ok}/{total} · 全部可用", "compat.summary.degraded": "宿主 {version} · 能力 {ok}/{total} · 降级 {count} 项",
|
|
6159
6455
|
"compat.summary.identity": "宿主 {version} · 能力 {ok}/{total} · 身份 {count} 项待处理",
|
|
6456
|
+
"compat.summary.review": "宿主 {version} · 能力 {ok}/{total} · 契约 {count} 项待复核",
|
|
6160
6457
|
"compat.update.available": "插件有兼容更新:{current} → {best}", "compat.update.current": "插件已是最新兼容版本({current})",
|
|
6161
6458
|
"compat.update.localAhead": "本地版本 {current} 比 registry 上兼容的最高版 {best} 更新", "compat.update.none": "registry 上没有与宿主 {host} 兼容的版本",
|
|
6162
6459
|
"compat.update.incompatible": "当前插件版本 {current} 与本宿主 {host} 不兼容", "compat.update.hostUnknown": "取不到宿主版本,已跳过更新检查",
|
|
@@ -6176,7 +6473,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6176
6473
|
"update.install.copy": "复制命令", "update.install.copied": "已复制升级命令",
|
|
6177
6474
|
"update.install.copyFailed": "复制失败,请手动选中命令复制",
|
|
6178
6475
|
"update.install.noCommand": "这次检查没有给出可执行的命令,请重新点一次检查更新。",
|
|
6179
|
-
"compat.diag.copy": "复制诊断信息", "compat.diag.copied": "已复制诊断信息",
|
|
6476
|
+
"compat.diag.copy": "复制诊断信息", "compat.diag.copied": "已复制诊断信息", "compat.generatedAt": "检测时间:{time}",
|
|
6180
6477
|
"compat.host": "宿主版本", "compat.verified": "插件适配版本",
|
|
6181
6478
|
"compat.caps": "可用能力", "compat.caps.degraded": "{count} 项不可用",
|
|
6182
6479
|
"compat.caps.substituted": "缺口由插件自补",
|
|
@@ -6189,7 +6486,11 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6189
6486
|
"compat.others": "其它能力项",
|
|
6190
6487
|
"compat.contracts": "宿主契约", "compat.contracts.missing": "不在位", "compat.contracts.allOk": "本版依赖的宿主契约全部在位。",
|
|
6191
6488
|
"compat.bareModules": "裸模块解析", "compat.bareModules.present": "在位", "compat.bareModules.absent": "宿主未提供", "compat.bareModules.drift": "契约疑似漂移", "compat.bareModules.presentWhy": "影响:{feature}", "compat.bareModules.absentWhy": "宿主已不提供这个包:{feature}会降级", "compat.bareModules.driftWhy": "{feature}的契约标识有缺失({markers})—— 请人工核对该包的实现是否改过",
|
|
6489
|
+
"compat.packages": "宿主包版本(逐包)", "compat.packages.allOk": "全部官方包的版本与本插件适配基准一致。", "compat.packages.hint": "有 {count} 个官方包的版本与适配基准不同;超出 peer 范围的已在阻塞项中标出。", "compat.packages.baseline": "与基准一致", "compat.packages.changed": "版本与基准不同", "compat.packages.out": "超出适配范围", "compat.packages.unknown": "无法解析", "compat.packages.optional": "可选包未提供", "compat.packages.optionalDetail": "可选 peer:本机未安装,缺失按正常处理。", "compat.packages.detail": "宿主 {host} · 插件 {plugin} · 基准 {baseline} · peer {range}", "compat.packages.detailObserved": "宿主 {host} · 基准 {baseline} · 仅观测(非 peer)", "compat.packages.separate": "且插件加载的是另一份拷贝",
|
|
6490
|
+
"compat.behaviors": "宿主行为契约", "compat.behaviors.hint": "插件把这些宿主字符串契约写死在自己代码里;canary 缺失只说明「该人工复核」,不等于功能已经坏了。", "compat.behaviors.present": "契约标识在位", "compat.behaviors.drift": "契约疑似漂移", "compat.behaviors.absent": "宿主未提供", "compat.behaviors.optional": "本宿主未使用", "compat.behaviors.presentWhy": "影响:{feature}", "compat.behaviors.absentWhy": "宿主已不提供这个包:{feature}会失效({impact})", "compat.behaviors.optionalWhy": "该后端在本宿主未启用(正常形态);依赖它的功能:{feature}({impact})", "compat.behaviors.driftWhy": "{feature}的契约标识有缺失:{markers}。影响:{impact}。请人工核对该包的实现是否改过",
|
|
6491
|
+
"compat.clientUi": "客户端界面契约", "compat.clientUi.hint": "插件前端分片依赖宿主的模块加载器、插槽名与客户端服务;这里扫描的是宿主客户端 bundle 的字符串标记。", "compat.clientUi.present": "标记在位", "compat.clientUi.drift": "界面契约疑似漂移", "compat.clientUi.absent": "宿主未装配", "compat.clientUi.optional": "无客户端界面", "compat.clientUi.presentWhy": "影响:{feature}", "compat.clientUi.absentWhy": "宿主客户端里找不到这个包:{feature}不会加载({impact})", "compat.clientUi.optionalWhy": "该宿主没有客户端界面(正常形态);依赖它的功能:{feature}({impact})", "compat.clientUi.driftWhy": "{feature}的界面标记有缺失:{markers}。影响:{impact}。请人工核对宿主客户端是否改过名称",
|
|
6192
6492
|
"compat.fallback.substituted": "插件适配层(宿主无此入口)",
|
|
6493
|
+
"compat.fallback.informOnly": "仅提示(不影响使用)",
|
|
6193
6494
|
"compat.fallback.native": "改走原生入口", "compat.fallback.refuse": "该操作会被拒绝", "compat.fallback.blocked": "相关按钮已禁用", "compat.fallback.inform": "不影响写入",
|
|
6194
6495
|
"compat.modules": "模块实体(插件 vs 宿主)", "compat.module.same": "同一份模块", "compat.module.separate": "两份拷贝(需修复)", "compat.module.sameVersion": "同版本(分处归档内外)", "compat.module.unknown": "无法比较", "compat.module.realpath": "无法比较(路径取不到真实形态)", "compat.modules.realpath": "有 {count} 个包**比不了**:它们的路径取不到真实形态({names})—— 这不是「两份拷贝」,而是这项校验没做成。", "compat.modules.realpathSides": "宿主侧:{host};插件侧:{plugin}。修好路径(权限 / 路径长度 / 重新安装)后重新打开本页即重算。", "compat.modules.realpathNone": "无", "compat.modules.unverified": "有 {count} 个包没能比对(宿主的解析锚点里找不到:{names})—— 这不是「两份拷贝」,而是这项校验没做成。可运行 node scripts/doctor.mjs 查看。",
|
|
6195
6496
|
"compat.modules.asarHost": "宿主是桌面版:官方包装在 {name} 里,插件在归档外,两边不可能是同一份文件。下面 {count} 个包按版本核对:{version},一致。",
|
|
@@ -6223,6 +6524,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6223
6524
|
"compat.ov.toolTable.factory": "出厂默认关掉 {hidden}/{total} 个", "compat.ov.toolTable.mixed": "关掉 {hidden}/{total} 个(含出厂默认 {defaults} 个)",
|
|
6224
6525
|
"compat.ov.nativeDelete": "宿主原生删除入口", "compat.ov.nativeDelete.ok": "宿主未提供原生删除入口(本插件自有完整序列)",
|
|
6225
6526
|
"compat.ov.hostIdentity": "宿主身份与模块", "compat.ov.hostIdentity.ok": "模块与宿主同源(宿主 DSH {version})", "compat.ov.hostIdentity.asar": "官方包与宿主同版本(DSH {version}),但宿主跑在 {name} 里、插件在归档外", "compat.ov.hostIdentity.degraded": "存在阻塞项:{list}",
|
|
6527
|
+
"compat.ov.hostContracts": "宿主契约(事件 / 配置键 / 布局 / 界面)",
|
|
6528
|
+
"compat.ov.hostContracts.ok": "canary 齐全:事件名、配置键、磁盘布局与客户端界面标记仍与适配基准一致",
|
|
6529
|
+
"compat.ov.hostContracts.degraded": "需复核 {count} 个包:{list}",
|
|
6530
|
+
"compat.ov.hostContracts.item": "{package}({feature})",
|
|
6226
6531
|
"compat.ov.memory": "记忆", "compat.ov.prompts": "提示词", "compat.ov.subagents": "子智能体", "compat.ov.scenes": "场景档案",
|
|
6227
6532
|
"compat.ov.subagentPersona": "子智能体人设委派", "compat.ov.subagentToolRestrict": "子代理工具限制", "compat.ov.subagentCreatedEvent": "子代理创建时序", "compat.ov.webAdmission": "Web 连接准入",
|
|
6228
6533
|
"compat.ov.plain.ok": "无降级上报(装配失败会出现在这里)",
|
|
@@ -6317,8 +6622,11 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6317
6622
|
"compat.cap.workspaceReadHeader": "读取会话头部", "compat.cap.workspaceEnqueue": "串行写事务", "compat.cap.workspaceSetState": "写工作区状态",
|
|
6318
6623
|
"compat.cap.workspaceIndexHeader": "索引会话头部", "compat.cap.workspaceArchiveNative": "宿主原生归档入口", "compat.cap.workspaceUnarchiveNative": "宿主原生恢复入口",
|
|
6319
6624
|
"compat.cap.workspaceBatchNative": "宿主原生批量入口", "compat.cap.workspaceDeleteNative": "宿主原生删除入口", "compat.cap.sessionsDetachLive": "实时会话落盘与分离",
|
|
6320
|
-
"compat.cap.sessionsColdAnnounce": "冷会话移除广播", "compat.cap.
|
|
6321
|
-
"compat.cap.
|
|
6625
|
+
"compat.cap.sessionsColdAnnounce": "冷会话移除广播", "compat.cap.sessionsLiveAccess": "实时会话读取(get / list)",
|
|
6626
|
+
"compat.cap.persistenceList": "会话存储枚举", "compat.cap.persistenceTranscriptLocate": "会话转写工件定位", "compat.cap.persistenceTranscriptRead": "会话转写读取(投影修复)",
|
|
6627
|
+
"compat.cap.projectionWrite": "投影缓存写入路径", "compat.cap.projectionTableDelete": "投影缓存行删除",
|
|
6628
|
+
"compat.cap.agentPresetRegister": "临时子预设注册", "compat.cap.toolsRestrictMethod": "工具限制施加(restrict)", "compat.cap.toolsSchemaList": "工具清单读取(schemas)", "compat.cap.toolsGetMethod": "按名读取工具定义(get)", "compat.cap.toolsGuardDispatch": "工具执行守卫分发(guard / checkGuards)", "compat.cap.toolsMcpResourceArgs": "MCP 共享资源工具参数(server / uri)", "compat.cap.systemPromptMcpSection": "系统提示词 MCP 段(MCP_SERVERS)", "compat.cap.mcpClientConfigSchema": "MCP 客户端配置 schema", "compat.cap.skillsRegisterProvider": "技能 provider 注册(registerProvider)", "compat.cap.agentsList": "活动 agent 清单(agents.list)", "compat.cap.pluginInventoryList": "Loader 插件条目清单(pluginInventory.list)", "compat.cap.webServerRegister": "HTTP 路由注册(webServer.register)", "compat.cap.sandboxPolicyResolve": "沙箱策略解析(sandboxPolicy.resolve)", "compat.cap.projectionCachedTitle": "投影缓存标题读取(cachedSnapshot)", "compat.cap.officialSkillAssets": "官方 office 技能资产", "compat.cap.officialSandboxAsset": "官方沙盒诊断技能资产", "compat.cap.agentCreatedEvent": "子代理创建事件(agent/created)", "compat.cap.connectionAdmit": "连接准入(admit)",
|
|
6629
|
+
"compat.cap.subagentsRuntime": "子智能体运行时(startActivation)", "compat.cap.llmModelCatalog": "模型目录(场景模型候选)", "compat.cap.approvalEffectivePolicy": "审批策略读取(完全权限判定)",
|
|
6322
6630
|
"compat.cap.opArchive": "归档", "compat.cap.opUnarchive": "恢复", "compat.cap.opBatch": "批量操作", "compat.cap.opDelete": "删除", "compat.cap.opList": "历史列表",
|
|
6323
6631
|
"compat.reach": "预设注入边界",
|
|
6324
6632
|
"compat.reach.suppressing": "压制型",
|
|
@@ -6783,6 +7091,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6783
7091
|
"scope.view.leaseWs": "{count} 个工作区单独设置",
|
|
6784
7092
|
|
|
6785
7093
|
"scope.intent.keptRunning": "全局已关闭;还有 {count} 个对话在用,来源保持启用(只有这些对话看得到)。",
|
|
7094
|
+
"scope.intent.keptRunningWs": "全局已关闭;还有 {count} 个工作区在用,来源保持启用(只有这些工作区看得到)。",
|
|
6786
7095
|
"scope.intent.onOk": "已全局启用「{name}」。", "scope.intent.offOk": "已全局关闭「{name}」。",
|
|
6787
7096
|
"scope.intent.resume": "恢复启用",
|
|
6788
7097
|
"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}」。",
|
|
@@ -6793,6 +7102,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6793
7102
|
"scope.lease.released": "已让「{title}」不再临时运行",
|
|
6794
7103
|
"scope.lease.releasedWs": "已让工作区「{title}」不再临时运行",
|
|
6795
7104
|
"scope.lease.releaseFailed": "没能让「{title}」停止临时运行:{error}",
|
|
7105
|
+
"scope.lease.releasePartial": "「{title}」只停了一部分({done}/{total} 项),剩下的没能关掉,请重试",
|
|
6796
7106
|
"scope.lease.unknownError": "原因未说明",
|
|
6797
7107
|
},
|
|
6798
7108
|
en: {
|
|
@@ -6958,7 +7268,9 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6958
7268
|
"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.",
|
|
6959
7269
|
"mcp.intent.blockedHint": "Stopped machine-wide: even this conversation cannot switch it on. Turn it back on from the global layer first.",
|
|
6960
7270
|
"mcp.intent.lease": "temporary · {count} conversation(s)", "mcp.intent.leaseHint": "Off globally; {count} conversation(s) still use it, so the connection keeps running.",
|
|
7271
|
+
"mcp.intent.leaseWs": "temporary · {count} workspace(s)", "mcp.intent.leaseHintWs": "Off globally; {count} workspace(s) still use it, so the connection keeps running.",
|
|
6961
7272
|
"mcp.intent.keptRunning": "Disabled globally; {count} conversation(s) still use it, so the connection keeps running (use “Close everywhere” to close them now).",
|
|
7273
|
+
"mcp.intent.keptRunningWs": "Disabled globally; {count} workspace(s) still use it, so the connection keeps running (use “Close everywhere” to close them now).",
|
|
6962
7274
|
"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.",
|
|
6963
7275
|
"mcp.intent.stop": "Close everywhere",
|
|
6964
7276
|
"mcp.intent.stopTitle": "Close everywhere?",
|
|
@@ -7033,6 +7345,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7033
7345
|
"memory.title": "Memories",
|
|
7034
7346
|
"tabs.scenes": "Scenes", "tabs.skills": "Skills", "tabs.subagents": "Subagents", "tabs.prompts": "Prompts", "tabs.memory": "Memories", "tabs.sessions": "Sessions", "tabs.compat": "Host",
|
|
7035
7347
|
"compat.title": "Host compatibility", "compat.desc": "How this plugin attaches to DSH (read-only).",
|
|
7348
|
+
"compat.refresh": "Re-check", "compat.refresh.title": "Re-probe host capabilities, versions and contracts (bypasses the 5-second cache)",
|
|
7036
7349
|
"compat.backups.btn": "Clean old backups", "compat.backups.btnCount": "Clean old backups · {count}", "compat.backups.btnHint": "Delete surplus config backup copies (they hold secrets in cleartext)", "compat.backups.btnTitle": "{count} config backups exist ({size}, secrets in cleartext)", "compat.backups.title": "Clean old backups",
|
|
7037
7350
|
"compat.sidebar.hide": "Hide from sidebar", "compat.sidebar.show": "Show in sidebar", "compat.sidebar.hideHint": "Remove this plugin's row from the sidebar (Settings → Tools Management still works)", "compat.sidebar.showHint": "Add this plugin's row to the sidebar; it opens the same pages right here", "compat.sidebar.failed": "Could not save the sidebar toggle",
|
|
7038
7351
|
"compat.backups.desc": "Every backup is a full copy of the config — MCP secrets and the access token included, in cleartext.",
|
|
@@ -7077,11 +7390,12 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7077
7390
|
"compat.backups.confirm": "Delete", "compat.backups.confirm.ask": "Permanently delete {count} files? This cannot be undone.", "compat.backups.confirm.yes": "Delete permanently",
|
|
7078
7391
|
"compat.backups.done": "Deleted {removed}; {kept} kept.", "compat.backups.warnFailed": "{count} could not be deleted (in use?): {names}",
|
|
7079
7392
|
"compat.backups.loading": "Reading the backup list…", "compat.backups.loadFailed": "Could not read the backup list", "compat.backups.cleanFailed": "Cleanup failed",
|
|
7080
|
-
"compat.state.ok": "All good", "compat.state.blocked": "Needs attention",
|
|
7393
|
+
"compat.state.ok": "All good", "compat.state.blocked": "Needs attention", "compat.state.review": "Contracts need review",
|
|
7081
7394
|
"compat.checking": "Checking…", "compat.empty": "Not checked yet", "compat.failed": "Check failed",
|
|
7082
7395
|
"compat.save.failed": "Save failed",
|
|
7083
7396
|
"compat.summary.ok": "host {version} · capabilities {ok}/{total} · all usable", "compat.summary.degraded": "host {version} · capabilities {ok}/{total} · {count} degraded",
|
|
7084
7397
|
"compat.summary.identity": "host {version} · capabilities {ok}/{total} · {count} identity issue(s) to resolve",
|
|
7398
|
+
"compat.summary.review": "host {version} · capabilities {ok}/{total} · {count} contract(s) to review",
|
|
7085
7399
|
"compat.update.available": "Compatible update available: {current} → {best}", "compat.update.current": "Already on the newest compatible version ({current})",
|
|
7086
7400
|
"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}",
|
|
7087
7401
|
"compat.update.incompatible": "Plugin {current} is not compatible with this host ({host})", "compat.update.hostUnknown": "Host version unavailable — update check skipped",
|
|
@@ -7095,7 +7409,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7095
7409
|
"update.install.copy": "Copy command", "update.install.copied": "Upgrade command copied",
|
|
7096
7410
|
"update.install.copyFailed": "Copy failed; select the command and copy it manually",
|
|
7097
7411
|
"update.install.noCommand": "This check produced no runnable command; check for updates again.",
|
|
7098
|
-
"compat.diag.copy": "Copy diagnostics", "compat.diag.copied": "Diagnostics copied",
|
|
7412
|
+
"compat.diag.copy": "Copy diagnostics", "compat.diag.copied": "Diagnostics copied", "compat.generatedAt": "Last checked: {time}",
|
|
7099
7413
|
"compat.host": "Host version", "compat.verified": "Verified against",
|
|
7100
7414
|
"compat.caps": "Usable capabilities", "compat.caps.degraded": "{count} unavailable",
|
|
7101
7415
|
"compat.caps.substituted": "gaps covered by the plugin",
|
|
@@ -7108,7 +7422,11 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7108
7422
|
"compat.others": "Other capability slots",
|
|
7109
7423
|
"compat.contracts": "Host contracts", "compat.contracts.missing": "absent", "compat.contracts.allOk": "Every host contract this release depends on is present.",
|
|
7110
7424
|
"compat.bareModules": "Bare module resolution", "compat.bareModules.present": "present", "compat.bareModules.absent": "not shipped by host", "compat.bareModules.drift": "contract drift suspected", "compat.bareModules.presentWhy": "affects: {feature}", "compat.bareModules.absentWhy": "the host no longer ships this package: {feature} degrades", "compat.bareModules.driftWhy": "{feature} is missing contract markers ({markers}) — please re-check that package's implementation manually",
|
|
7425
|
+
"compat.packages": "Host package versions", "compat.packages.allOk": "Every official package matches the version this plugin was verified against.", "compat.packages.hint": "{count} official package(s) differ from the verified baseline; out-of-range ones are listed as blockers.", "compat.packages.baseline": "matches baseline", "compat.packages.changed": "version differs", "compat.packages.out": "out of range", "compat.packages.unknown": "not resolvable", "compat.packages.optional": "optional package absent", "compat.packages.optionalDetail": "Optional peer: not installed here; its absence is expected.", "compat.packages.detail": "host {host} · plugin {plugin} · baseline {baseline} · peer {range}", "compat.packages.detailObserved": "host {host} · baseline {baseline} · observed only (not a peer)", "compat.packages.separate": "and the plugin loads a separate copy",
|
|
7426
|
+
"compat.behaviors": "Host behavior contracts", "compat.behaviors.hint": "The plugin hard-codes these host strings (event names, disk layout, config keys, patch dialect). A missing canary means \"review manually\", not \"already broken\".", "compat.behaviors.present": "markers present", "compat.behaviors.drift": "contract drift suspected", "compat.behaviors.absent": "not shipped by host", "compat.behaviors.optional": "not used by this host", "compat.behaviors.presentWhy": "affects: {feature}", "compat.behaviors.absentWhy": "the host no longer ships this package: {feature} stops working ({impact})", "compat.behaviors.optionalWhy": "this backend is not in use here (normal); feature: {feature} ({impact})", "compat.behaviors.driftWhy": "{feature} is missing contract markers: {markers}. Impact: {impact}. Please re-check that package's implementation manually",
|
|
7427
|
+
"compat.clientUi": "Host client UI contracts", "compat.clientUi.hint": "The plugin's client fragments rely on the host's module loader, slot names and client services; this scans string markers in the host client bundles.", "compat.clientUi.present": "markers present", "compat.clientUi.drift": "UI contract drift suspected", "compat.clientUi.absent": "not assembled", "compat.clientUi.optional": "no client UI", "compat.clientUi.presentWhy": "affects: {feature}", "compat.clientUi.absentWhy": "the host client does not contain this package: {feature} will not load ({impact})", "compat.clientUi.optionalWhy": "this host has no client UI (normal); feature: {feature} ({impact})", "compat.clientUi.driftWhy": "{feature} is missing UI markers: {markers}. Impact: {impact}. Please re-check the host client names manually",
|
|
7111
7428
|
"compat.fallback.substituted": "Plugin adapter (no host entry)",
|
|
7429
|
+
"compat.fallback.informOnly": "Informational only (no functional impact)",
|
|
7112
7430
|
"compat.fallback.native": "Falls back to native entry", "compat.fallback.refuse": "Operation refused", "compat.fallback.blocked": "Affected buttons disabled", "compat.fallback.inform": "Writes unaffected",
|
|
7113
7431
|
"compat.modules": "Module identity (plugin vs host)", "compat.module.same": "same module", "compat.module.separate": "separate copy (repair needed)", "compat.module.sameVersion": "same version (inside/outside the archive)", "compat.module.unknown": "not comparable", "compat.module.realpath": "not comparable (real path unavailable)", "compat.modules.realpath": "{count} package(s) could **not be compared**: their real path could not be read ({names}) — that is not \"a separate copy\", it means the check could not run.", "compat.modules.realpathSides": "Host side: {host}; plugin side: {plugin}. Fix the path (permissions / path length / reinstall) and reopen this page to re-check.", "compat.modules.realpathNone": "none", "compat.modules.unverified": "{count} package(s) could not be compared (not resolvable from the host anchor: {names}) — that is not \"a separate copy\", it means the check could not run. Try node scripts/doctor.mjs.",
|
|
7114
7432
|
"compat.modules.asarHost": "The host is the desktop app: the official packages live inside {name} while the plugin sits outside the archive, so the two can never be the same file. The {count} package(s) below were checked by version: {version} on both sides.",
|
|
@@ -7142,6 +7460,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7142
7460
|
"compat.ov.toolTable.factory": "Factory defaults turn off {hidden}/{total}", "compat.ov.toolTable.mixed": "{hidden}/{total} are off (including {defaults} factory defaults)",
|
|
7143
7461
|
"compat.ov.nativeDelete": "Host native delete entry", "compat.ov.nativeDelete.ok": "The host offers no native delete entry (this plugin ships its own full sequence)",
|
|
7144
7462
|
"compat.ov.hostIdentity": "Host identity & modules", "compat.ov.hostIdentity.ok": "Modules are shared with the host (host DSH {version})", "compat.ov.hostIdentity.asar": "Official packages match the host version (DSH {version}), but the host runs inside {name} while the plugin sits outside it", "compat.ov.hostIdentity.degraded": "Blockers present: {list}",
|
|
7463
|
+
"compat.ov.hostContracts": "Host contracts (events / config keys / layout / UI)",
|
|
7464
|
+
"compat.ov.hostContracts.ok": "All canaries present: event names, config keys, on-disk layout and client UI markers still match the verified baseline",
|
|
7465
|
+
"compat.ov.hostContracts.degraded": "{count} package(s) need review: {list}",
|
|
7466
|
+
"compat.ov.hostContracts.item": "{package} ({feature})",
|
|
7145
7467
|
"compat.ov.memory": "Memory", "compat.ov.prompts": "Prompts", "compat.ov.subagents": "Subagents", "compat.ov.scenes": "Scene profiles",
|
|
7146
7468
|
"compat.ov.subagentPersona": "Subagent persona delegation", "compat.ov.subagentToolRestrict": "Subagent tool restriction", "compat.ov.subagentCreatedEvent": "Subagent creation ordering", "compat.ov.webAdmission": "Web connection admission",
|
|
7147
7469
|
"compat.ov.plain.ok": "No degradation reported (assembly failures would appear here)",
|
|
@@ -7235,8 +7557,11 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7235
7557
|
"compat.cap.workspaceReadHeader": "Read session header", "compat.cap.workspaceEnqueue": "Serialized write transaction", "compat.cap.workspaceSetState": "Write workspace state",
|
|
7236
7558
|
"compat.cap.workspaceIndexHeader": "Index session headers", "compat.cap.workspaceArchiveNative": "Host native archive entry", "compat.cap.workspaceUnarchiveNative": "Host native restore entry",
|
|
7237
7559
|
"compat.cap.workspaceBatchNative": "Host native batch entry", "compat.cap.workspaceDeleteNative": "Host native delete entry", "compat.cap.sessionsDetachLive": "Persist & detach live sessions",
|
|
7238
|
-
"compat.cap.sessionsColdAnnounce": "Cold session removal broadcast", "compat.cap.
|
|
7239
|
-
"compat.cap.
|
|
7560
|
+
"compat.cap.sessionsColdAnnounce": "Cold session removal broadcast", "compat.cap.sessionsLiveAccess": "Live session reads (get / list)",
|
|
7561
|
+
"compat.cap.persistenceList": "Session storage listing", "compat.cap.persistenceTranscriptLocate": "Transcript artifact lookup", "compat.cap.persistenceTranscriptRead": "Transcript reads (projection repair)",
|
|
7562
|
+
"compat.cap.projectionWrite": "Projection cache write path", "compat.cap.projectionTableDelete": "Projection cache row deletion",
|
|
7563
|
+
"compat.cap.agentPresetRegister": "Temporary child-preset registration", "compat.cap.toolsRestrictMethod": "Tool restriction (restrict)", "compat.cap.toolsSchemaList": "Tool schema listing (schemas)", "compat.cap.toolsGetMethod": "Tool definition by name (get)", "compat.cap.toolsGuardDispatch": "Tool guard dispatch (guard / checkGuards)", "compat.cap.toolsMcpResourceArgs": "Shared MCP resource tool arguments (server / uri)", "compat.cap.systemPromptMcpSection": "System-prompt MCP section (MCP_SERVERS)", "compat.cap.mcpClientConfigSchema": "MCP client config schema", "compat.cap.skillsRegisterProvider": "Skills provider registration (registerProvider)", "compat.cap.agentsList": "Live agent list (agents.list)", "compat.cap.pluginInventoryList": "Loader plugin entries (pluginInventory.list)", "compat.cap.webServerRegister": "HTTP route registration (webServer.register)", "compat.cap.sandboxPolicyResolve": "Sandbox policy resolution (sandboxPolicy.resolve)", "compat.cap.projectionCachedTitle": "Projection-cache title read (cachedSnapshot)", "compat.cap.officialSkillAssets": "Official office skill assets", "compat.cap.officialSandboxAsset": "Official sandbox diagnostic skill asset", "compat.cap.agentCreatedEvent": "Subagent creation event (agent/created)", "compat.cap.connectionAdmit": "Connection admission (admit)",
|
|
7564
|
+
"compat.cap.subagentsRuntime": "Subagent runtime (startActivation)", "compat.cap.llmModelCatalog": "Model catalog (scene model candidates)", "compat.cap.approvalEffectivePolicy": "Approval policy read (full-access detection)",
|
|
7240
7565
|
"compat.cap.opArchive": "Archive", "compat.cap.opUnarchive": "Restore", "compat.cap.opBatch": "Batch operations", "compat.cap.opDelete": "Delete", "compat.cap.opList": "History list",
|
|
7241
7566
|
"compat.reach": "Preset injection reach",
|
|
7242
7567
|
"compat.reach.suppressing": "suppressing",
|
|
@@ -7691,8 +8016,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7691
8016
|
"scope.lease.released": "“{title}” no longer runs it temporarily",
|
|
7692
8017
|
"scope.lease.releasedWs": "Workspace “{title}” no longer runs it temporarily",
|
|
7693
8018
|
"scope.lease.releaseFailed": "Could not stop the temporary run for “{title}”: {error}",
|
|
8019
|
+
"scope.lease.releasePartial": "Stopped only part of “{title}” ({done}/{total}): the rest could not be released; please retry",
|
|
7694
8020
|
"scope.lease.unknownError": "no reason given",
|
|
7695
8021
|
"scope.intent.keptRunning": "Disabled globally; {count} conversation(s) still use it, so the source stays enabled for them.",
|
|
8022
|
+
"scope.intent.keptRunningWs": "Disabled globally; {count} workspace(s) still use it, so the source stays enabled for them.",
|
|
7696
8023
|
"scope.intent.onOk": "Enabled “{name}” globally.", "scope.intent.offOk": "Disabled “{name}” globally.",
|
|
7697
8024
|
"scope.intent.resume": "Turn back on",
|
|
7698
8025
|
"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.",
|
|
@@ -7717,7 +8044,14 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7717
8044
|
// 写在 apply 方法体里的导出会随 apply 提前返回而静默消失(见下方注释)。
|
|
7718
8045
|
pages: _pages,
|
|
7719
8046
|
apply(ctx) {
|
|
7720
|
-
|
|
8047
|
+
// 样式表挂在 document.head 上,不随插件 fiber 销毁 —— 把移除函数交给宿主作用域,
|
|
8048
|
+
// 卸载 / 热重载后规则跟着走(判定与「为什么」见 20 片的 ensureCss)。
|
|
8049
|
+
var stopCss = ensureCss()
|
|
8050
|
+
try {
|
|
8051
|
+
if (ctx && typeof ctx.effect === 'function') {
|
|
8052
|
+
ctx.effect(function () { return stopCss }, 'dsh-plugin-tool-management: stylesheet')
|
|
8053
|
+
}
|
|
8054
|
+
} catch (e) { /* 旧宿主没有 effect:退化成"留到下次刷新",与改造前一致 */ }
|
|
7721
8055
|
// 导入 / 导出弹窗的默认目录:问一次宿主(桌面 → 主目录,跨平台跨用户),缓存起来供
|
|
7722
8056
|
// 各处输入框取用。放在 apply 开头是因为它**不依赖 ctx**(apiCall 直接走 fetch),
|
|
7723
8057
|
// 而用户打开那些弹窗要晚得多 —— 早一点发出去,打开时就已经到位(见 20 片的说明)。
|
|
@@ -8444,7 +8778,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8444
8778
|
// 详情弹窗的请求序号:见 openDetail / closeDetail(晚到响应不得复活弹窗)。
|
|
8445
8779
|
const detailSeqRef = React.useRef(0)
|
|
8446
8780
|
const [confirmRow, setConfirmRow] = React.useState(null)
|
|
8447
|
-
//
|
|
8781
|
+
// 「全部关闭」确认:与删除不同,它切断的是**正在用它的会话** —— 必须问一次。
|
|
8448
8782
|
const [stopConfirm, setStopConfirm] = React.useState(null)
|
|
8449
8783
|
const [reveal, setReveal] = React.useState(false)
|
|
8450
8784
|
const [settings, setSettings] = React.useState(null)
|
|
@@ -8609,7 +8943,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8609
8943
|
return
|
|
8610
8944
|
}
|
|
8611
8945
|
// 全局层 = 写**意图**(0.21.2):off 不再立刻停 —— 还在用它的会话按租约继续跑,
|
|
8612
|
-
//
|
|
8946
|
+
// 只有「全部关闭」才切断。撤销按操作前的意图值逐台写回。
|
|
8613
8947
|
setMsg(null)
|
|
8614
8948
|
setBusy('setall')
|
|
8615
8949
|
apiCall('scope-intent-set', { domain: 'mcp', keys: changed.map((item) => item.serverName), value: turnOn ? 'on' : 'off' })
|
|
@@ -8833,7 +9167,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8833
9167
|
return
|
|
8834
9168
|
}
|
|
8835
9169
|
// 全局层(0.21.2)= 写**意图**,不是补丁:off 之后仍被会话认领的服务器保持运行
|
|
8836
|
-
//
|
|
9170
|
+
// (租约),只有「全部关闭」才切断它们。开关读的也是意图(见 `serverGlobalOn`)。
|
|
8837
9171
|
const name = String(row.serverName || row.id)
|
|
8838
9172
|
const nextOn = !serverGlobalOn(row)
|
|
8839
9173
|
// 翻开 = 先按「启动中」显示(宿主拉起进程要几秒);关掉 = 销账。
|
|
@@ -8843,8 +9177,8 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8843
9177
|
.then((res) => {
|
|
8844
9178
|
if (res && res.ok === false) { setMsg({ kind: 'err', text: (res && res.error) || mt('mcp.msg.failed') }); return }
|
|
8845
9179
|
if (res && res.warnings && res.warnings.length) { setMsg({ kind: 'warn', text: res.warnings.join(';') }); return }
|
|
8846
|
-
const leases =
|
|
8847
|
-
if (!nextOn && leases > 0) setMsg({ kind: 'warn', text: mt('mcp.intent.keptRunning', { count: leases }) })
|
|
9180
|
+
const leases = scopeLeaseUnitCount('mcp', name)
|
|
9181
|
+
if (!nextOn && leases > 0) setMsg({ kind: 'warn', text: mt(scopeIsWorkspace() ? 'mcp.intent.keptRunningWs' : 'mcp.intent.keptRunning', { count: leases }) })
|
|
8848
9182
|
else setMsg({ kind: 'ok', text: mt(nextOn ? 'mcp.intent.onOk' : 'mcp.intent.offOk', { name: name }) })
|
|
8849
9183
|
refresh()
|
|
8850
9184
|
})
|
|
@@ -8872,7 +9206,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8872
9206
|
}
|
|
8873
9207
|
|
|
8874
9208
|
/**
|
|
8875
|
-
* MCP
|
|
9209
|
+
* MCP「全部关闭」是一次性动作:全局意图写 off,并把正在认领它的会话 / 工作区
|
|
8876
9210
|
* 一并写成显式关闭 —— 这样租约不会把它重新拉起来,也不会留下「恢复启用」状态。
|
|
8877
9211
|
* 走 op 而不是 `scope-intent-set`:后者只能写意图,写不到那些层的开关。
|
|
8878
9212
|
*/
|
|
@@ -8891,7 +9225,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8891
9225
|
}
|
|
8892
9226
|
|
|
8893
9227
|
/**
|
|
8894
|
-
* 页头「全部关闭」:逐台走同一个 op
|
|
9228
|
+
* 页头「全部关闭」:逐台走同一个 op,与行菜单里的「全部关闭」是一回事 ——
|
|
8895
9229
|
* 只改意图停不掉正在认领它的场景 / 工作区,那些层的开关也得写成显式关闭。
|
|
8896
9230
|
* 只在真有临时运行时出现(`scopeLeaseKeys` 非空),没东西可停就不占页头。
|
|
8897
9231
|
*/
|
|
@@ -9234,7 +9568,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9234
9568
|
if (row.notes) meta.push(React.createElement('span', { key: 'note', className: 'dsm-listrow-meta-desc', title: row.notes }, mt('mcp.note.prefix') + row.notes))
|
|
9235
9569
|
// 全局层的意图状态只挂**临时运行 · N 个对话** —— 它是"全局 off 却仍在跑"的
|
|
9236
9570
|
// 唯一解释,不标出来,用户会以为全局开关坏了。
|
|
9237
|
-
//
|
|
9571
|
+
// 全部关闭不挂标签:开关本身就是关的,标签会长期占着这一行;状态由开关的
|
|
9238
9572
|
// 悬浮说明承担。
|
|
9239
9573
|
// 同名两层行只标在**第一行**上(两行说同一件事,标两遍只是噪声)。
|
|
9240
9574
|
if (!scopeIsSession()) {
|
|
@@ -9316,13 +9650,13 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9316
9650
|
// 同名两行显示同一个意图值(意图按 serverName 键),不会一行开一行关。
|
|
9317
9651
|
const nameHere = String(row.serverName || row.id)
|
|
9318
9652
|
const intentHere = scopeIntentOf('mcp', nameHere)
|
|
9319
|
-
const leasesHere =
|
|
9653
|
+
const leasesHere = scopeLeaseUnitCount('mcp', nameHere)
|
|
9320
9654
|
return editable ? React.createElement(Switch, {
|
|
9321
9655
|
on: serverGlobalOn(row),
|
|
9322
9656
|
scoped: false,
|
|
9323
9657
|
disabled: actDisabled,
|
|
9324
9658
|
title: intentHere === 'blocked' ? mt('mcp.intent.blockedHint')
|
|
9325
|
-
: leasesHere > 0 ? mt('mcp.intent.leaseHint', { count: leasesHere })
|
|
9659
|
+
: leasesHere > 0 ? mt(scopeIsWorkspace() ? 'mcp.intent.leaseHintWs' : 'mcp.intent.leaseHint', { count: leasesHere })
|
|
9326
9660
|
: undefined,
|
|
9327
9661
|
label: mt('mcp.toggleServer') + ' ' + row.serverName,
|
|
9328
9662
|
onClick: () => toggleRow(row),
|
|
@@ -9583,7 +9917,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9583
9917
|
React.createElement('div', { className: 'dsm-modal-actions' },
|
|
9584
9918
|
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-danger', onClick: confirmRemove }, mt('mcp.btn.remove'))))
|
|
9585
9919
|
|
|
9586
|
-
//
|
|
9920
|
+
// 「全部关闭」确认:它会**立即**停掉连接,还会把正在用它的会话 / 工作区的开关
|
|
9587
9921
|
// 一并关掉 —— 与普通关闭不是一回事,必须问一次,并把影响说清。
|
|
9588
9922
|
const stopNode = stopConfirm && React.createElement(Modal, {
|
|
9589
9923
|
key: 'mcp-stop',
|
|
@@ -9628,7 +9962,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9628
9962
|
// 要把它们排除 —— 否则全部可见之后按钮仍写着「全部启用」,点了什么也不发生。
|
|
9629
9963
|
bulkAllOn ? mt('mcp.btn.disableAll') : mt('mcp.btn.enableAll')),
|
|
9630
9964
|
// 只在有临时运行时出现(会话 / 场景 / 工作区正在认领某几台);
|
|
9631
|
-
//
|
|
9965
|
+
// 与行菜单的「全部关闭」同一个 op,别在这里另写一条只改意图的路径。
|
|
9632
9966
|
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,
|
|
9633
9967
|
],
|
|
9634
9968
|
}),
|
|
@@ -9710,7 +10044,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9710
10044
|
var quick = qs[0], setQuick = qs[1]
|
|
9711
10045
|
var qk = React.useState(null), quickEdit = qk[0], setQuickEdit = qk[1]
|
|
9712
10046
|
var qf = React.useState(null), quickConfirm = qf[0], setQuickConfirm = qf[1]
|
|
9713
|
-
//
|
|
10047
|
+
// 单条快捷提示词的「全部关闭」确认(`{ id }`):切断的是各对话 / 工作区正在单独用它的那份。
|
|
9714
10048
|
var qz = React.useState(null), quickStop = qz[0], setQuickStop = qz[1]
|
|
9715
10049
|
// 三个弹窗(新增预设 / 编辑预设 / 编辑快捷提示词)各自一份关窗暂存(见 42-shared-ui.js:
|
|
9716
10050
|
// 关窗存、打开取,成功提交不走这条路,所以没有"成功后要记得清"那一步)。
|
|
@@ -10160,7 +10494,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
10160
10494
|
}).catch(function (e) { setBusy(null); setQuickConfirm(null); actionFailed(e) })
|
|
10161
10495
|
}
|
|
10162
10496
|
/**
|
|
10163
|
-
*
|
|
10497
|
+
* 单条快捷提示词的「全部关闭」:清掉各对话 / 工作区单独打开它的覆盖。
|
|
10164
10498
|
* 全局启停不动(页面那颗开关管的是它),这里只收临时的那一份。
|
|
10165
10499
|
*/
|
|
10166
10500
|
function doQuickStop(id) {
|
|
@@ -10304,7 +10638,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
10304
10638
|
var quickAllOn = visibleQuick.length > 0 && visibleQuick.every(function (p) { return scopeFlag('quickPrompts', p.id, p.enabled !== false).value })
|
|
10305
10639
|
/**
|
|
10306
10640
|
* 页头「全部关闭」:把各会话 / 工作区 / 场景里单独开着的快捷提示词一并停掉 ——
|
|
10307
|
-
*
|
|
10641
|
+
* 「本对话关掉、别的对话还开着」不算全部关闭,所以走全部关闭 op 清各层认领,
|
|
10308
10642
|
* 而不是只写全局 `meta.json`。全局那一档是单选基线,没有"临时运行"可言。
|
|
10309
10643
|
*/
|
|
10310
10644
|
function stopAllQuick() {
|
|
@@ -10845,6 +11179,9 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
10845
11179
|
// 指到非滚动容器(sticky 随之失效,页签被内容滚走)。
|
|
10846
11180
|
var section = sectionRef.current
|
|
10847
11181
|
if (!section) return undefined
|
|
11182
|
+
// 宿主把滚动放在视口上时(找不到祖先滚动容器),装订线只能挂在 html 上:
|
|
11183
|
+
// 加一个类、卸载时撤掉 —— 不是一条常驻的全局规则。
|
|
11184
|
+
document.documentElement.classList.add('dsm-scroll-stable')
|
|
10848
11185
|
var host = null
|
|
10849
11186
|
var node = section.parentElement
|
|
10850
11187
|
while (node && node !== document.body) {
|
|
@@ -10854,9 +11191,12 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
10854
11191
|
}
|
|
10855
11192
|
// 找不到(宿主换了实现)→ 退回原来的「上两级」,保持兼容。
|
|
10856
11193
|
if (!host) host = section.parentElement && section.parentElement.parentElement
|
|
10857
|
-
if (!host) return
|
|
11194
|
+
if (!host) return function () { document.documentElement.classList.remove('dsm-scroll-stable') }
|
|
10858
11195
|
host.classList.add('dsm-settings-scroll-host')
|
|
10859
|
-
return function () {
|
|
11196
|
+
return function () {
|
|
11197
|
+
host.classList.remove('dsm-settings-scroll-host')
|
|
11198
|
+
document.documentElement.classList.remove('dsm-scroll-stable')
|
|
11199
|
+
}
|
|
10860
11200
|
}, [])
|
|
10861
11201
|
var page = active === 'scenes' ? React.createElement(ScenesPage)
|
|
10862
11202
|
: active === 'mcp' ? React.createElement(MCPPage)
|
|
@@ -12871,7 +13211,7 @@ function enabledMemoryCount(rules) {
|
|
|
12871
13211
|
var tone = props.tone === 'ok' ? ' dsm-tag-on' : props.tone === 'bad' ? ' dsm-tag-off' : props.tone === 'warn' ? ' dsm-tag-warn' : ''
|
|
12872
13212
|
return h('span', { className: 'dsm-tag' + tone, title: props.title }, props.text)
|
|
12873
13213
|
}
|
|
12874
|
-
/**
|
|
13214
|
+
/** 租约浮窗的最大高度;`measure` 会按这一侧可用空间再夹一次(CSS 只负责滚动)。 */
|
|
12875
13215
|
var LEASE_POP_MAX_H = 320
|
|
12876
13216
|
/**
|
|
12877
13217
|
* 浮窗里的分组:按**工作区**归拢,同一个工作区的对话挨在一起。
|
|
@@ -12880,24 +13220,32 @@ function enabledMemoryCount(rules) {
|
|
|
12880
13220
|
* 在用它" —— 同一个工作区的那几个对话排成一块,才看得出"是这个项目在跑"。
|
|
12881
13221
|
* 组内按标题排;没有工作区的那些排在最后(它们不属于任何项目)。
|
|
12882
13222
|
*
|
|
12883
|
-
*
|
|
12884
|
-
* `C:\a\b` 与 `c:\a\b\`
|
|
13223
|
+
* 分组键取**与服务端同一口径**的路径键(`scopeWorkspacePathKey`):同一个目录在清单里
|
|
13224
|
+
* 可能写成 `C:\a\b`、`C:/a/b` 与 `c:\a\b\` 几种样子 —— 不归一就会分成两块,组头还同名。
|
|
13225
|
+
*
|
|
13226
|
+
* 工作区粒度下没有 cwd 的会话是**会话隔离**,不是同一个「无工作区」:它们各自算一组,
|
|
13227
|
+
* 否则徽章会把 N 个独立认领显示成 1 个、那颗「×」也只能放掉其中一个。
|
|
12885
13228
|
*/
|
|
12886
|
-
function leaseGroups(details) {
|
|
13229
|
+
function leaseGroups(details, workspaceMode) {
|
|
12887
13230
|
var byCwd = Object.create(null)
|
|
12888
13231
|
var order = []
|
|
12889
13232
|
var nameOf = Object.create(null)
|
|
12890
13233
|
details.forEach(function (d) {
|
|
12891
13234
|
var cwd = String((d && d.cwd) || '')
|
|
12892
|
-
var key = cwd
|
|
13235
|
+
var key = cwd === ''
|
|
13236
|
+
? (workspaceMode ? '\u0000' + String((d && d.id) || '') : '')
|
|
13237
|
+
: scopeWorkspacePathKey(cwd)
|
|
12893
13238
|
if (!byCwd[key]) { byCwd[key] = []; order.push(key) }
|
|
12894
13239
|
byCwd[key].push(d)
|
|
12895
13240
|
if (cwd !== '' && nameOf[key] === undefined) nameOf[key] = cwd
|
|
12896
13241
|
})
|
|
12897
13242
|
order.sort(function (a, b) {
|
|
12898
|
-
|
|
12899
|
-
|
|
12900
|
-
return a < b ? -1 : a > b ? 1 : 0
|
|
13243
|
+
var ac = nameOf[a] === undefined ? '' : nameOf[a]
|
|
13244
|
+
var bc = nameOf[b] === undefined ? '' : nameOf[b]
|
|
13245
|
+
if (ac === '' && bc === '') return a < b ? -1 : a > b ? 1 : 0
|
|
13246
|
+
if (ac === '') return 1
|
|
13247
|
+
if (bc === '') return -1
|
|
13248
|
+
return ac < bc ? -1 : ac > bc ? 1 : 0
|
|
12901
13249
|
})
|
|
12902
13250
|
return order.map(function (key) {
|
|
12903
13251
|
var rows = byCwd[key].slice().sort(function (x, y) {
|
|
@@ -12905,68 +13253,99 @@ function enabledMemoryCount(rules) {
|
|
|
12905
13253
|
var yt = String((y && y.title) || '')
|
|
12906
13254
|
return xt < yt ? -1 : xt > yt ? 1 : 0
|
|
12907
13255
|
})
|
|
12908
|
-
return { cwd: nameOf[key] === undefined ? '' : nameOf[key], rows: rows }
|
|
13256
|
+
return { key: key, cwd: nameOf[key] === undefined ? '' : nameOf[key], rows: rows }
|
|
12909
13257
|
})
|
|
12910
13258
|
}
|
|
12911
13259
|
/**
|
|
12912
13260
|
* 租约徽章 + 悬浮浮窗:**临时运行的是哪几个对话**。
|
|
12913
13261
|
*
|
|
12914
13262
|
* 徽章正文只说"几个对话"(`临时运行 · N 个对话`),用户真正要问的是"是哪几个"——
|
|
12915
|
-
*
|
|
13263
|
+
* 浮窗一行一个对话:标题在左,所属工作区作为弱化后缀,末尾一颗「×」只放开这一个。
|
|
13264
|
+
* 工作区粒度下每行就是一个工作区,那一行只显示工作区名。
|
|
12916
13265
|
*
|
|
12917
13266
|
* 浮窗用 `position:fixed` + **视口坐标**:徽章所在的列表行是 `overflow:hidden`
|
|
12918
13267
|
* (`.dsm-listrow-meta`),绝对定位的浮层会被裁掉(与 `SourceSelect` 的菜单同一条理由)。
|
|
12919
13268
|
*
|
|
12920
|
-
* @param {{ t: Function, count: number, runtime: boolean, domain: string, key: string, details: Array<{id?: string, title?: string, cwd?: string, keys?: Array<{domain: string, key: string}>}>, onRelease?: Function }} props
|
|
13269
|
+
* @param {{ t: Function, count: number, runtime: boolean, domain: string, key: string, details: Array<{id?: string, title?: string, cwd?: string, keys?: Array<{domain: string, key: string}>}>, onRelease?: Function, workspaceMode?: boolean }} props
|
|
12921
13270
|
*/
|
|
12922
13271
|
function LeaseTagBadge(props) {
|
|
12923
13272
|
var t = props.t
|
|
12924
13273
|
var runtime = props.runtime === true
|
|
12925
13274
|
var details = props.details || []
|
|
12926
|
-
var groups = leaseGroups(details)
|
|
12927
13275
|
// 工作区粒度:认领是**按工作区**记的 —— 徽章上的个数得跟浮窗里的行数同一个单位,
|
|
12928
|
-
// 否则会出现「2 个对话」配 1
|
|
12929
|
-
|
|
13276
|
+
// 否则会出现「2 个对话」配 1 行工作区(看着像漏了一条)。
|
|
13277
|
+
// 预览 / 测试可直接指定;正常渲染不传,读当前隔离粒度。
|
|
13278
|
+
var workspaceMode = typeof props.workspaceMode === 'boolean' ? props.workspaceMode : scopeIsWorkspace()
|
|
13279
|
+
var groups = leaseGroups(details, workspaceMode)
|
|
12930
13280
|
var count = workspaceMode ? groups.length : props.count
|
|
12931
13281
|
var openState = React.useState(false), open = openState[0], setOpen = openState[1]
|
|
12932
13282
|
var posState = React.useState(null), pos = posState[0], setPos = posState[1]
|
|
12933
13283
|
var busyState = React.useState(null), busyId = busyState[0], setBusyId = busyState[1]
|
|
12934
13284
|
var ref = React.useRef(null)
|
|
12935
13285
|
var popRef = React.useRef(null)
|
|
12936
|
-
|
|
13286
|
+
// 浮窗是给键盘用户打开的(Enter/空格)才把焦点送进去;鼠标悬停打开时抢焦点会打断输入。
|
|
13287
|
+
var keyboardOpen = React.useRef(false)
|
|
12937
13288
|
var label = workspaceMode
|
|
12938
13289
|
? (runtime ? t('scope.intent.leaseWs', { count: count }) : t('scope.view.leaseWs', { count: count }))
|
|
12939
13290
|
: (runtime ? t('scope.intent.lease', { count: count }) : t('scope.view.lease', { count: count }))
|
|
13291
|
+
/** 指针是否还在徽章或浮窗里:浮窗是 portal,不能只看徽章的 DOM 子树。 */
|
|
13292
|
+
function pointerWithin(target) {
|
|
13293
|
+
if (!target) return false
|
|
13294
|
+
return (ref.current && typeof ref.current.contains === 'function' && ref.current.contains(target))
|
|
13295
|
+
|| (popRef.current && typeof popRef.current.contains === 'function' && popRef.current.contains(target))
|
|
13296
|
+
}
|
|
13297
|
+
/** 立即收起。徽章与浮窗之间的空档由不可见的桥接条补上,不再需要关闭延迟。 */
|
|
13298
|
+
function closeNow() {
|
|
13299
|
+
keyboardOpen.current = false
|
|
13300
|
+
setOpen(false)
|
|
13301
|
+
setPos(null)
|
|
13302
|
+
}
|
|
12940
13303
|
/**
|
|
12941
|
-
*
|
|
12942
|
-
*
|
|
12943
|
-
* 进了浮窗本体就把这个计时撤掉 —— 那是"用户还在看它"的明确信号。
|
|
13304
|
+
* 指针离开徽章或浮窗。relatedTarget 还在两者之内时不动 —— 那只是从徽章跨进浮窗
|
|
13305
|
+
* (或反过来),桥接条让这段路始终落在浮窗的命中区里。
|
|
12944
13306
|
*/
|
|
12945
|
-
function
|
|
12946
|
-
if (
|
|
13307
|
+
function onLeave(e) {
|
|
13308
|
+
if (pointerWithin(e && e.relatedTarget)) return
|
|
13309
|
+
closeNow()
|
|
12947
13310
|
}
|
|
12948
|
-
|
|
12949
|
-
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
12953
|
-
|
|
12954
|
-
|
|
13311
|
+
/** 关掉浮窗并把焦点还给徽章:键盘用户按 Escape 或再按一次 Enter 时不能把焦点丢在 body 上。 */
|
|
13312
|
+
function closeAndFocus() {
|
|
13313
|
+
closeNow()
|
|
13314
|
+
var el = ref.current
|
|
13315
|
+
if (el && typeof el.focus === 'function') el.focus()
|
|
13316
|
+
}
|
|
13317
|
+
function onBadgeKeyDown(e) {
|
|
13318
|
+
if (e.key === 'Escape') {
|
|
13319
|
+
if (open) { e.preventDefault(); closeAndFocus() }
|
|
13320
|
+
return
|
|
13321
|
+
}
|
|
13322
|
+
// 浮窗里的按钮自己处理 Enter/空格,别让它们冒泡成「收起浮窗」。
|
|
13323
|
+
if (e.target !== ref.current) return
|
|
13324
|
+
if (e.key === 'Enter' || e.key === ' ' || e.key === 'Spacebar') {
|
|
13325
|
+
e.preventDefault()
|
|
13326
|
+
if (open) { closeAndFocus(); return }
|
|
13327
|
+
keyboardOpen.current = true
|
|
13328
|
+
setOpen(true)
|
|
13329
|
+
}
|
|
12955
13330
|
}
|
|
12956
|
-
React.useEffect(function () {
|
|
12957
|
-
return function () { if (closeTimer.current !== null) clearTimeout(closeTimer.current) }
|
|
12958
|
-
}, [])
|
|
12959
13331
|
/**
|
|
12960
13332
|
* 放掉**一个**对话的认领:只让它不再临时运行,其它对话照旧。
|
|
12961
13333
|
*
|
|
12962
13334
|
* 认领是**逐个对话**记的(会话层那条覆盖),所以放掉一个就是在那条对话的会话层
|
|
12963
13335
|
* 写一次「关」—— 服务端随即重算租约:最后一个认领者走了,连接 / 来源就跟着停。
|
|
12964
|
-
*
|
|
13336
|
+
* 工作区粒度下这条覆盖落在工作区上,同工作区的对话一起不再用(标题里说清楚);
|
|
13337
|
+
* 没有 cwd 的会话在工作区粒度下仍是独立的会话覆盖,提示按「对话」说。
|
|
13338
|
+
*
|
|
13339
|
+
* @param {object} d 认领明细(含 `id` / `title` / `keys`)
|
|
13340
|
+
* @param {string} [label] 提示里用的名字
|
|
13341
|
+
* @param {boolean} [wholeWorkspace] 这条覆盖是否落在整个工作区上
|
|
12965
13342
|
*/
|
|
12966
|
-
function release(d, label) {
|
|
13343
|
+
function release(d, label, wholeWorkspace) {
|
|
12967
13344
|
if (busyId !== null) return
|
|
12968
13345
|
var id = String((d && d.id) || '')
|
|
12969
13346
|
var name = String(label || (d && d.title) || id)
|
|
13347
|
+
// 工作区粒度的默认口径:整条覆盖落在工作区上;单个会话(没有 cwd)传 false。
|
|
13348
|
+
var whole = wholeWorkspace === undefined ? workspaceMode : wholeWorkspace === true
|
|
12970
13349
|
// 调用方自带放掉动作时用它(场景层要的是"退出场景",不是"关掉某一格")。
|
|
12971
13350
|
if (typeof props.onRelease === 'function') {
|
|
12972
13351
|
props.onRelease(d)
|
|
@@ -12978,22 +13357,37 @@ function enabledMemoryCount(rules) {
|
|
|
12978
13357
|
? d.keys
|
|
12979
13358
|
: [{ domain: props.domain, key: props.key }]
|
|
12980
13359
|
setBusyId(id)
|
|
12981
|
-
|
|
12982
|
-
|
|
12983
|
-
|
|
12984
|
-
|
|
12985
|
-
|
|
12986
|
-
|
|
12987
|
-
|
|
12988
|
-
|
|
12989
|
-
|
|
13360
|
+
// 逐格写、**一次一格**:中途失败就停在那一格 —— 后面的不再写,免得「前面失败、
|
|
13361
|
+
// 最后一条成功」被当成整体成功(提示会说反)。
|
|
13362
|
+
var applied = 0
|
|
13363
|
+
function writeNext(i) {
|
|
13364
|
+
if (i >= keys.length) return Promise.resolve()
|
|
13365
|
+
var k = keys[i]
|
|
13366
|
+
return Promise.resolve()
|
|
13367
|
+
.then(function () {
|
|
13368
|
+
return apiCall('scope-set', { sessionId: id, domain: String(k.domain), key: String(k.key), value: false })
|
|
13369
|
+
})
|
|
13370
|
+
.then(function (res) {
|
|
13371
|
+
if (!res || res.ok === false) throw new Error(scopeErrorText(res) || t('scope.lease.unknownError'))
|
|
13372
|
+
applied += 1
|
|
13373
|
+
return writeNext(i + 1)
|
|
13374
|
+
})
|
|
13375
|
+
}
|
|
13376
|
+
writeNext(0).then(function () {
|
|
12990
13377
|
// 本地先把这一条摘掉(全局快照有 150ms TTL,紧接着的重拉可能还是写前那一份)。
|
|
12991
13378
|
scopeForgetLeaseSession(props.domain, props.key, id)
|
|
12992
|
-
//
|
|
12993
|
-
//
|
|
12994
|
-
showPluginToast(
|
|
13379
|
+
// 整个工作区一起停时提示要说工作区,别让用户以为只关了一个对话;
|
|
13380
|
+
// 没有 cwd 的会话仍是单独的会话覆盖。
|
|
13381
|
+
showPluginToast(whole ? t('scope.lease.releasedWs', { title: name }) : t('scope.lease.released', { title: name }), 'ok')
|
|
12995
13382
|
setTimeout(function () { refreshScope({ silent: true }) }, 400)
|
|
12996
13383
|
}).catch(function (e) {
|
|
13384
|
+
if (applied > 0) {
|
|
13385
|
+
// 有格子已经放掉了:服务端状态变了,本地快照也得跟上;提示必须说明是**部分**完成。
|
|
13386
|
+
scopeForgetLeaseSession(props.domain, props.key, id)
|
|
13387
|
+
showPluginToast(t('scope.lease.releasePartial', { title: name, done: applied, total: keys.length }), 'warn')
|
|
13388
|
+
setTimeout(function () { refreshScope({ silent: true }) }, 400)
|
|
13389
|
+
return
|
|
13390
|
+
}
|
|
12997
13391
|
showPluginToast(t('scope.lease.releaseFailed', { title: name, error: scopeErrorText(e) || t('scope.lease.unknownError') }), 'err')
|
|
12998
13392
|
}).then(function () { setBusyId(null) })
|
|
12999
13393
|
}
|
|
@@ -13008,12 +13402,13 @@ function enabledMemoryCount(rules) {
|
|
|
13008
13402
|
if (!el) return
|
|
13009
13403
|
var box = el.getBoundingClientRect()
|
|
13010
13404
|
var gap = 6
|
|
13011
|
-
var
|
|
13405
|
+
var rowCount = workspaceMode ? groups.length : details.length
|
|
13406
|
+
var need = Math.min(rowCount * 28 + 16, LEASE_POP_MAX_H)
|
|
13012
13407
|
var below = window.innerHeight - box.bottom - gap - 8
|
|
13013
13408
|
var above = box.top - gap - 8
|
|
13014
13409
|
var nextUp = below < need && above > below
|
|
13015
13410
|
// 浮窗比徽章宽得多:按它自己的宽度靠右,别让它顶出窗口。
|
|
13016
|
-
var width = popRef.current ? popRef.current.offsetWidth :
|
|
13411
|
+
var width = popRef.current ? popRef.current.offsetWidth : 260
|
|
13017
13412
|
var next = {
|
|
13018
13413
|
left: Math.max(8, Math.min(box.left, window.innerWidth - width - 8)),
|
|
13019
13414
|
top: nextUp ? null : box.bottom + gap,
|
|
@@ -13027,13 +13422,22 @@ function enabledMemoryCount(rules) {
|
|
|
13027
13422
|
})
|
|
13028
13423
|
}
|
|
13029
13424
|
React.useEffect(function () {
|
|
13030
|
-
if (!open) return undefined
|
|
13425
|
+
if (!open) { keyboardOpen.current = false; return undefined }
|
|
13031
13426
|
measure()
|
|
13427
|
+
// 键盘打开时把焦点送到第一颗「×」:否则用户按了 Enter 之后还得再按 Tab 才够得着操作。
|
|
13428
|
+
var focusTimer = keyboardOpen.current
|
|
13429
|
+
? setTimeout(function () {
|
|
13430
|
+
var el = popRef.current
|
|
13431
|
+
var first = el && typeof el.querySelector === 'function' ? el.querySelector('button') : null
|
|
13432
|
+
if (first && typeof first.focus === 'function') first.focus()
|
|
13433
|
+
}, 0)
|
|
13434
|
+
: null
|
|
13032
13435
|
// 页面滚动 / 窗口尺寸变了,浮窗要跟着徽章走 —— 否则它会停在原地,指着空气。
|
|
13033
13436
|
var onMove = function () { measure() }
|
|
13034
13437
|
window.addEventListener('scroll', onMove, true)
|
|
13035
13438
|
window.addEventListener('resize', onMove)
|
|
13036
13439
|
return function () {
|
|
13440
|
+
if (focusTimer !== null) clearTimeout(focusTimer)
|
|
13037
13441
|
window.removeEventListener('scroll', onMove, true)
|
|
13038
13442
|
window.removeEventListener('resize', onMove)
|
|
13039
13443
|
}
|
|
@@ -13048,46 +13452,58 @@ function enabledMemoryCount(rules) {
|
|
|
13048
13452
|
style.top = pos.top === null || pos.top === undefined ? 'auto' : pos.top + 'px'
|
|
13049
13453
|
style.bottom = pos.bottom === null || pos.bottom === undefined ? 'auto' : pos.bottom + 'px'
|
|
13050
13454
|
}
|
|
13051
|
-
var releaseBtn = function (d, key, label) {
|
|
13455
|
+
var releaseBtn = function (d, key, label, wholeWorkspace) {
|
|
13456
|
+
var whole = wholeWorkspace === true
|
|
13457
|
+
var action = whole ? t('scope.lease.releaseWorkspace') : t('scope.lease.release')
|
|
13052
13458
|
return h('button', {
|
|
13053
13459
|
key: key,
|
|
13054
13460
|
type: 'button',
|
|
13055
13461
|
className: 'dsm-lease-pop-x',
|
|
13056
13462
|
disabled: busyId !== null,
|
|
13057
|
-
title:
|
|
13058
|
-
'aria-label':
|
|
13059
|
-
onClick: function (e) { if (e && e.stopPropagation) e.stopPropagation(); release(d, label) },
|
|
13463
|
+
title: action,
|
|
13464
|
+
'aria-label': action,
|
|
13465
|
+
onClick: function (e) { if (e && e.stopPropagation) e.stopPropagation(); release(d, label, whole) },
|
|
13060
13466
|
}, '×')
|
|
13061
13467
|
}
|
|
13062
13468
|
// 工作区粒度:认领是**按工作区**记的(同工作区的对话共用一份覆盖)—— 逐个列会话标题
|
|
13063
|
-
//
|
|
13064
|
-
|
|
13065
|
-
|
|
13066
|
-
|
|
13067
|
-
|
|
13068
|
-
|
|
13069
|
-
|
|
13070
|
-
|
|
13071
|
-
|
|
13072
|
-
|
|
13073
|
-
|
|
13074
|
-
|
|
13075
|
-
|
|
13076
|
-
|
|
13077
|
-
|
|
13078
|
-
|
|
13079
|
-
|
|
13469
|
+
// 只是噪声,列出工作区就够了。没有 cwd 的会话各自是一份独立覆盖(见 `leaseGroups`),
|
|
13470
|
+
// 行名用会话标题,否则 N 条都会显示成「无工作区」,根本分不出该放哪一条。
|
|
13471
|
+
// 会话粒度:一行一个对话,工作区作为弱化后缀跟在标题后面 —— 不另起组头,
|
|
13472
|
+
// 一两个对话时浮窗也就只有一两行高。
|
|
13473
|
+
var body = []
|
|
13474
|
+
if (workspaceMode) {
|
|
13475
|
+
groups.forEach(function (g) {
|
|
13476
|
+
var d = g.rows[0]
|
|
13477
|
+
var wsName = g.cwd !== '' ? scopeWorkspaceName(g.cwd) : String((d && d.title) || (d && d.id) || t('scope.lease.noWorkspace'))
|
|
13478
|
+
body.push(h('div', { key: 'w:' + g.key, className: 'dsm-lease-pop-item' },
|
|
13479
|
+
h('span', { className: 'dsm-lease-pop-title', title: g.cwd !== '' ? g.cwd : wsName }, wsName),
|
|
13480
|
+
// 工作区行顺带说清「这个工作区里有几个对话在认领它」:那颗「×」放掉的是整片。
|
|
13481
|
+
g.cwd !== '' ? h('span', { className: 'dsm-lease-pop-ws' }, t('scope.sessions.count', { count: g.rows.length })) : null,
|
|
13482
|
+
d !== undefined ? releaseBtn(d, 'x:' + g.key, wsName, g.cwd !== '') : null))
|
|
13483
|
+
})
|
|
13484
|
+
} else {
|
|
13485
|
+
groups.forEach(function (g, gi) {
|
|
13486
|
+
var wsName = g.cwd !== '' ? scopeWorkspaceName(g.cwd) : t('scope.lease.noWorkspace')
|
|
13487
|
+
g.rows.forEach(function (d, ri) {
|
|
13488
|
+
var title = String((d && d.title) || (d && d.id) || '')
|
|
13489
|
+
body.push(h('div', { key: 'r:' + gi + ':' + ri, className: 'dsm-lease-pop-item' },
|
|
13490
|
+
h('span', { className: 'dsm-lease-pop-title', title: title }, title),
|
|
13491
|
+
h('span', { className: 'dsm-lease-pop-ws', title: g.cwd !== '' ? g.cwd : wsName }, wsName),
|
|
13492
|
+
releaseBtn(d, 'x:' + gi + ':' + ri)))
|
|
13080
13493
|
})
|
|
13494
|
+
})
|
|
13495
|
+
}
|
|
13496
|
+
var up = pos !== null && pos.bottom !== null && pos.bottom !== undefined
|
|
13081
13497
|
popup = h('div', {
|
|
13082
|
-
className: 'dsm-lease-pop',
|
|
13498
|
+
className: 'dsm-lease-pop' + (up ? ' dsm-lease-pop-up' : ''),
|
|
13083
13499
|
style: style,
|
|
13084
13500
|
ref: popRef,
|
|
13085
|
-
|
|
13086
|
-
|
|
13087
|
-
onMouseLeave:
|
|
13501
|
+
role: 'dialog',
|
|
13502
|
+
'aria-label': label,
|
|
13503
|
+
onMouseLeave: onLeave,
|
|
13088
13504
|
// 浮窗在徽章里面:点它不该触发行上的动作。
|
|
13089
13505
|
onClick: function (e) { if (e && e.stopPropagation) e.stopPropagation() },
|
|
13090
|
-
}, body)
|
|
13506
|
+
}, h('div', { className: 'dsm-lease-pop-body' }, body))
|
|
13091
13507
|
// 浮窗挂到 `document.body` 上:留在面板里会被祖先的 `overflow:hidden` 裁掉
|
|
13092
13508
|
// (来源卡片就是 `overflow:hidden` —— 浮窗探出去的那截被裁掉,底下一张卡片的
|
|
13093
13509
|
// 内容透上来,就是用户看到的「穿模」,用户 2026-11-05 实测)。
|
|
@@ -13099,9 +13515,21 @@ function enabledMemoryCount(rules) {
|
|
|
13099
13515
|
return h('span', {
|
|
13100
13516
|
className: 'dsm-tag dsm-tag-lease',
|
|
13101
13517
|
ref: ref,
|
|
13102
|
-
|
|
13103
|
-
|
|
13104
|
-
|
|
13518
|
+
role: 'button',
|
|
13519
|
+
tabIndex: 0,
|
|
13520
|
+
'aria-haspopup': 'dialog',
|
|
13521
|
+
'aria-expanded': open ? 'true' : 'false',
|
|
13522
|
+
onKeyDown: onBadgeKeyDown,
|
|
13523
|
+
onBlur: function (e) {
|
|
13524
|
+
if (!open) return
|
|
13525
|
+
// 焦点还在徽章或浮窗里(浮窗是 portal,不在徽章的 DOM 子树里)。
|
|
13526
|
+
if (pointerWithin(e && e.relatedTarget)) return
|
|
13527
|
+
// Tab 走出去了:静默收起,不把焦点抢回来。
|
|
13528
|
+
closeNow()
|
|
13529
|
+
},
|
|
13530
|
+
onMouseEnter: function () { keyboardOpen.current = false; setOpen(true) },
|
|
13531
|
+
onMouseLeave: onLeave,
|
|
13532
|
+
}, label, popup)
|
|
13105
13533
|
}
|
|
13106
13534
|
/**
|
|
13107
13535
|
* 租约徽章(0.21.2):**六个域共用的唯一出口** —— 同一 HTML 结构、同一 class 族、同一浮窗。
|
|
@@ -13598,7 +14026,7 @@ function enabledMemoryCount(rules) {
|
|
|
13598
14026
|
}
|
|
13599
14027
|
/**
|
|
13600
14028
|
* 写来源的全局意图:`off` 只是"默认不要"—— 还有会话在用就保持启用(租约),
|
|
13601
|
-
*
|
|
14029
|
+
* 不切断正在用它的对话。技能来源没有逐条「全部关闭」这一档(页头「全部关闭」可一次收掉)。
|
|
13602
14030
|
*/
|
|
13603
14031
|
function setSourceIntent(root, value) {
|
|
13604
14032
|
var key = String(root.key || '')
|
|
@@ -13609,9 +14037,9 @@ function enabledMemoryCount(rules) {
|
|
|
13609
14037
|
.then(function (res) {
|
|
13610
14038
|
if (res && res.ok === false) { setResult({ ok: false, text: translateError(t, res) }); return }
|
|
13611
14039
|
var warnings = res && res.warnings && res.warnings.length ? res.warnings.join(';') : ''
|
|
13612
|
-
var leases =
|
|
14040
|
+
var leases = scopeLeaseUnitCount('skillSources', key)
|
|
13613
14041
|
var text = value === 'on' ? t('done.enabled', { name: name })
|
|
13614
|
-
: leases > 0 ? t('scope.intent.keptRunning', { count: leases }) : t('done.disabled', { name: name })
|
|
14042
|
+
: leases > 0 ? t(scopeIsWorkspace() ? 'scope.intent.keptRunningWs' : 'scope.intent.keptRunning', { count: leases }) : t('done.disabled', { name: name })
|
|
13615
14043
|
setResult({ ok: true, text: text + (warnings ? ' ' + warnings : '') })
|
|
13616
14044
|
refreshScope()
|
|
13617
14045
|
refresh(true)
|
|
@@ -13680,7 +14108,7 @@ function enabledMemoryCount(rules) {
|
|
|
13680
14108
|
.catch(function (error) { setResult({ ok: false, text: errMsg(error) }); })
|
|
13681
14109
|
.finally(function () { setBusy(false); });
|
|
13682
14110
|
}
|
|
13683
|
-
/**
|
|
14111
|
+
/** 全部关闭一条技能:一次性写 off + 清掉正在用它那几层的开关。 */
|
|
13684
14112
|
function stopSkillNow(target) {
|
|
13685
14113
|
setBusy(true); setResult(null);
|
|
13686
14114
|
apiCall("scope-stop-now", { domain: "skills", key: target.key })
|
|
@@ -14080,7 +14508,7 @@ function enabledMemoryCount(rules) {
|
|
|
14080
14508
|
root.mutable && !root.deletable ? h("span", { key: "notDeletable", className: "dsm-listrow-meta-info", title: t("status.notDeletable.hint") }, t("status.notDeletable")) : null,
|
|
14081
14509
|
];
|
|
14082
14510
|
// 行尾:详情常驻,其余动作收进 ⋯(与 MCP 页同一套口径):
|
|
14083
|
-
//
|
|
14511
|
+
// 全部关闭 —— 真有其他对话 / 工作区在临时用它时才出现;
|
|
14084
14512
|
// 编辑 / 删除 —— 官方内置与只读来源没有这两项(`mutable` / `deletable` 由服务端给)。
|
|
14085
14513
|
// 锁定期间只有「详情」还活着:其余都会改配置,一律置灰。
|
|
14086
14514
|
var actions = [];
|
|
@@ -14195,11 +14623,11 @@ function enabledMemoryCount(rules) {
|
|
|
14195
14623
|
return
|
|
14196
14624
|
}
|
|
14197
14625
|
// 全局层 = 写**意图**(0.21.2):off 之后仍被会话认领的来源保持启用(租约),
|
|
14198
|
-
//
|
|
14626
|
+
// 只有「全部关闭」才切断它们。
|
|
14199
14627
|
setSourceIntent(root, srcOn ? 'off' : 'on');
|
|
14200
14628
|
},
|
|
14201
14629
|
}));
|
|
14202
|
-
//
|
|
14630
|
+
// 技能来源没有逐条「全部关闭」:关闭只改默认,正在用它的会话 / 工作区照旧运行(租约),
|
|
14203
14631
|
// 页头「全部关闭」才把两格(技能 + 来源)的租约一起收掉。
|
|
14204
14632
|
// 旧版本留下的 blocked 仍要给出口 —— 那颗开关在 blocked 下是灰的,只能从这里恢复。
|
|
14205
14633
|
if (!scopeIsSession() && intentHere === 'blocked') {
|
|
@@ -15410,6 +15838,8 @@ function enabledMemoryCount(rules) {
|
|
|
15410
15838
|
var busy = bs[0], setBusy = bs[1]
|
|
15411
15839
|
var rs = React.useState(null)
|
|
15412
15840
|
var result = rs[0], setResult = rs[1]
|
|
15841
|
+
// 场景徽章那颗「×」的请求在途标记(`onRelease` 走这里,徽章内部的 busy 管不到)。
|
|
15842
|
+
var sceneReleaseBusy = React.useRef(null)
|
|
15413
15843
|
var ups = useUndoState()
|
|
15414
15844
|
var undo = ups[0], setUndo = ups[1], dismissUndo = ups[2]
|
|
15415
15845
|
var ms = React.useState(null)
|
|
@@ -16812,6 +17242,7 @@ function enabledMemoryCount(rules) {
|
|
|
16812
17242
|
name: item.name,
|
|
16813
17243
|
desc: item.description || null,
|
|
16814
17244
|
// 单行:描述截断排在名字右边(全文在悬浮里),一屏多看几条(用户 2026-11-06)。
|
|
17245
|
+
descTitle: item.description || null,
|
|
16815
17246
|
compact: true,
|
|
16816
17247
|
// 按模式配的工具限制摘要(没配就不显示):场景改不了会话的模式,
|
|
16817
17248
|
// 但要让用户看得见"这条人设在某些模式下是被限工具的"。
|
|
@@ -17273,7 +17704,7 @@ function enabledMemoryCount(rules) {
|
|
|
17273
17704
|
scopeForgetSceneLeases()
|
|
17274
17705
|
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
17275
17706
|
}
|
|
17276
|
-
/**
|
|
17707
|
+
/** 单张场景卡的「全部关闭」:只退出进入过这一场的对话 / 工作区。 */
|
|
17277
17708
|
function stopOneScene(name) {
|
|
17278
17709
|
setBusy(true); setResult(null)
|
|
17279
17710
|
apiCall('scope-stop-now', { domain: 'scene', key: name }).then(function (res) {
|
|
@@ -17293,7 +17724,12 @@ function enabledMemoryCount(rules) {
|
|
|
17293
17724
|
var id = String((d && d.id) || '')
|
|
17294
17725
|
var name = String((d && d.title) || id)
|
|
17295
17726
|
if (id === '') return
|
|
17727
|
+
// 徽章自带的 busy 只在它自己发请求时置位(`onRelease` 是立即返回的)——
|
|
17728
|
+
// 双击同一行会叠出两次 `scope-set`,第二次还会把已成功的提示再报一遍。
|
|
17729
|
+
if (sceneReleaseBusy.current !== null) return
|
|
17730
|
+
sceneReleaseBusy.current = id
|
|
17296
17731
|
apiCall('scope-set', { sessionId: id, domain: 'scene', value: null }).then(function (res) {
|
|
17732
|
+
sceneReleaseBusy.current = null
|
|
17297
17733
|
if (res && res.ok === false) {
|
|
17298
17734
|
showPluginToast(t('scope.lease.releaseFailed', { title: name, error: translateError(t, res) || t('scope.lease.unknownError') }), 'err')
|
|
17299
17735
|
return
|
|
@@ -17302,6 +17738,7 @@ function enabledMemoryCount(rules) {
|
|
|
17302
17738
|
// 全局快照有 150ms 的短 TTL:立刻重拉可能还是写前那一份。
|
|
17303
17739
|
setTimeout(function () { refreshScope({ silent: true }) }, 400)
|
|
17304
17740
|
}).catch(function (e) {
|
|
17741
|
+
sceneReleaseBusy.current = null
|
|
17305
17742
|
showPluginToast(t('scope.lease.releaseFailed', { title: name, error: errMsg(e) || t('scope.lease.unknownError') }), 'err')
|
|
17306
17743
|
})
|
|
17307
17744
|
}
|
|
@@ -17312,7 +17749,9 @@ function enabledMemoryCount(rules) {
|
|
|
17312
17749
|
* 哪几个,那颗「×」让其中一个退出这个场景。
|
|
17313
17750
|
*/
|
|
17314
17751
|
function sceneLeaseTag(name) {
|
|
17315
|
-
|
|
17752
|
+
// 全局粒度下会话层整层不读(`scope-set` 也直接拒写)—— 这里的「谁在临时运行」
|
|
17753
|
+
// 既不生效、那颗「×」也只会报错,整颗徽章都不该出现。
|
|
17754
|
+
if (scopeIsSession() || scopeIsGlobalMode()) return null
|
|
17316
17755
|
var count = scopeSceneLeaseCount(name)
|
|
17317
17756
|
if (!(count > 0)) return null
|
|
17318
17757
|
return React.createElement(LeaseTagBadge, {
|
|
@@ -17838,7 +18277,7 @@ function enabledMemoryCount(rules) {
|
|
|
17838
18277
|
}
|
|
17839
18278
|
/**
|
|
17840
18279
|
* 页头「全部关闭」:把各会话 / 工作区 / 场景里单独开着的人设一并停掉。
|
|
17841
|
-
*
|
|
18280
|
+
* 与快捷提示词同一条:只改全局启停名单停不到别的对话,得走全部关闭 op 清各层认领。
|
|
17842
18281
|
*/
|
|
17843
18282
|
function stopAllSubagents() {
|
|
17844
18283
|
var keys = scopeLeaseKeys('subagents')
|
|
@@ -17854,7 +18293,7 @@ function enabledMemoryCount(rules) {
|
|
|
17854
18293
|
scopeForgetLeases('subagents', keys)
|
|
17855
18294
|
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
17856
18295
|
}
|
|
17857
|
-
/**
|
|
18296
|
+
/** 单条人设的「全部关闭」:清掉各对话 / 工作区单独打开它的覆盖,全局启停不动。 */
|
|
17858
18297
|
function stopOnePersona(name) {
|
|
17859
18298
|
setResult(null)
|
|
17860
18299
|
setBusy(true)
|
|
@@ -19198,7 +19637,7 @@ function enabledMemoryCount(rules) {
|
|
|
19198
19637
|
}
|
|
19199
19638
|
/**
|
|
19200
19639
|
* 页头「全部关闭」:把各会话 / 工作区 / 场景里单独开着的记忆一并停掉。
|
|
19201
|
-
* 只改全局索引停不到别的对话 ——
|
|
19640
|
+
* 只改全局索引停不到别的对话 —— 那些是各层自己的认领,得走全部关闭 op 清掉。
|
|
19202
19641
|
*/
|
|
19203
19642
|
function stopAllMemories() {
|
|
19204
19643
|
var keys = scopeLeaseKeys('memory')
|
|
@@ -19213,7 +19652,7 @@ function enabledMemoryCount(rules) {
|
|
|
19213
19652
|
scopeForgetLeases('memory', keys)
|
|
19214
19653
|
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
19215
19654
|
}
|
|
19216
|
-
/**
|
|
19655
|
+
/** 单条记忆的「全部关闭」:清掉各对话 / 工作区单独打开它的覆盖,全局启停不动。 */
|
|
19217
19656
|
function stopOneMemory(rule) {
|
|
19218
19657
|
var id = String(rule.id)
|
|
19219
19658
|
setBusy(true); setResult(null)
|
|
@@ -21444,6 +21883,8 @@ function enabledMemoryCount(rules) {
|
|
|
21444
21883
|
// 只有真渲染才看得出挤不挤(同 `_pages.VersionBadge` 那条理由)。
|
|
21445
21884
|
_pages.TrashModal = TrashModal
|
|
21446
21885
|
_pages.RetentionSelect = RetentionSelect
|
|
21886
|
+
// 租约浮窗:行距与「×」贴边这类排版只有真渲染才看得出,预览脚本直接渲染它。
|
|
21887
|
+
_pages.LeaseTagBadge = LeaseTagBadge
|
|
21447
21888
|
},
|
|
21448
21889
|
}
|
|
21449
21890
|
return module.exports
|