import { DeepPartial } from 'utility-types'; import { edgeClient } from '@/libs/trpc/client'; import { LobeAgentConfig } from '@/types/agent'; import { GlobalRuntimeConfig } from '@/types/serverConfig'; const VERSION_URL = 'https://registry.npmmirror.com/@lobehub/chat/latest'; class GlobalService { /** * get latest version from npm */ getLatestVersion = async (): Promise => { const res = await fetch(VERSION_URL); const data = await res.json(); return data['version']; }; getGlobalConfig = async (): Promise => { return edgeClient.config.getGlobalConfig.query(); }; getDefaultAgentConfig = async (): Promise> => { return edgeClient.config.getDefaultAgentConfig.query(); }; } export const globalService = new GlobalService();