mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-10 13:10:44 +08:00
feat: add unified IM access policies
This commit is contained in:
parent
075d2713c1
commit
840e5aa857
89 changed files with 5573 additions and 1676 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue