granclaw 0.0.1-beta.20 → 0.0.1-beta.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,7 @@ const config_js_1 = require("./config.js");
15
15
  const CONFIG_APP_PATH = path_1.default.join(config_js_1.GRANCLAW_HOME, 'config-app.json');
16
16
  const DEFAULTS = {
17
17
  showWorkspaceDirConfig: true,
18
+ showBraveSearchConfig: true,
18
19
  };
19
20
  function getAppConfig() {
20
21
  try {
@@ -158,16 +158,19 @@ function getProviderBaseUrl(provider) {
158
158
  return null;
159
159
  return managed.llm.baseUrl ?? null;
160
160
  }
161
- /** Returns the Brave Search API key, or null if not configured. */
161
+ /** Returns the Brave Search API key, or null if not configured.
162
+ * Checks user config first, then falls back to the managed config seeded by the enterprise control plane. */
162
163
  function getSearchApiKey() {
163
164
  try {
164
165
  const raw = fs_1.default.readFileSync(configPath(), 'utf8');
165
166
  const parsed = JSON.parse(raw);
166
- return parsed.search?.apiKey ?? null;
167
- }
168
- catch {
169
- return null;
167
+ if (parsed.search?.apiKey)
168
+ return parsed.search.apiKey;
170
169
  }
170
+ catch { /* fall through */ }
171
+ // Fall back to managed config (enterprise control seeds search.apiKey)
172
+ const managed = readManagedConfig();
173
+ return managed.search?.apiKey ?? null;
171
174
  }
172
175
  function saveSearch(apiKey) {
173
176
  let existing = {};