|
25 | 25 | (def ^:private logger-tag "[CONFIG]") |
26 | 26 |
|
27 | 27 | (def ^:dynamic *env-var-config-error* false) |
28 | | -(def ^:dynamic *cli-file-config-error* false) |
| 28 | +(def ^:dynamic *custom-config-error* false) |
29 | 29 | (def ^:dynamic *global-config-error* false) |
30 | 30 | (def ^:dynamic *local-config-error* false) |
31 | 31 |
|
32 | 32 | (def ^:private listen-idle-ms 3000) |
33 | 33 |
|
34 | | -(def config-file-path-from-cli* (atom nil)) |
| 34 | +(def custom-config-file-path* (atom nil)) |
35 | 35 |
|
36 | 36 | (def initial-config |
37 | 37 | {:providers {"openai" {:api "openai-responses" |
|
153 | 153 |
|
154 | 154 | (def ^:private config-from-envvar (memoize config-from-envvar*)) |
155 | 155 |
|
156 | | -(defn ^:private config-from-cli* [] |
157 | | - (when-some [path @config-file-path-from-cli*] |
| 156 | +(defn ^:private config-from-custom* [] |
| 157 | + (when-some [path @custom-config-file-path*] |
158 | 158 | (let [config-file (io/file path)] |
159 | 159 | (when (.exists config-file) |
160 | | - (safe-read-json-string (slurp config-file) (var *cli-file-config-error*)))))) |
| 160 | + (safe-read-json-string (slurp config-file) (var *custom-config-error*)))))) |
161 | 161 |
|
162 | | -(def ^:private config-from-cli (memoize config-from-cli*)) |
| 162 | +(def ^:private config-from-custom (memoize config-from-custom*)) |
163 | 163 |
|
164 | 164 | (defn global-config-dir ^File [] |
165 | 165 | (let [xdg-config-home (or (get-env "XDG_CONFIG_HOME") |
|
275 | 275 | [:behavior :ANY :toolCall :approval :deny :ANY :argsMatchers] |
276 | 276 | [:otlp]]}) |
277 | 277 |
|
278 | | -(defn ^:private config-from-cli-or-default-location [pure-config? db] |
279 | | - (if-some [config-from-cli (config-from-cli)] |
280 | | - (when-not pure-config? config-from-cli) |
| 278 | +(defn ^:private config-from-custom-or-default-location [pure-config? db] |
| 279 | + (if-some [config-from-custom (config-from-custom)] |
| 280 | + (when-not pure-config? config-from-custom) |
281 | 281 | (deep-merge |
282 | 282 | (when-not pure-config? (config-from-global-file)) |
283 | 283 | (when-not pure-config? (config-from-local-file (:workspace-folders db)))))) |
|
290 | 290 | eca-config-normalization-rules |
291 | 291 | (deep-merge initialization-config |
292 | 292 | (when-not pure-config? (config-from-envvar)) |
293 | | - (config-from-cli-or-default-location pure-config? db)))))) |
| 293 | + (config-from-custom-or-default-location pure-config? db)))))) |
294 | 294 |
|
295 | 295 | (defn validation-error [] |
296 | 296 | (cond |
|
0 commit comments