Skip to content

feat(js): readDir returns entries with metadata (Python parity)#1132

Merged
chaliy merged 6 commits intomainfrom
feat/issue-1129-js-fs-operations
Apr 7, 2026
Merged

feat(js): readDir returns entries with metadata (Python parity)#1132
chaliy merged 6 commits intomainfrom
feat/issue-1129-js-fs-operations

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 6, 2026

Summary

  • Bash.readDir() and BashTool.readDir() now return JsDirEntry objects with name and metadata (fileType, size, mode, timestamps) instead of plain strings
  • This matches the Python bindings' read_dir behavior and the existing JsFileSystem.readDir() API
  • All other operations requested in the issue (stat, appendFile, chmod, symlink, readLink, fs()) already exist on the Bash class

Test plan

  • New test: stat returns file metadata
  • New test: stat returns directory metadata
  • New test: readDir returns entries with metadata
  • New test: appendFile appends content
  • New test: chmod changes file mode
  • New test: symlink and readLink roundtrip
  • New test: fs() accessor provides same operations
  • JS crate compiles cleanly

Closes #1129

chaliy added 6 commits April 6, 2026 22:31
Bash.readDir() and BashTool.readDir() now return JsDirEntry objects
with name and metadata (fileType, size, mode, etc.) instead of plain
strings. This matches the Python bindings' read_dir behavior and the
JsFileSystem.readDir() API.

All other missing operations (stat, appendFile, chmod, symlink,
readLink) already exist on the Bash class. Added comprehensive VFS
API tests covering stat, readDir, appendFile, chmod, symlink,
readLink, and the fs() accessor.

Closes #1129
wrapper.ts ls() methods return string[] by mapping JsDirEntry.name
from the now-rich readDir results.
… fs on wrapper

Both Bash and BashTool wrapper classes now expose all VFS operations
that the native NAPI class provides, achieving full Python parity.
readFile via direct API doesn't follow symlinks; use bash cat which does.
@chaliy chaliy merged commit 5a3c055 into main Apr 7, 2026
20 checks passed
@chaliy chaliy deleted the feat/issue-1129-js-fs-operations branch April 7, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(js): expose stat() and fs operations (Python parity)

1 participant