|
1 | 1 | # @stackables/bridge-core |
2 | 2 |
|
| 3 | +## 1.5.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- [#104](https://github.com/stackables/bridge/pull/104) [`b213e9f`](https://github.com/stackables/bridge/commit/b213e9f49ed5da80e7d9a1b9e161586e59b3719c) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Multi-Level Control Flow (break N, continue N) |
| 8 | + |
| 9 | + When working with deeply nested arrays (e.g., mapping categories that contain lists of products), you may want an error deep inside the inner array to skip the outer array element. |
| 10 | + |
| 11 | + You can append a number to break or continue to specify how many loop levels the signal should pierce. |
| 12 | + |
| 13 | +- [#100](https://github.com/stackables/bridge/pull/100) [`8e5b2e2`](https://github.com/stackables/bridge/commit/8e5b2e21796cfd7e9a9345225d94ceb8bfc39bac) Thanks [@aarne](https://github.com/aarne)! - Add `ToolMetadata` — per-tool observability controls |
| 14 | + |
| 15 | + Tools can now attach a `.bridge` property to declare how the engine should |
| 16 | + instrument them, imported as `ToolMetadata` from `@stackables/bridge`. |
| 17 | + |
| 18 | + ```ts |
| 19 | + import type { ToolMetadata } from "@stackables/bridge"; |
| 20 | + |
| 21 | + myTool.bridge = { |
| 22 | + trace: false, // skip OTel span for this tool |
| 23 | + log: { |
| 24 | + execution: "info", // log successful calls at info level |
| 25 | + errors: "error", // log failures at error level (default) |
| 26 | + }, |
| 27 | + } satisfies ToolMetadata; |
| 28 | + ``` |
| 29 | + |
| 30 | +### Patch Changes |
| 31 | + |
| 32 | +- [#103](https://github.com/stackables/bridge/pull/103) [`fc6c619`](https://github.com/stackables/bridge/commit/fc6c6195dec524c880ac20f3057e776f76583f60) Thanks [@aarne](https://github.com/aarne)! - Fix AOT/runtime parity for null element traversal, catch-null recovery, and non-array source handling |
| 33 | + |
| 34 | + **bridge-core:** |
| 35 | + |
| 36 | + - `catch` gate now correctly recovers with an explicit `null` fallback value. |
| 37 | + Previously, `if (recoveredValue != null)` caused the catch gate to rethrow |
| 38 | + the original error when the fallback resolved to `null`; changed to |
| 39 | + `!== undefined` so `null` is treated as a valid recovered value. |
| 40 | + |
| 41 | + - Element refs (array-mapping `el.field` references) are now null-safe during |
| 42 | + path traversal. When an array element is `null` or `undefined`, the runtime |
| 43 | + returns `undefined` instead of throwing `TypeError`, matching AOT-generated |
| 44 | + code which uses optional chaining on element accesses. |
| 45 | + |
| 46 | + - Array-mapping fields (`resolveNestedField`) now return `null` when the |
| 47 | + resolved source value is not an array, instead of returning the raw value |
| 48 | + unchanged. This aligns with AOT behavior and makes non-array source handling |
| 49 | + consistent. |
| 50 | + |
| 51 | + **bridge-compiler:** |
| 52 | + |
| 53 | + - AOT-generated code now respects `rootSafe` / `pathSafe` flags on input refs, |
| 54 | + using strict property access (`["key"]`) instead of optional chaining |
| 55 | + (`?.["key"]`) for non-safe segments. Previously all input-ref segments used |
| 56 | + optional chaining regardless of flags, silently swallowing TypeErrors that |
| 57 | + the runtime would throw. |
| 58 | + |
| 59 | + - Array-mapping expressions now guard the source with `Array.isArray` before |
| 60 | + calling `.map` / `.flatMap`. Previously, a non-array non-null source |
| 61 | + (e.g. a string) would cause a `TypeError` in the generated code while the |
| 62 | + runtime returned `null`. |
| 63 | + |
| 64 | +- Updated dependencies [[`fc6c619`](https://github.com/stackables/bridge/commit/fc6c6195dec524c880ac20f3057e776f76583f60), [`8e5b2e2`](https://github.com/stackables/bridge/commit/8e5b2e21796cfd7e9a9345225d94ceb8bfc39bac)]: |
| 65 | + - @stackables/bridge-stdlib@1.5.2 |
| 66 | + - @stackables/bridge-types@1.1.0 |
| 67 | + |
3 | 68 | ## 1.4.0 |
4 | 69 |
|
5 | 70 | ### Minor Changes |
|
0 commit comments