Download packages/kap-server/src/protocol/tool.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/kap-server/src/protocol/tool.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/kap-server/src/protocol/tool.ts
-
curl -L -o tool.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/kap-server/src/protocol/tool.ts
1.11 kB
| import { z } from 'zod'; | |
| export const toolSourceSchema = z.enum(['builtin', 'skill', 'mcp']); | |
| export type ToolSource = z.infer<typeof toolSourceSchema>; | |
| export const toolDescriptorSchema = z.object({ | |
| name: z.string().min(1), | |
| description: z.string(), | |
| input_schema: z.unknown(), | |
| source: toolSourceSchema, | |
| mcp_server_id: z.string().min(1).optional(), | |
| active: z.boolean().optional(), | |
| }); | |
| export type ToolDescriptor = z.infer<typeof toolDescriptorSchema>; | |
| export const mcpServerStatusSchema = z.enum([ | |
| 'connected', | |
| 'connecting', | |
| 'disconnected', | |
| 'error', | |
| ]); | |
| export type McpServerStatus = z.infer<typeof mcpServerStatusSchema>; | |
| export const mcpServerTransportSchema = z.enum(['stdio', 'http', 'sse']); | |
| export type McpServerTransport = z.infer<typeof mcpServerTransportSchema>; | |
| export const mcpServerSchema = z.object({ | |
| id: z.string().min(1), | |
| name: z.string().min(1), | |
| transport: mcpServerTransportSchema, | |
| status: mcpServerStatusSchema, | |
| last_error: z.string().optional(), | |
| tool_count: z.number().int().nonnegative(), | |
| }); | |
| export type McpServer = z.infer<typeof mcpServerSchema>; | |