(conf map[string]interface{})
| 290 | } |
| 291 | |
| 292 | func extractOtherConfig(conf map[string]interface{}) dto.AgentOtherConfig { |
| 293 | result := dto.AgentOtherConfig{ |
| 294 | UserTimezone: resolveServerTimezone(), |
| 295 | BrowserEnabled: true, |
| 296 | NPMRegistry: defaultOpenclawNPMRegistry, |
| 297 | } |
| 298 | agents, ok := conf["agents"].(map[string]interface{}) |
| 299 | if !ok { |
| 300 | browser := extractBrowserConfig(conf) |
| 301 | result.BrowserEnabled = browser.Enabled |
| 302 | return result |
| 303 | } |
| 304 | defaults, ok := agents["defaults"].(map[string]interface{}) |
| 305 | if !ok { |
| 306 | browser := extractBrowserConfig(conf) |
| 307 | result.BrowserEnabled = browser.Enabled |
| 308 | return result |
| 309 | } |
| 310 | if timezone, ok := defaults["userTimezone"].(string); ok && strings.TrimSpace(timezone) != "" { |
| 311 | result.UserTimezone = strings.TrimSpace(timezone) |
| 312 | } |
| 313 | browser := extractBrowserConfig(conf) |
| 314 | result.BrowserEnabled = browser.Enabled |
| 315 | return result |
| 316 | } |
| 317 | |
| 318 | func setOtherConfig(conf map[string]interface{}, config dto.AgentOtherConfig) { |
| 319 | agents := ensureChildMap(conf, "agents") |
no test coverage detected