@procedures/fs 0.0.0-stage → 0.2.0

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/LICENSE +21 -0
  3. package/README.md +895 -2
  4. package/dist/.tsbuildinfo +1 -0
  5. package/dist/index.d.ts +17 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +17 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/module.d.ts +22 -0
  10. package/dist/module.d.ts.map +1 -0
  11. package/dist/module.js +203 -0
  12. package/dist/module.js.map +1 -0
  13. package/dist/procedures/fs/copy.d.ts +11 -0
  14. package/dist/procedures/fs/copy.d.ts.map +1 -0
  15. package/dist/procedures/fs/copy.js +21 -0
  16. package/dist/procedures/fs/copy.js.map +1 -0
  17. package/dist/procedures/fs/exists.d.ts +11 -0
  18. package/dist/procedures/fs/exists.d.ts.map +1 -0
  19. package/dist/procedures/fs/exists.js +20 -0
  20. package/dist/procedures/fs/exists.js.map +1 -0
  21. package/dist/procedures/fs/glob.d.ts +17 -0
  22. package/dist/procedures/fs/glob.d.ts.map +1 -0
  23. package/dist/procedures/fs/glob.js +85 -0
  24. package/dist/procedures/fs/glob.js.map +1 -0
  25. package/dist/procedures/fs/index.d.ts +12 -0
  26. package/dist/procedures/fs/index.d.ts.map +1 -0
  27. package/dist/procedures/fs/index.js +12 -0
  28. package/dist/procedures/fs/index.js.map +1 -0
  29. package/dist/procedures/fs/json.d.ts +11 -0
  30. package/dist/procedures/fs/json.d.ts.map +1 -0
  31. package/dist/procedures/fs/json.js +16 -0
  32. package/dist/procedures/fs/json.js.map +1 -0
  33. package/dist/procedures/fs/mkdir.d.ts +11 -0
  34. package/dist/procedures/fs/mkdir.d.ts.map +1 -0
  35. package/dist/procedures/fs/mkdir.js +39 -0
  36. package/dist/procedures/fs/mkdir.js.map +1 -0
  37. package/dist/procedures/fs/move.d.ts +11 -0
  38. package/dist/procedures/fs/move.d.ts.map +1 -0
  39. package/dist/procedures/fs/move.js +46 -0
  40. package/dist/procedures/fs/move.js.map +1 -0
  41. package/dist/procedures/fs/read.d.ts +11 -0
  42. package/dist/procedures/fs/read.d.ts.map +1 -0
  43. package/dist/procedures/fs/read.js +21 -0
  44. package/dist/procedures/fs/read.js.map +1 -0
  45. package/dist/procedures/fs/readdir.d.ts +11 -0
  46. package/dist/procedures/fs/readdir.d.ts.map +1 -0
  47. package/dist/procedures/fs/readdir.js +38 -0
  48. package/dist/procedures/fs/readdir.js.map +1 -0
  49. package/dist/procedures/fs/rm.d.ts +11 -0
  50. package/dist/procedures/fs/rm.d.ts.map +1 -0
  51. package/dist/procedures/fs/rm.js +30 -0
  52. package/dist/procedures/fs/rm.js.map +1 -0
  53. package/dist/procedures/fs/stat.d.ts +11 -0
  54. package/dist/procedures/fs/stat.d.ts.map +1 -0
  55. package/dist/procedures/fs/stat.js +29 -0
  56. package/dist/procedures/fs/stat.js.map +1 -0
  57. package/dist/procedures/fs/write.d.ts +11 -0
  58. package/dist/procedures/fs/write.d.ts.map +1 -0
  59. package/dist/procedures/fs/write.js +24 -0
  60. package/dist/procedures/fs/write.js.map +1 -0
  61. package/dist/procedures/fs.d.ts +5 -0
  62. package/dist/procedures/fs.d.ts.map +1 -0
  63. package/dist/procedures/fs.js +5 -0
  64. package/dist/procedures/fs.js.map +1 -0
  65. package/dist/register.d.ts +7 -0
  66. package/dist/register.d.ts.map +1 -0
  67. package/dist/register.js +9 -0
  68. package/dist/register.js.map +1 -0
  69. package/dist/types.d.ts +187 -0
  70. package/dist/types.d.ts.map +1 -0
  71. package/dist/types.js +197 -0
  72. package/dist/types.js.map +1 -0
  73. package/package.json +77 -3
  74. package/src/index.ts +17 -0
  75. package/src/module.ts +265 -0
  76. package/src/procedures/fs/copy.ts +24 -0
  77. package/src/procedures/fs/exists.ts +20 -0
  78. package/src/procedures/fs/glob.ts +92 -0
  79. package/src/procedures/fs/index.ts +11 -0
  80. package/src/procedures/fs/json.ts +21 -0
  81. package/src/procedures/fs/mkdir.ts +43 -0
  82. package/src/procedures/fs/move.ts +47 -0
  83. package/src/procedures/fs/read.ts +23 -0
  84. package/src/procedures/fs/readdir.ts +44 -0
  85. package/src/procedures/fs/rm.ts +31 -0
  86. package/src/procedures/fs/stat.ts +30 -0
  87. package/src/procedures/fs/write.ts +27 -0
  88. package/src/procedures/fs.ts +5 -0
  89. package/src/register.ts +11 -0
  90. package/src/types.ts +407 -0
