on main help sign in
rename to use toplevel permissions
7015943Tai Groot
internal/app/app.go+2−2
@@ -61,8 +61,8 @@ func New(ctx context.Context, conn *sql.DB, cfg *config.Config) (*App, error) {
61 files := history.NewService(q, conn)
61 files := history.NewService(q, conn)
62 skipPermissionsRequests := cfg.Options != nil && cfg.Options.SkipPermissionsRequests
62 skipPermissionsRequests := cfg.Options != nil && cfg.Options.SkipPermissionsRequests
63 allowedCommands := []string{}
63 allowedCommands := []string{}
64− if cfg.Options != nil && cfg.Options.AllowedCommands != nil {
64+ if cfg.Permissions != nil && cfg.Permissions.AllowedTools != nil {
65− allowedCommands = cfg.Options.AllowedCommands
65+ allowedCommands = cfg.Permissions.AllowedTools
66 }
66 }
67
67
68 app := &App{
68 app := &App{
internal/config/config.go+8−3
@@ -120,15 +120,18 @@ type TUIOptions struct {
120 // Here we can add themes later or any TUI related options
120 // Here we can add themes later or any TUI related options
121}
121}
122
122
123+type Permissions struct {
124+ AllowedTools []string `json:"allowed_tools,omitempty"` // Tools that don't require permission prompts
125+}
126+
123type Options struct {
127type Options struct {
124 ContextPaths []string `json:"context_paths,omitempty"`
128 ContextPaths []string `json:"context_paths,omitempty"`
125 TUI *TUIOptions `json:"tui,omitempty"`
129 TUI *TUIOptions `json:"tui,omitempty"`
126 Debug bool `json:"debug,omitempty"`
130 Debug bool `json:"debug,omitempty"`
127 DebugLSP bool `json:"debug_lsp,omitempty"`
131 DebugLSP bool `json:"debug_lsp,omitempty"`
128 DisableAutoSummarize bool `json:"disable_auto_summarize,omitempty"`
132 DisableAutoSummarize bool `json:"disable_auto_summarize,omitempty"`
129− DataDirectory string `json:"data_directory,omitempty"` // Relative to the cwd
133+ DataDirectory string `json:"data_directory,omitempty"` // Relative to the cwd
130− SkipPermissionsRequests bool `json:"-"` // Automatically accept all permissions (YOLO mode)
134+ SkipPermissionsRequests bool `json:"-"` // Automatically accept all permissions (YOLO mode)
131− AllowedCommands []string `json:"allowed_commands,omitempty"` // Commands that don't require permission prompts
132}
135}
133
136
134type MCPs map[string]MCPConfig
137type MCPs map[string]MCPConfig
@@ -245,6 +248,8 @@ type Config struct {
245
248
246 Options *Options `json:"options,omitempty"`
249 Options *Options `json:"options,omitempty"`
247
250
251+ Permissions *Permissions `json:"permissions,omitempty"`
252+
248 // Internal
253 // Internal
249 workingDir string `json:"-"`
254 workingDir string `json:"-"`
250 // TODO: most likely remove this concept when I come back to it
255 // TODO: most likely remove this concept when I come back to it