Currently this logic is reimplemented in node. We should instead expose whatever we need from the rust code so it's not implemented in two places. _Originally posted by @virajmehta in https://github.com/tensorzero/tensorzero/pull/4069#discussion_r2453271121_