feat(interop): add filesystem ABI handles#1353
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | ad3d96d | Commit Preview URL Branch Preview URL |
Apr 30 2026, 05:48 AM |
ec711ba to
5c470d2
Compare
There was a problem hiding this comment.
Pull request overview
Adds a stable, cross-addon filesystem handle contract and exposes it through the Python and Node.js bindings so downstream native extensions can construct and mount bashkit-owned filesystem handles.
Changes:
- Introduce
bashkit::interop::fs(behind theinteropcargo feature) implementing a versionedrepr(C)filesystem handle + vtable contract. - Add Python
FileSystem.to_capsule()/FileSystem.from_capsule()plus regression test coverage and docs. - Add Node.js standalone
FileSystemwrapper withtoExternal()/fromExternal()and support for mountingFileSystemobjects intoBash/BashTool, plus tests and docs/spec updates.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| specs/vfs.md | Documents filesystem concepts parity and binding-specific interop APIs/contracts. |
| crates/bashkit/src/lib.rs | Exposes interop module behind the interop feature. |
| crates/bashkit/src/interop/mod.rs | Adds interop module root. |
| crates/bashkit/src/interop/fs.rs | Implements the stable ABI handle/vtable, import/export, and Rust-side roundtrip tests. |
| crates/bashkit/Cargo.toml | Adds interop feature (tokio multi-thread runtime support). |
| crates/bashkit-python/tests/_bashkit_categories.py | Adds capsule roundtrip + mount integration regression test. |
| crates/bashkit-python/src/lib.rs | Implements FileSystem.from_capsule() and to_capsule() in PyO3 binding. |
| crates/bashkit-python/bashkit/_bashkit.pyi | Adds type stubs for capsule interop APIs. |
| crates/bashkit-python/README.md | Documents native-extension interop usage and API list updates. |
| crates/bashkit-python/Cargo.toml | Enables bashkit interop feature for the Python binding crate. |
| crates/bashkit-js/wrapper.ts | Adds JS FileSystem class, external interop, and overloads mount() to accept FileSystem. |
| crates/bashkit-js/src/lib.rs | Adds NAPI exports for standalone FS ops, external import/export, and filesystem mounting. |
| crates/bashkit-js/test/vfs.spec.ts | Adds external roundtrip + mount regression test. |
| crates/bashkit-js/README.md | Documents standalone FileSystem, mounting, and addon interop. |
| crates/bashkit-js/Cargo.toml | Enables bashkit interop feature for the Node binding crate. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5c470d2 to
6c5398e
Compare
c7b2ae0 to
ad3d96d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add a feature-gated filesystem interop ABI owned by the core crate and expose it through Python and Node bindings.
Why
Fixes #1352. Downstream native extensions need a supported way to create filesystem implementations that bashkit can mount without sharing addon-private Rust object layouts or PyO3 class identity.
How
bashkit::interop::fsbehind theinteropcargo featurerepr(C)filesystem handle + vtable for cross-addon/native-extension interopFileSystem.from_capsule()/to_capsule()using the core ABIFileSystem.fromExternal()/toExternal()using the same core ABIbashkit-fs-interopcrateExample
Downstream package wrapper:
Downstream PyO3 extension:
End-user code:
Risk
Checklist