This commit is contained in:
2026-06-09 21:19:30 +08:00
parent 8b41ff9360
commit 0484e79978
66 changed files with 4043 additions and 533 deletions
+10 -1
View File
@@ -37,10 +37,15 @@ func (s *agentKindService) Create(ctx context.Context, c Caller, in CreateAgentK
if args == nil {
args = []string{}
}
allowlist := in.ToolAllowlist
if allowlist == nil {
allowlist = []string{}
}
k := &AgentKind{
ID: uuid.New(), Name: in.Name, DisplayName: in.DisplayName, Description: in.Description,
BinaryPath: in.BinaryPath, Args: args, EncryptedEnv: encrypted, Enabled: in.Enabled,
CreatedBy: c.UserID,
ToolAllowlist: allowlist,
CreatedBy: c.UserID,
}
out, err := s.repo.CreateAgentKind(ctx, k)
if err != nil {
@@ -105,6 +110,10 @@ func (s *agentKindService) Update(ctx context.Context, c Caller, id uuid.UUID, i
cur.EncryptedEnv = encrypted
changed["env"] = "<changed>"
}
if in.ToolAllowlist != nil {
cur.ToolAllowlist = in.ToolAllowlist
changed["tool_allowlist"] = "<changed>"
}
if in.Enabled != nil && *in.Enabled != cur.Enabled {
cur.Enabled = *in.Enabled
changed["enabled"] = *in.Enabled