mirror of
https://github.com/charmbracelet/crush.git
synced 2025-08-02 05:20:46 +03:00
rename to use toplevel permissions
This commit is contained in:
@@ -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{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user