dsh-plugin-tool-management 0.22.0 → 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 +80 -0
- package/README.md +8 -7
- package/README_EN.md +8 -7
- package/docs/UPDATE.md +2 -0
- package/lib/client.js +1162 -185
- package/lib/compat/capability-specs.js +400 -1
- package/lib/compat/host-contracts.js +350 -6
- 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/host-names.js +18 -0
- package/lib/index.js +298 -25
- package/lib/mcp/manager.js +23 -3
- 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/scenes/candidates.js +4 -1
- package/lib/scope/intent.js +77 -1
- package/lib/subagents/tool-filter.js +2 -2
- package/lib/tool-table-switch.js +2 -2
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -17,6 +17,15 @@ window.__ModuleLoader__.load({
|
|
|
17
17
|
var exports = module.exports
|
|
18
18
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' })
|
|
19
19
|
const React = require('react')
|
|
20
|
+
/**
|
|
21
|
+
* `react-dom`(只取 `createPortal`):浮窗要挂到 `document.body` 上 ——
|
|
22
|
+
* 挂在面板里会被祖先的 `overflow:hidden` 裁掉(用户 2026-11-05 实测的「穿模」:
|
|
23
|
+
* 浮窗被来源卡片裁掉一半,底下一张卡片的内容透上来)。
|
|
24
|
+
* 拿不到就退回「就地渲染」:功能在,观感差一点。
|
|
25
|
+
* @type {any}
|
|
26
|
+
*/
|
|
27
|
+
var ReactDOM = null
|
|
28
|
+
try { ReactDOM = require('react-dom') } catch (e) { ReactDOM = null }
|
|
20
29
|
|
|
21
30
|
// 本插件自己的设计变量(宿主那套是 `--dsw-*`)。告警色此前在 12 条规则里各写一遍
|
|
22
31
|
// 十六进制字面量,换主题要改 12 次 —— 收敛成 `--dsm-warn`,字面量只留下面那一处。
|
|
@@ -209,6 +218,39 @@ button.dsm-qty:disabled{cursor:default}
|
|
|
209
218
|
.dsm-source-body .dsm-source{border:0;border-radius:0;border-bottom:1px solid var(--dsw-alias-border-l1)}
|
|
210
219
|
.dsm-source-body .dsm-source:last-child{border-bottom:0}
|
|
211
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
|
+
/* 中性标签:灰边框 + 主色字(用户 2026-11-06:MCP 的「未运行」不该是红的 —— 没跑起来不是故障)。 */
|
|
222
|
+
.dsm-tag-quiet{border-color:var(--dsw-alias-border-l3);color:var(--dsw-alias-label-primary)}
|
|
223
|
+
/* 租约浮窗(悬在「临时运行 · N 个对话」徽章上):一行一个认领者,对话标题在左、
|
|
224
|
+
工作区弱化成行尾后缀、放行按钮贴右边。早先按工作区分组时,组头与缩进各占一行,
|
|
225
|
+
只有一两个对话时整块像张空卡片(用户反馈「太多空白」)——分组只保留排序意义,不再占行。
|
|
226
|
+
固定定位 + 视口坐标 —— 徽章所在的列表行是 overflow:hidden,绝对定位会被裁掉
|
|
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}
|
|
247
|
+
/* 每行末尾那颗「×」:只放开这一个对话的临时运行,其余对话照旧(认领是逐个对话记的)。 */
|
|
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)}
|
|
250
|
+
.dsm-lease-pop-x:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
|
|
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}
|
|
212
254
|
/* 开关与官方同款(用户 2026-10-18:「switch 按键统一和官方一样的模板」→「改成完全一样」):
|
|
213
255
|
36×20 外壳 + 16px 拇指、内边距 2px、滑块位移 16px、开态用 brand-primary,
|
|
214
256
|
关态拇指用 switch-thumb —— 尺寸与配色照抄宿主设置面板那颗。
|
|
@@ -579,7 +621,12 @@ button.dsm-qty:disabled{cursor:default}
|
|
|
579
621
|
.dsm-compat-code{font-family:var(--ds-font-family-code,ui-monospace,SFMono-Regular,Consolas,monospace);font-size:11px}
|
|
580
622
|
.dsm-compat-list{margin:0;padding-left:16px}.dsm-compat-list li+li{margin-top:4px}
|
|
581
623
|
@container(max-width:640px){.dsm-compat-grid{grid-template-columns:1fr}}
|
|
582
|
-
|
|
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}}
|
|
583
630
|
/* 顶部栏右上角那一行(版本号 · 检查更新 · GitHub):排在**作用域行**的右端,页签行独占一行。
|
|
584
631
|
位置由 .dsm-panel-head 的网格排(area links)—— 它要和 GitHub 图标并排(用户 2026-10-22),
|
|
585
632
|
塞进 .dsm-tabs-shell 就只能挤在页签那一行里。 */
|
|
@@ -982,6 +1029,13 @@ html,body{scrollbar-gutter:stable}.dsm-settings-scroll-host{overflow-y:scroll!im
|
|
|
982
1029
|
.dsm-rowselect-box{display:inline-flex;flex:none;width:14px;height:14px;align-items:center;justify-content:center;border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsm-radius-s);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary-foreground)}
|
|
983
1030
|
.dsm-rowselect-on .dsm-rowselect-box{border-color:var(--dsw-alias-button-primary-fill);background:var(--dsw-alias-button-primary-fill)}
|
|
984
1031
|
.dsm-rowselect-main{display:flex;min-width:0;flex:1;flex-direction:column;gap:2px}
|
|
1032
|
+
/* 单行版(compact):名字与描述并排一行,描述吃掉余量并截断 —— 一屏多看一半条目
|
|
1033
|
+
(场景档案的四个集,user 2026-11-06)。 */
|
|
1034
|
+
.dsm-rowselect-compact .dsm-rowselect-main{flex-direction:row;align-items:baseline;gap:8px}
|
|
1035
|
+
/* 单行版里**名字不缩**(用户 2026-11-06:「标题名字要全部展示」)—— 挤掉的是描述,
|
|
1036
|
+
不是名字。 */
|
|
1037
|
+
.dsm-rowselect-compact .dsm-rowselect-name{flex:none;max-width:100%}
|
|
1038
|
+
.dsm-rowselect-compact .dsm-rowselect-desc{min-width:0;flex:1 1 auto}
|
|
985
1039
|
.dsm-rowselect-name{overflow:hidden;font-size:13px;line-height:18px;text-overflow:ellipsis;white-space:nowrap}
|
|
986
1040
|
.dsm-rowselect-desc{overflow:hidden;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:16px;text-overflow:ellipsis;white-space:nowrap}
|
|
987
1041
|
.dsm-rowselect-meta{display:flex;align-items:center;gap:4px;flex:none;color:var(--dsw-alias-label-tertiary);font-size:12px;white-space:nowrap}
|
|
@@ -1172,6 +1226,9 @@ html,body{scrollbar-gutter:stable}.dsm-settings-scroll-host{overflow-y:scroll!im
|
|
|
1172
1226
|
4px 的 flex 间距对**文字**来说不够,两段会连成一句读不出边界;点由后一件的 ::before 提供,
|
|
1173
1227
|
所以只有一段时不会多出孤点。 */
|
|
1174
1228
|
.dsm-listrow-meta>*+*::before{content:"·";margin-right:4px;color:var(--dsw-alias-label-tertiary)}
|
|
1229
|
+
/* 租约徽章自带一圈虚线边框,前面再挂一个「·」就像坏掉的标点(用户 2026-11-05 报障):
|
|
1230
|
+
徽章是**独立的一枚**,不是元信息里的一段文字,不需要分隔点。 */
|
|
1231
|
+
.dsm-listrow-meta>.dsm-tag-lease::before{content:none}
|
|
1175
1232
|
.dsm-listrow-meta:empty{display:none}
|
|
1176
1233
|
.dsm-listrow-meta-desc{min-width:0;overflow:hidden;text-overflow:ellipsis}
|
|
1177
1234
|
.dsm-listrow-meta-info{flex:none;color:var(--dsw-alias-label-tertiary)}
|
|
@@ -1232,6 +1289,19 @@ html,body{scrollbar-gutter:stable}.dsm-settings-scroll-host{overflow-y:scroll!im
|
|
|
1232
1289
|
.dsm-setrow-desc{overflow:hidden;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:16px;text-overflow:ellipsis;white-space:nowrap}
|
|
1233
1290
|
.dsm-setrow-control{display:flex;flex:none;align-items:center;gap:8px}
|
|
1234
1291
|
.dsm-setrow .dsm-btn{min-width:92px}
|
|
1292
|
+
/* 场景档案的技能集:**按来源分组**(用户 2026-11-06:平铺按技能名排,一屏四十六条
|
|
1293
|
+
混在一起很乱)。组头 = 一颗组勾选框(全选 / 全不选这一整个来源)+ 来源名(点它
|
|
1294
|
+
展开 / 收起)+ "N/M";组内按技能名排。 */
|
|
1295
|
+
.dsm-skill-groups{display:flex;flex-direction:column;gap:2px}
|
|
1296
|
+
.dsm-skill-group{display:flex;flex-direction:column}
|
|
1297
|
+
.dsm-skill-group-head{display:flex;align-items:center;gap:8px;padding:4px 8px;border-radius:var(--dsm-radius-s)}
|
|
1298
|
+
.dsm-skill-group-head:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
1299
|
+
.dsm-skill-group-name{display:flex;min-width:0;flex:1;align-items:center;gap:4px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;font-weight:600;text-align:left;cursor:pointer}
|
|
1300
|
+
.dsm-skill-group-caret{flex:none}
|
|
1301
|
+
.dsm-skill-group-count{flex:none;color:var(--dsw-alias-label-tertiary);font-size:12px;font-variant-numeric:tabular-nums}
|
|
1302
|
+
.dsm-skill-group-items{padding-left:16px}
|
|
1303
|
+
/* 部分勾选:框里一根横杠(全选是主色实底 + 白勾,见 .dsm-rowselect-box-on)。 */
|
|
1304
|
+
.dsm-rowselect-dash{display:block;width:8px;height:2px;border-radius:1px;background:var(--dsw-alias-label-primary)}
|
|
1235
1305
|
/* RowCheck:框本身是控制件(button)—— 去按钮默认内边距、给禁用态;选中态与
|
|
1236
1306
|
RowSelect 的选中框同款主色实底(原规则钉在 .dsm-rowselect-on 父级上,独立框用这
|
|
1237
1307
|
条直接落在框上)。 */
|
|
@@ -1330,15 +1400,48 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
1330
1400
|
}).catch(function () { return ioDefaultDir })
|
|
1331
1401
|
}
|
|
1332
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
|
+
*/
|
|
1333
1416
|
function ensureCss() {
|
|
1334
|
-
if (typeof document === 'undefined') return
|
|
1417
|
+
if (typeof document === 'undefined') return function () {}
|
|
1335
1418
|
const id = 'dsh-plugin-tool-management'
|
|
1336
|
-
|
|
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
|
+
}
|
|
1337
1438
|
const tag = document.createElement('style')
|
|
1338
1439
|
tag.dataset.plugin = id
|
|
1339
1440
|
tag.dataset.pluginCss = id
|
|
1441
|
+
tag.setAttribute(REFS, '1')
|
|
1340
1442
|
tag.textContent = CSS
|
|
1341
1443
|
document.head.appendChild(tag)
|
|
1444
|
+
return retain(tag)
|
|
1342
1445
|
}
|
|
1343
1446
|
|
|
1344
1447
|
/**
|
|
@@ -1636,13 +1739,16 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
1636
1739
|
* 行才是可点目标;14px 的框是纯视觉(aria-hidden),给它挂 role 只会造出第二个
|
|
1637
1740
|
* 不可聚焦的 checkbox。动作槽里的按钮自己 stopPropagation,点动作不翻勾。
|
|
1638
1741
|
* props:checked / disabled / name / desc / descTitle / meta / actions / onChange / key。
|
|
1742
|
+
* `compact`:**单行版** —— 名字与描述并排一行(描述截断,全文在 descTitle 里)。场景
|
|
1743
|
+
* 档案的四个集用它:一屏能多看一半条目(用户 2026-11-06:「这样能展示更多条」)。
|
|
1639
1744
|
* 2026-10-11 切片五从 42 片上移:快照导入预览(兼容页)也要用行选择。
|
|
1640
1745
|
*/
|
|
1641
1746
|
function RowSelect(props) {
|
|
1642
1747
|
var disabled = props.disabled === true
|
|
1643
1748
|
var toggle = function () { if (!disabled && props.onChange) props.onChange() }
|
|
1644
1749
|
return h('div', {
|
|
1645
|
-
className: 'dsm-rowselect' + (props.checked ? ' dsm-rowselect-on' : '') + (disabled ? ' dsm-rowselect-disabled' : ''),
|
|
1750
|
+
className: 'dsm-rowselect' + (props.checked ? ' dsm-rowselect-on' : '') + (disabled ? ' dsm-rowselect-disabled' : '') + (props.compact ? ' dsm-rowselect-compact' : ''),
|
|
1751
|
+
|
|
1646
1752
|
role: 'checkbox', 'aria-checked': props.checked === true, 'aria-disabled': disabled || undefined,
|
|
1647
1753
|
tabIndex: disabled ? -1 : 0,
|
|
1648
1754
|
onClick: toggle,
|
|
@@ -2360,13 +2466,13 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2360
2466
|
* (颜色统一为绿/灰,这个标记只留给"来源点"与统计用)。全局层恒 `scoped: false`。
|
|
2361
2467
|
*/
|
|
2362
2468
|
function scopeFlag(domain, key, globalValue) {
|
|
2363
|
-
// 全局 blocked
|
|
2469
|
+
// 全局 blocked(旧版「全部关闭」留下的持久停机)压过一切会话层(与后端 `resolveResource` 同一条):会话里的覆盖、
|
|
2364
2470
|
// 场景勾选、逐工具 / 单条技能的推导都不能把它显成开着 —— 否则开关是绿的、模型调不到。
|
|
2365
2471
|
// 技能还要看所在来源:来源被 blocked 时,技能级开着也加载不到。
|
|
2366
2472
|
if (domain === 'mcp' || domain === 'skills' || domain === 'skillSources') {
|
|
2367
2473
|
var intentState = scopeIntentOf(domain, key)
|
|
2368
2474
|
if (intentState === 'blocked') return { value: false, scoped: false }
|
|
2369
|
-
// 意图比列表里那份 `globalOn`
|
|
2475
|
+
// 意图比列表里那份 `globalOn` 新:写完全部关闭后列表还没重读,全局开关也该立刻翻过去。
|
|
2370
2476
|
if (intentState === 'on') globalValue = true
|
|
2371
2477
|
else if (intentState === 'off') globalValue = false
|
|
2372
2478
|
}
|
|
@@ -2387,7 +2493,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2387
2493
|
//
|
|
2388
2494
|
// MCP 服务器与技能来源两格的全局开关**不是**补丁 / 来源状态,而是意图:
|
|
2389
2495
|
// on —— 全局启用;off —— 全局关闭(有会话还在用就保持运行,即租约);
|
|
2390
|
-
// blocked ——
|
|
2496
|
+
// blocked —— 持久停机(旧版全部关闭;压过租约与一切会话层)。
|
|
2391
2497
|
// 界面上的全局开关读意图;"临时运行 · N 个对话"来自 `leases`,它是全局 off 却能跑的
|
|
2392
2498
|
// 唯一解释。会话层不显示意图(那一层只回答"这个对话看不看得到")。
|
|
2393
2499
|
/** 某一格的全局意图:`'on' | 'off' | 'blocked' | null`(没记录 = 跟随运行态)。 */
|
|
@@ -2399,10 +2505,47 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2399
2505
|
/** 这一格有几个会话在认领(租约)。全局层才读得到;会话层返回 0。 */
|
|
2400
2506
|
function scopeLeaseCount(domain, key) {
|
|
2401
2507
|
if (scopeIsSession()) return 0
|
|
2508
|
+
// 来源格算的是**并集**(来源自己 + 它底下那些技能):见 `scopeLeaseDetails`。
|
|
2509
|
+
if (domain === 'skillSources') return scopeLeaseDetails('skillSources', key).length
|
|
2402
2510
|
var leases = scopeState.global && scopeState.global.leases ? scopeState.global.leases[domain] : null
|
|
2403
2511
|
var n = leases && typeof leases === 'object' ? Number(leases[key]) : 0
|
|
2404
2512
|
return Number.isFinite(n) && n > 0 ? Math.floor(n) : 0
|
|
2405
2513
|
}
|
|
2514
|
+
/**
|
|
2515
|
+
* 这一格的租约认领者(`[{ id, title, cwd, keys }]`):徽章浮窗逐行列出"是哪几个对话"。
|
|
2516
|
+
*
|
|
2517
|
+
* 来源格(`skillSources`)那份是**并集**(来源自己 + 它底下那些技能)—— 服务端算好:
|
|
2518
|
+
* 默认来源(官方内置 / DSH 技能)全局开着、租约只落在底下的技能上,客户端自己再并一遍
|
|
2519
|
+
* 就会与计数对不上。
|
|
2520
|
+
*/
|
|
2521
|
+
function scopeLeaseDetails(domain, key) {
|
|
2522
|
+
if (scopeIsSession()) return []
|
|
2523
|
+
var all = scopeState.global && scopeState.global.leaseDetails ? scopeState.global.leaseDetails : null
|
|
2524
|
+
var byKey = all && typeof all === 'object' ? all[domain] : null
|
|
2525
|
+
var list = byKey && typeof byKey === 'object' ? byKey[key] : null
|
|
2526
|
+
return Array.isArray(list) ? list : []
|
|
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
|
+
}
|
|
2406
2549
|
/** 这一域此刻有租约的键(全局层专用;会话层返回空)。「全部关闭」按它取目标集。 */
|
|
2407
2550
|
function scopeLeaseKeys(domain) {
|
|
2408
2551
|
if (scopeIsSession()) return []
|
|
@@ -2411,7 +2554,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2411
2554
|
return Object.keys(leases).filter(function (key) { return Number(leases[key]) > 0 })
|
|
2412
2555
|
}
|
|
2413
2556
|
/**
|
|
2414
|
-
*
|
|
2557
|
+
* 全部关闭成功后**就地**摘掉本地快照里的租约与意图,不等 `scope-get` 回来。
|
|
2415
2558
|
*
|
|
2416
2559
|
* 为什么不能改成再拉一次:服务端快照有短 TTL,紧接着的 `scope-get` 可能仍是写前的
|
|
2417
2560
|
* 那一份 —— 徽章会先消失又冒回来;而且整层重拉会让列表按新状态重新定序,用户刚打开的
|
|
@@ -2435,6 +2578,18 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2435
2578
|
nextLeases[domain] = domainLeases
|
|
2436
2579
|
patch.leases = nextLeases
|
|
2437
2580
|
}
|
|
2581
|
+
// 认领者名单跟计数同生共死:计数摘了还留着名单,浮窗会列出已经不认领的对话。
|
|
2582
|
+
var details = global.leaseDetails || {}
|
|
2583
|
+
var domainDetails = Object.assign({}, details[domain] || {})
|
|
2584
|
+
var detailsChanged = false
|
|
2585
|
+
list.forEach(function (key) {
|
|
2586
|
+
if (domainDetails[key] !== undefined) { delete domainDetails[key]; detailsChanged = true }
|
|
2587
|
+
})
|
|
2588
|
+
if (detailsChanged) {
|
|
2589
|
+
var nextDetails = Object.assign({}, details)
|
|
2590
|
+
nextDetails[domain] = domainDetails
|
|
2591
|
+
patch.leaseDetails = nextDetails
|
|
2592
|
+
}
|
|
2438
2593
|
if (domain === 'mcp' || domain === 'skills' || domain === 'skillSources') {
|
|
2439
2594
|
var intent = global.intent || {}
|
|
2440
2595
|
var nextDomainIntent = Object.assign({}, intent[domain] || {})
|
|
@@ -2443,9 +2598,55 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2443
2598
|
nextIntent[domain] = nextDomainIntent
|
|
2444
2599
|
patch.intent = nextIntent
|
|
2445
2600
|
}
|
|
2446
|
-
if (patch.leases === undefined && patch.intent === undefined) return
|
|
2601
|
+
if (patch.leases === undefined && patch.intent === undefined && patch.leaseDetails === undefined) return
|
|
2447
2602
|
setScopeState({ global: Object.assign({}, global, patch) })
|
|
2448
2603
|
}
|
|
2604
|
+
/**
|
|
2605
|
+
* 释放**一个**对话的认领之后,就地改本地快照(计数减一、名单摘掉一条)。
|
|
2606
|
+
*
|
|
2607
|
+
* 为什么不能等服务端重拉:全局快照有 150ms 的短 TTL,紧接着的 `scope-get` 可能还是
|
|
2608
|
+
* 写前那一份 —— 徽章会先留着又消失。摘干净之后由调用方补一次静默重拉对齐。
|
|
2609
|
+
*
|
|
2610
|
+
* 工作区粒度下认领是**按工作区**记的:放掉一个对话等于放掉整个工作区,这一格里
|
|
2611
|
+
* 同工作区的那些对话一起摘掉(与服务端写到的层一致)。
|
|
2612
|
+
*/
|
|
2613
|
+
function scopeForgetLeaseSession(domain, key, sessionId) {
|
|
2614
|
+
if (scopeIsSession()) return
|
|
2615
|
+
var global = scopeState.global
|
|
2616
|
+
if (!global) return
|
|
2617
|
+
var id = String(sessionId || '')
|
|
2618
|
+
var leases = global.leases || {}
|
|
2619
|
+
var details = global.leaseDetails || {}
|
|
2620
|
+
var domainDetails = Object.assign({}, details[domain] || {})
|
|
2621
|
+
var list = Array.isArray(domainDetails[key]) ? domainDetails[key].slice() : []
|
|
2622
|
+
if (list.length === 0) return
|
|
2623
|
+
var found = false
|
|
2624
|
+
var cwd = ''
|
|
2625
|
+
list.forEach(function (d) {
|
|
2626
|
+
if (found) return
|
|
2627
|
+
if (String((d && d.id) || '') === id) { found = true; cwd = String((d && d.cwd) || '') }
|
|
2628
|
+
})
|
|
2629
|
+
if (!found) return
|
|
2630
|
+
var workspaceKey = scopeWorkspacePathKey(cwd)
|
|
2631
|
+
var keep = list.filter(function (d) {
|
|
2632
|
+
if (String((d && d.id) || '') === id) return false
|
|
2633
|
+
if (scopeIsWorkspace() && workspaceKey !== '' && scopeWorkspacePathKey(d && d.cwd) === workspaceKey) return false
|
|
2634
|
+
return true
|
|
2635
|
+
})
|
|
2636
|
+
var domainLeases = Object.assign({}, leases[domain] || {})
|
|
2637
|
+
if (keep.length > 0) {
|
|
2638
|
+
domainDetails[key] = keep
|
|
2639
|
+
domainLeases[key] = keep.length
|
|
2640
|
+
} else {
|
|
2641
|
+
delete domainDetails[key]
|
|
2642
|
+
delete domainLeases[key]
|
|
2643
|
+
}
|
|
2644
|
+
var nextLeases = Object.assign({}, leases)
|
|
2645
|
+
nextLeases[domain] = domainLeases
|
|
2646
|
+
var nextDetails = Object.assign({}, details)
|
|
2647
|
+
nextDetails[domain] = domainDetails
|
|
2648
|
+
setScopeState({ global: Object.assign({}, global, { leases: nextLeases, leaseDetails: nextDetails }) })
|
|
2649
|
+
}
|
|
2449
2650
|
/** 有多少个会话 / 工作区进入了场景(全局层专用;会话层返回 0)。传场景名只数那一个。 */
|
|
2450
2651
|
function scopeSceneLeaseCount(sceneName) {
|
|
2451
2652
|
if (scopeIsSession()) return 0
|
|
@@ -2457,7 +2658,18 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2457
2658
|
var n = Number(raw)
|
|
2458
2659
|
return Number.isFinite(n) && n > 0 ? Math.floor(n) : 0
|
|
2459
2660
|
}
|
|
2460
|
-
/**
|
|
2661
|
+
/**
|
|
2662
|
+
* 这一场有谁在用(场景层):徽章浮窗逐行列出是哪些对话 / 工作区进入了这个场景。
|
|
2663
|
+
*
|
|
2664
|
+
* 与 `scopeSceneLeaseCount` 同一份服务端数据(`global.sceneLeaseDetails`),全局层才读得到。
|
|
2665
|
+
*/
|
|
2666
|
+
function scopeSceneLeaseDetails(sceneName) {
|
|
2667
|
+
if (scopeIsSession()) return []
|
|
2668
|
+
var all = scopeState.global && scopeState.global.sceneLeaseDetails ? scopeState.global.sceneLeaseDetails : null
|
|
2669
|
+
var list = all && typeof all === 'object' ? all[String(sceneName)] : null
|
|
2670
|
+
return Array.isArray(list) ? list : []
|
|
2671
|
+
}
|
|
2672
|
+
/** 全部关闭某个(或全部)场景后,就地改本地计数 —— 理由同 `scopeForgetLeases`。 */
|
|
2461
2673
|
function scopeForgetSceneLeases(sceneName) {
|
|
2462
2674
|
if (scopeIsSession()) return
|
|
2463
2675
|
var global = scopeState.global
|
|
@@ -2774,6 +2986,22 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
2774
2986
|
var parts = trimmed.split(/[\\/]/)
|
|
2775
2987
|
return parts.length ? parts[parts.length - 1] : trimmed
|
|
2776
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
|
+
}
|
|
2777
3005
|
/** 工作区键(`ws:<cwd>`)→ 显示名(键里带完整路径,去掉前缀再取末段)。 */
|
|
2778
3006
|
function scopeWorkspaceNameFromKey(key) {
|
|
2779
3007
|
var raw = String(key || '')
|
|
@@ -3096,18 +3324,23 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
3096
3324
|
batch: 'compat.op.batch', delete: 'compat.op.delete',
|
|
3097
3325
|
}
|
|
3098
3326
|
/**
|
|
3099
|
-
*
|
|
3327
|
+
* 本插件依赖的**必备**宿主契约能力 id(capability-specs.ts 里没有等价兜底、缺席即功能
|
|
3328
|
+
* 少一半的那些)。
|
|
3100
3329
|
*
|
|
3101
3330
|
* 与上面那排 action 的区别:action 是"这个操作走哪条路",这些是"某个契约还在不在"。
|
|
3102
3331
|
* 它们缺了都不抛错、只是功能少一半,所以单独一块而不是混进 action 表 —— 混进去会让
|
|
3103
3332
|
* "删除不可用"和"工具限制失效"看起来一样严重,实际后者不影响你删任何东西。
|
|
3104
3333
|
*
|
|
3105
|
-
*
|
|
3106
|
-
*
|
|
3107
|
-
*
|
|
3334
|
+
* 与服务端 `CONTRACT_CAPABILITY_IDS` 的关系:那边只映射 feature-overview 里**有独立行**
|
|
3335
|
+
* 的四条;这里还包含没有独立行、但同属必备契约的能力。两处都按能力 id 过滤 findings,
|
|
3336
|
+
* 任一处改名都会让对应条目在界面上静默消失,所以改了能力 id 就一起登记。
|
|
3108
3337
|
*/
|
|
3109
3338
|
var CONTRACT_CAPABILITY_IDS = [
|
|
3110
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',
|
|
3111
3344
|
]
|
|
3112
3345
|
/**
|
|
3113
3346
|
* 「最近改动」流水里 op 的人类名(0.15.0 B2)。
|
|
@@ -3223,20 +3456,27 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
3223
3456
|
const findings = (data && data.findings) || []
|
|
3224
3457
|
const byId = {}
|
|
3225
3458
|
findings.forEach(function (f) { byId[f.id] = f })
|
|
3226
|
-
|
|
3459
|
+
// 缺席的 id 不能当成满足:那说明能力表被删 / 改名了,路由却仍会走一条已不再被探测的
|
|
3460
|
+
// 破坏性路径。与服务端 routeFor 同口径(fail-closed),否则页面说"可用"、点下去被拒。
|
|
3461
|
+
const ok = function (id) { return byId[id] !== undefined && byId[id].state === 'ok' }
|
|
3227
3462
|
const routes = {}
|
|
3228
|
-
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'
|
|
3229
3465
|
routes.archive = ok('workspace.archive-native') ? 'native' : (ok('workspace.enqueue') && ok('workspace.set-state') ? 'adapter' : 'none')
|
|
3230
3466
|
routes.unarchive = ok('workspace.unarchive-native') ? 'native' : (ok('workspace.enqueue') && ok('workspace.set-state') ? 'adapter' : 'none')
|
|
3231
3467
|
routes.batch = ok('workspace.batch-native') ? 'native' : (ok('workspace.enqueue') && ok('workspace.set-state') ? 'adapter' : 'none')
|
|
3232
|
-
// 与服务端 OPERATION_ROUTES 同源(src/compat/
|
|
3468
|
+
// 与服务端 OPERATION_ROUTES 同源(src/compat/host-roots.ts):
|
|
3233
3469
|
// · delete 不要求 `projection.delete-native` —— 宿主自带删除屏障是可选槽位,
|
|
3234
3470
|
// 要求它会把 rc.2 上的删除显示成不可用(服务端有意不要求);
|
|
3235
|
-
// · 但要求 `projection.table-delete` ——
|
|
3471
|
+
// · 但要求 `projection.table-delete` —— 那是运行时的硬前提(表不可删就没法安全删行);
|
|
3472
|
+
// · 还要求 `workspace.read-header` / `sessions.live-access` / `persistence.list` /
|
|
3473
|
+
// `persistence.transcript-locate` —— 删除入口在破坏性步骤之前会硬检查它们,
|
|
3474
|
+
// 不算进路由就会「页面说可用、点下去在链路中段报错」。
|
|
3236
3475
|
routes.delete = ok('workspace.delete-native') ? 'native'
|
|
3237
3476
|
: (ok('workspace.enqueue') && ok('workspace.set-state') && ok('workspace.index-header')
|
|
3238
|
-
&& ok('
|
|
3239
|
-
&& 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')
|
|
3240
3480
|
return routes
|
|
3241
3481
|
}
|
|
3242
3482
|
|
|
@@ -3885,6 +4125,22 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
3885
4125
|
loadBackups(alive)
|
|
3886
4126
|
return function () { alive = false }
|
|
3887
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
|
+
}
|
|
3888
4144
|
// 保存注入设置:先乐观更新界面(点一下就该有反馈),服务端返回值到达后以其为准;
|
|
3889
4145
|
// 失败则重新拉一次。可达性矩阵跟着刷新 —— 芯片要反映新的开关状态。
|
|
3890
4146
|
// `{ok:false}` 与网络异常分开处理:前者是服务端明确拒绝(坏侧车 / 令牌失效),
|
|
@@ -3953,6 +4209,18 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
3953
4209
|
+ blockers.length
|
|
3954
4210
|
+ unverified.length
|
|
3955
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'
|
|
3956
4224
|
const unavailableCount = Object.keys(OPERATION_LABELS).filter(function (op) { return routes[op] === 'none' }).length
|
|
3957
4225
|
|
|
3958
4226
|
const routeClass = function (via) {
|
|
@@ -3981,12 +4249,33 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
3981
4249
|
case 'workspace.delete-native': return t('compat.cap.workspaceDeleteNative')
|
|
3982
4250
|
case 'sessions.detach-live': return t('compat.cap.sessionsDetachLive')
|
|
3983
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')
|
|
3984
4256
|
case 'projection.write': return t('compat.cap.projectionWrite')
|
|
3985
4257
|
case 'projection.table-delete': return t('compat.cap.projectionTableDelete')
|
|
3986
4258
|
case 'agentPreset.register': return t('compat.cap.agentPresetRegister')
|
|
3987
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')
|
|
3988
4274
|
case 'agent.created-event': return t('compat.cap.agentCreatedEvent')
|
|
3989
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')
|
|
3990
4279
|
case 'archive': return t('compat.cap.opArchive')
|
|
3991
4280
|
case 'unarchive': return t('compat.cap.opUnarchive')
|
|
3992
4281
|
case 'batch': return t('compat.cap.opBatch')
|
|
@@ -4020,6 +4309,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
4020
4309
|
case 'slash-commands': return t('compat.ov.slashCommands')
|
|
4021
4310
|
case 'native-delete': return t('compat.ov.nativeDelete')
|
|
4022
4311
|
case 'host-identity': return t('compat.ov.hostIdentity')
|
|
4312
|
+
case 'host-contracts': return t('compat.ov.hostContracts')
|
|
4023
4313
|
case 'memory': return t('compat.ov.memory')
|
|
4024
4314
|
case 'prompts': return t('compat.ov.prompts')
|
|
4025
4315
|
case 'subagents': return t('compat.ov.subagents')
|
|
@@ -4120,6 +4410,13 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
4120
4410
|
if (row.slashTools && row.slashQuickPrompts) return t('compat.ov.slashCommands.on')
|
|
4121
4411
|
return t(row.slashTools ? 'compat.ov.slashCommands.onTools' : 'compat.ov.slashCommands.onQuick')
|
|
4122
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
|
+
}
|
|
4123
4420
|
if (row.key === 'host-identity') {
|
|
4124
4421
|
if (row.state === 'unknown') return t('compat.ov.route.unknown')
|
|
4125
4422
|
if (row.state === 'degraded') return t('compat.ov.hostIdentity.degraded', { list: list(row.blockers) })
|
|
@@ -4703,6 +5000,53 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
4703
5000
|
// 而且"出厂默认关掉"这件事用户不需要为此做什么 —— 要用就勾上,不用管它。
|
|
4704
5001
|
rows)))
|
|
4705
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
|
+
}
|
|
4706
5050
|
// 注入实况:紧挨「注入」设置块下方。数据来自 `injection-live`(宿主读最近活跃会话的
|
|
4707
5051
|
// 可见表面),是"回放"不是"重算"—— 界面显示已注入而模型实际没收到时(场景接管、
|
|
4708
5052
|
// 压制型预设、开关被关、压缩后还没补发),这里一眼可见。
|
|
@@ -4854,27 +5198,34 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
4854
5198
|
// 它自带的 summary 是中文,直接渲染会让英文界面露出中文)。
|
|
4855
5199
|
const findingsN = Array.isArray(data.findings) ? data.findings.length : 0
|
|
4856
5200
|
const degradedN = Array.isArray(data.degraded) ? data.degraded.length : 0
|
|
4857
|
-
//
|
|
4858
|
-
// 「全部可用」——
|
|
4859
|
-
// (2026-09-30 桌面版实测)。
|
|
5201
|
+
// 摘要四形态:能力降级 / 仅身份待处理 / 契约待复核 / 全部可用。后两种都不能说
|
|
5202
|
+
// 「全部可用」—— 横幅已转黄或转红,摘要却报一切正常,两句自相矛盾。
|
|
4860
5203
|
const summaryKey = degradedN > 0 ? 'compat.summary.degraded'
|
|
4861
|
-
: 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
|
|
4862
5207
|
const summaryText = findingsN === 0
|
|
4863
5208
|
? (data.summary || '')
|
|
4864
5209
|
: t(summaryKey)
|
|
4865
5210
|
.replace('{version}', String((data.host && data.host.version) || '?'))
|
|
4866
5211
|
.replace('{ok}', String(findingsN - degradedN))
|
|
4867
5212
|
.replace('{total}', String(findingsN))
|
|
4868
|
-
.replace('{count}', String(
|
|
4869
|
-
push(React.createElement('div', { className: 'dsm-compat-bar' + (
|
|
4870
|
-
React.createElement('span', { className: 'dsm-compat-dot' + (
|
|
4871
|
-
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')),
|
|
4872
5218
|
React.createElement('span', { className: 'dsm-compat-sum' }, summaryText)))
|
|
4873
5219
|
// 诊断包:排障时用户能一键复制一份"环境 + 状态",不必逐项截图。
|
|
4874
5220
|
// 放在结论条下面而不是页脚:有阻塞项时它就在眼前。
|
|
5221
|
+
// 同时给出检测时间:compat-status 有 5s 短 TTL,用户得知道眼前这份结论有多旧。
|
|
4875
5222
|
push(React.createElement('div', { className: 'dsm-feedback-row' },
|
|
4876
5223
|
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-quiet', onClick: copyDiagnostics },
|
|
4877
|
-
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))
|
|
4878
5229
|
|
|
4879
5230
|
// 指标卡:宿主 / 本插件适配版本 / 可用能力(含插件自补的 optional 槽位)。
|
|
4880
5231
|
// 三张卡都只在**有事要说**时带注脚:
|
|
@@ -4979,7 +5330,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
4979
5330
|
React.createElement('div', { className: 'dsm-compat-mod-list dsm-compat-cards' },
|
|
4980
5331
|
degraded.map(function (item) {
|
|
4981
5332
|
return React.createElement('div', { className: 'dsm-compat-mod-row', key: item.id },
|
|
4982
|
-
React.createElement('span', { className: 'dsm-compat-name' }, item.label),
|
|
5333
|
+
React.createElement('span', { className: 'dsm-compat-name' }, capLabel(item.id, item.label)),
|
|
4983
5334
|
React.createElement('span', { className: 'dsm-compat-pill dsm-compat-pill-warn' },
|
|
4984
5335
|
item.fallback === 'native-entry' ? t('compat.fallback.native')
|
|
4985
5336
|
: item.fallback === 'refuse-operation' ? t('compat.fallback.refuse')
|
|
@@ -5004,8 +5355,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5004
5355
|
React.createElement('div', { className: 'dsm-compat-mod-list dsm-compat-cards' },
|
|
5005
5356
|
optionalAbsent.map(function (item) {
|
|
5006
5357
|
return React.createElement('div', { className: 'dsm-compat-mod-row', key: item.id },
|
|
5007
|
-
React.createElement('span', { className: 'dsm-compat-name' }, item.label),
|
|
5008
|
-
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')),
|
|
5009
5362
|
React.createElement('span', { className: 'dsm-compat-mod dsm-compat-mod-self' },
|
|
5010
5363
|
React.createElement('span', { className: 'dsm-compat-label' }, t('compat.reason')),
|
|
5011
5364
|
item.detail))
|
|
@@ -5044,10 +5397,54 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5044
5397
|
React.createElement('span', { className: 'dsm-compat-pill ' + cls }, text))
|
|
5045
5398
|
}))))
|
|
5046
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
|
+
|
|
5047
5444
|
// 裸模块解析(与上面那一块的分工:上面比的是**同一份物理模块**,这里看的是**包还在不在**)。
|
|
5048
5445
|
//
|
|
5049
5446
|
// 为什么分开:上面那 6 个包是插件的 peerDependency,「两份不同拷贝」那种故障只可能发生在
|
|
5050
|
-
// 它们身上;而下面这
|
|
5447
|
+
// 它们身上;而下面这 5 个包是插件按**裸模块名**在运行时 require 的官方包,宿主不要求插件
|
|
5051
5448
|
// 依赖它们。官方撤掉其中一个,对应功能静默降级,而身份比对那一栏根本看不见它们 —— 所以
|
|
5052
5449
|
// 必须在这里列一行。canary 缺失不是「包坏了」,是「该人工复核这条契约」,显示成提示而非红色。
|
|
5053
5450
|
const contractPackages = (data && data.contracts && data.contracts.packages) || []
|
|
@@ -5069,7 +5466,77 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5069
5466
|
}))))
|
|
5070
5467
|
}
|
|
5071
5468
|
|
|
5072
|
-
//
|
|
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
|
+
|
|
5073
5540
|
// 归档宿主的说明排最前 —— 它解释的正是这一排「无法比较」的成因,而且必须讲明白
|
|
5074
5541
|
// **不要去跑 host-deps --fix**:那条命令会把插件的依赖指向 npx 缓存里另一个版本。
|
|
5075
5542
|
if (asarNote) {
|
|
@@ -5123,54 +5590,6 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5123
5590
|
}
|
|
5124
5591
|
}
|
|
5125
5592
|
|
|
5126
|
-
// 预设注入边界:五类内容(记忆 / 全局提示词 / 技能 / MCP / 子智能体)在**每个 Agent
|
|
5127
|
-
// 预设**下到不到得了模型。回答的是"面板标着已注入,模型真的看得到吗"——本插件的
|
|
5128
|
-
// 注入由它自己在每步发出(极简这类预设下默认不发,可用上面的「注入」块强制),
|
|
5129
|
-
// 而全局提示词与技能目录还要看官方那两条行挂没挂(极简都没挂)。单独一块:取不到时
|
|
5130
|
-
// 这一节不显示,不影响上面的结论。
|
|
5131
|
-
//
|
|
5132
|
-
// 排版口径(用户裁定 2026-09-15):每格一枚描边标签,**绿框=能用、红框=不能用、
|
|
5133
|
-
// 灰框=判断不了**;不再出现 ✓/✗ 符号,也不再有任何整行的解释文字 —— 预设损坏与
|
|
5134
|
-
// 解析失败缩成预设名旁边的小标签。MCP 与子智能体两列由宿主侧的 preset-reach 给出。
|
|
5135
|
-
if (presetReach && Array.isArray(presetReach.rows) && presetReach.rows.length) {
|
|
5136
|
-
push(section(t('compat.reach'), null,
|
|
5137
|
-
React.createElement('div', { className: 'dsm-compat-mod-list dsm-compat-cards' },
|
|
5138
|
-
presetReach.rows.map(function (row) {
|
|
5139
|
-
// ok → 绿框;absent / suppressed → 红框;其余(unknown,含宿主还没回传该字段)
|
|
5140
|
-
// 一律灰框,绝不把"读不到"画成"不能用"。
|
|
5141
|
-
const chip = function (label, state) {
|
|
5142
|
-
const kind = state === 'ok' ? 'ok' : (state === 'absent' || state === 'suppressed') ? 'bad' : 'unknown'
|
|
5143
|
-
return React.createElement('span', { className: 'dsm-reach-chip dsm-reach-' + kind, key: label }, label)
|
|
5144
|
-
}
|
|
5145
|
-
const tags = []
|
|
5146
|
-
if (row.suppressing) tags.push(React.createElement('span', { className: 'dsm-tag dsm-tag-off', key: 'suppressing' }, t('compat.reach.suppressing')))
|
|
5147
|
-
if (row.broken) tags.push(React.createElement('span', { className: 'dsm-tag dsm-tag-off', key: 'broken' }, t('compat.reach.broken')))
|
|
5148
|
-
else if (row.reason) tags.push(React.createElement('span', { className: 'dsm-tag', key: 'reason' }, t('compat.reach.whyUnknown')))
|
|
5149
|
-
return React.createElement('div', { className: 'dsm-compat-mod-row', key: row.presetId },
|
|
5150
|
-
React.createElement('span', { className: 'dsm-compat-name dsm-reach-name' },
|
|
5151
|
-
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') : '')),
|
|
5152
|
-
tags.length ? React.createElement('span', { className: 'dsm-tags' }, tags) : null),
|
|
5153
|
-
// 芯片顺序与「注入」块的勾选顺序一致(用户裁定 2026-09-16;2026-09-23 起
|
|
5154
|
-
// 场景与记忆是两个域,各占一枚):场景 → 记忆 → MCP → 技能 → 子智能体 → 提示词。
|
|
5155
|
-
React.createElement('span', { className: 'dsm-compat-reach-marks' },
|
|
5156
|
-
chip(t('compat.reach.mark.scene'), row.scene),
|
|
5157
|
-
chip(t('compat.reach.mark.memory'), row.memory),
|
|
5158
|
-
chip(t('compat.reach.mark.mcp'), row.mcp),
|
|
5159
|
-
chip(t('compat.reach.mark.skill'), row.skillCatalog),
|
|
5160
|
-
chip(t('compat.reach.mark.subagent'), row.subagent),
|
|
5161
|
-
chip(t('compat.reach.mark.agentsMd'), row.agentsMd)))
|
|
5162
|
-
}))))
|
|
5163
|
-
|
|
5164
|
-
// 页脚用「标题 + 条目」清单,与导入弹窗的「文件要求」同款结构与样式(用户裁定
|
|
5165
|
-
// 2026-09-16 第二版:条目要短、不列路径与内部机制,使用者知道"有这回事"就够)。
|
|
5166
|
-
push(React.createElement('div', { className: 'dsm-upload-requirements' },
|
|
5167
|
-
React.createElement('div', { className: 'dsm-label' }, t('compat.reach.tools.title')),
|
|
5168
|
-
React.createElement('ul', null,
|
|
5169
|
-
[1, 2, 3].map(function (n) {
|
|
5170
|
-
return React.createElement('li', { key: n }, t('compat.reach.tools.' + n))
|
|
5171
|
-
}))))
|
|
5172
|
-
}
|
|
5173
|
-
|
|
5174
5593
|
// ── 最近改动(0.15.0 B2)─────────────────────────────────────────────────
|
|
5175
5594
|
// 倒序列表 + 按域过滤 + 「同秒同来源」合并。落盘不去重(保真),合并只发生在展示层:
|
|
5176
5595
|
// 进一次场景会连写几条,逐条铺开会把「一次动作」读成「很多次改动」。
|
|
@@ -5687,6 +6106,14 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5687
6106
|
title: t('compat.title'),
|
|
5688
6107
|
desc: t('compat.desc'),
|
|
5689
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')),
|
|
5690
6117
|
compatDialogButton('audit', t('compat.audit')),
|
|
5691
6118
|
compatDialogButton('snapshot', t('snapshot.title')),
|
|
5692
6119
|
compatDialogButton('live', t('compat.live.title')),
|
|
@@ -5896,12 +6323,14 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5896
6323
|
"mcp.live.notLoaded": "未加载", "mcp.live.failed": "启动失败", "mcp.live.stopped": "未启用", "mcp.live.loading": "加载中", "mcp.live.noTools": "无可用工具", "mcp.live.running": "已启用",
|
|
5897
6324
|
"mcp.live.failedHint": "启动失败,检查配置后重新尝试", "mcp.live.offlineHint": "启动失败,检查配置后重新尝试", "mcp.live.neverHint": "启动失败,检查配置后重新尝试", "mcp.live.allOffHint": "工具全部被停用:当前没有可调用的工具(取消停用即恢复)",
|
|
5898
6325
|
"mcp.note.prefix": "备注:", "mcp.toggleServer": "启停服务", "mcp.toggleTool": "启停工具", "mcp.session.startGlobal": "全局关着:打开后仅为这个对话临时运行,全局设置不变。",
|
|
5899
|
-
"mcp.intent.blockedHint": "
|
|
6326
|
+
"mcp.intent.blockedHint": "全局已全部关闭这台服务器:会话层也不能打开它。先在全局重新打开。",
|
|
5900
6327
|
"mcp.intent.lease": "临时运行 · {count} 个对话", "mcp.intent.leaseHint": "全局是关的;{count} 个对话在用它,连接保持运行。",
|
|
5901
|
-
"mcp.intent.
|
|
5902
|
-
"mcp.intent.
|
|
5903
|
-
"mcp.intent.
|
|
5904
|
-
"mcp.intent.
|
|
6328
|
+
"mcp.intent.leaseWs": "临时运行 · {count} 个工作区", "mcp.intent.leaseHintWs": "全局是关的;{count} 个工作区在用它,连接保持运行。",
|
|
6329
|
+
"mcp.intent.keptRunning": "已全局关闭;还有 {count} 个对话在用,连接保持运行(要立即关闭用「全部关闭」)。",
|
|
6330
|
+
"mcp.intent.keptRunningWs": "已全局关闭;还有 {count} 个工作区在用,连接保持运行(要立即关闭用「全部关闭」)。",
|
|
6331
|
+
"mcp.intent.onOk": "已全局启用「{name}」。", "mcp.intent.offOk": "已全局关闭「{name}」。", "mcp.intent.stopped": "已全部关闭「{name}」:正在使用它的对话 / 工作区也已关闭。",
|
|
6332
|
+
"mcp.intent.stop": "全部关闭",
|
|
6333
|
+
"mcp.intent.stopTitle": "全部关闭?",
|
|
5905
6334
|
"mcp.intent.stopDesc": "「{name}」会立即关闭,正在使用它的对话 / 工作区也会一并关闭(它们的开关会变成关闭);之后可以重新打开。",
|
|
5906
6335
|
"mcp.tools.serverOff": "这台服务器在本会话里看不到:先在上面打开它,再拨工具",
|
|
5907
6336
|
"mcp.msg.ok": "操作成功", "mcp.msg.failed": "操作失败", "mcp.msg.loadFailed": "加载失败", "mcp.msg.warn": "操作完成,但加载器有提示:{warning}", "mcp.msg.toolsRefreshed": "已取到 {count} 个工具", "mcp.msg.restartWarn": "已重启,但有告警:{warning}", "mcp.msg.restarted": "已重启:{name}",
|
|
@@ -5973,6 +6402,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
5973
6402
|
"memory.title": "记忆",
|
|
5974
6403
|
"tabs.scenes": "场景", "tabs.skills": "技能", "tabs.subagents": "子智能体", "tabs.prompts": "提示词", "tabs.memory": "记忆", "tabs.sessions": "会话", "tabs.compat": "兼容",
|
|
5975
6404
|
"compat.title": "宿主兼容", "compat.desc": "本插件与 DSH 的对接体检(只读)。",
|
|
6405
|
+
"compat.refresh": "重新检测", "compat.refresh.title": "重新探测宿主能力、版本与契约(忽略 5 秒缓存)",
|
|
5976
6406
|
"compat.backups.btn": "清理旧备份", "compat.backups.btnCount": "清理旧备份 · {count} 份", "compat.backups.btnHint": "删掉多余的配置备份副本(它们含明文密钥)", "compat.backups.btnTitle": "现有 {count} 份配置备份(共 {size},含明文密钥)", "compat.backups.title": "清理旧备份",
|
|
5977
6407
|
// 侧栏入口的开关(按钮文字说"点下去会发生什么":开着 → 「关闭侧栏」)。
|
|
5978
6408
|
"compat.sidebar.hide": "关闭侧栏", "compat.sidebar.show": "开启侧栏", "compat.sidebar.hideHint": "把本插件的入口从侧栏撤掉(「设置 → 工具管理」照旧可用)", "compat.sidebar.showHint": "在侧栏里挂出本插件的入口,点一下就在这里打开同一套页面", "compat.sidebar.failed": "侧栏开关没保存成功",
|
|
@@ -6018,11 +6448,12 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6018
6448
|
"compat.backups.confirm": "删除", "compat.backups.confirm.ask": "确认永久删除 {count} 个文件?不可恢复。", "compat.backups.confirm.yes": "确认永久删除",
|
|
6019
6449
|
"compat.backups.done": "已删除 {removed} 份,保留 {kept} 份。", "compat.backups.warnFailed": "{count} 份没能删除(可能被占用):{names}",
|
|
6020
6450
|
"compat.backups.loading": "正在读取备份清单…", "compat.backups.loadFailed": "读取备份清单失败", "compat.backups.cleanFailed": "清理失败",
|
|
6021
|
-
"compat.state.ok": "一切正常", "compat.state.blocked": "有需要处理的问题",
|
|
6451
|
+
"compat.state.ok": "一切正常", "compat.state.blocked": "有需要处理的问题", "compat.state.review": "有契约待复核",
|
|
6022
6452
|
"compat.checking": "检查中…", "compat.empty": "尚未检查", "compat.failed": "检查失败",
|
|
6023
6453
|
"compat.save.failed": "保存失败",
|
|
6024
6454
|
"compat.summary.ok": "宿主 {version} · 能力 {ok}/{total} · 全部可用", "compat.summary.degraded": "宿主 {version} · 能力 {ok}/{total} · 降级 {count} 项",
|
|
6025
6455
|
"compat.summary.identity": "宿主 {version} · 能力 {ok}/{total} · 身份 {count} 项待处理",
|
|
6456
|
+
"compat.summary.review": "宿主 {version} · 能力 {ok}/{total} · 契约 {count} 项待复核",
|
|
6026
6457
|
"compat.update.available": "插件有兼容更新:{current} → {best}", "compat.update.current": "插件已是最新兼容版本({current})",
|
|
6027
6458
|
"compat.update.localAhead": "本地版本 {current} 比 registry 上兼容的最高版 {best} 更新", "compat.update.none": "registry 上没有与宿主 {host} 兼容的版本",
|
|
6028
6459
|
"compat.update.incompatible": "当前插件版本 {current} 与本宿主 {host} 不兼容", "compat.update.hostUnknown": "取不到宿主版本,已跳过更新检查",
|
|
@@ -6042,7 +6473,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6042
6473
|
"update.install.copy": "复制命令", "update.install.copied": "已复制升级命令",
|
|
6043
6474
|
"update.install.copyFailed": "复制失败,请手动选中命令复制",
|
|
6044
6475
|
"update.install.noCommand": "这次检查没有给出可执行的命令,请重新点一次检查更新。",
|
|
6045
|
-
"compat.diag.copy": "复制诊断信息", "compat.diag.copied": "已复制诊断信息",
|
|
6476
|
+
"compat.diag.copy": "复制诊断信息", "compat.diag.copied": "已复制诊断信息", "compat.generatedAt": "检测时间:{time}",
|
|
6046
6477
|
"compat.host": "宿主版本", "compat.verified": "插件适配版本",
|
|
6047
6478
|
"compat.caps": "可用能力", "compat.caps.degraded": "{count} 项不可用",
|
|
6048
6479
|
"compat.caps.substituted": "缺口由插件自补",
|
|
@@ -6055,7 +6486,11 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6055
6486
|
"compat.others": "其它能力项",
|
|
6056
6487
|
"compat.contracts": "宿主契约", "compat.contracts.missing": "不在位", "compat.contracts.allOk": "本版依赖的宿主契约全部在位。",
|
|
6057
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}。请人工核对宿主客户端是否改过名称",
|
|
6058
6492
|
"compat.fallback.substituted": "插件适配层(宿主无此入口)",
|
|
6493
|
+
"compat.fallback.informOnly": "仅提示(不影响使用)",
|
|
6059
6494
|
"compat.fallback.native": "改走原生入口", "compat.fallback.refuse": "该操作会被拒绝", "compat.fallback.blocked": "相关按钮已禁用", "compat.fallback.inform": "不影响写入",
|
|
6060
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 查看。",
|
|
6061
6496
|
"compat.modules.asarHost": "宿主是桌面版:官方包装在 {name} 里,插件在归档外,两边不可能是同一份文件。下面 {count} 个包按版本核对:{version},一致。",
|
|
@@ -6089,6 +6524,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6089
6524
|
"compat.ov.toolTable.factory": "出厂默认关掉 {hidden}/{total} 个", "compat.ov.toolTable.mixed": "关掉 {hidden}/{total} 个(含出厂默认 {defaults} 个)",
|
|
6090
6525
|
"compat.ov.nativeDelete": "宿主原生删除入口", "compat.ov.nativeDelete.ok": "宿主未提供原生删除入口(本插件自有完整序列)",
|
|
6091
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})",
|
|
6092
6531
|
"compat.ov.memory": "记忆", "compat.ov.prompts": "提示词", "compat.ov.subagents": "子智能体", "compat.ov.scenes": "场景档案",
|
|
6093
6532
|
"compat.ov.subagentPersona": "子智能体人设委派", "compat.ov.subagentToolRestrict": "子代理工具限制", "compat.ov.subagentCreatedEvent": "子代理创建时序", "compat.ov.webAdmission": "Web 连接准入",
|
|
6094
6533
|
"compat.ov.plain.ok": "无降级上报(装配失败会出现在这里)",
|
|
@@ -6183,8 +6622,11 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6183
6622
|
"compat.cap.workspaceReadHeader": "读取会话头部", "compat.cap.workspaceEnqueue": "串行写事务", "compat.cap.workspaceSetState": "写工作区状态",
|
|
6184
6623
|
"compat.cap.workspaceIndexHeader": "索引会话头部", "compat.cap.workspaceArchiveNative": "宿主原生归档入口", "compat.cap.workspaceUnarchiveNative": "宿主原生恢复入口",
|
|
6185
6624
|
"compat.cap.workspaceBatchNative": "宿主原生批量入口", "compat.cap.workspaceDeleteNative": "宿主原生删除入口", "compat.cap.sessionsDetachLive": "实时会话落盘与分离",
|
|
6186
|
-
"compat.cap.sessionsColdAnnounce": "冷会话移除广播", "compat.cap.
|
|
6187
|
-
"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": "审批策略读取(完全权限判定)",
|
|
6188
6630
|
"compat.cap.opArchive": "归档", "compat.cap.opUnarchive": "恢复", "compat.cap.opBatch": "批量操作", "compat.cap.opDelete": "删除", "compat.cap.opList": "历史列表",
|
|
6189
6631
|
"compat.reach": "预设注入边界",
|
|
6190
6632
|
"compat.reach.suppressing": "压制型",
|
|
@@ -6420,9 +6862,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6420
6862
|
"scenes.archive.summary": "档案:MCP {mcp} 台 · 技能 {skills} 个 · 子智能体 {subagents} 个",
|
|
6421
6863
|
"scenes.mcp.noServers": "还没有可选的 MCP 服务器", "scenes.mcp.toolCount": "{count} 个工具", "scenes.skills.empty": "还没有可选的技能",
|
|
6422
6864
|
"scenes.mcp.allTools": "全部工具", "scenes.mcp.pickedCount": "指定 {count} 个工具", "scenes.mcp.notRunning": "未运行", "scenes.mcp.edit": "编辑", "scenes.mcp.done": "完成", "scenes.mcp.noteLabel": "场景备注", "scenes.mcp.notePlaceholder": "进入该场景时覆盖全局备注;退出后恢复", "scenes.mcp.hasNote": "有备注",
|
|
6423
|
-
"scenes.mcp.toolsOf": "选择工具", "scenes.mcp.probeTools": "启动服务器读取工具", "scenes.mcp.unknownCount": "工具数未知 · 点「编辑」读取", "scenes.mcp.
|
|
6865
|
+
"scenes.mcp.toolsOf": "选择工具", "scenes.mcp.probeTools": "启动服务器读取工具", "scenes.mcp.unknownCount": "工具数未知 · 点「编辑」读取", "scenes.mcp.noTools": "该服务器当前没有可列出的工具(从未运行过,或已配置的工具尚未被记录)",
|
|
6424
6866
|
"scenes.skills.hint": "添加「技能集」后,勾选该场景下启用的技能。没勾的、以及整段没建的,进场景时一律停用(退出按进场景前的开关还原)。被同名技能覆盖的副本与结构不完整的技能不能勾——它们在这个场景里不可能生效。", "scenes.skills.hint.short": "添加后勾选这个场景要启用的技能", "scenes.subagents.hint": "勾选本场景要打开的人设;没勾的、以及整段没建的,进场景时一律关闭(退出按进场景前的开关还原)。", "scenes.subagents.hint.short": "添加后勾选这个场景要打开的人设", "scenes.subagents.empty": "还没有人设——到「子智能体」页创建。",
|
|
6425
6867
|
"scenes.skills.shadowed.hint": "被同名技能覆盖,在这个场景里不可能生效,因此不能勾选。要改用这一份,请到「技能」页点它的「启用这个」。",
|
|
6868
|
+
"scenes.skills.groupCheck": "勾上这个来源的全部技能", "scenes.skills.groupUncheck": "取消这个来源的全部技能",
|
|
6426
6869
|
"scenes.skills.invalid.hint": "技能结构不完整(缺 frontmatter / 名字非法 / 描述为空),无法启停,因此不能勾选。",
|
|
6427
6870
|
"scenes.filter.skills": "筛选技能/目录名称", "scenes.filter.subagents": "筛选人设(名称或描述)", "scenes.filter.servers": "筛选服务器",
|
|
6428
6871
|
"scenes.mem.title": "记忆", "scenes.mem.search": "在本场景内筛选记忆(名称或描述)",
|
|
@@ -6636,7 +7079,6 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6636
7079
|
"scope.toggle.session": "{layer}",
|
|
6637
7080
|
"scope.currentWorkspace": "当前工作区",
|
|
6638
7081
|
"scope.view.lease": "{count} 个对话单独设置",
|
|
6639
|
-
"scope.view.leaseHint": "全局是关的,但还有 {count} 个对话单独把它拨开了 —— 这只影响它们各自看到的内容,全局设置没变。",
|
|
6640
7082
|
"scope.warn.dismiss": "知道了",
|
|
6641
7083
|
"scope.repair.action": "修复作用域文件", "scope.repair.confirm": "确认隔离损坏文件(设置回到默认)",
|
|
6642
7084
|
"scope.repair.hint": "仅在作用域侧车损坏时使用:损坏的文件会改名留存,覆盖表与全局意图回到默认,下一次对账会从运行态反推。",
|
|
@@ -6644,13 +7086,24 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6644
7086
|
"scope.repair.none": "作用域侧车文件正常,无需修复。",
|
|
6645
7087
|
"scope.repair.failed": "修复失败:{error}",
|
|
6646
7088
|
"scope.intent.globalOnly": "全局意图只能在全局层修改",
|
|
6647
|
-
"scope.intent.blocked": "
|
|
6648
|
-
"scope.intent.lease": "临时运行 · {count} 个对话", "scope.intent.
|
|
7089
|
+
"scope.intent.blocked": "已全部关闭", "scope.intent.blockedHint": "全局已「全部关闭」:任何会话都不能再用它(包括在会话层打开)。要恢复,先在全局改回启用。",
|
|
7090
|
+
"scope.intent.lease": "临时运行 · {count} 个对话", "scope.intent.leaseWs": "临时运行 · {count} 个工作区",
|
|
7091
|
+
"scope.view.leaseWs": "{count} 个工作区单独设置",
|
|
7092
|
+
|
|
6649
7093
|
"scope.intent.keptRunning": "全局已关闭;还有 {count} 个对话在用,来源保持启用(只有这些对话看得到)。",
|
|
7094
|
+
"scope.intent.keptRunningWs": "全局已关闭;还有 {count} 个工作区在用,来源保持启用(只有这些工作区看得到)。",
|
|
6650
7095
|
"scope.intent.onOk": "已全局启用「{name}」。", "scope.intent.offOk": "已全局关闭「{name}」。",
|
|
6651
7096
|
"scope.intent.resume": "恢复启用",
|
|
6652
|
-
"scope.unifiedClose": "
|
|
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}」。",
|
|
6653
7098
|
"scope.stopAll": "全部关闭", "scope.stopAll.done": "已全部关闭({count} 项)。",
|
|
7099
|
+
"scope.lease.noWorkspace": "无工作区",
|
|
7100
|
+
"scope.lease.release": "不再让这个对话临时运行它(其它对话照旧)",
|
|
7101
|
+
"scope.lease.releaseWorkspace": "不再让这个工作区临时运行它(同工作区的对话一起不再用)",
|
|
7102
|
+
"scope.lease.released": "已让「{title}」不再临时运行",
|
|
7103
|
+
"scope.lease.releasedWs": "已让工作区「{title}」不再临时运行",
|
|
7104
|
+
"scope.lease.releaseFailed": "没能让「{title}」停止临时运行:{error}",
|
|
7105
|
+
"scope.lease.releasePartial": "「{title}」只停了一部分({done}/{total} 项),剩下的没能关掉,请重试",
|
|
7106
|
+
"scope.lease.unknownError": "原因未说明",
|
|
6654
7107
|
},
|
|
6655
7108
|
en: {
|
|
6656
7109
|
"title": "Skills", "desc": "Manage skills: enable, import, create, trash.", "link.project": "GitHub", "link.feedback": "Issues",
|
|
@@ -6815,7 +7268,9 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6815
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.",
|
|
6816
7269
|
"mcp.intent.blockedHint": "Stopped machine-wide: even this conversation cannot switch it on. Turn it back on from the global layer first.",
|
|
6817
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.",
|
|
6818
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).",
|
|
6819
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.",
|
|
6820
7275
|
"mcp.intent.stop": "Close everywhere",
|
|
6821
7276
|
"mcp.intent.stopTitle": "Close everywhere?",
|
|
@@ -6890,6 +7345,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6890
7345
|
"memory.title": "Memories",
|
|
6891
7346
|
"tabs.scenes": "Scenes", "tabs.skills": "Skills", "tabs.subagents": "Subagents", "tabs.prompts": "Prompts", "tabs.memory": "Memories", "tabs.sessions": "Sessions", "tabs.compat": "Host",
|
|
6892
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)",
|
|
6893
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",
|
|
6894
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",
|
|
6895
7351
|
"compat.backups.desc": "Every backup is a full copy of the config — MCP secrets and the access token included, in cleartext.",
|
|
@@ -6934,11 +7390,12 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6934
7390
|
"compat.backups.confirm": "Delete", "compat.backups.confirm.ask": "Permanently delete {count} files? This cannot be undone.", "compat.backups.confirm.yes": "Delete permanently",
|
|
6935
7391
|
"compat.backups.done": "Deleted {removed}; {kept} kept.", "compat.backups.warnFailed": "{count} could not be deleted (in use?): {names}",
|
|
6936
7392
|
"compat.backups.loading": "Reading the backup list…", "compat.backups.loadFailed": "Could not read the backup list", "compat.backups.cleanFailed": "Cleanup failed",
|
|
6937
|
-
"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",
|
|
6938
7394
|
"compat.checking": "Checking…", "compat.empty": "Not checked yet", "compat.failed": "Check failed",
|
|
6939
7395
|
"compat.save.failed": "Save failed",
|
|
6940
7396
|
"compat.summary.ok": "host {version} · capabilities {ok}/{total} · all usable", "compat.summary.degraded": "host {version} · capabilities {ok}/{total} · {count} degraded",
|
|
6941
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",
|
|
6942
7399
|
"compat.update.available": "Compatible update available: {current} → {best}", "compat.update.current": "Already on the newest compatible version ({current})",
|
|
6943
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}",
|
|
6944
7401
|
"compat.update.incompatible": "Plugin {current} is not compatible with this host ({host})", "compat.update.hostUnknown": "Host version unavailable — update check skipped",
|
|
@@ -6952,7 +7409,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6952
7409
|
"update.install.copy": "Copy command", "update.install.copied": "Upgrade command copied",
|
|
6953
7410
|
"update.install.copyFailed": "Copy failed; select the command and copy it manually",
|
|
6954
7411
|
"update.install.noCommand": "This check produced no runnable command; check for updates again.",
|
|
6955
|
-
"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}",
|
|
6956
7413
|
"compat.host": "Host version", "compat.verified": "Verified against",
|
|
6957
7414
|
"compat.caps": "Usable capabilities", "compat.caps.degraded": "{count} unavailable",
|
|
6958
7415
|
"compat.caps.substituted": "gaps covered by the plugin",
|
|
@@ -6965,7 +7422,11 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6965
7422
|
"compat.others": "Other capability slots",
|
|
6966
7423
|
"compat.contracts": "Host contracts", "compat.contracts.missing": "absent", "compat.contracts.allOk": "Every host contract this release depends on is present.",
|
|
6967
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",
|
|
6968
7428
|
"compat.fallback.substituted": "Plugin adapter (no host entry)",
|
|
7429
|
+
"compat.fallback.informOnly": "Informational only (no functional impact)",
|
|
6969
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",
|
|
6970
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.",
|
|
6971
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.",
|
|
@@ -6999,6 +7460,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
6999
7460
|
"compat.ov.toolTable.factory": "Factory defaults turn off {hidden}/{total}", "compat.ov.toolTable.mixed": "{hidden}/{total} are off (including {defaults} factory defaults)",
|
|
7000
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)",
|
|
7001
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})",
|
|
7002
7467
|
"compat.ov.memory": "Memory", "compat.ov.prompts": "Prompts", "compat.ov.subagents": "Subagents", "compat.ov.scenes": "Scene profiles",
|
|
7003
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",
|
|
7004
7469
|
"compat.ov.plain.ok": "No degradation reported (assembly failures would appear here)",
|
|
@@ -7092,8 +7557,11 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7092
7557
|
"compat.cap.workspaceReadHeader": "Read session header", "compat.cap.workspaceEnqueue": "Serialized write transaction", "compat.cap.workspaceSetState": "Write workspace state",
|
|
7093
7558
|
"compat.cap.workspaceIndexHeader": "Index session headers", "compat.cap.workspaceArchiveNative": "Host native archive entry", "compat.cap.workspaceUnarchiveNative": "Host native restore entry",
|
|
7094
7559
|
"compat.cap.workspaceBatchNative": "Host native batch entry", "compat.cap.workspaceDeleteNative": "Host native delete entry", "compat.cap.sessionsDetachLive": "Persist & detach live sessions",
|
|
7095
|
-
"compat.cap.sessionsColdAnnounce": "Cold session removal broadcast", "compat.cap.
|
|
7096
|
-
"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)",
|
|
7097
7565
|
"compat.cap.opArchive": "Archive", "compat.cap.opUnarchive": "Restore", "compat.cap.opBatch": "Batch operations", "compat.cap.opDelete": "Delete", "compat.cap.opList": "History list",
|
|
7098
7566
|
"compat.reach": "Preset injection reach",
|
|
7099
7567
|
"compat.reach.suppressing": "suppressing",
|
|
@@ -7318,10 +7786,11 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7318
7786
|
"scenes.archive.summary": "Profile: {mcp} MCP server(s) · {skills} skill(s) · {subagents} subagent(s)",
|
|
7319
7787
|
"scenes.mcp.noServers": "No MCP servers to pick from yet", "scenes.mcp.toolCount": "{count} tool(s)", "scenes.skills.empty": "No skills to pick from yet",
|
|
7320
7788
|
"scenes.mcp.allTools": "all tools", "scenes.mcp.pickedCount": "{count} tools picked", "scenes.mcp.notRunning": "not running", "scenes.mcp.edit": "Edit", "scenes.mcp.done": "Done", "scenes.mcp.noteLabel": "Scene note", "scenes.mcp.notePlaceholder": "Overrides the global note in this scene; restored on exit", "scenes.mcp.hasNote": "has note",
|
|
7321
|
-
"scenes.mcp.toolsOf": "Pick tools", "scenes.mcp.probeTools": "Start the server to load tools", "scenes.mcp.unknownCount": "unknown tool count — open Edit to load", "scenes.mcp.
|
|
7789
|
+
"scenes.mcp.toolsOf": "Pick tools", "scenes.mcp.probeTools": "Start the server to load tools", "scenes.mcp.unknownCount": "unknown tool count — open Edit to load", "scenes.mcp.noTools": "No tools listed for this server (it has never run, or its tools were never recorded)",
|
|
7322
7790
|
"scenes.skills.hint": "Add the skills section first, then check the skills enabled in this scene. Unchecked skills — and scenes with no section at all — are disabled on entry, and restored to their previous switch when you exit. Copies shadowed by a same-name skill and structurally broken skills cannot be checked — they can never take effect in this scene.",
|
|
7323
7791
|
"scenes.skills.hint.short": "Add the section, then check the skills this scene enables",
|
|
7324
7792
|
"scenes.skills.shadowed.hint": "Shadowed by a same-name skill, so it can never take effect in this scene and cannot be checked. To use this copy instead, click “Use this one” for it on the Skills page.",
|
|
7793
|
+
"scenes.skills.groupCheck": "Check every skill of this source", "scenes.skills.groupUncheck": "Uncheck every skill of this source",
|
|
7325
7794
|
"scenes.skills.invalid.hint": "Incomplete skill (missing frontmatter / invalid name / empty description): it cannot be enabled or disabled, so it cannot be checked.", "scenes.subagents.hint": "Check the personas this scene should turn on; anything unchecked (or with no section at all) is turned off when you enter, and restored to its previous switch when you exit.", "scenes.subagents.hint.short": "Add the section, then check the personas to turn on", "scenes.subagents.empty": "No personas yet — create one on the Subagents page.",
|
|
7326
7795
|
"scenes.filter.skills": "Filter skills / directories", "scenes.filter.subagents": "Filter personas (name or description)", "scenes.filter.servers": "Filter servers",
|
|
7327
7796
|
"scenes.mem.title": "Memories", "scenes.mem.search": "Filter memories in this scene (name or description)",
|
|
@@ -7530,7 +7999,6 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7530
7999
|
"scope.toggle.session": "{layer}",
|
|
7531
8000
|
"scope.currentWorkspace": "this workspace",
|
|
7532
8001
|
"scope.view.lease": "set in {count} chats",
|
|
7533
|
-
"scope.view.leaseHint": "Off globally, but {count} conversation(s) switched it on for themselves — that only changes what they see; the global setting is unchanged.",
|
|
7534
8002
|
"scope.warn.dismiss": "Dismiss",
|
|
7535
8003
|
"scope.repair.action": "Repair scope files", "scope.repair.confirm": "Quarantine the corrupt file (settings reset to defaults)",
|
|
7536
8004
|
"scope.repair.hint": "Only for corrupt scope sidecars: the corrupt file is renamed and kept, per-conversation overrides and global intent reset to defaults, and the next reconcile adopts the running state.",
|
|
@@ -7539,8 +8007,19 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7539
8007
|
"scope.repair.failed": "Repair failed: {error}",
|
|
7540
8008
|
"scope.intent.globalOnly": "Global intent can only be changed from the global layer",
|
|
7541
8009
|
"scope.intent.blocked": "closed everywhere", "scope.intent.blockedHint": "Closed globally: no conversation can use it, even by switching it on locally. Set it back to on/off globally to allow it again.",
|
|
7542
|
-
"scope.intent.lease": "temporary · {count} conversation(s)", "scope.intent.
|
|
8010
|
+
"scope.intent.lease": "temporary · {count} conversation(s)", "scope.intent.leaseWs": "temporary · {count} workspace(s)",
|
|
8011
|
+
"scope.view.leaseWs": "set in {count} workspace(s)",
|
|
8012
|
+
|
|
8013
|
+
"scope.lease.noWorkspace": "no workspace",
|
|
8014
|
+
"scope.lease.release": "Stop it from running for this conversation (the others keep it)",
|
|
8015
|
+
"scope.lease.releaseWorkspace": "Stop it from running for this workspace (its conversations stop too)",
|
|
8016
|
+
"scope.lease.released": "“{title}” no longer runs it temporarily",
|
|
8017
|
+
"scope.lease.releasedWs": "Workspace “{title}” no longer runs it temporarily",
|
|
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",
|
|
8020
|
+
"scope.lease.unknownError": "no reason given",
|
|
7543
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.",
|
|
7544
8023
|
"scope.intent.onOk": "Enabled “{name}” globally.", "scope.intent.offOk": "Disabled “{name}” globally.",
|
|
7545
8024
|
"scope.intent.resume": "Turn back on",
|
|
7546
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.",
|
|
@@ -7565,7 +8044,14 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
7565
8044
|
// 写在 apply 方法体里的导出会随 apply 提前返回而静默消失(见下方注释)。
|
|
7566
8045
|
pages: _pages,
|
|
7567
8046
|
apply(ctx) {
|
|
7568
|
-
|
|
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:退化成"留到下次刷新",与改造前一致 */ }
|
|
7569
8055
|
// 导入 / 导出弹窗的默认目录:问一次宿主(桌面 → 主目录,跨平台跨用户),缓存起来供
|
|
7570
8056
|
// 各处输入框取用。放在 apply 开头是因为它**不依赖 ctx**(apiCall 直接走 fetch),
|
|
7571
8057
|
// 而用户打开那些弹窗要晚得多 —— 早一点发出去,打开时就已经到位(见 20 片的说明)。
|
|
@@ -8292,7 +8778,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8292
8778
|
// 详情弹窗的请求序号:见 openDetail / closeDetail(晚到响应不得复活弹窗)。
|
|
8293
8779
|
const detailSeqRef = React.useRef(0)
|
|
8294
8780
|
const [confirmRow, setConfirmRow] = React.useState(null)
|
|
8295
|
-
//
|
|
8781
|
+
// 「全部关闭」确认:与删除不同,它切断的是**正在用它的会话** —— 必须问一次。
|
|
8296
8782
|
const [stopConfirm, setStopConfirm] = React.useState(null)
|
|
8297
8783
|
const [reveal, setReveal] = React.useState(false)
|
|
8298
8784
|
const [settings, setSettings] = React.useState(null)
|
|
@@ -8457,7 +8943,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8457
8943
|
return
|
|
8458
8944
|
}
|
|
8459
8945
|
// 全局层 = 写**意图**(0.21.2):off 不再立刻停 —— 还在用它的会话按租约继续跑,
|
|
8460
|
-
//
|
|
8946
|
+
// 只有「全部关闭」才切断。撤销按操作前的意图值逐台写回。
|
|
8461
8947
|
setMsg(null)
|
|
8462
8948
|
setBusy('setall')
|
|
8463
8949
|
apiCall('scope-intent-set', { domain: 'mcp', keys: changed.map((item) => item.serverName), value: turnOn ? 'on' : 'off' })
|
|
@@ -8681,7 +9167,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8681
9167
|
return
|
|
8682
9168
|
}
|
|
8683
9169
|
// 全局层(0.21.2)= 写**意图**,不是补丁:off 之后仍被会话认领的服务器保持运行
|
|
8684
|
-
//
|
|
9170
|
+
// (租约),只有「全部关闭」才切断它们。开关读的也是意图(见 `serverGlobalOn`)。
|
|
8685
9171
|
const name = String(row.serverName || row.id)
|
|
8686
9172
|
const nextOn = !serverGlobalOn(row)
|
|
8687
9173
|
// 翻开 = 先按「启动中」显示(宿主拉起进程要几秒);关掉 = 销账。
|
|
@@ -8691,8 +9177,8 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8691
9177
|
.then((res) => {
|
|
8692
9178
|
if (res && res.ok === false) { setMsg({ kind: 'err', text: (res && res.error) || mt('mcp.msg.failed') }); return }
|
|
8693
9179
|
if (res && res.warnings && res.warnings.length) { setMsg({ kind: 'warn', text: res.warnings.join(';') }); return }
|
|
8694
|
-
const leases =
|
|
8695
|
-
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 }) })
|
|
8696
9182
|
else setMsg({ kind: 'ok', text: mt(nextOn ? 'mcp.intent.onOk' : 'mcp.intent.offOk', { name: name }) })
|
|
8697
9183
|
refresh()
|
|
8698
9184
|
})
|
|
@@ -8720,7 +9206,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8720
9206
|
}
|
|
8721
9207
|
|
|
8722
9208
|
/**
|
|
8723
|
-
* MCP
|
|
9209
|
+
* MCP「全部关闭」是一次性动作:全局意图写 off,并把正在认领它的会话 / 工作区
|
|
8724
9210
|
* 一并写成显式关闭 —— 这样租约不会把它重新拉起来,也不会留下「恢复启用」状态。
|
|
8725
9211
|
* 走 op 而不是 `scope-intent-set`:后者只能写意图,写不到那些层的开关。
|
|
8726
9212
|
*/
|
|
@@ -8739,7 +9225,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
8739
9225
|
}
|
|
8740
9226
|
|
|
8741
9227
|
/**
|
|
8742
|
-
* 页头「全部关闭」:逐台走同一个 op
|
|
9228
|
+
* 页头「全部关闭」:逐台走同一个 op,与行菜单里的「全部关闭」是一回事 ——
|
|
8743
9229
|
* 只改意图停不掉正在认领它的场景 / 工作区,那些层的开关也得写成显式关闭。
|
|
8744
9230
|
* 只在真有临时运行时出现(`scopeLeaseKeys` 非空),没东西可停就不占页头。
|
|
8745
9231
|
*/
|
|
@@ -9082,7 +9568,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9082
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))
|
|
9083
9569
|
// 全局层的意图状态只挂**临时运行 · N 个对话** —— 它是"全局 off 却仍在跑"的
|
|
9084
9570
|
// 唯一解释,不标出来,用户会以为全局开关坏了。
|
|
9085
|
-
//
|
|
9571
|
+
// 全部关闭不挂标签:开关本身就是关的,标签会长期占着这一行;状态由开关的
|
|
9086
9572
|
// 悬浮说明承担。
|
|
9087
9573
|
// 同名两层行只标在**第一行**上(两行说同一件事,标两遍只是噪声)。
|
|
9088
9574
|
if (!scopeIsSession()) {
|
|
@@ -9102,12 +9588,13 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9102
9588
|
key: 'menu',
|
|
9103
9589
|
label: mt('row.menu', { name: row.serverName }),
|
|
9104
9590
|
items: [
|
|
9105
|
-
|
|
9591
|
+
{ key: 'edit', label: mt('mcp.btn.edit'), disabled: actDisabled, onClick: () => openEdit(row) },
|
|
9592
|
+
{ key: 'remove', label: mt('mcp.btn.remove'), danger: true, disabled: actDisabled, onClick: () => setConfirmRow(row) },
|
|
9593
|
+
// 全局层的「全部关闭」:只在真有其他对话 / 工作区在临时用它时出现(没有租约时
|
|
9106
9594
|
// 普通开关就能停,菜单不必多一项)。它是一次性动作,不在菜单里留「恢复启用」。
|
|
9107
9595
|
// 会话层没有这一项 —— 会话只能"看不到它",停整台机器是全局动作。
|
|
9596
|
+
// 放在**最后**(删除下面):它是停机动作,不是这一行的日常操作(用户 2026-11-06)。
|
|
9108
9597
|
...(scopeIsSession() || scopeLeaseCount('mcp', String(row.serverName || row.id)) <= 0 ? [] : [{ key: 'intent-stop', label: mt('mcp.intent.stop'), danger: true, disabled: actDisabled, onClick: () => setStopConfirm(row) }]),
|
|
9109
|
-
{ key: 'edit', label: mt('mcp.btn.edit'), disabled: actDisabled, onClick: () => openEdit(row) },
|
|
9110
|
-
{ key: 'remove', label: mt('mcp.btn.remove'), danger: true, disabled: actDisabled, onClick: () => setConfirmRow(row) },
|
|
9111
9598
|
],
|
|
9112
9599
|
}))
|
|
9113
9600
|
return React.createElement(ListRow, {
|
|
@@ -9163,13 +9650,13 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9163
9650
|
// 同名两行显示同一个意图值(意图按 serverName 键),不会一行开一行关。
|
|
9164
9651
|
const nameHere = String(row.serverName || row.id)
|
|
9165
9652
|
const intentHere = scopeIntentOf('mcp', nameHere)
|
|
9166
|
-
const leasesHere =
|
|
9653
|
+
const leasesHere = scopeLeaseUnitCount('mcp', nameHere)
|
|
9167
9654
|
return editable ? React.createElement(Switch, {
|
|
9168
9655
|
on: serverGlobalOn(row),
|
|
9169
9656
|
scoped: false,
|
|
9170
9657
|
disabled: actDisabled,
|
|
9171
9658
|
title: intentHere === 'blocked' ? mt('mcp.intent.blockedHint')
|
|
9172
|
-
: leasesHere > 0 ? mt('mcp.intent.leaseHint', { count: leasesHere })
|
|
9659
|
+
: leasesHere > 0 ? mt(scopeIsWorkspace() ? 'mcp.intent.leaseHintWs' : 'mcp.intent.leaseHint', { count: leasesHere })
|
|
9173
9660
|
: undefined,
|
|
9174
9661
|
label: mt('mcp.toggleServer') + ' ' + row.serverName,
|
|
9175
9662
|
onClick: () => toggleRow(row),
|
|
@@ -9430,7 +9917,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9430
9917
|
React.createElement('div', { className: 'dsm-modal-actions' },
|
|
9431
9918
|
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-danger', onClick: confirmRemove }, mt('mcp.btn.remove'))))
|
|
9432
9919
|
|
|
9433
|
-
//
|
|
9920
|
+
// 「全部关闭」确认:它会**立即**停掉连接,还会把正在用它的会话 / 工作区的开关
|
|
9434
9921
|
// 一并关掉 —— 与普通关闭不是一回事,必须问一次,并把影响说清。
|
|
9435
9922
|
const stopNode = stopConfirm && React.createElement(Modal, {
|
|
9436
9923
|
key: 'mcp-stop',
|
|
@@ -9475,7 +9962,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9475
9962
|
// 要把它们排除 —— 否则全部可见之后按钮仍写着「全部启用」,点了什么也不发生。
|
|
9476
9963
|
bulkAllOn ? mt('mcp.btn.disableAll') : mt('mcp.btn.enableAll')),
|
|
9477
9964
|
// 只在有临时运行时出现(会话 / 场景 / 工作区正在认领某几台);
|
|
9478
|
-
//
|
|
9965
|
+
// 与行菜单的「全部关闭」同一个 op,别在这里另写一条只改意图的路径。
|
|
9479
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,
|
|
9480
9967
|
],
|
|
9481
9968
|
}),
|
|
@@ -9557,7 +10044,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
9557
10044
|
var quick = qs[0], setQuick = qs[1]
|
|
9558
10045
|
var qk = React.useState(null), quickEdit = qk[0], setQuickEdit = qk[1]
|
|
9559
10046
|
var qf = React.useState(null), quickConfirm = qf[0], setQuickConfirm = qf[1]
|
|
9560
|
-
//
|
|
10047
|
+
// 单条快捷提示词的「全部关闭」确认(`{ id }`):切断的是各对话 / 工作区正在单独用它的那份。
|
|
9561
10048
|
var qz = React.useState(null), quickStop = qz[0], setQuickStop = qz[1]
|
|
9562
10049
|
// 三个弹窗(新增预设 / 编辑预设 / 编辑快捷提示词)各自一份关窗暂存(见 42-shared-ui.js:
|
|
9563
10050
|
// 关窗存、打开取,成功提交不走这条路,所以没有"成功后要记得清"那一步)。
|
|
@@ -10007,7 +10494,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
10007
10494
|
}).catch(function (e) { setBusy(null); setQuickConfirm(null); actionFailed(e) })
|
|
10008
10495
|
}
|
|
10009
10496
|
/**
|
|
10010
|
-
*
|
|
10497
|
+
* 单条快捷提示词的「全部关闭」:清掉各对话 / 工作区单独打开它的覆盖。
|
|
10011
10498
|
* 全局启停不动(页面那颗开关管的是它),这里只收临时的那一份。
|
|
10012
10499
|
*/
|
|
10013
10500
|
function doQuickStop(id) {
|
|
@@ -10151,7 +10638,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
10151
10638
|
var quickAllOn = visibleQuick.length > 0 && visibleQuick.every(function (p) { return scopeFlag('quickPrompts', p.id, p.enabled !== false).value })
|
|
10152
10639
|
/**
|
|
10153
10640
|
* 页头「全部关闭」:把各会话 / 工作区 / 场景里单独开着的快捷提示词一并停掉 ——
|
|
10154
|
-
*
|
|
10641
|
+
* 「本对话关掉、别的对话还开着」不算全部关闭,所以走全部关闭 op 清各层认领,
|
|
10155
10642
|
* 而不是只写全局 `meta.json`。全局那一档是单选基线,没有"临时运行"可言。
|
|
10156
10643
|
*/
|
|
10157
10644
|
function stopAllQuick() {
|
|
@@ -10228,9 +10715,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
10228
10715
|
key: 'menu',
|
|
10229
10716
|
label: t('row.menu', { name: p.id }),
|
|
10230
10717
|
items: [
|
|
10231
|
-
...(scopeLeaseCount('quickPrompts', p.id) > 0 ? [{ key: 'stop', label: t('scope.unifiedClose'), danger: true, disabled: busy !== null || state.anyLocked === true, onClick: function () { setQuickStop({ id: p.id }) } }] : []),
|
|
10232
10718
|
{ key: 'edit', label: t('agm.btn.edit'), disabled: busy !== null || scopeIsSession(), title: scopeIsSession() ? promptBlockTitle : undefined, onClick: function () { openQuickEdit(p) } },
|
|
10233
10719
|
{ key: 'delete', label: t('agm.btn.delete'), danger: true, disabled: busy !== null || promptWriteBlocked, title: promptWriteBlocked ? promptBlockTitle : undefined, onClick: function () { setQuickConfirm({ id: p.id }) } },
|
|
10720
|
+
// 「全部关闭」放在最后(删除下面):它是停机动作(用户 2026-11-06)。
|
|
10721
|
+
...(scopeLeaseCount('quickPrompts', p.id) > 0 ? [{ key: 'stop', label: t('scope.unifiedClose'), danger: true, disabled: busy !== null || state.anyLocked === true, onClick: function () { setQuickStop({ id: p.id }) } }] : []),
|
|
10234
10722
|
],
|
|
10235
10723
|
}),
|
|
10236
10724
|
],
|
|
@@ -10691,6 +11179,9 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
10691
11179
|
// 指到非滚动容器(sticky 随之失效,页签被内容滚走)。
|
|
10692
11180
|
var section = sectionRef.current
|
|
10693
11181
|
if (!section) return undefined
|
|
11182
|
+
// 宿主把滚动放在视口上时(找不到祖先滚动容器),装订线只能挂在 html 上:
|
|
11183
|
+
// 加一个类、卸载时撤掉 —— 不是一条常驻的全局规则。
|
|
11184
|
+
document.documentElement.classList.add('dsm-scroll-stable')
|
|
10694
11185
|
var host = null
|
|
10695
11186
|
var node = section.parentElement
|
|
10696
11187
|
while (node && node !== document.body) {
|
|
@@ -10700,9 +11191,12 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
|
|
|
10700
11191
|
}
|
|
10701
11192
|
// 找不到(宿主换了实现)→ 退回原来的「上两级」,保持兼容。
|
|
10702
11193
|
if (!host) host = section.parentElement && section.parentElement.parentElement
|
|
10703
|
-
if (!host) return
|
|
11194
|
+
if (!host) return function () { document.documentElement.classList.remove('dsm-scroll-stable') }
|
|
10704
11195
|
host.classList.add('dsm-settings-scroll-host')
|
|
10705
|
-
return function () {
|
|
11196
|
+
return function () {
|
|
11197
|
+
host.classList.remove('dsm-settings-scroll-host')
|
|
11198
|
+
document.documentElement.classList.remove('dsm-scroll-stable')
|
|
11199
|
+
}
|
|
10706
11200
|
}, [])
|
|
10707
11201
|
var page = active === 'scenes' ? React.createElement(ScenesPage)
|
|
10708
11202
|
: active === 'mcp' ? React.createElement(MCPPage)
|
|
@@ -12717,8 +13211,328 @@ function enabledMemoryCount(rules) {
|
|
|
12717
13211
|
var tone = props.tone === 'ok' ? ' dsm-tag-on' : props.tone === 'bad' ? ' dsm-tag-off' : props.tone === 'warn' ? ' dsm-tag-warn' : ''
|
|
12718
13212
|
return h('span', { className: 'dsm-tag' + tone, title: props.title }, props.text)
|
|
12719
13213
|
}
|
|
13214
|
+
/** 租约浮窗的最大高度;`measure` 会按这一侧可用空间再夹一次(CSS 只负责滚动)。 */
|
|
13215
|
+
var LEASE_POP_MAX_H = 320
|
|
13216
|
+
/**
|
|
13217
|
+
* 浮窗里的分组:按**工作区**归拢,同一个工作区的对话挨在一起。
|
|
13218
|
+
*
|
|
13219
|
+
* 为什么按工作区分组(用户 2026-11-05):认领是逐个对话记的,但用户找的是"哪个项目
|
|
13220
|
+
* 在用它" —— 同一个工作区的那几个对话排成一块,才看得出"是这个项目在跑"。
|
|
13221
|
+
* 组内按标题排;没有工作区的那些排在最后(它们不属于任何项目)。
|
|
13222
|
+
*
|
|
13223
|
+
* 分组键取**与服务端同一口径**的路径键(`scopeWorkspacePathKey`):同一个目录在清单里
|
|
13224
|
+
* 可能写成 `C:\a\b`、`C:/a/b` 与 `c:\a\b\` 几种样子 —— 不归一就会分成两块,组头还同名。
|
|
13225
|
+
*
|
|
13226
|
+
* 工作区粒度下没有 cwd 的会话是**会话隔离**,不是同一个「无工作区」:它们各自算一组,
|
|
13227
|
+
* 否则徽章会把 N 个独立认领显示成 1 个、那颗「×」也只能放掉其中一个。
|
|
13228
|
+
*/
|
|
13229
|
+
function leaseGroups(details, workspaceMode) {
|
|
13230
|
+
var byCwd = Object.create(null)
|
|
13231
|
+
var order = []
|
|
13232
|
+
var nameOf = Object.create(null)
|
|
13233
|
+
details.forEach(function (d) {
|
|
13234
|
+
var cwd = String((d && d.cwd) || '')
|
|
13235
|
+
var key = cwd === ''
|
|
13236
|
+
? (workspaceMode ? '\u0000' + String((d && d.id) || '') : '')
|
|
13237
|
+
: scopeWorkspacePathKey(cwd)
|
|
13238
|
+
if (!byCwd[key]) { byCwd[key] = []; order.push(key) }
|
|
13239
|
+
byCwd[key].push(d)
|
|
13240
|
+
if (cwd !== '' && nameOf[key] === undefined) nameOf[key] = cwd
|
|
13241
|
+
})
|
|
13242
|
+
order.sort(function (a, b) {
|
|
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
|
|
13249
|
+
})
|
|
13250
|
+
return order.map(function (key) {
|
|
13251
|
+
var rows = byCwd[key].slice().sort(function (x, y) {
|
|
13252
|
+
var xt = String((x && x.title) || '')
|
|
13253
|
+
var yt = String((y && y.title) || '')
|
|
13254
|
+
return xt < yt ? -1 : xt > yt ? 1 : 0
|
|
13255
|
+
})
|
|
13256
|
+
return { key: key, cwd: nameOf[key] === undefined ? '' : nameOf[key], rows: rows }
|
|
13257
|
+
})
|
|
13258
|
+
}
|
|
12720
13259
|
/**
|
|
12721
|
-
*
|
|
13260
|
+
* 租约徽章 + 悬浮浮窗:**临时运行的是哪几个对话**。
|
|
13261
|
+
*
|
|
13262
|
+
* 徽章正文只说"几个对话"(`临时运行 · N 个对话`),用户真正要问的是"是哪几个"——
|
|
13263
|
+
* 浮窗一行一个对话:标题在左,所属工作区作为弱化后缀,末尾一颗「×」只放开这一个。
|
|
13264
|
+
* 工作区粒度下每行就是一个工作区,那一行只显示工作区名。
|
|
13265
|
+
*
|
|
13266
|
+
* 浮窗用 `position:fixed` + **视口坐标**:徽章所在的列表行是 `overflow:hidden`
|
|
13267
|
+
* (`.dsm-listrow-meta`),绝对定位的浮层会被裁掉(与 `SourceSelect` 的菜单同一条理由)。
|
|
13268
|
+
*
|
|
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
|
|
13270
|
+
*/
|
|
13271
|
+
function LeaseTagBadge(props) {
|
|
13272
|
+
var t = props.t
|
|
13273
|
+
var runtime = props.runtime === true
|
|
13274
|
+
var details = props.details || []
|
|
13275
|
+
// 工作区粒度:认领是**按工作区**记的 —— 徽章上的个数得跟浮窗里的行数同一个单位,
|
|
13276
|
+
// 否则会出现「2 个对话」配 1 行工作区(看着像漏了一条)。
|
|
13277
|
+
// 预览 / 测试可直接指定;正常渲染不传,读当前隔离粒度。
|
|
13278
|
+
var workspaceMode = typeof props.workspaceMode === 'boolean' ? props.workspaceMode : scopeIsWorkspace()
|
|
13279
|
+
var groups = leaseGroups(details, workspaceMode)
|
|
13280
|
+
var count = workspaceMode ? groups.length : props.count
|
|
13281
|
+
var openState = React.useState(false), open = openState[0], setOpen = openState[1]
|
|
13282
|
+
var posState = React.useState(null), pos = posState[0], setPos = posState[1]
|
|
13283
|
+
var busyState = React.useState(null), busyId = busyState[0], setBusyId = busyState[1]
|
|
13284
|
+
var ref = React.useRef(null)
|
|
13285
|
+
var popRef = React.useRef(null)
|
|
13286
|
+
// 浮窗是给键盘用户打开的(Enter/空格)才把焦点送进去;鼠标悬停打开时抢焦点会打断输入。
|
|
13287
|
+
var keyboardOpen = React.useRef(false)
|
|
13288
|
+
var label = workspaceMode
|
|
13289
|
+
? (runtime ? t('scope.intent.leaseWs', { count: count }) : t('scope.view.leaseWs', { count: count }))
|
|
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
|
+
}
|
|
13303
|
+
/**
|
|
13304
|
+
* 指针离开徽章或浮窗。relatedTarget 还在两者之内时不动 —— 那只是从徽章跨进浮窗
|
|
13305
|
+
* (或反过来),桥接条让这段路始终落在浮窗的命中区里。
|
|
13306
|
+
*/
|
|
13307
|
+
function onLeave(e) {
|
|
13308
|
+
if (pointerWithin(e && e.relatedTarget)) return
|
|
13309
|
+
closeNow()
|
|
13310
|
+
}
|
|
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
|
+
}
|
|
13330
|
+
}
|
|
13331
|
+
/**
|
|
13332
|
+
* 放掉**一个**对话的认领:只让它不再临时运行,其它对话照旧。
|
|
13333
|
+
*
|
|
13334
|
+
* 认领是**逐个对话**记的(会话层那条覆盖),所以放掉一个就是在那条对话的会话层
|
|
13335
|
+
* 写一次「关」—— 服务端随即重算租约:最后一个认领者走了,连接 / 来源就跟着停。
|
|
13336
|
+
* 工作区粒度下这条覆盖落在工作区上,同工作区的对话一起不再用(标题里说清楚);
|
|
13337
|
+
* 没有 cwd 的会话在工作区粒度下仍是独立的会话覆盖,提示按「对话」说。
|
|
13338
|
+
*
|
|
13339
|
+
* @param {object} d 认领明细(含 `id` / `title` / `keys`)
|
|
13340
|
+
* @param {string} [label] 提示里用的名字
|
|
13341
|
+
* @param {boolean} [wholeWorkspace] 这条覆盖是否落在整个工作区上
|
|
13342
|
+
*/
|
|
13343
|
+
function release(d, label, wholeWorkspace) {
|
|
13344
|
+
if (busyId !== null) return
|
|
13345
|
+
var id = String((d && d.id) || '')
|
|
13346
|
+
var name = String(label || (d && d.title) || id)
|
|
13347
|
+
// 工作区粒度的默认口径:整条覆盖落在工作区上;单个会话(没有 cwd)传 false。
|
|
13348
|
+
var whole = wholeWorkspace === undefined ? workspaceMode : wholeWorkspace === true
|
|
13349
|
+
// 调用方自带放掉动作时用它(场景层要的是"退出场景",不是"关掉某一格")。
|
|
13350
|
+
if (typeof props.onRelease === 'function') {
|
|
13351
|
+
props.onRelease(d)
|
|
13352
|
+
return
|
|
13353
|
+
}
|
|
13354
|
+
// 这一条认领落在哪几格,由**服务端**随名单一起给(`keys`)—— 来源格可能是"来源
|
|
13355
|
+
// 自己 + 底下那几条技能",客户端不必(也不该)自己再猜一遍。
|
|
13356
|
+
var keys = (d && Array.isArray(d.keys) && d.keys.length > 0)
|
|
13357
|
+
? d.keys
|
|
13358
|
+
: [{ domain: props.domain, key: props.key }]
|
|
13359
|
+
setBusyId(id)
|
|
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 () {
|
|
13377
|
+
// 本地先把这一条摘掉(全局快照有 150ms TTL,紧接着的重拉可能还是写前那一份)。
|
|
13378
|
+
scopeForgetLeaseSession(props.domain, props.key, id)
|
|
13379
|
+
// 整个工作区一起停时提示要说工作区,别让用户以为只关了一个对话;
|
|
13380
|
+
// 没有 cwd 的会话仍是单独的会话覆盖。
|
|
13381
|
+
showPluginToast(whole ? t('scope.lease.releasedWs', { title: name }) : t('scope.lease.released', { title: name }), 'ok')
|
|
13382
|
+
setTimeout(function () { refreshScope({ silent: true }) }, 400)
|
|
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
|
+
}
|
|
13391
|
+
showPluginToast(t('scope.lease.releaseFailed', { title: name, error: scopeErrorText(e) || t('scope.lease.unknownError') }), 'err')
|
|
13392
|
+
}).then(function () { setBusyId(null) })
|
|
13393
|
+
}
|
|
13394
|
+
/**
|
|
13395
|
+
* 量一次徽章的位置,算出浮窗放哪儿。
|
|
13396
|
+
*
|
|
13397
|
+
* 上下方向按"下方装不下且上方更宽裕才上翻"判;高度夹到那一侧的可用空间,
|
|
13398
|
+
* 夹住之后浮窗自己滚 —— 与 `SourceSelect` 的菜单同一条口径。
|
|
13399
|
+
*/
|
|
13400
|
+
function measure() {
|
|
13401
|
+
var el = ref.current
|
|
13402
|
+
if (!el) return
|
|
13403
|
+
var box = el.getBoundingClientRect()
|
|
13404
|
+
var gap = 6
|
|
13405
|
+
var rowCount = workspaceMode ? groups.length : details.length
|
|
13406
|
+
var need = Math.min(rowCount * 28 + 16, LEASE_POP_MAX_H)
|
|
13407
|
+
var below = window.innerHeight - box.bottom - gap - 8
|
|
13408
|
+
var above = box.top - gap - 8
|
|
13409
|
+
var nextUp = below < need && above > below
|
|
13410
|
+
// 浮窗比徽章宽得多:按它自己的宽度靠右,别让它顶出窗口。
|
|
13411
|
+
var width = popRef.current ? popRef.current.offsetWidth : 260
|
|
13412
|
+
var next = {
|
|
13413
|
+
left: Math.max(8, Math.min(box.left, window.innerWidth - width - 8)),
|
|
13414
|
+
top: nextUp ? null : box.bottom + gap,
|
|
13415
|
+
bottom: nextUp ? window.innerHeight - box.top + gap : null,
|
|
13416
|
+
maxHeight: Math.max(120, Math.min(need, nextUp ? above : below)),
|
|
13417
|
+
}
|
|
13418
|
+
// 位置没变就别换新对象(滚动时每次都换会让整个浮窗重渲染一遍)。
|
|
13419
|
+
setPos(function (prev) {
|
|
13420
|
+
if (prev === null) return next
|
|
13421
|
+
return prev.left === next.left && prev.top === next.top && prev.bottom === next.bottom && prev.maxHeight === next.maxHeight ? prev : next
|
|
13422
|
+
})
|
|
13423
|
+
}
|
|
13424
|
+
React.useEffect(function () {
|
|
13425
|
+
if (!open) { keyboardOpen.current = false; return undefined }
|
|
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
|
|
13435
|
+
// 页面滚动 / 窗口尺寸变了,浮窗要跟着徽章走 —— 否则它会停在原地,指着空气。
|
|
13436
|
+
var onMove = function () { measure() }
|
|
13437
|
+
window.addEventListener('scroll', onMove, true)
|
|
13438
|
+
window.addEventListener('resize', onMove)
|
|
13439
|
+
return function () {
|
|
13440
|
+
if (focusTimer !== null) clearTimeout(focusTimer)
|
|
13441
|
+
window.removeEventListener('scroll', onMove, true)
|
|
13442
|
+
window.removeEventListener('resize', onMove)
|
|
13443
|
+
}
|
|
13444
|
+
}, [open])
|
|
13445
|
+
var popup = null
|
|
13446
|
+
if (open && details.length > 0) {
|
|
13447
|
+
var style = { left: '0px', top: '0px', bottom: 'auto', maxHeight: '240px', visibility: 'hidden' }
|
|
13448
|
+
if (pos !== null) {
|
|
13449
|
+
style.left = pos.left + 'px'
|
|
13450
|
+
style.visibility = 'visible'
|
|
13451
|
+
style.maxHeight = pos.maxHeight + 'px'
|
|
13452
|
+
style.top = pos.top === null || pos.top === undefined ? 'auto' : pos.top + 'px'
|
|
13453
|
+
style.bottom = pos.bottom === null || pos.bottom === undefined ? 'auto' : pos.bottom + 'px'
|
|
13454
|
+
}
|
|
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')
|
|
13458
|
+
return h('button', {
|
|
13459
|
+
key: key,
|
|
13460
|
+
type: 'button',
|
|
13461
|
+
className: 'dsm-lease-pop-x',
|
|
13462
|
+
disabled: busyId !== null,
|
|
13463
|
+
title: action,
|
|
13464
|
+
'aria-label': action,
|
|
13465
|
+
onClick: function (e) { if (e && e.stopPropagation) e.stopPropagation(); release(d, label, whole) },
|
|
13466
|
+
}, '×')
|
|
13467
|
+
}
|
|
13468
|
+
// 工作区粒度:认领是**按工作区**记的(同工作区的对话共用一份覆盖)—— 逐个列会话标题
|
|
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)))
|
|
13493
|
+
})
|
|
13494
|
+
})
|
|
13495
|
+
}
|
|
13496
|
+
var up = pos !== null && pos.bottom !== null && pos.bottom !== undefined
|
|
13497
|
+
popup = h('div', {
|
|
13498
|
+
className: 'dsm-lease-pop' + (up ? ' dsm-lease-pop-up' : ''),
|
|
13499
|
+
style: style,
|
|
13500
|
+
ref: popRef,
|
|
13501
|
+
role: 'dialog',
|
|
13502
|
+
'aria-label': label,
|
|
13503
|
+
onMouseLeave: onLeave,
|
|
13504
|
+
// 浮窗在徽章里面:点它不该触发行上的动作。
|
|
13505
|
+
onClick: function (e) { if (e && e.stopPropagation) e.stopPropagation() },
|
|
13506
|
+
}, h('div', { className: 'dsm-lease-pop-body' }, body))
|
|
13507
|
+
// 浮窗挂到 `document.body` 上:留在面板里会被祖先的 `overflow:hidden` 裁掉
|
|
13508
|
+
// (来源卡片就是 `overflow:hidden` —— 浮窗探出去的那截被裁掉,底下一张卡片的
|
|
13509
|
+
// 内容透上来,就是用户看到的「穿模」,用户 2026-11-05 实测)。
|
|
13510
|
+
// 拿不到 react-dom 就退回就地渲染:功能在,只是可能被裁。
|
|
13511
|
+
if (ReactDOM && typeof ReactDOM.createPortal === 'function' && typeof document !== 'undefined' && document.body) {
|
|
13512
|
+
popup = ReactDOM.createPortal(popup, document.body)
|
|
13513
|
+
}
|
|
13514
|
+
}
|
|
13515
|
+
return h('span', {
|
|
13516
|
+
className: 'dsm-tag dsm-tag-lease',
|
|
13517
|
+
ref: ref,
|
|
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)
|
|
13533
|
+
}
|
|
13534
|
+
/**
|
|
13535
|
+
* 租约徽章(0.21.2):**六个域共用的唯一出口** —— 同一 HTML 结构、同一 class 族、同一浮窗。
|
|
12722
13536
|
*
|
|
12723
13537
|
* 为什么必须共用一个函数:这六处的文案与判据曾经各写一份(技能来源用 `scope.intent.lease`,
|
|
12724
13538
|
* 其余五处干脆没有),口径一分叉就会出现"同一件事在 MCP 页写着临时运行、在记忆页什么都不说"。
|
|
@@ -12740,11 +13554,13 @@ function enabledMemoryCount(rules) {
|
|
|
12740
13554
|
if (!(count > 0)) return null
|
|
12741
13555
|
if (scopeIsSession()) return null
|
|
12742
13556
|
var runtime = props.runtime === true
|
|
12743
|
-
return h(
|
|
13557
|
+
return h(LeaseTagBadge, {
|
|
12744
13558
|
key: props.tagKey || undefined,
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
|
|
13559
|
+
t: t,
|
|
13560
|
+
count: count,
|
|
13561
|
+
runtime: runtime,
|
|
13562
|
+
details: scopeLeaseDetails(props.domain, props.key),
|
|
13563
|
+
})
|
|
12748
13564
|
}
|
|
12749
13565
|
|
|
12750
13566
|
// ---------- MCP 导入 / 导出(0.15.0 A1;0.20.x 起收 dsh 补丁片段)------------------
|
|
@@ -13210,7 +14026,7 @@ function enabledMemoryCount(rules) {
|
|
|
13210
14026
|
}
|
|
13211
14027
|
/**
|
|
13212
14028
|
* 写来源的全局意图:`off` 只是"默认不要"—— 还有会话在用就保持启用(租约),
|
|
13213
|
-
*
|
|
14029
|
+
* 不切断正在用它的对话。技能来源没有逐条「全部关闭」这一档(页头「全部关闭」可一次收掉)。
|
|
13214
14030
|
*/
|
|
13215
14031
|
function setSourceIntent(root, value) {
|
|
13216
14032
|
var key = String(root.key || '')
|
|
@@ -13221,9 +14037,9 @@ function enabledMemoryCount(rules) {
|
|
|
13221
14037
|
.then(function (res) {
|
|
13222
14038
|
if (res && res.ok === false) { setResult({ ok: false, text: translateError(t, res) }); return }
|
|
13223
14039
|
var warnings = res && res.warnings && res.warnings.length ? res.warnings.join(';') : ''
|
|
13224
|
-
var leases =
|
|
14040
|
+
var leases = scopeLeaseUnitCount('skillSources', key)
|
|
13225
14041
|
var text = value === 'on' ? t('done.enabled', { name: name })
|
|
13226
|
-
: 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 })
|
|
13227
14043
|
setResult({ ok: true, text: text + (warnings ? ' ' + warnings : '') })
|
|
13228
14044
|
refreshScope()
|
|
13229
14045
|
refresh(true)
|
|
@@ -13292,7 +14108,7 @@ function enabledMemoryCount(rules) {
|
|
|
13292
14108
|
.catch(function (error) { setResult({ ok: false, text: errMsg(error) }); })
|
|
13293
14109
|
.finally(function () { setBusy(false); });
|
|
13294
14110
|
}
|
|
13295
|
-
/**
|
|
14111
|
+
/** 全部关闭一条技能:一次性写 off + 清掉正在用它那几层的开关。 */
|
|
13296
14112
|
function stopSkillNow(target) {
|
|
13297
14113
|
setBusy(true); setResult(null);
|
|
13298
14114
|
apiCall("scope-stop-now", { domain: "skills", key: target.key })
|
|
@@ -13692,15 +14508,16 @@ function enabledMemoryCount(rules) {
|
|
|
13692
14508
|
root.mutable && !root.deletable ? h("span", { key: "notDeletable", className: "dsm-listrow-meta-info", title: t("status.notDeletable.hint") }, t("status.notDeletable")) : null,
|
|
13693
14509
|
];
|
|
13694
14510
|
// 行尾:详情常驻,其余动作收进 ⋯(与 MCP 页同一套口径):
|
|
13695
|
-
//
|
|
14511
|
+
// 全部关闭 —— 真有其他对话 / 工作区在临时用它时才出现;
|
|
13696
14512
|
// 编辑 / 删除 —— 官方内置与只读来源没有这两项(`mutable` / `deletable` 由服务端给)。
|
|
13697
14513
|
// 锁定期间只有「详情」还活着:其余都会改配置,一律置灰。
|
|
13698
14514
|
var actions = [];
|
|
13699
14515
|
var menuItems = [];
|
|
13700
14516
|
var stopLease = scopeLeaseCount('skills', skillKey);
|
|
13701
|
-
if (stopLease > 0) menuItems.push({ key: "stop", label: t("scope.unifiedClose"), danger: true, disabled: busy || scopeWriteLocked(anyLocked), onClick: function () { setModal({ type: "skill-stop-confirm", key: skillKey, name: skillName }); } });
|
|
13702
14517
|
if (root.mutable === true && !skill.shadowedBy) menuItems.push({ key: "edit", label: t("btn.edit"), disabled: busy || anyLocked, onClick: function () { openSkillEdit(root, skill); } });
|
|
13703
14518
|
if (root.deletable === true) menuItems.push({ key: "trash", label: t("btn.trash"), danger: true, disabled: busy || anyLocked, onClick: function () { setModal({ type: "trash-confirm", root: root.key, name: skill.name }); } });
|
|
14519
|
+
// 「全部关闭」放在最后(删除下面):它是停机动作(用户 2026-11-06)。
|
|
14520
|
+
if (stopLease > 0) menuItems.push({ key: "stop", label: t("scope.unifiedClose"), danger: true, disabled: busy || scopeWriteLocked(anyLocked), onClick: function () { setModal({ type: "skill-stop-confirm", key: skillKey, name: skillName }); } });
|
|
13704
14521
|
/**
|
|
13705
14522
|
* 「启用这个」写的是「同名技能该用哪个**来源**」的首选表(`/prefer` →
|
|
13706
14523
|
* `preferredSkills[名] = 来源 key`,`shadowedBy.root === 本行来源` 即表示撞名发生在
|
|
@@ -13755,11 +14572,13 @@ function enabledMemoryCount(rules) {
|
|
|
13755
14572
|
var rootCount = root.count == null ? root.skills.length : root.count;
|
|
13756
14573
|
var srcOnHere = srcOnInLayer(root);
|
|
13757
14574
|
// 全局意图 / 租约:来源关闭后还有会话在用时挂「临时运行 · N 个对话」;
|
|
13758
|
-
// 旧版本留下的 blocked
|
|
14575
|
+
// 旧版本留下的 blocked 仍显示「已全部关闭」,并给一个恢复入口。
|
|
13759
14576
|
// 会话层不显示(那一层只回答"这个对话看得到哪些技能")。
|
|
14577
|
+
// **默认来源(官方内置 / DSH 技能)也挂**:它们没有来源级开关,租约落在底下的
|
|
14578
|
+
// 技能上 —— 组头不标,用户只会在某一行技能上看到徽章(用户 2026-11-05 报障)。
|
|
13760
14579
|
var rootKeyHere = String(root.key || "");
|
|
13761
14580
|
var intentHere = scopeIntentOf('skillSources', rootKeyHere);
|
|
13762
|
-
var intentTag = scopeIsSession()
|
|
14581
|
+
var intentTag = scopeIsSession() ? null
|
|
13763
14582
|
: intentHere === 'blocked' ? h("span", { key: "intent", className: "dsm-tag dsm-tag-off", title: t("scope.intent.blockedHint") }, t("scope.intent.blocked"))
|
|
13764
14583
|
: h(react.Fragment, { key: "intent" }, leaseTag({ t: t, domain: 'skillSources', key: rootKeyHere, runtime: true }));
|
|
13765
14584
|
var section = h("section", { key: root.key, className: "dsm-source" }, h("div", { className: "dsm-source-head dsm-source-head-pin" }, h("button", { type: "button", className: "dsm-source-head-main", "aria-expanded": open, onClick: function () { setExpanded(Object.assign({}, expanded, { [root.key]: !baseOpen })); } }, h("span", { className: "dsm-source-title", title: displayName }, displayName), h("span", { className: "dsm-count" }, String(rootCount)), h("span", { className: "dsm-tag " + (root.scope === "project" ? "dsm-tag-on" : root.defaultSource === true ? "" : srcOnHere ? "dsm-tag-on" : "") }, root.scope === "project" ? t("status.project") : root.defaultSource === true ? t("status.manageable") : t(srcOnHere ? "status.source.on" : "status.source.off")), intentTag, root.scope === "project" ? h("span", { className: "dsm-tag" }, t("status.rank", { rank: root.rank })) : null, h("span", { className: "dsm-path", title: root.path }, root.path)), (function () {
|
|
@@ -13804,11 +14623,11 @@ function enabledMemoryCount(rules) {
|
|
|
13804
14623
|
return
|
|
13805
14624
|
}
|
|
13806
14625
|
// 全局层 = 写**意图**(0.21.2):off 之后仍被会话认领的来源保持启用(租约),
|
|
13807
|
-
//
|
|
14626
|
+
// 只有「全部关闭」才切断它们。
|
|
13808
14627
|
setSourceIntent(root, srcOn ? 'off' : 'on');
|
|
13809
14628
|
},
|
|
13810
14629
|
}));
|
|
13811
|
-
//
|
|
14630
|
+
// 技能来源没有逐条「全部关闭」:关闭只改默认,正在用它的会话 / 工作区照旧运行(租约),
|
|
13812
14631
|
// 页头「全部关闭」才把两格(技能 + 来源)的租约一起收掉。
|
|
13813
14632
|
// 旧版本留下的 blocked 仍要给出口 —— 那颗开关在 blocked 下是灰的,只能从这里恢复。
|
|
13814
14633
|
if (!scopeIsSession() && intentHere === 'blocked') {
|
|
@@ -15019,6 +15838,8 @@ function enabledMemoryCount(rules) {
|
|
|
15019
15838
|
var busy = bs[0], setBusy = bs[1]
|
|
15020
15839
|
var rs = React.useState(null)
|
|
15021
15840
|
var result = rs[0], setResult = rs[1]
|
|
15841
|
+
// 场景徽章那颗「×」的请求在途标记(`onRelease` 走这里,徽章内部的 busy 管不到)。
|
|
15842
|
+
var sceneReleaseBusy = React.useRef(null)
|
|
15022
15843
|
var ups = useUndoState()
|
|
15023
15844
|
var undo = ups[0], setUndo = ups[1], dismissUndo = ups[2]
|
|
15024
15845
|
var ms = React.useState(null)
|
|
@@ -15704,6 +16525,8 @@ function enabledMemoryCount(rules) {
|
|
|
15704
16525
|
name: m.name,
|
|
15705
16526
|
desc: m.description ? clipText(m.description, MEM_DESC_MAX) : null,
|
|
15706
16527
|
descTitle: m.description || null,
|
|
16528
|
+
// 单行:与下面的真记忆同一形状(用户 2026-11-06)。
|
|
16529
|
+
compact: true,
|
|
15707
16530
|
meta: React.createElement(React.Fragment, null,
|
|
15708
16531
|
React.createElement('span', { className: 'dsm-tag', title: t('scenes.mem.pendingTagTitle') }, t('scenes.mem.pendingTag')),
|
|
15709
16532
|
attachMark((m.files || []).length, (m.files || []).reduce(function (sum, f) { return sum + Number(f.size || 0) }, 0))),
|
|
@@ -15731,6 +16554,8 @@ function enabledMemoryCount(rules) {
|
|
|
15731
16554
|
// 记忆描述是自由正文的首行,可能很长:截断到 MEM_DESC_MAX,全文放 title。
|
|
15732
16555
|
desc: m.description ? clipText(m.description, MEM_DESC_MAX) : null,
|
|
15733
16556
|
descTitle: m.description || null,
|
|
16557
|
+
// 单行:描述排在名字右边(用户 2026-11-06)。
|
|
16558
|
+
compact: true,
|
|
15734
16559
|
// 带附件的 bundle 记忆标一枚回形针 + 个数(见 attachMark)。
|
|
15735
16560
|
meta: attachMark(m.attach && m.attach.count, m.attach && m.attach.bytes),
|
|
15736
16561
|
onChange: function () { toggleMemory(String(m.id)) },
|
|
@@ -16099,8 +16924,10 @@ function enabledMemoryCount(rules) {
|
|
|
16099
16924
|
checked: selected,
|
|
16100
16925
|
name: server.name,
|
|
16101
16926
|
desc: desc,
|
|
16927
|
+
// 单行:名字与工具数并排,标签与「编辑」在右边 —— 一屏多看几台(用户 2026-11-06)。
|
|
16928
|
+
compact: true,
|
|
16102
16929
|
meta: [
|
|
16103
|
-
server.live ? null : React.createElement('span', { key: 'nr', className: 'dsm-tag dsm-tag-
|
|
16930
|
+
server.live ? null : React.createElement('span', { key: 'nr', className: 'dsm-tag dsm-tag-quiet' }, t('scenes.mcp.notRunning')),
|
|
16104
16931
|
specText ? React.createElement('span', { key: 'spec' }, specText) : null,
|
|
16105
16932
|
hasNote ? React.createElement('span', { key: 'note', className: 'dsm-tag' }, t('scenes.mcp.hasNote')) : null,
|
|
16106
16933
|
],
|
|
@@ -16141,8 +16968,7 @@ function enabledMemoryCount(rules) {
|
|
|
16141
16968
|
React.createElement('div', { className: 'dsm-budget-meta' },
|
|
16142
16969
|
React.createElement('span', { className: 'dsm-label' }, t('scenes.mcp.noteLabel')),
|
|
16143
16970
|
React.createElement('span', { className: 'dsm-char-count' + (String(noteVal || '').length > MCP_NOTE_MAX ? ' dsm-char-over' : '') }, String(noteVal || '').length + ' / ' + MCP_NOTE_MAX)),
|
|
16144
|
-
React.createElement('input', { className: 'dsm-control', type: 'text', value: noteVal, maxLength: MCP_NOTE_MAX, placeholder: t('scenes.mcp.notePlaceholder'), onChange: function (e) { setMcpNote(server, e.target.value) } }),
|
|
16145
|
-
React.createElement('p', { className: 'dsm-help' }, t('scenes.mcp.noteHint'))),
|
|
16971
|
+
React.createElement('input', { className: 'dsm-control', type: 'text', value: noteVal, maxLength: MCP_NOTE_MAX, placeholder: t('scenes.mcp.notePlaceholder'), onChange: function (e) { setMcpNote(server, e.target.value) } })),
|
|
16146
16972
|
React.createElement('div', { className: 'dsm-field' },
|
|
16147
16973
|
React.createElement('div', { className: 'dsm-mcp-edit-tools-head' },
|
|
16148
16974
|
React.createElement('label', { className: 'dsm-label' }, t('scenes.mcp.toolsOf')),
|
|
@@ -16169,8 +16995,7 @@ function enabledMemoryCount(rules) {
|
|
|
16169
16995
|
React.createElement('div', { className: 'dsm-pick-empty' }, t('scenes.mcp.noTools')),
|
|
16170
16996
|
modal.drillError ? React.createElement('div', { className: 'dsm-seg-empty-error' }, modal.drillError) : null,
|
|
16171
16997
|
React.createElement('div', { className: 'dsm-seg-empty-actions' },
|
|
16172
|
-
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-secondary', disabled: drillTools === null, onClick: probeMcpTools }, t('scenes.mcp.probeTools'))))
|
|
16173
|
-
React.createElement('div', { className: 'dsm-seg-foot' }, t('scenes.mcp.drillHint')))))
|
|
16998
|
+
React.createElement('button', { type: 'button', className: 'dsm-btn dsm-btn-secondary', disabled: drillTools === null, onClick: probeMcpTools }, t('scenes.mcp.probeTools')))))))
|
|
16174
16999
|
}
|
|
16175
17000
|
/** 段 2:技能集。 */
|
|
16176
17001
|
/**
|
|
@@ -16211,17 +17036,74 @@ function enabledMemoryCount(rules) {
|
|
|
16211
17036
|
*/
|
|
16212
17037
|
var pickable = function (x) { return !x.shadowed && x.loadable !== false }
|
|
16213
17038
|
var pickableItems = allItems.filter(pickable)
|
|
16214
|
-
var
|
|
16215
|
-
|
|
16216
|
-
if (!q) return
|
|
17039
|
+
var q = String(modal.skillQuery || '').trim().toLowerCase()
|
|
17040
|
+
var matches = function (x) {
|
|
17041
|
+
if (!q) return true
|
|
16217
17042
|
// 搜索同时匹配技能名与来源名(用户按"来源"找技能是常见动作)。
|
|
16218
|
-
|
|
16219
|
-
|
|
16220
|
-
|
|
17043
|
+
var d = skillDisplay(x)
|
|
17044
|
+
return (d.name + ' ' + d.source + ' ' + d.key).toLowerCase().indexOf(q) >= 0
|
|
17045
|
+
}
|
|
17046
|
+
/**
|
|
17047
|
+
* **按来源分组**(用户 2026-11-06):平铺按技能名排,一屏四十六条混在一起很乱。
|
|
17048
|
+
* 组的次序 = 技能页里的次序(服务端给的 `rootIndex`);组内按技能名排。
|
|
17049
|
+
*/
|
|
17050
|
+
var groups = []
|
|
17051
|
+
var groupOf = {}
|
|
17052
|
+
allItems.forEach(function (x) {
|
|
17053
|
+
var d = skillDisplay(x)
|
|
17054
|
+
var rootKey = String((x && x.rootKey) || '')
|
|
17055
|
+
var g = groupOf[rootKey]
|
|
17056
|
+
if (!g) {
|
|
17057
|
+
g = { key: rootKey, label: d.source, rootIndex: Number(x.rootIndex) || 0, all: [], rows: [] }
|
|
17058
|
+
groupOf[rootKey] = g
|
|
17059
|
+
groups.push(g)
|
|
17060
|
+
}
|
|
17061
|
+
g.all.push(x)
|
|
17062
|
+
if (matches(x)) g.rows.push(x)
|
|
17063
|
+
})
|
|
17064
|
+
groups.sort(function (a, b) {
|
|
17065
|
+
if (a.rootIndex !== b.rootIndex) return a.rootIndex - b.rootIndex
|
|
17066
|
+
return a.label < b.label ? -1 : a.label > b.label ? 1 : 0
|
|
17067
|
+
})
|
|
17068
|
+
// 没有(匹配到的)技能的目录不显示(用户 2026-11-06)。
|
|
17069
|
+
groups = groups.filter(function (g) { return g.rows.length > 0 })
|
|
17070
|
+
groups.forEach(function (g) {
|
|
17071
|
+
g.rows.sort(function (x, y) {
|
|
17072
|
+
var xn = String((x && x.name) || '')
|
|
17073
|
+
var yn = String((y && y.name) || '')
|
|
17074
|
+
return xn.localeCompare(yn)
|
|
16221
17075
|
})
|
|
16222
|
-
})
|
|
16223
|
-
function (x) { return !!sections.skills && sections.skills.indexOf(x.key) >= 0 })
|
|
17076
|
+
})
|
|
16224
17077
|
var pickedCount = pickableItems.filter(function (x) { return sections.skills && sections.skills.indexOf(x.key) >= 0 }).length
|
|
17078
|
+
/** 展开状态:默认"这一组有勾选的就展开"(编辑时一眼看见自己选了什么)。 */
|
|
17079
|
+
function expandedOf(g, picked) {
|
|
17080
|
+
if (q) return true
|
|
17081
|
+
var saved = modal.skillExpanded
|
|
17082
|
+
if (saved && saved[g.key] !== undefined) return saved[g.key] === true
|
|
17083
|
+
return picked > 0
|
|
17084
|
+
}
|
|
17085
|
+
function setExpanded(key, open) {
|
|
17086
|
+
var next = Object.assign({}, modal.skillExpanded || {})
|
|
17087
|
+
next[key] = open === true
|
|
17088
|
+
setModal(Object.assign({}, modal, { skillExpanded: next }))
|
|
17089
|
+
}
|
|
17090
|
+
/** 组勾选框:全选 / 全不选这一整个来源。 */
|
|
17091
|
+
function toggleGroup(g, allChecked) {
|
|
17092
|
+
var list = sections.skills.slice()
|
|
17093
|
+
g.all.filter(pickable).forEach(function (x) {
|
|
17094
|
+
var i = list.indexOf(x.key)
|
|
17095
|
+
if (allChecked) { if (i >= 0) list.splice(i, 1) } else if (i < 0) list.push(x.key)
|
|
17096
|
+
})
|
|
17097
|
+
// 全不选就把这一组收起来(全选则展开)——「关闭后不显示里面的技能」。
|
|
17098
|
+
var nextExpanded = Object.assign({}, modal.skillExpanded || {})
|
|
17099
|
+
nextExpanded[g.key] = !allChecked
|
|
17100
|
+
// **一次写回**:两次 setModal 都拿同一份旧 modal,后一次会把前一次盖掉(勾选与
|
|
17101
|
+
// 展开会互相抵消)。
|
|
17102
|
+
setModal(Object.assign({}, modal, {
|
|
17103
|
+
sections: Object.assign({}, modalSections(), { skills: list }),
|
|
17104
|
+
skillExpanded: nextExpanded,
|
|
17105
|
+
}))
|
|
17106
|
+
}
|
|
16225
17107
|
return editorGroupNode({
|
|
16226
17108
|
title: t('memory.archive.skills'),
|
|
16227
17109
|
count: defined ? t('scenes.seg.checked', { checked: pickedCount, total: pickableItems.length }) : t('scenes.archive.sectionOff'),
|
|
@@ -16237,28 +17119,60 @@ function enabledMemoryCount(rules) {
|
|
|
16237
17119
|
hideFilter: !defined,
|
|
16238
17120
|
body: !defined
|
|
16239
17121
|
? React.createElement('div', { className: 'dsm-pick-empty', title: t('scenes.skills.hint') }, t('scenes.skills.hint.short'))
|
|
16240
|
-
:
|
|
16241
|
-
? React.createElement('div',
|
|
16242
|
-
var
|
|
16243
|
-
var
|
|
16244
|
-
|
|
16245
|
-
|
|
16246
|
-
|
|
16247
|
-
|
|
16248
|
-
|
|
16249
|
-
|
|
16250
|
-
|
|
16251
|
-
|
|
16252
|
-
|
|
16253
|
-
|
|
16254
|
-
|
|
16255
|
-
:
|
|
16256
|
-
|
|
16257
|
-
|
|
16258
|
-
|
|
16259
|
-
|
|
16260
|
-
|
|
16261
|
-
|
|
17122
|
+
: groups.length
|
|
17123
|
+
? React.createElement('div', { className: 'dsm-skill-groups' }, groups.map(function (g) {
|
|
17124
|
+
var pickableInGroup = g.all.filter(pickable)
|
|
17125
|
+
var picked = pickableInGroup.filter(function (x) { return sections.skills.indexOf(x.key) >= 0 }).length
|
|
17126
|
+
var allChecked = pickableInGroup.length > 0 && picked === pickableInGroup.length
|
|
17127
|
+
var some = picked > 0 && !allChecked
|
|
17128
|
+
var expanded = expandedOf(g, picked)
|
|
17129
|
+
return React.createElement('div', { key: 'g:' + g.key, className: 'dsm-skill-group' },
|
|
17130
|
+
React.createElement('div', { className: 'dsm-skill-group-head' },
|
|
17131
|
+
// 组勾选框:全选 / 全不选这一整个来源(部分勾上是横杠)。
|
|
17132
|
+
React.createElement('button', {
|
|
17133
|
+
key: 'box',
|
|
17134
|
+
type: 'button',
|
|
17135
|
+
className: 'dsm-rowselect-box' + (allChecked ? ' dsm-rowselect-box-on' : ''),
|
|
17136
|
+
disabled: busy || pickableInGroup.length === 0,
|
|
17137
|
+
title: allChecked ? t('scenes.skills.groupUncheck') : t('scenes.skills.groupCheck'),
|
|
17138
|
+
'aria-label': (allChecked ? t('scenes.skills.groupUncheck') : t('scenes.skills.groupCheck')) + ' · ' + g.label,
|
|
17139
|
+
onClick: function (e) { e.stopPropagation(); toggleGroup(g, allChecked) },
|
|
17140
|
+
}, allChecked
|
|
17141
|
+
? React.createElement('svg', { viewBox: '0 0 12 12', width: 10, height: 10, focusable: 'false' },
|
|
17142
|
+
React.createElement('path', { d: 'M2.5 6.5L5 9L9.5 3.5', fill: 'none', stroke: 'currentColor', strokeWidth: 1.5, strokeLinecap: 'round', strokeLinejoin: 'round' }))
|
|
17143
|
+
: some ? React.createElement('span', { className: 'dsm-rowselect-dash' }) : null),
|
|
17144
|
+
// 来源名 = 展开 / 收起(点勾选框才是全选 / 全不选)。
|
|
17145
|
+
React.createElement('button', {
|
|
17146
|
+
key: 'name',
|
|
17147
|
+
type: 'button',
|
|
17148
|
+
className: 'dsm-skill-group-name',
|
|
17149
|
+
title: g.label,
|
|
17150
|
+
onClick: function () { setExpanded(g.key, !expanded) },
|
|
17151
|
+
}, React.createElement(CaretIcon, { open: expanded, className: 'dsm-skill-group-caret' }), g.label),
|
|
17152
|
+
React.createElement('span', { key: 'count', className: 'dsm-skill-group-count' }, picked + '/' + pickableInGroup.length)),
|
|
17153
|
+
expanded
|
|
17154
|
+
? React.createElement('div', { className: 'dsm-skill-group-items' }, g.rows.map(function (item) {
|
|
17155
|
+
var offered = pickable(item)
|
|
17156
|
+
return RowSelect({
|
|
17157
|
+
disabled: busy || !offered,
|
|
17158
|
+
key: item.key,
|
|
17159
|
+
checked: offered && sections.skills.indexOf(item.key) >= 0,
|
|
17160
|
+
name: String((item && item.name) || ''),
|
|
17161
|
+
desc: null,
|
|
17162
|
+
descTitle: item.key,
|
|
17163
|
+
meta: item.shadowed
|
|
17164
|
+
? React.createElement('span', { className: 'dsm-tag dsm-tag-off', title: t('scenes.skills.shadowed.hint') }, t('status.shadowed'))
|
|
17165
|
+
: (item.loadable === false
|
|
17166
|
+
? React.createElement('span', { className: 'dsm-tag', title: t('scenes.skills.invalid.hint') }, t('status.invalid'))
|
|
17167
|
+
: (item.enabled === false ? React.createElement('span', { className: 'dsm-tag' }, t('memory.scene.off')) : null)),
|
|
17168
|
+
onChange: function () {
|
|
17169
|
+
var list = sections.skills.slice(); var i = list.indexOf(item.key)
|
|
17170
|
+
if (i >= 0) list.splice(i, 1); else list.push(item.key)
|
|
17171
|
+
setSections(Object.assign({}, modalSections(), { skills: list }))
|
|
17172
|
+
},
|
|
17173
|
+
})
|
|
17174
|
+
}))
|
|
17175
|
+
: null)
|
|
16262
17176
|
}))
|
|
16263
17177
|
: React.createElement('div', { className: 'dsm-pick-empty' }, modal.skillQuery ? t('scenes.mem.noMatch') : t('scenes.skills.empty')),
|
|
16264
17178
|
})
|
|
@@ -16327,6 +17241,9 @@ function enabledMemoryCount(rules) {
|
|
|
16327
17241
|
checked: sections.subagents.indexOf(item.name) >= 0,
|
|
16328
17242
|
name: item.name,
|
|
16329
17243
|
desc: item.description || null,
|
|
17244
|
+
// 单行:描述截断排在名字右边(全文在悬浮里),一屏多看几条(用户 2026-11-06)。
|
|
17245
|
+
descTitle: item.description || null,
|
|
17246
|
+
compact: true,
|
|
16330
17247
|
// 按模式配的工具限制摘要(没配就不显示):场景改不了会话的模式,
|
|
16331
17248
|
// 但要让用户看得见"这条人设在某些模式下是被限工具的"。
|
|
16332
17249
|
meta: personaRuleSummary(item),
|
|
@@ -16787,7 +17704,7 @@ function enabledMemoryCount(rules) {
|
|
|
16787
17704
|
scopeForgetSceneLeases()
|
|
16788
17705
|
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
16789
17706
|
}
|
|
16790
|
-
/**
|
|
17707
|
+
/** 单张场景卡的「全部关闭」:只退出进入过这一场的对话 / 工作区。 */
|
|
16791
17708
|
function stopOneScene(name) {
|
|
16792
17709
|
setBusy(true); setResult(null)
|
|
16793
17710
|
apiCall('scope-stop-now', { domain: 'scene', key: name }).then(function (res) {
|
|
@@ -16797,6 +17714,56 @@ function enabledMemoryCount(rules) {
|
|
|
16797
17714
|
scopeForgetSceneLeases(name)
|
|
16798
17715
|
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
16799
17716
|
}
|
|
17717
|
+
/**
|
|
17718
|
+
* 放掉**一个**对话的场景进入:让那个对话退出这个场景(其余对话照旧)。
|
|
17719
|
+
*
|
|
17720
|
+
* 写的是会话层的 scene = null(退出场景模式,回到它进入前的样子)—— 不是全局:
|
|
17721
|
+
* 全局正在用的那个场景不受影响。
|
|
17722
|
+
*/
|
|
17723
|
+
function exitSceneLease(d) {
|
|
17724
|
+
var id = String((d && d.id) || '')
|
|
17725
|
+
var name = String((d && d.title) || id)
|
|
17726
|
+
if (id === '') return
|
|
17727
|
+
// 徽章自带的 busy 只在它自己发请求时置位(`onRelease` 是立即返回的)——
|
|
17728
|
+
// 双击同一行会叠出两次 `scope-set`,第二次还会把已成功的提示再报一遍。
|
|
17729
|
+
if (sceneReleaseBusy.current !== null) return
|
|
17730
|
+
sceneReleaseBusy.current = id
|
|
17731
|
+
apiCall('scope-set', { sessionId: id, domain: 'scene', value: null }).then(function (res) {
|
|
17732
|
+
sceneReleaseBusy.current = null
|
|
17733
|
+
if (res && res.ok === false) {
|
|
17734
|
+
showPluginToast(t('scope.lease.releaseFailed', { title: name, error: translateError(t, res) || t('scope.lease.unknownError') }), 'err')
|
|
17735
|
+
return
|
|
17736
|
+
}
|
|
17737
|
+
showPluginToast(t('scope.lease.released', { title: name }), 'ok')
|
|
17738
|
+
// 全局快照有 150ms 的短 TTL:立刻重拉可能还是写前那一份。
|
|
17739
|
+
setTimeout(function () { refreshScope({ silent: true }) }, 400)
|
|
17740
|
+
}).catch(function (e) {
|
|
17741
|
+
sceneReleaseBusy.current = null
|
|
17742
|
+
showPluginToast(t('scope.lease.releaseFailed', { title: name, error: errMsg(e) || t('scope.lease.unknownError') }), 'err')
|
|
17743
|
+
})
|
|
17744
|
+
}
|
|
17745
|
+
/**
|
|
17746
|
+
* 场景行的租约徽章:几个对话 / 工作区在用这个场景(进入过)。
|
|
17747
|
+
*
|
|
17748
|
+
* 与其它域同一颗徽章(用户 2026-11-05:「场景缺少临时运行」):浮窗里逐行列出是
|
|
17749
|
+
* 哪几个,那颗「×」让其中一个退出这个场景。
|
|
17750
|
+
*/
|
|
17751
|
+
function sceneLeaseTag(name) {
|
|
17752
|
+
// 全局粒度下会话层整层不读(`scope-set` 也直接拒写)—— 这里的「谁在临时运行」
|
|
17753
|
+
// 既不生效、那颗「×」也只会报错,整颗徽章都不该出现。
|
|
17754
|
+
if (scopeIsSession() || scopeIsGlobalMode()) return null
|
|
17755
|
+
var count = scopeSceneLeaseCount(name)
|
|
17756
|
+
if (!(count > 0)) return null
|
|
17757
|
+
return React.createElement(LeaseTagBadge, {
|
|
17758
|
+
key: 'lease',
|
|
17759
|
+
t: t,
|
|
17760
|
+
count: count,
|
|
17761
|
+
runtime: true,
|
|
17762
|
+
domain: 'scene',
|
|
17763
|
+
details: scopeSceneLeaseDetails(name),
|
|
17764
|
+
onRelease: exitSceneLease,
|
|
17765
|
+
})
|
|
17766
|
+
}
|
|
16800
17767
|
/** 锁 / 解锁本会话的覆盖(0.21.2,决策 12):只冻结这一层,与场景锁互不干扰。 */
|
|
16801
17768
|
function toggleSessionLock() {
|
|
16802
17769
|
if (busy) return
|
|
@@ -17074,7 +18041,10 @@ function enabledMemoryCount(rules) {
|
|
|
17074
18041
|
// 编辑器里一眼可改,挂在卡片上只是每行多一枚药丸。只留**出问题时**的两枚
|
|
17075
18042
|
//(预设不见了 / 文件里不是它)—— 那才是需要人动手的信号。
|
|
17076
18043
|
promptMissing ? React.createElement('span', { className: 'dsm-tag dsm-tag-off', title: t('scenes.prompt.tag.hint') }, t('scenes.prompt.missing', { id: boundPrompt })) : null,
|
|
17077
|
-
promptMismatch ? React.createElement('span', { className: 'dsm-tag dsm-tag-off', title: t('scenes.prompt.mismatch.hint', { id: boundPrompt }) }, t('agm.file.mismatch')) : null
|
|
18044
|
+
promptMismatch ? React.createElement('span', { className: 'dsm-tag dsm-tag-off', title: t('scenes.prompt.mismatch.hint', { id: boundPrompt }) }, t('agm.file.mismatch')) : null,
|
|
18045
|
+
// 「临时运行 · N 个对话」:有几个对话 / 工作区进入了这一场(用户 2026-11-05:
|
|
18046
|
+
// 场景此前不挂这颗,别的域都挂 —— 同一件事两种长相)。
|
|
18047
|
+
sceneLeaseTag(name)),
|
|
17078
18048
|
// 描述固定第二行(用户 2026-10-18:「场景页的备注在设置页没显示,应该显示在第二行」):
|
|
17079
18049
|
// 在编辑器里填的描述就是这一句,它不在卡头那一行跟名字抢宽度。没有描述也渲染,
|
|
17080
18050
|
// 保持每张卡同样两行高,行与行之间对得齐。
|
|
@@ -17110,11 +18080,13 @@ function enabledMemoryCount(rules) {
|
|
|
17110
18080
|
key: 'menu',
|
|
17111
18081
|
label: t('row.menu', { name: label }),
|
|
17112
18082
|
items: [
|
|
17113
|
-
...(scopeIsSession() || scopeSceneLeaseCount(name) <= 0 ? [] : [{ key: 'stop', label: t('scope.unifiedClose'), danger: true, disabled: busy || sceneStats.locked > 0, title: sceneStats.locked > 0 ? t('scenes.lock.blockedEdit') : undefined, onClick: function () { setModal({ type: 'scene-stop', name: name }) } }]),
|
|
17114
18083
|
{ key: 'edit', label: t('scenes.row.edit'), disabled: busy || sceneLocked, title: sceneLocked ? t('scenes.lock.blockedEdit') : undefined, onClick: function () { openEditor(scene) } },
|
|
17115
18084
|
].concat(locked ? [] : [
|
|
17116
18085
|
{ key: 'delete', label: t('scenes.row.delete'), danger: true, disabled: busy || sceneLocked, title: sceneLocked ? t('scenes.lock.blockedEdit') : undefined, onClick: function () { setModal({ type: 'scene-delete', name: name }) } },
|
|
17117
|
-
])
|
|
18086
|
+
]).concat(
|
|
18087
|
+
// 「全部关闭」放在最后(删除下面):它是停机动作(用户 2026-11-06)。
|
|
18088
|
+
scopeIsSession() || scopeSceneLeaseCount(name) <= 0 ? [] : [{ key: 'stop', label: t('scope.unifiedClose'), danger: true, disabled: busy || sceneStats.locked > 0, title: sceneStats.locked > 0 ? t('scenes.lock.blockedEdit') : undefined, onClick: function () { setModal({ type: 'scene-stop', name: name }) } }],
|
|
18089
|
+
),
|
|
17118
18090
|
})))
|
|
17119
18091
|
})),
|
|
17120
18092
|
modal && modal.type === 'scene-delete' ? React.createElement(Modal, { key: 'sdel', className: 'dsm-modal-sm', title: t('memory.deleteScene.title'), closeLabel: t('btn.close'), onClose: function () { setModal(null) } },
|
|
@@ -17206,6 +18178,7 @@ function enabledMemoryCount(rules) {
|
|
|
17206
18178
|
}) : null,
|
|
17207
18179
|
)
|
|
17208
18180
|
}
|
|
18181
|
+
|
|
17209
18182
|
// ---------- 子智能体页:人设文件(~/.dsh/subagents/*.md)管理 ----------
|
|
17210
18183
|
/**
|
|
17211
18184
|
* 「思考强度」档位的按 (provider, model) 缓存。
|
|
@@ -17304,7 +18277,7 @@ function enabledMemoryCount(rules) {
|
|
|
17304
18277
|
}
|
|
17305
18278
|
/**
|
|
17306
18279
|
* 页头「全部关闭」:把各会话 / 工作区 / 场景里单独开着的人设一并停掉。
|
|
17307
|
-
*
|
|
18280
|
+
* 与快捷提示词同一条:只改全局启停名单停不到别的对话,得走全部关闭 op 清各层认领。
|
|
17308
18281
|
*/
|
|
17309
18282
|
function stopAllSubagents() {
|
|
17310
18283
|
var keys = scopeLeaseKeys('subagents')
|
|
@@ -17320,7 +18293,7 @@ function enabledMemoryCount(rules) {
|
|
|
17320
18293
|
scopeForgetLeases('subagents', keys)
|
|
17321
18294
|
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
17322
18295
|
}
|
|
17323
|
-
/**
|
|
18296
|
+
/** 单条人设的「全部关闭」:清掉各对话 / 工作区单独打开它的覆盖,全局启停不动。 */
|
|
17324
18297
|
function stopOnePersona(name) {
|
|
17325
18298
|
setResult(null)
|
|
17326
18299
|
setBusy(true)
|
|
@@ -18030,9 +19003,10 @@ function enabledMemoryCount(rules) {
|
|
|
18030
19003
|
key: 'menu',
|
|
18031
19004
|
label: t('row.menu', { name: p.name }),
|
|
18032
19005
|
items: [
|
|
18033
|
-
...(scopeLeaseCount('subagents', String(p.name)) > 0 ? [{ key: 'stop', label: t('scope.unifiedClose'), danger: true, disabled: busy || anyLocked, onClick: function () { setModal({ type: 'stop', name: p.name }) } }] : []),
|
|
18034
19006
|
{ key: 'edit', label: t('memory.edit'), disabled: busy, onClick: function () { openEditor(p.name) } },
|
|
18035
19007
|
{ key: 'delete', label: t('memory.delete'), danger: true, disabled: busy || anyLocked, onClick: function () { setModal({ type: 'delete', name: p.name }) } },
|
|
19008
|
+
// 「全部关闭」放在最后(删除下面):它是停机动作(用户 2026-11-06)。
|
|
19009
|
+
...(scopeLeaseCount('subagents', String(p.name)) > 0 ? [{ key: 'stop', label: t('scope.unifiedClose'), danger: true, disabled: busy || anyLocked, onClick: function () { setModal({ type: 'stop', name: p.name }) } }] : []),
|
|
18036
19010
|
],
|
|
18037
19011
|
}),
|
|
18038
19012
|
],
|
|
@@ -18663,7 +19637,7 @@ function enabledMemoryCount(rules) {
|
|
|
18663
19637
|
}
|
|
18664
19638
|
/**
|
|
18665
19639
|
* 页头「全部关闭」:把各会话 / 工作区 / 场景里单独开着的记忆一并停掉。
|
|
18666
|
-
* 只改全局索引停不到别的对话 ——
|
|
19640
|
+
* 只改全局索引停不到别的对话 —— 那些是各层自己的认领,得走全部关闭 op 清掉。
|
|
18667
19641
|
*/
|
|
18668
19642
|
function stopAllMemories() {
|
|
18669
19643
|
var keys = scopeLeaseKeys('memory')
|
|
@@ -18678,7 +19652,7 @@ function enabledMemoryCount(rules) {
|
|
|
18678
19652
|
scopeForgetLeases('memory', keys)
|
|
18679
19653
|
}).catch(function (e) { setBusy(false); setResult({ ok: false, text: errMsg(e) }) })
|
|
18680
19654
|
}
|
|
18681
|
-
/**
|
|
19655
|
+
/** 单条记忆的「全部关闭」:清掉各对话 / 工作区单独打开它的覆盖,全局启停不动。 */
|
|
18682
19656
|
function stopOneMemory(rule) {
|
|
18683
19657
|
var id = String(rule.id)
|
|
18684
19658
|
setBusy(true); setResult(null)
|
|
@@ -18962,9 +19936,10 @@ function enabledMemoryCount(rules) {
|
|
|
18962
19936
|
// 「编辑」在锁定态**照常可点**(用户 2026-10-12:「场景锁定下改成子智能体、
|
|
18963
19937
|
// 提示词、记忆可以打开编辑页面,但是不能保存」):只读地看一眼内容不该被锁挡住,
|
|
18964
19938
|
// 真正写盘的那一步(弹窗里的保存键)才置灰。其余会写盘的动作照旧置灰。
|
|
18965
|
-
...(scopeLeaseCount('memory', String(r.id)) > 0 ? [{ key: 'stop', label: t('scope.unifiedClose'), danger: true, disabled: busy || scopeWriteLocked(anyLocked), onClick: function () { setModal({ type: 'stop', rule: r }) } }] : []),
|
|
18966
19939
|
{ key: 'edit', label: t('memory.edit'), disabled: busy || shadowed, onClick: function () { openEditor(r) } },
|
|
18967
19940
|
{ key: 'delete', label: t('memory.delete'), danger: true, disabled: busy || shadowed || anyLocked, onClick: function () { setModal({ type: 'delete', rule: r }) } },
|
|
19941
|
+
// 「全部关闭」放在最后(删除下面):它是停机动作(用户 2026-11-06)。
|
|
19942
|
+
...(scopeLeaseCount('memory', String(r.id)) > 0 ? [{ key: 'stop', label: t('scope.unifiedClose'), danger: true, disabled: busy || scopeWriteLocked(anyLocked), onClick: function () { setModal({ type: 'stop', rule: r }) } }] : []),
|
|
18968
19943
|
],
|
|
18969
19944
|
})],
|
|
18970
19945
|
})
|
|
@@ -20908,6 +21883,8 @@ function enabledMemoryCount(rules) {
|
|
|
20908
21883
|
// 只有真渲染才看得出挤不挤(同 `_pages.VersionBadge` 那条理由)。
|
|
20909
21884
|
_pages.TrashModal = TrashModal
|
|
20910
21885
|
_pages.RetentionSelect = RetentionSelect
|
|
21886
|
+
// 租约浮窗:行距与「×」贴边这类排版只有真渲染才看得出,预览脚本直接渲染它。
|
|
21887
|
+
_pages.LeaseTagBadge = LeaseTagBadge
|
|
20911
21888
|
},
|
|
20912
21889
|
}
|
|
20913
21890
|
return module.exports
|