|
40 | 40 | (defn get-env [env] (System/getenv env)) |
41 | 41 | (defn get-property [property] (System/getProperty property)) |
42 | 42 |
|
| 43 | +(def ^:private dangerous-commands-regexes |
| 44 | + ["[12&]?>>?\\s*(?!/dev/null($|\\s))\\S+" |
| 45 | + ".*>.*", |
| 46 | + ".*\\|\\s*(tee|dd|xargs).*", |
| 47 | + ".*\\b(sed|awk|perl)\\s+.*-i.*", |
| 48 | + ".*\\b(rm|mv|cp|touch|mkdir)\\b.*", |
| 49 | + ".*git\\s+(add|commit|push).*", |
| 50 | + ".*npm\\s+install.*", |
| 51 | + ".*-c\\s+[\"'].*open.*[\"']w[\"'].*", |
| 52 | + ".*bash.*-c.*>.*"]) |
| 53 | + |
43 | 54 | (def ^:private initial-config* |
44 | 55 | {:providers {"openai" {:api "openai-responses" |
45 | 56 | :url "${env:OPENAI_API_URL:https://api.openai.com}" |
|
66 | 77 | :models {"gemini-2.5-pro" {}}} |
67 | 78 | "ollama" {:url "${env:OLLAMA_API_URL:http://localhost:11434}"}} |
68 | 79 | :defaultAgent "code" |
69 | | - :agent {"code" {:mode :primary |
| 80 | + :agent {"code" {:mode "primary" |
70 | 81 | :prompts {:chat "${classpath:prompts/code_agent.md}"} |
71 | 82 | :disabledTools ["preview_file_change"]} |
72 | | - "plan" {:mode :primary |
| 83 | + "plan" {:mode "primary" |
73 | 84 | :prompts {:chat "${classpath:prompts/plan_agent.md}"} |
74 | 85 | :disabledTools ["edit_file" "write_file" "move_file"] |
75 | 86 | :toolCall {:approval {:allow {"eca__shell_command" |
|
79 | 90 | "eca__read_file" {} |
80 | 91 | "eca__directory_tree" {}} |
81 | 92 | :deny {"eca__shell_command" |
82 | | - {:argsMatchers {"command" ["[12&]?>>?\\s*(?!/dev/null($|\\s))\\S+" |
83 | | - ".*>.*", |
84 | | - ".*\\|\\s*(tee|dd|xargs).*", |
85 | | - ".*\\b(sed|awk|perl)\\s+.*-i.*", |
86 | | - ".*\\b(rm|mv|cp|touch|mkdir)\\b.*", |
87 | | - ".*git\\s+(add|commit|push).*", |
88 | | - ".*npm\\s+install.*", |
89 | | - ".*-c\\s+[\"'].*open.*[\"']w[\"'].*", |
90 | | - ".*bash.*-c.*>.*"]}}}}}}} |
| 93 | + {:argsMatchers {"command" dangerous-commands-regexes}}}}}} |
| 94 | + "explorer" {:mode "subagent" |
| 95 | + :description "Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns, search code for keywords, or answer questions about the codebase." |
| 96 | + :systemPrompt "${classpath:prompts/explorer_agent.md}" |
| 97 | + :disabledTools ["edit_file" "write_file" "move_file" "preview_file_change"] |
| 98 | + :toolCall {:approval {:allow {"eca__shell_command" |
| 99 | + {:argsMatchers {"command" ["pwd"]}} |
| 100 | + "eca__grep" {} |
| 101 | + "eca__read_file" {} |
| 102 | + "eca__directory_tree" {}} |
| 103 | + :deny {"eca__shell_command" |
| 104 | + {:argsMatchers {"command" dangerous-commands-regexes}}}}}} |
| 105 | + "general" {:mode "subagent" |
| 106 | + :description "General-purpose agent for researching complex questions and executing multi-step tasks. Use this agent to execute multiple units of work in parallel." |
| 107 | + :systemPrompt "${classpath:prompts/code_agent.md}" |
| 108 | + :disabledTools ["preview_file_change"]}} |
91 | 109 | :defaultModel nil |
92 | 110 | :prompts {:chat "${classpath:prompts/code_agent.md}" ;; default to code agent |
93 | 111 | :chatTitle "${classpath:prompts/title.md}" |
|
0 commit comments