mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-30 04:44:28 +00:00
feat(agent): add asset management tools and CLI commands (#387)
* feat(agent): add asset management tools and CLI commands * fix(core): resolve code review findings for reparenting cycles, agent deniedTools update, and CLI folder delete
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
-- Append 'delete_asset' to deniedTools of existing agents if not already present
|
||||
UPDATE "agents"
|
||||
SET "config" = jsonb_set(
|
||||
"config"::jsonb,
|
||||
'{deniedTools}',
|
||||
CASE
|
||||
WHEN "config"::jsonb ? 'deniedTools' AND jsonb_typeof("config"::jsonb->'deniedTools') = 'array' THEN
|
||||
CASE
|
||||
WHEN "config"::jsonb->'deniedTools' @> '["delete_asset"]'::jsonb THEN "config"::jsonb->'deniedTools'
|
||||
ELSE ("config"::jsonb->'deniedTools') || '["delete_asset"]'::jsonb
|
||||
END
|
||||
ELSE
|
||||
'["delete_asset"]'::jsonb
|
||||
END
|
||||
);
|
||||
Reference in New Issue
Block a user