Download packages/agent-core-v2/src/os/interface/hostFileSystem.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 1.61 kB
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/os/interface/hostFileSystem.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/agent-core-v2/src/os/interface/hostFileSystem.ts
-
curl -L -o hostFileSystem.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/os/interface/hostFileSystem.ts
1.61 kB
| import { createDecorator, type ServiceIdentifier } from '#/_base/di/instantiation'; | |
| import type { TextDecodeErrors } from '#/_base/execEnv/decodeText'; | |
| export interface HostFileStat { | |
| readonly isFile: boolean; | |
| readonly isDirectory: boolean; | |
| readonly isSymbolicLink?: boolean; | |
| readonly size: number; | |
| readonly mtimeMs?: number; | |
| readonly ino?: number; | |
| } | |
| export interface HostDirEntry { | |
| readonly name: string; | |
| readonly isFile: boolean; | |
| readonly isDirectory: boolean; | |
| readonly isSymbolicLink?: boolean; | |
| } | |
| export interface IHostFileSystem { | |
| readonly _serviceBrand: undefined; | |
| readText( | |
| path: string, | |
| options?: { encoding?: BufferEncoding; errors?: TextDecodeErrors }, | |
| ): Promise<string>; | |
| writeText(path: string, data: string): Promise<void>; | |
| appendText(path: string, data: string): Promise<void>; | |
| readBytes(path: string, n?: number, offset?: number): Promise<Uint8Array>; | |
| writeBytes(path: string, data: Uint8Array): Promise<void>; | |
| readLines( | |
| path: string, | |
| options?: { encoding?: BufferEncoding; errors?: TextDecodeErrors }, | |
| ): AsyncGenerator<string>; | |
| createExclusive(path: string, data: Uint8Array): Promise<boolean>; | |
| stat(path: string): Promise<HostFileStat>; | |
| lstat(path: string): Promise<HostFileStat>; | |
| readdir(path: string): Promise<readonly HostDirEntry[]>; | |
| mkdir(path: string, options?: { readonly recursive?: boolean }): Promise<void>; | |
| remove(path: string): Promise<void>; | |
| realpath(path: string): Promise<string>; | |
| } | |
| export const IHostFileSystem: ServiceIdentifier<IHostFileSystem> = | |
| createDecorator<IHostFileSystem>('hostFileSystem'); | |