纳入小白板内容+世界书读取逻辑修正 (#23) (#25)

* Strip everything before and including </think> (handles unclosed think blocks)

* Log 样式优化

* Log样式优化

* 小白板内容曝露给ena-planner

* 小白板内容曝露给ena-planner

* 修正世界书宏读取问题

* 修正summary触发绿灯的问题

* 向量存储到ST端

* 向量存储到ST端

* 向量到ST服务器

* 向量存储到ST端

* backup file名称修正

* 存取向量逻辑修正

* 切聊天时清掉旧 summary

* 新增向量备份管理 UI(清单 + Modal)

- vector-io.js:新增 fetchManifest / upsertManifestEntry / deleteServerBackup 等清单管理函数;backupToServer 成功后自动写入 LWB_BackupManifest.json
- story-summary.html:在服务器 IO 区域新增「管理」按钮及独立 Modal 弹窗
- story-summary-ui.js:新增备份列表渲染、删除确认、只读模式降级逻辑
- story-summary.js:新增 VECTOR_LIST_BACKUPS / VECTOR_DELETE_BACKUP 消息处理



* 备份管理 Modal 移至父窗口,修复层级与配色问题

- Modal 从 iframe 移到父窗口 DOM(z-index:100000),不再被 settings modal 遮挡
- 改为白底深色文字,配色清晰可读
- 删除逻辑直接在父窗口调用,无需跨帧消息
- 简化 story-summary-ui.js,移除 modal 相关代码



* 删除聊天时自动清理服务器向量备份

- vector-io.js:导出 getBackupFilename
- story-summary.js:监听 CHAT_DELETED / GROUP_CHAT_DELETED,静默删除对应 zip 和清单条目



* 修复 serverPath 含前导斜杠导致删除失败的问题

buildSafeServerPath 比较前 strip 前导 /,upsertManifestEntry 写入前同样 normalize,
确保清单和校验逻辑使用统一格式



* normalizeManifestEntry 读取时同步 strip serverPath 前导斜杠

补全斜杠 normalize 的覆盖点:写入(upsertManifestEntry)、校验(buildSafeServerPath)、
读取(normalizeManifestEntry)三处统一,旧清单条目自动修正



* 重要NPC生成路径:拆分添加按钮 + 完整角色档案模板

- 陌路人卡片"添加"按钮拆为"重要"(importantNpc)和"背景板"(npc)两个
- 新增 importantNpc 生成路径,传递 npcType 贯穿 genAddCt → CHECK_STRANGER_WORLDBOOK_RESULT → GENERATE_NPC_RESULT
- 新增 importantNpc JSON 模板:白描外貌、世界观适配、性格调色盘+衍生、台词示例、结构化二次解释
- 新增 importantNpc UAUA 提示词:内嵌白描规则+正反示范、调色盘衍生写法指导



* 高级设置模板编辑器加注授权声明



* 授权声明仅在重要NPC生成模板下显示



---------

Co-authored-by: Hao19911125 <99091644+Hao19911125@users.noreply.github.com>
Co-authored-by: LittleWhiteBox Dev <dev@littlewhitebox.local>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
RT15548
2026-03-19 00:50:14 +08:00
committed by GitHub
parent 80f7e37843
commit 11e48f8dc5
8 changed files with 861 additions and 7 deletions

View File

@@ -561,6 +561,18 @@
style="flex:1">导入向量数据</button>
</div>
<div class="settings-hint" id="vector-io-status"></div>
<div class="settings-btn-row" style="margin-top:6px">
<button class="btn btn-sm" id="btn-backup-server"
style="flex:1">☁️ 备份向量到服务器</button>
<button class="btn btn-sm" id="btn-restore-server"
style="flex:1">☁️ 从服务器恢复向量</button>
</div>
<div class="settings-hint" id="server-io-status"></div>
<div style="margin-top:6px">
<button class="btn btn-sm" id="btn-manage-backups" style="width:100%">
☁️ 管理服务器向量备份
</button>
</div>
</div>
</div>
</div>
@@ -854,6 +866,7 @@
</div>
</div>
</div>
</body>
</html>