Download packages/klient/src/contract/global/hostFs.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 945 Bytes
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/klient/src/contract/global/hostFs.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/klient/src/contract/global/hostFs.ts
-
curl -L -o hostFs.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/klient/src/contract/global/hostFs.ts
945 Bytes
| /** | |
| * `hostFolderBrowser` — host-side folder picker for choosing a workspace | |
| * folder. Mirrors `agent-core-v2/app/hostFolderBrowser/hostFolderBrowser.ts`; | |
| * wire shapes mirror `protocol/src/rest/fsBrowse.ts` (snake_case fields). | |
| */ | |
| import { z } from 'zod'; | |
| import type { ServiceContract } from '../types.js'; | |
| export const fsBrowseEntrySchema = z.object({ | |
| name: z.string().min(1), | |
| path: z.string().min(1), | |
| is_dir: z.literal(true), | |
| }); | |
| export const fsBrowseResponseSchema = z.object({ | |
| path: z.string().min(1), | |
| parent: z.string().min(1).nullable(), | |
| entries: z.array(fsBrowseEntrySchema), | |
| }); | |
| export const fsHomeResponseSchema = z.object({ | |
| home: z.string().min(1), | |
| recent_roots: z.array(z.string().min(1)), | |
| }); | |
| export const hostFsContract = { | |
| browse: { input: z.tuple([z.string().optional()]), output: fsBrowseResponseSchema }, | |
| home: { input: z.tuple([]), output: fsHomeResponseSchema }, | |
| } satisfies ServiceContract; | |