feat: add unified IM access policies

This commit is contained in:
xmanrui 2026-09-01 10:45:12 +08:00
parent 075d2713c1
commit 840e5aa857
89 changed files with 5573 additions and 1676 deletions

View file

@ -353,7 +353,7 @@ async function runSessionBindCommand(command, harness, conversationKey) {
}
export async function runWorkspaceCommand(text, harness, conversationKey) {
if (typeof text !== 'string') return null;
if (!isWorkspaceCommand(text)) return null;
const command = text.trim();
if (SESSION_BIND_PREFIX.test(command)) {
return runSessionBindCommand(command, harness, conversationKey);
@ -385,3 +385,12 @@ export async function runWorkspaceCommand(text, harness, conversationKey) {
throw error;
}
}
export function isWorkspaceCommand(text) {
if (typeof text !== 'string') return false;
const command = text.trim();
return SESSION_BIND_PREFIX.test(command)
|| SESSION_LIST_COMMAND.test(command)
|| WORKSPACE_LIST_COMMAND.test(command)
|| WORKSPACE_COMMAND.test(command);
}