Download packages/kap-server/src/protocol/rest-fs.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 1.44 kB
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/kap-server/src/protocol/rest-fs.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/kap-server/src/protocol/rest-fs.ts
-
curl -L -o rest-fs.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/kap-server/src/protocol/rest-fs.ts
1.44 kB
| import { z } from 'zod'; | |
| export const fsOpenRequestSchema = z.object({ | |
| path: z.string().min(1), | |
| line: z.number().int().positive().optional(), | |
| }); | |
| export type FsOpenRequest = z.infer<typeof fsOpenRequestSchema>; | |
| export const fsOpenResponseSchema = z.object({ | |
| opened: z.literal(true), | |
| }); | |
| export type FsOpenResponse = z.infer<typeof fsOpenResponseSchema>; | |
| export const fsRevealRequestSchema = z.object({ | |
| path: z.string().min(1), | |
| }); | |
| export type FsRevealRequest = z.infer<typeof fsRevealRequestSchema>; | |
| export const fsRevealResponseSchema = z.object({ | |
| revealed: z.literal(true), | |
| }); | |
| export type FsRevealResponse = z.infer<typeof fsRevealResponseSchema>; | |
| export const fsOpenInAppIdSchema = z.enum([ | |
| 'finder', | |
| 'cursor', | |
| 'vscode', | |
| 'iterm', | |
| 'terminal', | |
| ]); | |
| export type FsOpenInAppId = z.infer<typeof fsOpenInAppIdSchema>; | |
| export const fsOpenInRequestSchema = z.object({ | |
| app_id: fsOpenInAppIdSchema, | |
| path: z.string().min(1), | |
| line: z.number().int().positive().optional(), | |
| }); | |
| export type FsOpenInRequest = z.infer<typeof fsOpenInRequestSchema>; | |
| export const fsOpenInResponseSchema = z.object({ | |
| opened: z.literal(true), | |
| }); | |
| export type FsOpenInResponse = z.infer<typeof fsOpenInResponseSchema>; | |
| export const fsDownloadParamsSchema = z.object({ | |
| path: z.string().min(1), | |
| range: z.string().optional(), | |
| if_none_match: z.string().optional(), | |
| }); | |
| export type FsDownloadParams = z.infer<typeof fsDownloadParamsSchema>; | |