chore: import clean Agent Desk snapshot (2/7)

This commit is contained in:
2026-10-16 11:57:21 +00:00
parent 79176541c7
commit 89c5231c4c
461 changed files with 60092 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
package config
import "strings"
var current *Config
func SetCurrent(cfg *Config) {
current = cfg
}
func Current() Config {
if current == nil {
panic("config not initialized")
}
return *current
}
func GetCurrent() *Config {
return current
}
// ResolveSlack resolves the Slack app credentials for one channel without
// requiring the caller to nil-check the loaded configuration.
func ResolveSlack(channelBotToken, channelSigningSecret string) SlackConfig {
if current == nil {
return SlackConfig{
BotToken: strings.TrimSpace(channelBotToken),
SigningSecret: strings.TrimSpace(channelSigningSecret),
}
}
return current.SlackApp(channelBotToken, channelSigningSecret)
}