claude-brain 0.17.9 → 0.17.10
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/VERSION +1 -1
- package/package.json +1 -1
- package/src/config/defaults.ts +1 -1
- package/src/config/loader.ts +20 -3
- package/src/config/schema.ts +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.17.
|
|
1
|
+
0.17.10
|
package/package.json
CHANGED
package/src/config/defaults.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { PartialConfig } from './schema'
|
|
|
3
3
|
/** Default configuration values for Claude Brain */
|
|
4
4
|
export const defaultConfig: PartialConfig = {
|
|
5
5
|
serverName: 'claude-brain',
|
|
6
|
-
serverVersion: '0.17.
|
|
6
|
+
serverVersion: '0.17.10',
|
|
7
7
|
logLevel: 'info',
|
|
8
8
|
logFilePath: './logs/claude-brain.log',
|
|
9
9
|
dbPath: './data/memory.db',
|
package/src/config/loader.ts
CHANGED
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs'
|
|
2
2
|
import { resolve } from 'node:path'
|
|
3
|
-
import { config as loadEnv } from 'dotenv'
|
|
4
3
|
import { ConfigSchema, type Config, type PartialConfig } from './schema'
|
|
5
4
|
import { defaultConfig } from './defaults'
|
|
6
5
|
import { getClaudeBrainHome, resolveHomePath } from './home'
|
|
7
6
|
|
|
7
|
+
/** Parse a .env file without dotenv (avoids stdout pollution from dotenv v17) */
|
|
8
|
+
function loadEnvFile(filePath: string): void {
|
|
9
|
+
if (!existsSync(filePath)) return
|
|
10
|
+
const content = readFileSync(filePath, 'utf-8')
|
|
11
|
+
for (const line of content.split('\n')) {
|
|
12
|
+
const trimmed = line.trim()
|
|
13
|
+
if (!trimmed || trimmed.startsWith('#')) continue
|
|
14
|
+
const eqIdx = trimmed.indexOf('=')
|
|
15
|
+
if (eqIdx === -1) continue
|
|
16
|
+
const key = trimmed.slice(0, eqIdx).trim()
|
|
17
|
+
const val = trimmed.slice(eqIdx + 1).trim()
|
|
18
|
+
// Don't override existing env vars
|
|
19
|
+
if (!(key in process.env)) {
|
|
20
|
+
process.env[key] = val
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
8
25
|
const CONFIG_FILE_NAME = '.claudebrainrc.json'
|
|
9
26
|
|
|
10
27
|
/** Load configuration from a JSON file if it exists */
|
|
@@ -32,8 +49,8 @@ function loadFromFile(basePath: string): PartialConfig {
|
|
|
32
49
|
function loadFromEnv(): PartialConfig {
|
|
33
50
|
// Skip .env loading if SKIP_DOTENV is set (for MCP servers where env is provided externally)
|
|
34
51
|
if (!process.env.SKIP_DOTENV) {
|
|
35
|
-
//
|
|
36
|
-
|
|
52
|
+
// Use custom parser instead of dotenv v17 (which prints to stdout and breaks MCP stdio)
|
|
53
|
+
loadEnvFile(resolve(getClaudeBrainHome(), '.env'))
|
|
37
54
|
}
|
|
38
55
|
|
|
39
56
|
const config: PartialConfig = {}
|
package/src/config/schema.ts
CHANGED
|
@@ -284,7 +284,7 @@ export const ConfigSchema = z.object({
|
|
|
284
284
|
serverName: z.string().default('claude-brain'),
|
|
285
285
|
|
|
286
286
|
/** Server version in semver format */
|
|
287
|
-
serverVersion: z.string().regex(/^\d+\.\d+\.\d+$/, 'Version must be semver format').default('0.17.
|
|
287
|
+
serverVersion: z.string().regex(/^\d+\.\d+\.\d+$/, 'Version must be semver format').default('0.17.10'),
|
|
288
288
|
|
|
289
289
|
/** Logging level */
|
|
290
290
|
logLevel: LogLevelSchema.default('info'),
|