fix lint issues (#180)
This commit is contained in:
1 parent
9d93ea4f87
commit
bdeccafada
11 files changed
+1444
-13
No files matched your search
@@ -17,10 +17,30 @@ export interface TelegramSettings {
|
||||
nativeDrafts?: boolean;
|
||||
}
|
||||
|
||||
export type McpRemoteTransport = "http" | "sse";
|
||||
|
||||
export interface McpServerConfig {
|
||||
id: string;
|
||||
label: string;
|
||||
enabled: boolean;
|
||||
transport: McpRemoteTransport | "stdio";
|
||||
url?: string;
|
||||
headers?: Record<string, string>;
|
||||
command?: string;
|
||||
args?: string[];
|
||||
env?: Record<string, string>;
|
||||
cwd?: string;
|
||||
}
|
||||
|
||||
export interface McpSettings {
|
||||
servers?: McpServerConfig[];
|
||||
}
|
||||
|
||||
export interface UserSettings {
|
||||
apiKey?: string;
|
||||
defaultModel?: string;
|
||||
telegram?: TelegramSettings;
|
||||
mcp?: McpSettings;
|
||||
}
|
||||
|
||||
export interface ProjectSettings {
|
||||
@@ -73,6 +93,15 @@ export function saveUserSettings(partial: Partial<UserSettings>): void {
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
...(partial.mcp !== undefined
|
||||
? {
|
||||
mcp: {
|
||||
...current.mcp,
|
||||
...partial.mcp,
|
||||
servers: partial.mcp.servers ?? current.mcp?.servers ?? [],
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
|
||||
writeJson(USER_SETTINGS_PATH, next);
|
||||
@@ -122,3 +151,11 @@ export function resolveTelegramStreamSettings(t: TelegramSettings | undefined):
|
||||
nativeDrafts: t?.nativeDrafts === true,
|
||||
};
|
||||
}
|
||||
|
||||
export function loadMcpServers(): McpServerConfig[] {
|
||||
return loadUserSettings().mcp?.servers ?? [];
|
||||
}
|
||||
|
||||
export function saveMcpServers(servers: McpServerConfig[]): void {
|
||||
saveUserSettings({ mcp: { servers } });
|
||||
}
|
||||
Reference in new issue
Block a user