feat(plugins): WASM Node.js polyfills for node:fs, node:path, node:os#20
Merged
Conversation
…e:os Enables Tier 1 WASM plugins to use core Node.js APIs through virtual implementations backed by host functions: - 5 new host functions: astrid_fs_exists, astrid_fs_mkdir, astrid_fs_readdir, astrid_fs_stat, astrid_fs_unlink (all security-gated via resolve_within_workspace) - Shim polyfills: _virtualFs (readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync, statSync, unlinkSync), _virtualPath (join, resolve, dirname, basename, extname, normalize, isAbsolute), _virtualOs (homedir, platform, tmpdir) - require() polyfill dispatching node:fs/path/os to virtual implementations - Transpiler relaxation: imports from polyfilled modules (node:fs, node:path, node:os) are now allowed and converted to require() calls via ESM->CJS - Updated QuickJS shim dispatch table from 7 to 12 host functions Closes #12
joshuajbouw
marked this pull request as draft
February 16, 2026 12:58
joshuajbouw
marked this pull request as ready for review
February 16, 2026 16:36
joshuajbouw
added a commit
that referenced
this pull request
Jul 2, 2026
….1.0 Points the wit submodule at astrid-runtime/wit@278dbca (PR #20), so the committed wit-staging matches the pinned contract and the CI drift check passes. Pairs with the dual-version host serving in this branch. Claude-Session: https://claude.ai/code/session_01NvX2tE7tgXuCRevqqiXTGU
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.
Summary
astrid_fs_exists,astrid_fs_mkdir,astrid_fs_readdir,astrid_fs_stat,astrid_fs_unlink) — all security-gated throughresolve_within_workspace()+SecurityGate_virtualFs,_virtualPath,_virtualOspolyfill objects in the JS shim, with arequire()polyfill that dispatchesnode:fs,node:path,node:osto themrequire()callsTest Plan
cargo test -p openclaw-bridge -- --quiet— transpiler tests for polyfilled import acceptance, ESM→CJS conversion of import statements, rejection of non-polyfilled modulescargo test -p astrid-plugins -- --quiet— host function ordering test verifies all 12 functions are correctly indexedimport { readFileSync } from "node:fs"— should succeed (previously rejected as unresolved import)Closes #12