@vite-hub/shell 0.0.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,77 @@
1
+ import { s as ShellObservation } from "./types-BNtJGjIv.js";
2
+ import { IFileSystem } from "just-bash";
3
+
4
+ //#region src/workspace/types.d.ts
5
+ type ShellContent = string | Uint8Array;
6
+ interface ShellReadFileOptions {
7
+ encoding?: "utf8" | "binary";
8
+ }
9
+ interface ShellListOptions {
10
+ recursive?: boolean;
11
+ }
12
+ interface ShellMkdirOptions {
13
+ recursive?: boolean;
14
+ }
15
+ interface ShellRmOptions {
16
+ force?: boolean;
17
+ recursive?: boolean;
18
+ }
19
+ interface ShellEntry {
20
+ path: string;
21
+ type: "file" | "directory";
22
+ size?: number;
23
+ }
24
+ interface ShellStat extends ShellEntry {}
25
+ interface ShellSearchQuery {
26
+ pattern: string;
27
+ cwd?: string;
28
+ paths?: string[];
29
+ regex?: boolean;
30
+ caseSensitive?: boolean;
31
+ limit?: number;
32
+ }
33
+ interface ShellSearchHit {
34
+ path: string;
35
+ line: number;
36
+ column: number;
37
+ text: string;
38
+ }
39
+ interface ReadonlyShellWorkspace {
40
+ readFile(path: string, options?: ShellReadFileOptions): Promise<string | Uint8Array>;
41
+ exists(path: string): Promise<boolean>;
42
+ stat(path: string): Promise<ShellStat>;
43
+ list(path?: string, options?: ShellListOptions): Promise<ShellEntry[]>;
44
+ }
45
+ interface SearchableShellWorkspace extends ReadonlyShellWorkspace {
46
+ search(query: ShellSearchQuery): Promise<ShellSearchHit[]>;
47
+ }
48
+ interface WritableShellWorkspace extends ReadonlyShellWorkspace {
49
+ writeFile(path: string, content: ShellContent): Promise<void>;
50
+ mkdir(path: string, options?: ShellMkdirOptions): Promise<void>;
51
+ rm(path: string, options?: ShellRmOptions): Promise<void>;
52
+ }
53
+ //#endregion
54
+ //#region src/workspace/filesystem.d.ts
55
+ interface WorkspaceShellFileSystem extends IFileSystem {
56
+ readonly writeFs: boolean;
57
+ }
58
+ declare const workspaceMountPoint = "/workspace";
59
+ declare function createReadonlyWorkspaceFs(workspace: ReadonlyShellWorkspace): WorkspaceShellFileSystem;
60
+ declare function createWritableWorkspaceFs(workspace: WritableShellWorkspace): WorkspaceShellFileSystem;
61
+ //#endregion
62
+ //#region src/workspace/inspection.d.ts
63
+ interface WorkspaceInspectionCommandOptions {
64
+ broadSearchPaths?: string[];
65
+ commands?: string[];
66
+ cwd?: string;
67
+ fs: WorkspaceShellFileSystem;
68
+ maxOutputLength?: number;
69
+ timeout?: number;
70
+ }
71
+ declare function runWorkspaceInspectionCommand(_input: SearchableShellWorkspace, command: string, options: WorkspaceInspectionCommandOptions): Promise<ShellObservation>;
72
+ //#endregion
73
+ //#region src/workspace/path.d.ts
74
+ declare function cleanWorkspaceShellPath(path?: string): string;
75
+ declare function cleanWorkspaceMutationPath(path: string): string;
76
+ //#endregion
77
+ export { ReadonlyShellWorkspace, SearchableShellWorkspace, ShellContent, ShellEntry, ShellListOptions, ShellMkdirOptions, ShellReadFileOptions, ShellRmOptions, ShellSearchHit, ShellSearchQuery, ShellStat, type WorkspaceShellFileSystem, WritableShellWorkspace, cleanWorkspaceMutationPath, cleanWorkspaceShellPath, createReadonlyWorkspaceFs, createWritableWorkspaceFs, runWorkspaceInspectionCommand, workspaceMountPoint };