@poe-platform/safe-fs 0.1.642 → 0.1.644

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.
@@ -150,7 +150,14 @@ export class PythonFileSystem {
150
150
  case "stat": return fs.stat(this.#path(request.args[0]), options);
151
151
  case "lstat": return fs.lstat(this.#path(request.args[0]), options);
152
152
  case "realpath": return fs.realpath(this.#path(request.args[0]), options);
153
- case "readdir": return fs.readdir(this.#path(request.args[0]), { ...options, maxEntries: this.#directoryLimit });
153
+ case "readdir": {
154
+ const path = this.#path(request.args[0]);
155
+ const entries = await fs.readdir(path, { ...options, maxEntries: this.#directoryLimit });
156
+ signal.throwIfAborted();
157
+ if (entries.length > this.#directoryLimit)
158
+ throw new FsError("EFBIG", { syscall: "readdir", path, message: "Python directory listing exceeds configured limit" });
159
+ return entries;
160
+ }
154
161
  case "access": return fs.access(this.#path(request.args[0]), request.args[1], options);
155
162
  case "mkdir": return fs.mkdir(this.#path(request.args[0]), { ...request.args[1], ...options });
156
163
  case "rm": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-fs",
3
- "version": "0.1.642",
3
+ "version": "0.1.644",
4
4
  "description": "Composable filesystem with a portable core and explicit Node adapters",
5
5
  "type": "module",
6
6
  "license": "MIT",