rename to use toplevel permissions

This commit is contained in:
Tai Groot
2025-07-24 00:02:27 -07:00
parent bc6fadc81a
commit 70159438d4
2 changed files with 10 additions and 5 deletions

View File

@@ -61,8 +61,8 @@ func New(ctx context.Context, conn *sql.DB, cfg *config.Config) (*App, error) {
files := history.NewService(q, conn)
skipPermissionsRequests := cfg.Options != nil && cfg.Options.SkipPermissionsRequests
allowedCommands := []string{}
if cfg.Options != nil && cfg.Options.AllowedCommands != nil {
allowedCommands = cfg.Options.AllowedCommands
if cfg.Permissions != nil && cfg.Permissions.AllowedTools != nil {
allowedCommands = cfg.Permissions.AllowedTools
}
app := &App{

View File

@@ -120,15 +120,18 @@ type TUIOptions struct {
// Here we can add themes later or any TUI related options
}
type Permissions struct {
AllowedTools []string `json:"allowed_tools,omitempty"` // Tools that don't require permission prompts
}
type Options struct {
ContextPaths []string `json:"context_paths,omitempty"`
TUI *TUIOptions `json:"tui,omitempty"`
Debug bool `json:"debug,omitempty"`
DebugLSP bool `json:"debug_lsp,omitempty"`
DisableAutoSummarize bool `json:"disable_auto_summarize,omitempty"`
DataDirectory string `json:"data_directory,omitempty"` // Relative to the cwd
SkipPermissionsRequests bool `json:"-"` // Automatically accept all permissions (YOLO mode)
AllowedCommands []string `json:"allowed_commands,omitempty"` // Commands that don't require permission prompts
DataDirectory string `json:"data_directory,omitempty"` // Relative to the cwd
SkipPermissionsRequests bool `json:"-"` // Automatically accept all permissions (YOLO mode)
}
type MCPs map[string]MCPConfig
@@ -245,6 +248,8 @@ type Config struct {
Options *Options `json:"options,omitempty"`
Permissions *Permissions `json:"permissions,omitempty"`
// Internal
workingDir string `json:"-"`
// TODO: most likely remove this concept when I come back to it