add
This commit is contained in:
@@ -461,23 +461,30 @@ func GenerateAndWriteConfig(opts ConfigOptions) error {
|
||||
},
|
||||
Tools: ToolsConfig{
|
||||
Elevated: ElevatedConfig{
|
||||
Enabled: true,
|
||||
AllowFrom: map[string][]string{
|
||||
"telegram": {opts.AdminID},
|
||||
},
|
||||
Enabled: true,
|
||||
AllowFrom: map[string][]string{},
|
||||
},
|
||||
Allow: []string{"exec", "process", "read", "write", "edit", "web_search", "web_fetch", "cron"},
|
||||
},
|
||||
Channels: ChannelsConfig{
|
||||
Telegram: TelegramConfig{
|
||||
Enabled: true,
|
||||
BotToken: opts.BotToken,
|
||||
Enabled: false,
|
||||
DMPolicy: "pairing",
|
||||
AllowFrom: []string{opts.AdminID},
|
||||
AllowFrom: []string{},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// Configure Telegram if token provided
|
||||
if opts.BotToken != "" {
|
||||
config.Channels.Telegram.Enabled = true
|
||||
config.Channels.Telegram.BotToken = opts.BotToken
|
||||
if opts.AdminID != "" {
|
||||
config.Channels.Telegram.AllowFrom = []string{opts.AdminID}
|
||||
config.Tools.Elevated.AllowFrom["telegram"] = []string{opts.AdminID}
|
||||
}
|
||||
}
|
||||
|
||||
if opts.ApiType == "anthropic" {
|
||||
config.Env = map[string]string{
|
||||
"ANTHROPIC_API_KEY": opts.AnthropicKey,
|
||||
@@ -489,6 +496,16 @@ func GenerateAndWriteConfig(opts ConfigOptions) error {
|
||||
},
|
||||
},
|
||||
}
|
||||
} else if opts.ApiType == "skip" {
|
||||
// Minimal config for Web UI setup
|
||||
config.Channels.Telegram.Enabled = false
|
||||
config.Agents = AgentsConfig{
|
||||
Defaults: AgentDefaults{
|
||||
Model: ModelRef{
|
||||
Primary: "anthropic/claude-opus-4-5", // Default placeholder
|
||||
},
|
||||
},
|
||||
}
|
||||
} else {
|
||||
// OpenAI Compatible
|
||||
config.Agents = AgentsConfig{
|
||||
|
||||
Reference in New Issue
Block a user