@@ -0,0 +1,21 @@
1
+ /**
2
+ * read procedure
3
+ *
4
+ * Read file contents
5
+ */
6
+ import { readFile } from "node:fs/promises";
7
+ import { stat } from "./stat.js";
8
+ /**
9
+ * Read file contents
10
+ */
11
+ export async function read(input) {
12
+ const { path, encoding } = input;
13
+ const content = await readFile(path, { encoding: encoding });
14
+ const stats = await stat({ path });
15
+ return {
16
+ content,
17
+ path,
18
+ stats
19
+ };
20
+ }
21
+ //# sourceMappingURL=read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.js","sourceRoot":"","sources":["../../../src/procedures/fs/read.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,KAAgB;IACzC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACjC,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,QAA0B,EAAE,CAAC,CAAC;IAC/E,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,EAAC,IAAI,EAAC,CAAC,CAAC;IACjC,OAAO;QACL,OAAO;QACP,IAAI;QACJ,KAAK;KACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * readdir procedure
3
+ *
4
+ * Read directory contents
5
+ */
6
+ import { type ReaddirInput, type ReaddirOutput } from "../../types.js";
7
+ /**
8
+ * Read directory contents
9
+ */
10
+ export declare function readdir(input: ReaddirInput): Promise<ReaddirOutput>;
11
+ //# sourceMappingURL=readdir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readdir.d.ts","sourceRoot":"","sources":["../../../src/procedures/fs/readdir.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAA+B,MAAM,gBAAgB,CAAC;AAGpG;;GAEG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CA6BzE"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * readdir procedure
3
+ *
4
+ * Read directory contents
5
+ */
6
+ import { readdir as fsReaddir } from "node:fs/promises";
7
+ import { join } from "node:path";
8
+ import { FileType } from "../../types.js";
9
+ import { stat } from "./stat.js";
10
+ /**
11
+ * Read directory contents
12
+ */
13
+ export async function readdir(input) {
14
+ const { path, recursive, includeStats } = input;
15
+ const entries = [];
16
+ async function readDir(dir) {
17
+ const items = await fsReaddir(dir, { withFileTypes: true });
18
+ for (const item of items) {
19
+ const fullPath = join(dir, item.name);
20
+ let type = FileType.Other;
21
+ if (item.isFile())
22
+ type = FileType.File;
23
+ else if (item.isDirectory())
24
+ type = FileType.Directory;
25
+ const entry = { name: item.name, path: fullPath, type };
26
+ if (includeStats) {
27
+ entry.stats = await stat({ path: fullPath });
28
+ }
29
+ entries.push(entry);
30
+ if (recursive && item.isDirectory()) {
31
+ await readDir(fullPath);
32
+ }
33
+ }
34
+ }
35
+ await readDir(path);
36
+ return { path, entries };
37
+ }
38
+ //# sourceMappingURL=readdir.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readdir.js","sourceRoot":"","sources":["../../../src/procedures/fs/readdir.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,E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AQ,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * rm procedure
3
+ *
4
+ * Remove file or directory
5
+ */
6
+ import type { RmInput, RmOutput } from "../../types.js";
7
+ /**
8
+ * Remove file or directory
9
+ */
10
+ export declare function rm(input: RmInput): Promise<RmOutput>;
11
+ //# sourceMappingURL=rm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rm.d.ts","sourceRoot":"","sources":["../../../src/procedures/fs/rm.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAExD;;GAEG;AACH,wBAAsB,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAkB1D"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * rm procedure
3
+ *
4
+ * Remove file or directory
5
+ */
6
+ import { rm as fsRm } from "node:fs/promises";
7
+ /**
8
+ * Remove file or directory
9
+ */
10
+ export async function rm(input) {
11
+ const { path, recursive, force } = input;
12
+ // Always call with force:false so Node reports a missing path via ENOENT
13
+ // (letting us distinguish "removed" from "didn't exist"). Node's `force`
14
+ // option only suppresses ENOENT anyway, so replicating it here keeps the
15
+ // exact same behavior while still surfacing EPERM/ENOTEMPTY/EBUSY/etc.
16
+ try {
17
+ await fsRm(path, { recursive, force: false });
18
+ return { path, removed: true };
19
+ }
20
+ catch (err) {
21
+ // With force:true a non-existent path is not an error — report it as
22
+ // "nothing removed". Every other error (permissions, non-empty, busy) must
23
+ // propagate rather than being silently swallowed.
24
+ if (force && err.code === "ENOENT") {
25
+ return { path, removed: false };
26
+ }
27
+ throw err;
28
+ }
29
+ }
30
+ //# sourceMappingURL=rm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rm.js","sourceRoot":"","sources":["../../../src/procedures/fs/rm.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG9C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,EAAE,CAAC,KAAc;IACrC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACzC,yEAAyE;IACzE,yEAAyE;IACzE,yEAAyE;IACzE,uEAAuE;IACvE,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACjC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,qEAAqE;QACrE,2EAA2E;QAC3E,kDAAkD;QAClD,IAAI,KAAK,IAAK,GAA6B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC9D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAClC,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * stat procedure
3
+ *
4
+ * Get file or directory stats
5
+ */
6
+ import { type StatInput, type StatOutput } from "../../types.js";
7
+ /**
8
+ * Get file or directory stats
9
+ */
10
+ export declare function stat(input: StatInput): Promise<StatOutput>;
11
+ //# sourceMappingURL=stat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stat.d.ts","sourceRoot":"","sources":["../../../src/procedures/fs/stat.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAY,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE3E;;GAEG;AACH,wBAAsB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAiBhE"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * stat procedure
3
+ *
4
+ * Get file or directory stats
5
+ */
6
+ import { stat as fsStat } from "node:fs/promises";
7
+ import { FileType } from "../../types.js";
8
+ /**
9
+ * Get file or directory stats
10
+ */
11
+ export async function stat(input) {
12
+ const { path } = input;
13
+ const stats = await fsStat(path);
14
+ let type = FileType.Other;
15
+ if (stats.isFile())
16
+ type = FileType.File;
17
+ else if (stats.isDirectory())
18
+ type = FileType.Directory;
19
+ return {
20
+ path,
21
+ type,
22
+ size: stats.size,
23
+ mtime: stats.mtime.toISOString(),
24
+ ctime: stats.ctime.toISOString(),
25
+ atime: stats.atime.toISOString(),
26
+ mode: stats.mode,
27
+ };
28
+ }
29
+ //# sourceMappingURL=stat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stat.js","sourceRoot":"","sources":["../../../src/procedures/fs/stat.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAmC,MAAM,gBAAgB,CAAC;AAE3E;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,KAAgB;IACzC,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACvB,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;IAEjC,IAAI,IAAI,GAAa,QAAQ,CAAC,KAAK,CAAC;IACpC,IAAI,KAAK,CAAC,MAAM,EAAE;QAAE,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;SACpC,IAAI,KAAK,CAAC,WAAW,EAAE;QAAE,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC;IAExD,OAAO;QACL,IAAI;QACJ,IAAI;QACJ,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE;QAChC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE;QAChC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE;QAChC,IAAI,EAAE,KAAK,CAAC,IAAI;KACjB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * write procedure
3
+ *
4
+ * Write content to file
5
+ */
6
+ import type { WriteInput, WriteOutput } from "../../types.js";
7
+ /**
8
+ * Write content to file
9
+ */
10
+ export declare function write(input: WriteInput): Promise<WriteOutput>;
11
+ //# sourceMappingURL=write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../../src/procedures/fs/write.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE9D;;GAEG;AACH,wBAAsB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAcnE"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * write procedure
3
+ *
4
+ * Write content to file
5
+ */
6
+ import { writeFile, appendFile } from "node:fs/promises";
7
+ /**
8
+ * Write content to file
9
+ */
10
+ export async function write(input) {
11
+ const { path, content, encoding, mode } = input;
12
+ const writeOptions = { encoding: encoding };
13
+ if (mode === "append") {
14
+ await appendFile(path, content, writeOptions);
15
+ }
16
+ else {
17
+ await writeFile(path, content, writeOptions);
18
+ }
19
+ return {
20
+ path,
21
+ bytesWritten: Buffer.byteLength(content, encoding),
22
+ };
23
+ }
24
+ //# sourceMappingURL=write.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.js","sourceRoot":"","sources":["../../../src/procedures/fs/write.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGzD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,KAAiB;IAC3C,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAChD,MAAM,YAAY,GAAG,EAAE,QAAQ,EAAE,QAA0B,EAAE,CAAC;IAE9D,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,MAAM,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACN,MAAM,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO;QACL,IAAI;QACJ,YAAY,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,QAA0B,CAAC;KACrE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Filesystem procedures barrel export
3
+ */
4
+ export * from "./fs/index.js";
5
+ //# sourceMappingURL=fs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/procedures/fs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,eAAe,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Filesystem procedures barrel export
3
+ */
4
+ export * from "./fs/index.js";
5
+ //# sourceMappingURL=fs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/procedures/fs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,eAAe,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Importing this file registers the procedures of @procedures/fs, and of the modules that it
3
+ * requires, in the global registry: `import "@procedures/fs/register"`. The package root and the
4
+ * `./module` entry register nothing (ARCHITECTURE-PROPOSALS-2026-10, P9).
5
+ */
6
+ export * from "./module.js";
7
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,cAAc,aAAa,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Importing this file registers the procedures of @procedures/fs, and of the modules that it
3
+ * requires, in the global registry: `import "@procedures/fs/register"`. The package root and the
4
+ * `./module` entry register nothing (ARCHITECTURE-PROPOSALS-2026-10, P9).
5
+ */
6
+ import { registerFsProcedures } from "./module.js";
7
+ export * from "./module.js";
8
+ registerFsProcedures();
9
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,cAAc,aAAa,CAAC;AAE5B,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,187 @@
1
+ /**
2
+ * Type definitions for client-fs procedures
3
+ */
4
+ import type { Stats } from "node:fs";
5
+ import { z } from "zod";
6
+ export declare const ReadInputSchema: z.ZodObject<{
7
+ path: z.ZodString;
8
+ encoding: z.ZodDefault<z.ZodOptional<z.ZodString>>;
9
+ }>;
10
+ export type ReadInput = z.infer<typeof ReadInputSchema>;
11
+ export interface ReadOutput {
12
+ /** File content */
13
+ content: string;
14
+ /** File path */
15
+ path: string;
16
+ /** File size in bytes */
17
+ stats: StatOutput;
18
+ }
19
+ export declare const WriteInputSchema: z.ZodObject<{
20
+ path: z.ZodString;
21
+ content: z.ZodString;
22
+ encoding: z.ZodDefault<z.ZodOptional<z.ZodString>>;
23
+ mode: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
24
+ write: "write";
25
+ append: "append";
26
+ }>>>;
27
+ }>;
28
+ export type WriteInput = z.infer<typeof WriteInputSchema>;
29
+ export interface WriteOutput {
30
+ /** File path that was written */
31
+ path: string;
32
+ /** Bytes written */
33
+ bytesWritten: number;
34
+ }
35
+ export declare const FileTypeInputSchema: z.ZodObject<{
36
+ path: z.ZodString;
37
+ }>;
38
+ export type FileTypeInput = z.infer<typeof FileTypeInputSchema>;
39
+ export interface FileTypeOutput {
40
+ /** Path that was checked */
41
+ path: string;
42
+ /** Type if exists: file, directory, or other */
43
+ type: FileType;
44
+ stats: Stats;
45
+ }
46
+ export declare const ExistsInputSchema: z.ZodObject<{
47
+ path: z.ZodString;
48
+ }>;
49
+ export type ExistsInput = z.infer<typeof ExistsInputSchema>;
50
+ export declare enum FileType {
51
+ File = "file",
52
+ Directory = "directory",
53
+ Other = "other"
54
+ }
55
+ export type ExistsOutput = {
56
+ exists: false;
57
+ } | {
58
+ exists: true;
59
+ stats: StatOutput;
60
+ };
61
+ export declare const MkdirInputSchema: z.ZodObject<{
62
+ path: z.ZodString;
63
+ recursive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
64
+ }>;
65
+ export type MkdirInput = z.infer<typeof MkdirInputSchema>;
66
+ export interface MkdirOutput {
67
+ /** Path that was created */
68
+ path: string;
69
+ /** Whether the directory was created (false if already existed) */
70
+ created: boolean;
71
+ }
72
+ export declare const RmInputSchema: z.ZodObject<{
73
+ path: z.ZodString;
74
+ recursive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
75
+ force: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
76
+ }>;
77
+ export type RmInput = z.infer<typeof RmInputSchema>;
78
+ export interface RmOutput {
79
+ /** Path that was removed */
80
+ path: string;
81
+ /** Whether something was removed (false if didn't exist with force=true) */
82
+ removed: boolean;
83
+ }
84
+ export declare const ReaddirInputSchema: z.ZodObject<{
85
+ path: z.ZodString;
86
+ recursive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
87
+ includeStats: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
88
+ }>;
89
+ export type ReaddirInput = z.infer<typeof ReaddirInputSchema>;
90
+ export interface ReaddirEntry {
91
+ /** Entry name */
92
+ name: string;
93
+ /** Full path */
94
+ path: string;
95
+ /** Type: file, directory, or other */
96
+ type: FileType;
97
+ /** Stats if includeStats was true */
98
+ stats?: StatOutput | undefined;
99
+ }
100
+ export interface ReaddirOutput {
101
+ /** Directory path */
102
+ path: string;
103
+ /** Directory entries */
104
+ entries: ReaddirEntry[];
105
+ }
106
+ export declare const StatInputSchema: z.ZodObject<{
107
+ path: z.ZodString;
108
+ }>;
109
+ export type StatInput = z.infer<typeof StatInputSchema>;
110
+ export interface StatOutput {
111
+ /** Path */
112
+ path: string;
113
+ /** Type: file, directory, or other */
114
+ type: FileType;
115
+ /** Size in bytes */
116
+ size: number;
117
+ /** Last modified time (ISO string) */
118
+ mtime: string;
119
+ /** Creation time (ISO string) */
120
+ ctime: string;
121
+ /** Last access time (ISO string) */
122
+ atime: string;
123
+ /** Unix mode/permissions */
124
+ mode: number;
125
+ }
126
+ export declare const CopyInputSchema: z.ZodObject<{
127
+ src: z.ZodString;
128
+ dest: z.ZodString;
129
+ recursive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
130
+ overwrite: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
131
+ }>;
132
+ export type CopyInput = z.infer<typeof CopyInputSchema>;
133
+ export interface CopyOutput {
134
+ /** Source path */
135
+ src: string;
136
+ /** Destination path */
137
+ dest: string;
138
+ }
139
+ export declare const MoveInputSchema: z.ZodObject<{
140
+ src: z.ZodString;
141
+ dest: z.ZodString;
142
+ overwrite: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
143
+ }>;
144
+ export type MoveInput = z.infer<typeof MoveInputSchema>;
145
+ export interface MoveOutput {
146
+ /** Source path (original) */
147
+ src: string;
148
+ /** Destination path (new location) */
149
+ dest: string;
150
+ }
151
+ export declare const GlobInputSchema: z.ZodObject<{
152
+ pattern: z.ZodString;
153
+ cwd: z.ZodOptional<z.ZodString>;
154
+ absolute: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
155
+ dot: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
156
+ ignore: z.ZodOptional<z.ZodArray<z.ZodString>>;
157
+ }>;
158
+ export type GlobInput = z.infer<typeof GlobInputSchema>;
159
+ export interface GlobOutput {
160
+ /** Glob pattern used */
161
+ pattern: string;
162
+ /** Matching paths, sorted: relative to `cwd` with "/" separators, or absolute with `absolute: true` */
163
+ matches: string[];
164
+ }
165
+ export declare const ReadJsonInputSchema: z.ZodObject<{
166
+ path: z.ZodString;
167
+ }>;
168
+ export type ReadJsonInput = z.infer<typeof ReadJsonInputSchema>;
169
+ export interface ReadJsonOutput {
170
+ /** File path */
171
+ path: string;
172
+ /** Parsed JSON data */
173
+ data: unknown;
174
+ stats: StatOutput;
175
+ }
176
+ export declare const StatOutputSchema: z.ZodType<StatOutput>;
177
+ export declare const ReadOutputSchema: z.ZodType<ReadOutput>;
178
+ export declare const WriteOutputSchema: z.ZodType<WriteOutput>;
179
+ export declare const ExistsOutputSchema: z.ZodType<ExistsOutput>;
180
+ export declare const MkdirOutputSchema: z.ZodType<MkdirOutput>;
181
+ export declare const RmOutputSchema: z.ZodType<RmOutput>;
182
+ export declare const ReaddirOutputSchema: z.ZodType<ReaddirOutput>;
183
+ export declare const CopyOutputSchema: z.ZodType<CopyOutput>;
184
+ export declare const MoveOutputSchema: z.ZodType<MoveOutput>;
185
+ export declare const GlobOutputSchema: z.ZodType<GlobOutput>;
186
+ export declare const ReadJsonOutputSchema: z.ZodType<ReadJsonOutput>;
187
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,SAAS,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC;IAClB,QAAQ,EAAE,CAAC,CAAC,UAAU,C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