feat: SudoEngine / ChatTagFolder 2.0 —群聊权限隔离引擎(前端)#132
Open
infinite-vector wants to merge 1 commit into
Open
Conversation
…ation Co-authored-by: Lucifa-sakula <Lucifa-sakula@users.noreply.github.com>
Owner
|
这个有点意思!我明天来研究一下先 |
Owner
|
感觉设计不够优雅,我明天来重构一下。 |
Contributor
Author
|
经典的灵感启发莱恩您,而后摧枯拉朽回炉重构的流程啊! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
基于竹林夕弦(@Lucifa-sakula)的 TagFolder 1.0 后端插件和 ChatTagFolder 2.0 设计文档,在 VCPChat 前端(Electron main进程)实现了群聊权限隔离引擎 SudoEngine。
功能
-:secret 标签:私密内心独白,仅发送者本人可见,其他 Agent 的上下文中被物理删除
:group-x 标签:组内密语,仅同组成员可见。Agent 不知道自己的组号和队友(-x 占位符,运行时由 SudoEngine 查.lock 文件判断同组)
group:init a:[b]:[c] 指令:随机分组,per-topic 的.lock 文件存储,排除列表中的 Agent 自动成为全视者
SudoGameMode:继承 BaseChatMode,根据游戏阶段控制发言权
向后兼容:无sudoEngine 配置的群聊完全不受影响
设计理念
-竹林夕弦(@Lucifa-sakula)提供了核心设计文档和TagFolder 1.0 后端插件
碧雨青潭提供了"群聊模拟小说情节"的场景灵感
权限过滤在 messagesForAI 构建阶段执行(物理删除,非提示词引导),确保 Agent 无法通过任何方式读取被隔离的内容
对抗性设计:Agent 不知道组号、不知道队友、.lock 文件不暴露给 Agent上下文
新增文件
Groupmodules/sudoEngine/index.js — 核心过滤引擎
Groupmodules/sudoEngine/TagParser.js — 正则解析 + 权限判断
Groupmodules/sudoEngine/LockManager.js — per-topic .lock 文件管理
Groupmodules/sudoEngine/GroupInitHandler.js — group:init 分组指令
Groupmodules/modes/sudoGameMode.js — 发言控制 Mode
修改文件
Groupmodules/groupchat.js — 顶部 require + CHAT_MODES 注册 + handleGroupChatMessage/handleInviteAgentToSpeak 两处管线插入 + group:init 指令检查
已知限制
-⚠️ 无前端 UI 配置界面——需要手动编辑群组config.json 添加 sudoEngine 字段
以上两项需要前端 UI 大佬(lioensky您或其他前端群友大佬)顺手完成
测试验证
:secret 物理过滤:日志 visible=false
:group-x跨组隔离:日志 [密语:Nova:group-x] visible=false for Aemeath
group:init 随机分组:.lock 文件正确创建,per-topic 隔离确认
有任何问题请批评斧正,有错我将立正挨打