mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-18 00:15:05 +00:00
feat: configurable workspace sharing with per-agent DM/group/user controls
Add workspace_sharing config in other_config JSONB to control per-user workspace isolation. When enabled, users share the base workspace directory instead of isolated subfolders — configurable separately for DMs and groups, with a per-user allowlist override. Backend: WorkspaceSharingConfig struct, ParseWorkspaceSharing(), conditional isolation in loop.go/loop_history.go, 7 unit tests. Frontend: prominent always-visible config section with contact search combobox, sticky save bar layout fix, i18n (en/vi/zh).
This commit is contained in:
1 parent
a75e977dca
commit
25b24ebd50
15 files changed
+361
-7
No files matched your search
@@ -39,6 +39,27 @@ func (l *Loop) scanWebToolResult(toolName string, result *tools.Result) {
|
||||
}
|
||||
}
|
||||
|
||||
// shouldShareWorkspace checks if the given user should share the base workspace
|
||||
// directory (skip per-user subfolder isolation) based on workspace_sharing config.
|
||||
func (l *Loop) shouldShareWorkspace(userID, peerKind string) bool {
|
||||
ws := l.workspaceSharing
|
||||
if ws == nil {
|
||||
return false
|
||||
}
|
||||
for _, u := range ws.SharedUsers {
|
||||
if u == userID {
|
||||
return true
|
||||
}
|
||||
}
|
||||
switch peerKind {
|
||||
case "direct":
|
||||
return ws.SharedDM
|
||||
case "group":
|
||||
return ws.SharedGroup
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// InvalidateUserWorkspace clears the cached workspace for a user,
|
||||
// forcing the next request to re-read from user_agent_profiles.
|
||||
func (l *Loop) InvalidateUserWorkspace(userID string) {
|
||||
|
||||
Reference in new issue
Block a user