Skip to content
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
bcdefc2
set up new HIR traversal
sxlijin Nov 4, 2025
aea4a16
checkpoint control flow logic
sxlijin Nov 4, 2025
df62f8f
update it all
sxlijin Nov 4, 2025
d67a726
design-docs v1
aaronvg Nov 4, 2025
d9854ed
move stuff around
sxlijin Nov 4, 2025
225ffb0
more update
sxlijin Nov 4, 2025
cebdb69
keep going
sxlijin Nov 4, 2025
2f95963
plans 1-3
aaronvg Nov 5, 2025
1bdd8bd
clean up test pipeline
sxlijin Nov 5, 2025
84df1be
delete mmd files
sxlijin Nov 5, 2025
3420b1e
fix broken files
sxlijin Nov 5, 2025
7df8d52
more testing
sxlijin Nov 5, 2025
81caaca
updates
sxlijin Nov 5, 2025
610079d
AnnotatedStatement -> HeaderContextStart
sxlijin Nov 5, 2025
1790077
HeaderContextEnter
sxlijin Nov 5, 2025
4e8247b
new control flow logic
sxlijin Nov 6, 2025
e9e161c
use indexmap
sxlijin Nov 6, 2025
5ff06a6
move baml-graphs files over
aaronvg Nov 6, 2025
e92a8d8
add tests
aaronvg Nov 6, 2025
b0e4fb8
more test
sxlijin Nov 6, 2025
9dc2600
test runner changes
aaronvg Nov 6, 2025
45b6c4b
fix edge bookkeeping
sxlijin Nov 6, 2025
a2707a2
update snapshots
sxlijin Nov 6, 2025
9cc852b
wip migrating old code to sdk
aaronvg Nov 6, 2025
ae1bd70
test runner migrated
aaronvg Nov 7, 2025
0a9ad3f
node id changed
sxlijin Nov 7, 2025
fdda0ba
all flatten passes implemented
sxlijin Nov 7, 2025
6e0ec35
apply flattening passes
sxlijin Nov 7, 2025
8904e7c
things
aaronvg Nov 8, 2025
35af3e4
checkpoint
aaronvg Nov 8, 2025
5a64cdd
function click fix
aaronvg Nov 8, 2025
f760578
remove logs
aaronvg Nov 8, 2025
9d0cb1a
fix test panel atom states
aaronvg Nov 8, 2025
ccafa99
prep for wasm refactor
aaronvg Nov 8, 2025
e48238d
checkpoint, everything works with new types
aaronvg Nov 8, 2025
2d88f60
migrate more atoms to new interfaec
aaronvg Nov 8, 2025
9af3c3d
fix files atom bug
aaronvg Nov 9, 2025
bbcb74d
fix test not scrollintoview working
aaronvg Nov 9, 2025
3a2da1b
cleanup
aaronvg Nov 9, 2025
452d3c9
use new type FunctionWithCallGraph
aaronvg Nov 9, 2025
e92f6a3
checkpoint, fixing tests, premerge
aaronvg Nov 9, 2025
170f52d
unify uis WIP
aaronvg Nov 9, 2025
4f52e5d
cleanup
aaronvg Nov 9, 2025
8a5946c
commit debug panel
aaronvg Nov 9, 2025
a3d8088
flatten efore return
sxlijin Nov 9, 2025
4a88131
fix more issues
aaronvg Nov 9, 2025
05f362d
fix selection1
aaronvg Nov 9, 2025
e572273
checkpoint, working integration1
aaronvg Nov 9, 2025
92192b5
fix selection bug
aaronvg Nov 9, 2025
a9f435e
new debug panel with ifs
aaronvg Nov 10, 2025
03a279d
arrow pointer thing
aaronvg Nov 10, 2025
ec4b57c
tweak
aaronvg Nov 10, 2025
a15ccba
merge
aaronvg Nov 10, 2025
7008b4c
merge and fix conflict
aaronvg Nov 10, 2025
d296f78
proper merge
aaronvg Nov 10, 2025
4125e44
flatten if conditions, wire up the wasm graphs to typescript
aaronvg Nov 10, 2025
571ea41
selection bugs, hacks and hacks
aaronvg Nov 10, 2025
8b0ab69
fix emptys tate
aaronvg Nov 10, 2025
cf5911d
Fix sidebar styling to be more compact
aaronvg Nov 11, 2025
f91dd8f
sidebar styling more
aaronvg Nov 11, 2025
1b1ea44
more api fixes in wasm to epose function kind
aaronvg Nov 12, 2025
8d3405a
cleanup navigation
aaronvg Nov 12, 2025
620a11e
simplify selections more
aaronvg Nov 12, 2025
2518bad
autoselect test if available
aaronvg Nov 12, 2025
4ec2725
fix circular ref, more state cleanup
aaronvg Nov 12, 2025
600ebab
more state stuff
aaronvg Nov 13, 2025
733dd8b
fix the build
aaronvg Nov 13, 2025
2488f22
more navigation fixes in vscode
aaronvg Nov 16, 2025
920111a
run tests works again
aaronvg Nov 17, 2025
8c92c00
fix issue where graph autolayout had a race condition
aaronvg Nov 17, 2025
bb6a48d
more graph fixes
aaronvg Nov 18, 2025
1505d88
fix issue with copy pasting making an undefined ondidtextselectioncha…
aaronvg Nov 18, 2025
c48714e
note
aaronvg Nov 18, 2025
50d16f7
Merge branch 'canary' into aaron/graphs2
aaronvg Nov 25, 2025
3f24040
reset some dirs to canary
aaronvg Nov 25, 2025
1ef136a
fix bad snap file
aaronvg Nov 25, 2025
5559d57
readd file
aaronvg Nov 25, 2025
4ad3638
make wasm compile
aaronvg Nov 25, 2025
32e94fa
fix selection id
aaronvg Nov 25, 2025
d85582c
ui cleanup, fix issue with vscode proxynot updating runtime
aaronvg Nov 25, 2025
b312b2d
fix streaming of test data again
aaronvg Nov 25, 2025
cd6d2d5
simplify wasm interface, only use one runtests function, fix some oth…
aaronvg Nov 26, 2025
01cf41c
more bugfixes to selections
aaronvg Nov 26, 2025
f54b753
execution log ui
aaronvg Nov 26, 2025
06646ec
reduce bundle sizes with lazy loading react-pdf, performanc eimprovem…
aaronvg Nov 27, 2025
bc31adb
fix bugs when there are no header nodes
aaronvg Nov 27, 2025
34911bd
Merge remote-tracking branch 'origin/canary' into aaron/graphs2
aaronvg Nov 27, 2025
2f87d62
format
aaronvg Nov 27, 2025
1a986e4
readd codelenses for expr tests
aaronvg Nov 27, 2025
c12e452
go files
aaronvg Nov 27, 2025
1f866a3
clippy
aaronvg Nov 27, 2025
bf51a85
fix promptfiddle
aaronvg Nov 29, 2025
905bd0e
Merge remote-tracking branch 'origin/canary' into aaron/graphs2
aaronvg Nov 29, 2025
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
92 changes: 59 additions & 33 deletions engine/Cargo.lock

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

