mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
21 lines
436 B
TypeScript
21 lines
436 B
TypeScript
import { readFileSync } from 'fs'
|
|
import { parse } from 'toml'
|
|
|
|
type AgentGatewayConfig = {
|
|
'agent_gateway': {
|
|
host?: string
|
|
port?: number
|
|
},
|
|
'server': {
|
|
addr?: string
|
|
},
|
|
'brave': {
|
|
api_key?: string
|
|
base_url?: string
|
|
}
|
|
}
|
|
|
|
export const loadConfig = (path: string = './config.toml'): AgentGatewayConfig => {
|
|
const config = parse(readFileSync(path, 'utf-8'))
|
|
return config satisfies AgentGatewayConfig
|
|
} |