mrmd-server 0.1.20 → 0.1.21
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.
- package/package.json +1 -1
- package/src/ai-service.js +8 -2
package/package.json
CHANGED
package/src/ai-service.js
CHANGED
|
@@ -80,13 +80,19 @@ function findUv() {
|
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* Load API keys from settings file
|
|
83
|
+
* Settings are stored in ~/.config/mrmd/settings.json (same as mrmd-electron)
|
|
83
84
|
*/
|
|
84
85
|
function loadApiKeysFromSettings() {
|
|
85
|
-
const settingsPath = path.join(os.homedir(), '.mrmd', 'settings.json');
|
|
86
|
+
const settingsPath = path.join(os.homedir(), '.config', 'mrmd', 'settings.json');
|
|
87
|
+
console.log(`[ai] Loading API keys from ${settingsPath}`);
|
|
86
88
|
try {
|
|
87
89
|
if (existsSync(settingsPath)) {
|
|
88
90
|
const settings = JSON.parse(readFileSync(settingsPath, 'utf-8'));
|
|
89
|
-
|
|
91
|
+
const apiKeys = settings.apiKeys || {};
|
|
92
|
+
console.log(`[ai] Found API keys for: ${Object.keys(apiKeys).filter(k => apiKeys[k]).join(', ') || 'none'}`);
|
|
93
|
+
return apiKeys;
|
|
94
|
+
} else {
|
|
95
|
+
console.log(`[ai] Settings file not found at ${settingsPath}`);
|
|
90
96
|
}
|
|
91
97
|
} catch (e) {
|
|
92
98
|
console.warn('[ai] Failed to load API keys from settings:', e.message);
|