6 changes: 4 additions & 2 deletions engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ tokio = { version = "1", default-features = false, features = [
"time",
] }

js-sys = "=0.3.78"
wasm-bindgen = "=0.2.101"
js-sys = "=0.3.82"
wasm-bindgen = "=0.2.105"
wasm-bindgen-futures = "0.4.42"
wasm-bindgen-test = "0.3.45"
web-sys = { version = "0.3.78", features = [
Expand All @@ -179,6 +179,8 @@ web-sys = { version = "0.3.78", features = [
"Window",
] }
web-time = "1.1.0"
tsify = { version = "0.5.6", features = ["js"] }


[workspace.package]
version = "0.214.0"
Expand Down
6 changes: 6 additions & 0 deletions engine/baml-compiler/src/baml_src/foo.baml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function Foo() -> string {
//# lorem
//## ipsum
"ipsum"
//# dolor
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Test file accidentally committed

A test BAML file named foo.baml containing a simple function with comment examples was added to the source directory. This appears to be temporary test code that shouldn't be in the production codebase under baml-compiler/src/baml_src/.

Fix in Cursor Fix in Web

25 changes: 25 additions & 0 deletions engine/baml-compiler/src/watch/watch_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ pub fn shared_noop_handler() -> SharedWatchHandler {
pub enum WatchBamlValue {
Value(BamlValueWithMeta<WatchValueMetadata>),
Header(HeaderContext),
/// HACK: Emitted synthetically when a new header comes in at the same or shallower level.
/// This signals that the previous header's scope has ended. This is a workaround until
/// proper exit events are emitted from the interpreter.
HeaderStopped(HeaderContext),
StreamStart(StreamId),
StreamUpdate(StreamId, BamlValueWithMeta<WatchValueMetadata>),
StreamEnd(StreamId),
Expand Down Expand Up @@ -145,6 +149,15 @@ impl fmt::Display for WatchNotification {
title = header.title
)
}
WatchBamlValue::HeaderStopped(header) => {
write!(
f,
"(header stopped L{level}) {function}.{title}",
level = header.level,
function = self.function_name,
title = header.title
)
}
WatchBamlValue::StreamStart(stream_id) => {
write!(f, "(stream start) {stream_id}")
}
Expand Down Expand Up @@ -203,6 +216,18 @@ impl WatchNotification {
}
}

/// HACK: Create a synthetic "stopped" notification for a header block.
/// Used when a new header at the same or shallower level comes in.
pub fn new_block_stopped(header: HeaderContext, function_name: String) -> Self {
Self {
value: WatchBamlValue::HeaderStopped(header),
variable_name: None,
channel_name: None,
function_name,
is_stream: false,
}
}

pub fn new_stream_start(
variable_name: String,
stream_id: StreamId,
Expand Down
9 changes: 9 additions & 0 deletions engine/baml-lib/baml-types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
use serde::{Deserialize, Serialize};

mod constraint;
pub mod expr;
mod map;
mod media;
mod minijinja;
pub mod tracing;

#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum FunctionFlavor {
Llm,
Expr,
}

pub mod baml_value;
mod generator;
pub mod ir_type;
Expand Down
2 changes: 2 additions & 0 deletions engine/baml-lsp-types/src/baml_lsp_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// but without the wasm-bindgen dependency.
// Wasm-bindgen causes strange issues with ruby builds so we'd rather not add that dependency if we can.

use baml_types::FunctionFlavor;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Serialize, Deserialize)]
Expand Down Expand Up @@ -57,6 +58,7 @@ pub struct BamlFunctionTestCasePair {
pub struct BamlFunction {
pub name: String,
pub span: BamlSpan,
pub function_type: FunctionFlavor,
pub test_cases: Vec<BamlFunctionTestCasePair>,
pub test_snippet: String,
pub signature: String,
Expand Down
2 changes: 1 addition & 1 deletion engine/baml-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ impl BamlRuntime {
baml_log::set_from_env(&env_vars).unwrap();

log::info!(
"[Runtime] run_test_with_expr_events start function={function_name} test={test_name}"
"[Runtime] run_test_with_expr_events start function={function_name} test={test_name}...."
);

let call = self
Expand Down
15 changes: 13 additions & 2 deletions engine/baml-runtime/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,20 @@ impl CachedClient {
}

pub fn has_env_vars_changed(&self, new_env_vars: &HashMap<String, String>) -> bool {
self.env_vars
// Check if any existing env vars have different values
let values_changed = self.env_vars
.iter()
.any(|(k, v)| new_env_vars.get(k).is_some_and(|v2| v2 != v))
.any(|(k, v)| new_env_vars.get(k).is_some_and(|v2| v2 != v));

if values_changed {
return true;
}

// Check if BOUNDARY_PROXY_URL was added or removed (affects client configuration)
let had_proxy = self.env_vars.contains_key("BOUNDARY_PROXY_URL");
let has_proxy = new_env_vars.contains_key("BOUNDARY_PROXY_URL");

had_proxy != has_proxy
}
}

Expand Down
1 change: 1 addition & 0 deletions engine/baml-schema-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ either = "1.8.1"
itertools = "0.13.0"
once_cell.workspace = true
stream-cancel = "0.8"
tsify.workspace = true

[dev-dependencies]
dissimilar = "1.0.4"
Expand Down
Loading
Loading