Add L0 index and anchor UI updates
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// Story Summary - Config
|
||||
// Plugin settings, panel config, and vector config.
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
// Story Summary - Config (v2 简化版)
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
|
||||
import { extension_settings } from "../../../../../../extensions.js";
|
||||
import { EXT_ID } from "../../../core/constants.js";
|
||||
@@ -37,6 +38,7 @@ export function getSummaryPanelConfig() {
|
||||
},
|
||||
vector: null,
|
||||
};
|
||||
|
||||
try {
|
||||
const raw = localStorage.getItem('summary_panel_config');
|
||||
if (!raw) return defaults;
|
||||
@@ -66,15 +68,29 @@ export function saveSummaryPanelConfig(config) {
|
||||
}
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
// 向量配置(简化版 - 只需要 key)
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
|
||||
export function getVectorConfig() {
|
||||
try {
|
||||
const raw = localStorage.getItem('summary_panel_config');
|
||||
if (!raw) return null;
|
||||
const parsed = JSON.parse(raw);
|
||||
const cfg = parsed.vector || null;
|
||||
|
||||
if (cfg && !cfg.textFilterRules) {
|
||||
cfg.textFilterRules = [...DEFAULT_FILTER_RULES];
|
||||
}
|
||||
|
||||
// 简化:统一使用硅基
|
||||
if (cfg) {
|
||||
cfg.engine = 'online';
|
||||
cfg.online = cfg.online || {};
|
||||
cfg.online.provider = 'siliconflow';
|
||||
cfg.online.model = 'BAAI/bge-m3';
|
||||
}
|
||||
|
||||
return cfg;
|
||||
} catch {
|
||||
return null;
|
||||
@@ -90,7 +106,19 @@ export function saveVectorConfig(vectorCfg) {
|
||||
try {
|
||||
const raw = localStorage.getItem('summary_panel_config') || '{}';
|
||||
const parsed = JSON.parse(raw);
|
||||
parsed.vector = vectorCfg;
|
||||
|
||||
// 简化配置
|
||||
parsed.vector = {
|
||||
enabled: vectorCfg?.enabled || false,
|
||||
engine: 'online',
|
||||
online: {
|
||||
provider: 'siliconflow',
|
||||
key: vectorCfg?.online?.key || '',
|
||||
model: 'BAAI/bge-m3',
|
||||
},
|
||||
textFilterRules: vectorCfg?.textFilterRules || DEFAULT_FILTER_RULES,
|
||||
};
|
||||
|
||||
localStorage.setItem('summary_panel_config', JSON.stringify(parsed));
|
||||
CommonSettingStorage.set(SUMMARY_CONFIG_KEY, parsed);
|
||||
} catch (e) {
|
||||
|
||||
@@ -6,7 +6,6 @@ import { chat_metadata } from "../../../../../../../script.js";
|
||||
import { EXT_ID } from "../../../core/constants.js";
|
||||
import { xbLog } from "../../../core/debug-core.js";
|
||||
import { clearEventVectors, deleteEventVectorsByIds } from "../vector/storage/chunk-store.js";
|
||||
import { clearEventTextIndex } from '../vector/retrieval/text-search.js';
|
||||
|
||||
const MODULE_ID = 'summaryStore';
|
||||
const FACTS_LIMIT_PER_SUBJECT = 10;
|
||||
@@ -422,7 +421,6 @@ export async function clearSummaryData(chatId) {
|
||||
await clearEventVectors(chatId);
|
||||
}
|
||||
|
||||
clearEventTextIndex();
|
||||
|
||||
xbLog.info(MODULE_ID, '总结数据已清空');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user