Download packages/agent-core-v2/src/mcpCore/configView.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 755 Bytes
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/mcpCore/configView.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/agent-core-v2/src/mcpCore/configView.ts
-
curl -L -o configView.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/mcpCore/configView.ts
755 Bytes
| import type { McpServerConfig } from './config-schema'; | |
| export type McpServerConfigView = | |
| | (Omit<Extract<McpServerConfig, { readonly transport: 'stdio' }>, 'env'> & { | |
| readonly envKeys?: readonly string[]; | |
| }) | |
| | (Omit<Exclude<McpServerConfig, { readonly transport: 'stdio' }>, 'headers'> & { | |
| readonly headerKeys?: readonly string[]; | |
| }); | |
| export function toMcpServerConfigView(config: McpServerConfig): McpServerConfigView { | |
| if (config.transport === 'stdio') { | |
| const { env, ...safe } = config; | |
| return env === undefined ? safe : { ...safe, envKeys: Object.keys(env).toSorted() }; | |
| } | |
| const { headers, ...safe } = config; | |
| return headers === undefined ? safe : { ...safe, headerKeys: Object.keys(headers).toSorted() }; | |
| } | |