chore: directory migration - gateway→server, web→client/electron
This commit is contained in:
@ -1789,6 +1789,23 @@ export function apply(ctx: any, config: PluginConfig): void {
|
||||
case 'permission_decision':
|
||||
handlePermissionDecision(data);
|
||||
break;
|
||||
case 'session_update': {
|
||||
// 人类在 WebUI 切换权限档位后,DSH 运行时必须立刻更新 sandbox/mode +
|
||||
// approval/policy,否则模型仍按旧档位执行。
|
||||
const sid = String(data?.session_id || '');
|
||||
const pm = String(data?.permission_mode || '');
|
||||
if (sid && pm) {
|
||||
const bound = sessionMap.peek(sid);
|
||||
if (bound) {
|
||||
const live = ctx.agents.get(bound.dshSessionId);
|
||||
if (live?.session) {
|
||||
applyPermissionMode(live.session, pm);
|
||||
console.error(`[dsh-mail-bridge] session_update ${sid} -> 权限档位 ${pm}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'session_archived':
|
||||
// 会话归档 = 那条会话再也不会收信,映射可以确定性地清掉(不必等上限淘汰)。
|
||||
forgetSession(String(data?.session_id || ''));
|
||||
|
||||
Reference in New Issue
Block a user