Open
Conversation
Implements a new filesystem that loads content on-demand via user-provided loader functions. Content is cached in memory using InMemoryFs as the backing store. Designed for AI agents needing lazy access to remote or virtual content. Features: - Lazy loading of files and directories via listDir/loadFile callbacks - Caching with separate negative cache for files vs directories - Write/delete operations shadow lazy content - Full symlink support with proper resolution - Implements complete IFileSystem interface Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document the new lazy-loading filesystem implementation with usage examples showing listDir/loadFile callbacks and caching behavior. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix TypeScript compilation error in LazyFs documentation example by using inline stub values instead of undefined placeholder functions - Use correct type "directory" instead of "dir" to match LazyDirEntry - Add .claude/ to gitignore (local Claude Code settings) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@defrex is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
When writing files to non-existent paths, parent directories created by InMemoryFs were invisible to LazyFs operations. Added markParentsModified() helper to track implicitly created parent directories, and fixed readdir to handle locally-created directories that don't exist in the lazy source. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
|
Should OverlayFS just be lazy? |
Author
That seems like a good default for Though to clarify, that wouldn't solve my use-case since I specifically need to load data from a database, not the filesystem. |
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.
I've ben loving just-bash! It's solved a ton of problems for me by enabling filesystem agents without a full sandbox.
However, I'm loading so many files in there that initializing the tool has gotten quite slow, and most of the time the agent doesn't even need the files.
The new
LazyFsclass has allowed me to quickly initialize the virtual filesystem and only load files that directories on an as-needed bases, which has greatly improved performance.In addition to the unit tests in the PR, I've integrated this into my agents and run through my evals, etc confirming that this is working great for me.
README Snippet
LazyFs - Lazy-loading filesystem that loads content on-demand via callbacks. Ideal for remote content, API-backed storage, or large datasets where you don't want to load everything upfront:
Content is cached after first access. Writes and deletes stay in memory and shadow the lazy-loaded content.