Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
68d9108
Add baml.fs.read_dir, baml.fs.mkdir, baml.glob namespace, and fix par…
aaronvg Apr 23, 2026
1b6afd7
Finish BEP 37 filesystem glob implementation
antoniosarosi Apr 28, 2026
f54a106
Test WASM filesystem glob runtime wiring
antoniosarosi Apr 28, 2026
6e30cf7
Extract glob pattern matcher into shared sys_glob crate
antoniosarosi Apr 28, 2026
506ed49
WIP: WASM read_dir/mkdir + new fs/glob tests + MIR field-order workar…
antoniosarosi Apr 28, 2026
a40872b
Fix MIR field-order bug: preserve qualified type paths through TIR
antoniosarosi Apr 28, 2026
9db8793
Native Glob.scan: propagate real I/O errors, scope throw-on-broken co…
antoniosarosi Apr 28, 2026
0277dae
Native Glob.scan: prune dot directories during walk
antoniosarosi Apr 28, 2026
51fecad
Glob.scan: pick canonical path form by pattern shape
antoniosarosi Apr 28, 2026
bde42c6
WASM mkdir(recursive=true): don't turn create errors into success
antoniosarosi Apr 29, 2026
2c7b72d
WASM read_dir: rich readDirEntries contract with symlink info
antoniosarosi Apr 29, 2026
bd606da
Move external_as_string/bool helpers to BexExternalValue
antoniosarosi Apr 29, 2026
afb2092
Codegen: unify emit_result_conversion + emit_result_conversion_inner
antoniosarosi Apr 29, 2026
a98e4be
WASM Glob.scan: anchor `cwd: "."` to the VFS root
antoniosarosi Apr 29, 2026
6bf2691
Native fs/glob: add coverage gaps from review
antoniosarosi Apr 29, 2026
4920205
Trim redundant fs_open_only test
antoniosarosi Apr 29, 2026
399ebe4
Merge branch 'canary' into aaron/add-readdir-function-to-bamlfs-module
antoniosarosi Apr 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions baml_language/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions baml_language/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ baml_compiler_parser = { path = "crates/baml_compiler_parser" }
baml_compiler_syntax = { path = "crates/baml_compiler_syntax" }
bex_project = { path = "crates/bex_project" }
bex_engine = { path = "crates/bex_engine" }
sys_glob = { path = "crates/sys_glob" }
sys_llm = { path = "crates/sys_llm" }
sys_ops = { path = "crates/sys_ops" }
sys_types = { path = "crates/sys_types" }
Expand Down Expand Up @@ -151,6 +152,7 @@ salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "cdd0b85516a52c18
"inventory",
] }
serde = { version = "1.0.197", features = [ "derive" ] }
serde-wasm-bindgen = "0.6"
serde_json = { version = "1.0.113", features = [ "preserve_order" ] }
similar = { version = "2.4.0", features = [ "inline" ] }
smol_str = { version = "0.3" }
Expand Down
19 changes: 19 additions & 0 deletions baml_language/crates/baml_builtins2/baml_std/baml/ns_fs/fs.baml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,22 @@ function write(path: string, content: string) -> int throws root.errors.Io {
function write_bytes(path: string, content: uint8array) -> int throws root.errors.Io {
$rust_io_function
}

class DirEntry {
name string
is_dir bool
is_file bool
is_symlink bool
}

class MkdirOptions {
recursive bool
}

function read_dir(path: string) -> DirEntry[] throws root.errors.Io {
$rust_io_function
}

function mkdir(path: string, options: MkdirOptions) -> null throws root.errors.Io {
$rust_io_function
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class ScanOptions {
cwd string?
dot bool?
absolute bool?
follow_symlinks bool?
throw_error_on_broken_symlink bool?
only_files bool?
}

class Glob {
_handle $rust_type

function scan(self, root: string | ScanOptions) -> string[] throws root.errors.Io {
$rust_io_function
}

function matches(self, path: string) -> bool throws root.errors.Io {
$rust_io_function
}
}

function new(pattern: string) -> Glob throws root.errors.Io {
$rust_io_function
}
1 change: 1 addition & 0 deletions baml_language/crates/baml_builtins2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ pub const ALL: &[BuiltinFile] = &[
builtin!("baml", "ns_math/math.baml"),
builtin!("baml", "ns_sys/sys.baml"),
builtin!("baml", "ns_fs/fs.baml"),
builtin!("baml", "ns_glob/glob.baml"),
builtin!("baml", "ns_net/net.baml"),
builtin!("baml", "ns_media/media.baml"),
builtin!("baml", "ns_unstable/unstable.baml"),
Expand Down
Loading
Loading