| 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "strings" |
| 5 | |
| 6 | "reasonix/internal/config" |
| 7 | ) |
| 8 | |
| 9 | func dingtalkConfigFromView(view DingtalkBotView, current config.DingtalkBotConfig) config.DingtalkBotConfig { |
| 10 | return config.DingtalkBotConfig{ |
| 11 | Enabled: view.Enabled, |
| 12 | ClientID: strings.TrimSpace(view.ClientID), |
| 13 | ClientSecret: current.ClientSecret, |
| 14 | ClientIDEnv: current.ClientIDEnv, |
| 15 | SecretEnv: strings.TrimSpace(view.ClientSecretEnv), |
| 16 | BotName: strings.TrimSpace(view.BotName), |
| 17 | RequireMention: view.RequireMention, |
| 18 | Model: strings.TrimSpace(view.Model), |
| 19 | ToolApprovalMode: normalizeBotConnectionToolApprovalMode(view.ToolApprovalMode), |
| 20 | WorkspaceRoot: strings.TrimSpace(view.WorkspaceRoot), |
| 21 | Access: botAccessConfigFromView(view.Access), |
| 22 | SessionMappings: append([]config.BotConnectionSessionMapping(nil), current.SessionMappings...), |
| 23 | } |
| 24 | } |
| 25 |