diff --git a/panel.html b/panel.html index 3819e64..08352c3 100644 --- a/panel.html +++ b/panel.html @@ -877,73 +877,98 @@

-
-
-
-
-
核心能力
-
- 决定主记忆链路是否运行,以及常用的强化能力是否开启。 -
-
+
+ + + + + + + + + + +
+
@@ -981,124 +1006,6 @@
-
-
-
-
增强能力
-
- 用于补充召回链路、压缩维护和长期叙事观察的可选模块。 -
-
-
-
- - - - - - - -
-
-
@@ -1249,495 +1156,702 @@

-
-
-
-
-
提取
-
- 控制自动提取的频率和按轮计的上下文窗口。默认 2 - 轮,通常约等于向前补 4 层普通消息。 -
+
+
+
+
提取
+
+ 控制自动提取的频率和按轮计的上下文窗口。默认 2 + 轮,通常约等于向前补 4 层普通消息。
-
- - -
-
- - -
-
- -
-
-
-
召回与注入
-
- 控制最终注入层级。当前注入走 - IN_CHAT@Depth,数值越大越靠前。 -
-
-
- 在“功能开关”中启用后生效。 -
-
-
- - -
-
- -
-
-
-
向量预筛
-
- 控制是否启用向量候选检索,以及向量阶段输出的 Top-K - 宽度。 -
-
-
- 在“功能开关”中启用后生效。 -
-
- -
- - -
-
- -
-
-
-
图扩散
-
- 控制是否沿图结构继续扩散候选,以及扩散阶段保留的候选上限。 -
-
-
- 在“功能开关”中启用后生效。 -
-
- -
- - -
-
- -
-
-
-
召回增强
-
- 先调多意图、扩散回拉和时间链;更后面的候选整理与弱信号补抓收进折叠里。 -
-
-
- 在“功能开关”中启用后生效。 -
-
- -
- - -
-
- - -
- -
- - -
-
- -
-
更多高级项
-
- 收纳上下文混合查询、文字补分,以及 DPP、共现补强和弱信号残差召回。 -
-
- -
-
-
作用域记忆
-
- 让召回优先理解“谁怎么记得这件事”和“当前地区的客观事实”,避免所有记忆都用上帝视角混在一起。 -
- - - +
+
- 每 N 条回复提取 -
-
- - -
-
- - -
-
- - -
-
- - -
- - -
-
-
查询纠偏
-
- 让召回在“那后来呢”“他为什么这么做”这类追问里,也能借最近上下文稳一点。 -
- -
- - -
-
- - -
- -
- - -
-
-
-
DPP 与共现补强
-
- 用来减少重复候选,并在需要时轻推经常一起出现的相关节点。 -
- -
- -
- 提取上下文轮数 +
+
+
+
+ +
+
+
召回与注入
+
+ 控制最终注入层级。当前注入走 + IN_CHAT@Depth,数值越大越靠前。 +
+
+
+
+
+ 在“功能开关”中启用后生效。 +
+
+ + +
+
+
+
+ +
+
+
向量预筛
+
+ 控制是否启用向量候选检索,以及向量阶段输出的 Top-K + 宽度。 +
+
+
+
+
+ 在“功能开关”中启用后生效。 +
+ +
+ + +
+
+
+
+ +
+
+
图扩散
+
+ 控制是否沿图结构继续扩散候选,以及扩散阶段保留的候选上限。 +
+
+
+
+
+ 在“功能开关”中启用后生效。 +
+ +
+ + +
+
+
+
+ +
+
+
召回增强
+
+ 先调多意图、扩散回拉和时间链;更后面的候选整理与弱信号补抓收进折叠里。 +
+
+
+
+
+ 在“功能开关”中启用后生效。 +
+ +
+ + +
+
+ +
- 时间链强度
+
+ +
+
更多高级项
+
+ 收纳上下文混合查询、文字补分,以及 DPP、共现补强和弱信号残差召回。 +
+
+ +
+
+
作用域记忆
+
+ 让召回优先理解“谁怎么记得这件事”和“当前地区的客观事实”,避免所有记忆都用上帝视角混在一起。 +
+ + + +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + +
+
+
查询纠偏
+
+ 让召回在“那后来呢”“他为什么这么做”这类追问里,也能借最近上下文稳一点。 +
+ +
+ + +
+
+ + +
+ +
+ + +
+
+
+
DPP 与共现补强
+
+ 用来减少重复候选,并在需要时轻推经常一起出现的相关节点。 +
+ +
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+
+
+
弱信号召回
+
+ 仅在直连 embedding 且本地有足够向量时使用,用于补抓被主主题压住的弱线索。 +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+
+ +
+
+
混合评分
+
+ 评分层始终运行;下面 3 + 个权重共同决定图扩散、向量相似和重要度在召回中的占比。 +
+
+
+
+
+ 在“功能开关”中启用后生效。 +
- 图扩散权重 + +
+
+ + +
+
+ +
+
+
+
+ +
+
+
LLM 精确召回
+
+ 控制是否启用 LLM 精排,以及传给 LLM + 的上下文消息数、候选池大小与最终保留上限。 +
+
+
+
+
+ 在“功能开关”中启用后生效。 +
+ +
+ + +
+
+ + +
+
+ +
-
-
弱信号召回
-
- 仅在直连 embedding 且本地有足够向量时使用,用于补抓被主主题压住的弱线索。 -
- -
- - +
+
+ +
+
+
记忆整合
+
+ 控制近邻搜索规模和冲突判定阈值。 +
+
+
+
+
+ 在“功能开关”中启用后生效。
- 近邻数量 -
-
- - -
-
- - -
-
- -
-
-
-
- -
-
-
-
混合评分
-
- 评分层始终运行;下面 3 - 个权重共同决定图扩散、向量相似和重要度在召回中的占比。 -
-
-
- 在“功能开关”中启用后生效。 -
-
-
- - -
-
- - -
-
- - -
-
- -
-
-
-
LLM 精确召回
-
- 控制是否启用 LLM 精排,以及传给 LLM - 的上下文消息数、候选池大小与最终保留上限。 -
-
-
- 在“功能开关”中启用后生效。 -
-
- -
- - -
-
- - -
-
- - -
-
- -
-
-
-
记忆整合
-
- 控制近邻搜索规模和冲突判定阈值。 -
-
-
- 在“功能开关”中启用后生效。 -
-
-
- - -
-
- - -
-
- -
-
-
-
概要
-
- 控制全局概要节点的生成周期。 -
-
-
- 在“功能开关”中启用后生效。 -
-
-
- - -
-
- -
-
-
-
惊奇触发
-
- 高信息量触发规则和阈值。 -
-
-
- 在“功能开关”中启用后生效。 -
-
-
- - -
-
- - -
-
- -
-
-
-
睡眠遗忘
-
- 配置遗忘阈值和执行周期。 -
-
-
- 在“功能开关”中启用后生效。 -
-
-
- - -
-
- - -
-
- -
-
-
-
自动整合触发
-
- 本批新增节点不足时,仍会检查是否与旧记忆高度重复;命中后照样自动整合。 +
+ +
-
- + +
+
+
概要
+
+ 控制全局概要节点的生成周期。 +
+
+
+
- +
+ 在“功能开关”中启用后生效。 +
+
+ + +
+
-
-
-
-
自动压缩周期
-
- 按提取次数计数;只有到周期点时才会尝试自动压缩。 -
-
-
- 在“功能开关”中启用后生效。 +
+
+
惊奇触发
+
+ 高信息量触发规则和阈值。
-
- +
- +
+ 在“功能开关”中启用后生效。 +
+
+ + +
+
+ + +
+
-
-
-
-
概率召回
-
- 调整弱相关记忆被纳入召回的概率。 -
-
-
- 在“功能开关”中启用后生效。 +
+
+
睡眠遗忘
+
+ 配置遗忘阈值和执行周期。
-
- - +
+
+
+ 在“功能开关”中启用后生效。 +
+
+ + +
+
+ + +
+
-
-
-
-
反思
-
- 控制叙事反思节点的生成间隔。 -
-
-
- 在“功能开关”中启用后生效。 +
+
+
自动整合触发
+
+ 本批新增节点不足时,仍会检查是否与旧记忆高度重复;命中后照样自动整合。
-
- +
+
+ + +
+
+
+
+ +
+
+
自动压缩周期
+
+ 按提取次数计数;只有到周期点时才会尝试自动压缩。 +
+
+
+
- +
+ 在“功能开关”中启用后生效。 +
+
+ + +
+
+
+
+ +
+
+
概率召回
+
+ 调整弱相关记忆被纳入召回的概率。 +
+
+
+
+
+ 在“功能开关”中启用后生效。 +
+
+ + +
+
+
+
+ +
+
+
反思
+
+ 控制叙事反思节点的生成间隔。 +
+
+
+
+
+ 在“功能开关”中启用后生效。 +
+
+ + +
+
diff --git a/panel.js b/panel.js index e924b56..90c92ad 100644 --- a/panel.js +++ b/panel.js @@ -3068,16 +3068,6 @@ function _handleTaskProfileWorkspaceInput(event) { const target = event.target; if (!(target instanceof HTMLElement)) return; - if (target.id === "bme-task-profile-name") { - _updateCurrentTaskProfile( - (draft) => { - draft.name = String(target.value || "").trim() || draft.name; - }, - { refresh: false }, - ); - return; - } - if (target.matches("[data-block-field]")) { _persistSelectedBlockField(target, false); return; @@ -3556,14 +3546,16 @@ async function _handleTaskProfileWorkspaceClick(event) { toastr.success("当前预设已保存", "ST-BME"); return; case "rename-profile": { - const nameInput = document.getElementById("bme-task-profile-name"); - const nextName = String(nameInput?.value || "").trim(); - if (!nextName) { + const current = String(selectedProfile?.name || "").trim(); + const nextName = window.prompt("请输入预设名称", current); + if (nextName == null) return; + const trimmed = String(nextName).trim(); + if (!trimmed) { toastr.info("预设名称不能为空", "ST-BME"); return; } _updateCurrentTaskProfile((draft) => { - draft.name = nextName; + draft.name = trimmed; }); toastr.success("预设名称已更新", "ST-BME"); return; @@ -3683,8 +3675,8 @@ function _renderTaskProfileWorkspace(state) { return `
-
-
+
+
${state.taskTypeOptions .map( (item) => ` @@ -3693,111 +3685,89 @@ function _renderTaskProfileWorkspace(state) { data-task-action="switch-task-type" data-task-type="${_escAttr(item.id)}" type="button" - > - ${_escHtml(item.label)} - + >${_escHtml(item.label)} `, ) .join("")} - +
+
+
-
-
-
-
- ${_escHtml(taskMeta?.label || state.taskType)} 任务预设 -
-
- ${_escHtml(taskMeta?.description || "")} -
-
-
- - ${state.profile.builtin ? "内置" : "自定义"} - - 更新于 ${_escHtml(profileUpdatedAt)} -
-
- -
-
- - ${state.bucket.profiles .map( (profile) => ` - - `, + + `, ) .join("")} +
+ + ${state.profile.builtin ? "内置" : "自定义"} + + 更新于 ${_escHtml(profileUpdatedAt)} +
-
- - +
+ + + + + +
-
- - - - - - - - +
+ ${TASK_PROFILE_TABS.map( + (tab) => ` + + `, + ).join("")} +
+ +
+ ${ + state.taskTabId === "generation" + ? _renderTaskGenerationTab(state) + : state.taskTabId === "regex" + ? _renderTaskRegexTab(state) + : state.taskTabId === "debug" + ? _renderTaskDebugTab(state) + : _renderTaskPromptTab(state) + }
- -
- ${TASK_PROFILE_TABS.map( - (tab) => ` - - `, - ).join("")} -
- -
- ${ - state.taskTabId === "generation" - ? _renderTaskGenerationTab(state) - : state.taskTabId === "regex" - ? _renderTaskRegexTab(state) - : state.taskTabId === "debug" - ? _renderTaskDebugTab(state) - : _renderTaskPromptTab(state) - } -
`; } diff --git a/style.css b/style.css index 109873c..7f983d1 100644 --- a/style.css +++ b/style.css @@ -1311,7 +1311,8 @@ #st-bme-panel textarea.bme-config-textarea, #st-bme-panel input.bme-search-input, #st-bme-panel .bme-node-detail-input, -#st-bme-panel .bme-node-detail-textarea { +#st-bme-panel .bme-node-detail-textarea, +#st-bme-panel .bme-task-editor-preset-select { background-color: var(--bme-surface-high) !important; color: var(--bme-on-surface) !important; } @@ -1381,6 +1382,20 @@ color: #f4f4f5 !important; } +/* --- 压制宿主注入的原生对号 (SillyTavern 全局 checkbox::before) --- */ +#st-bme-panel input[type="checkbox"]::before, +#st-bme-panel-overlay input[type="checkbox"]::before { + content: "" !important; + display: none !important; + background: none !important; + background-image: none !important; + -webkit-mask-image: none !important; + mask-image: none !important; + width: 0 !important; + height: 0 !important; + visibility: hidden !important; +} + #st-bme-panel input.bme-config-input:-webkit-autofill, #st-bme-panel input.bme-config-input:-webkit-autofill:hover, #st-bme-panel input.bme-config-input:-webkit-autofill:focus, @@ -1640,6 +1655,7 @@ .bme-toggle-item input[type="checkbox"] { -webkit-appearance: none; + -moz-appearance: none; appearance: none; width: 40px; height: 22px; @@ -1652,6 +1668,8 @@ position: relative; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease; + color: transparent; + overflow: hidden; } .bme-toggle-item input[type="checkbox"]::after { @@ -1667,13 +1685,158 @@ } .bme-toggle-item input[type="checkbox"]:checked { - background: var(--bme-primary, #a078ff); - border-color: var(--bme-primary, #a078ff); + background: color-mix(in srgb, var(--bme-primary) 45%, var(--bme-surface-high, #2a2a2d)); + border-color: color-mix(in srgb, var(--bme-primary) 55%, transparent); } .bme-toggle-item input[type="checkbox"]:checked::after { transform: translateX(18px); - background: #fff; + background: var(--bme-primary-text, #ffb2b7); +} + +/* --- CAPABILITY CARD GRID (Feature Toggles) --- */ + +.bme-capability-grid { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 14px; +} + +.bme-capability-card { + display: flex; + flex-direction: column; + background: var(--bme-surface-container); + border: 1px solid var(--bme-border); + border-radius: 12px; + padding: 16px; + cursor: pointer; + transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; + position: relative; +} + +.bme-capability-card:hover { + border-color: var(--bme-primary); + box-shadow: 0 0 0 1px var(--bme-primary), 0 4px 12px rgba(0, 0, 0, 0.15); +} + +.bme-cap-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 10px; +} + +.bme-cap-icon { + width: 34px; + height: 34px; + border-radius: 8px; + display: flex; + align-items: center; + justify-content: center; + background: var(--bme-primary); + color: #fff; + font-size: 15px; + flex-shrink: 0; +} + +.bme-cap-title { + font-size: 13px; + font-weight: 600; + color: var(--bme-on-surface); + margin-bottom: 4px; + line-height: 1.3; +} + +.bme-cap-desc { + font-size: 11.5px; + color: var(--bme-on-surface-dim); + line-height: 1.45; +} + +.bme-capability-card input[type="checkbox"] { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + width: 40px; + height: 22px; + background: var(--bme-surface-high); + border-radius: 11px; + position: relative; + cursor: pointer; + transition: background 0.2s; + flex-shrink: 0; + border: 1px solid var(--bme-border); + color: transparent; + overflow: hidden; +} + +.bme-capability-card input[type="checkbox"]::after { + content: ""; + position: absolute; + width: 16px; + height: 16px; + border-radius: 50%; + background: var(--bme-on-surface-dim); + top: 2px; + left: 3px; + transition: transform 0.2s, background 0.2s; +} + +.bme-capability-card input[type="checkbox"]:checked { + background: color-mix(in srgb, var(--bme-primary) 45%, var(--bme-surface-high)); + border-color: color-mix(in srgb, var(--bme-primary) 55%, transparent); +} + +.bme-capability-card input[type="checkbox"]:checked::after { + transform: translateX(18px); + background: var(--bme-primary-text, #ffb2b7); +} + +/* --- STRIPE ROW LAYOUT (Advanced Settings) --- */ + +.bme-stripe-section { + display: flex; + flex-direction: column; +} + +.bme-stripe-row { + display: flex; + gap: 32px; + padding: 20px 0; + border-bottom: 1px solid var(--bme-border); +} + +.bme-stripe-row:last-child { + border-bottom: none; +} + +.bme-stripe-label { + flex: 0 0 28%; + max-width: 28%; + padding-top: 4px; +} + +.bme-stripe-label-title { + font-size: 14px; + font-weight: 600; + color: var(--bme-on-surface); + margin-bottom: 6px; + line-height: 1.3; +} + +.bme-stripe-label-desc { + font-size: 12px; + color: var(--bme-on-surface-dim); + line-height: 1.55; +} + +.bme-stripe-content { + flex: 1; + min-width: 0; +} + +.bme-stripe-content > .bme-config-card { + margin-bottom: 0; } .bme-prompt-card-actions { @@ -1715,7 +1878,149 @@ .bme-task-shell { display: flex; flex-direction: column; - gap: 16px; + gap: 12px; +} + +.bme-task-action-bar { + display: flex; + align-items: center; + gap: 12px; + flex-wrap: wrap; +} + +.bme-task-action-bar-right { + margin-left: auto; + display: flex; + align-items: center; + gap: 6px; +} + +.bme-task-segmented-control { + display: inline-flex; + background: var(--bme-surface-container); + border-radius: 10px; + padding: 3px; + gap: 2px; + border: 1px solid var(--bme-border); +} + +.bme-task-segmented-control .bme-task-type-btn { + border: none; + border-radius: 8px; + min-height: 32px; + padding: 0 14px; + font-size: 12.5px; + background: transparent; + color: var(--bme-on-surface-dim); + transition: background 0.15s, color 0.15s; +} + +.bme-task-segmented-control .bme-task-type-btn:hover { + background: rgba(255, 255, 255, 0.06); + color: var(--bme-on-surface); +} + +.bme-task-segmented-control .bme-task-type-btn.active { + background: var(--bme-primary); + color: #fff; + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); +} + +.bme-task-master-detail { + display: flex; + gap: 0; + border: 1px solid var(--bme-border); + border-radius: 12px; + overflow: hidden; + min-height: 480px; + background: var(--bme-surface-container); +} + +.bme-visually-hidden { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +} + +.bme-task-editor-kicker { + font-size: 10px; + font-weight: 700; + letter-spacing: 0.04em; + text-transform: uppercase; + color: var(--bme-on-surface-dim); + line-height: 1.2; +} + +.bme-task-editor-preset-select { + flex: 1; + min-width: 200px; + min-height: 40px; + font-size: 16px; + font-weight: 600; + padding: 6px 32px 6px 12px; + line-height: 1.35; + border-radius: 8px; + border: 1px solid var(--bme-border); + cursor: pointer; +} + +.bme-task-profile-editor { + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + overflow-y: auto; +} + +.bme-task-editor-header { + padding: 16px 20px; + border-bottom: 1px solid var(--bme-border); + display: flex; + flex-direction: column; + gap: 10px; +} + +.bme-task-editor-title-row { + display: flex; + align-items: center; + gap: 12px; + flex-wrap: wrap; +} + +.bme-task-editor-preset-select:hover, +.bme-task-editor-preset-select:focus { + border-color: var(--bme-primary); + outline: none; +} + +.bme-task-editor-actions { + display: flex; + gap: 6px; + flex-wrap: wrap; +} + +.bme-task-editor-actions .bme-config-secondary-btn { + font-size: 12px; + min-height: 28px; + padding: 0 10px; + gap: 4px; +} + +.bme-task-profile-editor > .bme-task-subtabs { + padding: 0 20px; + border-bottom: 1px solid var(--bme-border); +} + +.bme-task-profile-editor > .bme-task-tab-body { + flex: 1; + padding: 16px 20px; + overflow-y: auto; } .bme-task-header { @@ -3734,3 +4039,62 @@ font-size: 10px; } } + +/* --- RESPONSIVE: New Layout Components --- */ + +@media (max-width: 768px) { + .bme-capability-grid { + grid-template-columns: repeat(2, 1fr); + gap: 10px; + } + + .bme-stripe-row { + flex-direction: column; + gap: 12px; + } + + .bme-stripe-label { + flex: none; + max-width: 100%; + } + + .bme-task-master-detail { + flex-direction: column; + min-height: auto; + } + + .bme-task-editor-preset-select { + min-width: 0; + width: 100%; + flex: 1 1 100%; + } + + .bme-task-editor-title-row { + flex-direction: column; + align-items: stretch; + } + + .bme-task-profile-badges { + justify-content: flex-start; + } + + .bme-task-segmented-control { + flex-wrap: wrap; + } + + .bme-task-action-bar { + flex-direction: column; + align-items: stretch; + } + + .bme-task-action-bar-right { + margin-left: 0; + justify-content: flex-end; + } +} + +@media (max-width: 520px) { + .bme-capability-grid { + grid-template-columns: 1fr; + } +}