v4.2.4
π₯ Breaking Changes
-
Changed how whitespace is handled in JSX expressions by default.
-
Previously, whitespace was preserved as much as possible. This meant that all spaces and newlines which were in the JSX expression were preserved in the JSX output. It also meant that formatting JSX could change the output.
-
Now, whitespace is removed unless explicitly added. This means that formatting will no longer change the JSX output. Additionally, this behavior matches the whitespace behavior of other JSX compilers (React, Babel, etc.).
-
If you want to preserve the previous behavior, you can add the
"jsx-preserve-whitespace";directive at the start of the script(s) you want JSX whitespace preservation on. -
Here's an example of the changed behavior:
let jsx = ( <div> <span>Hello</span> <span>World</span> </div> ); // Previously, the output would be like this: let originalOutput = ( <div> {' '} <span>Hello</span> <span>World</span>{' '} </div> ); // Now, the output is like this: let newOutput = ( <div> <span>Hello</span> <span>World</span> </div> ); // Notice the spacing between the <div> and <span> tags
-
π Features
ai.chat()andai.stream.chat()now include the provider-native response object on each returned choice.- The raw response from the underlying provider is available as a property named after the provider (e.g.
openai,anthropic,google). - For custom OpenAI-compatible providers the property is keyed by the configured provider name.
- Example:
const response = await ai.chat('Hello!'); const nativeOpenAIResponse = response.openai; const nativeAnthropicResponse = response.anthropic; const nativeGoogleResponse = response.google;
- The existing normalized fields (
role,content,finishReason, etc.) are unchanged.
- The raw response from the underlying provider is available as a property named after the provider (e.g.
- Added the
listTransfersoperation (GET /api/v2/transfers) to support listing financial account transfers.- Supports user, studio, and contract accounts denominated in USD or credits.
- Returns the current account balance and the matching transfers for the given account.
- Supports filtering by
minTimeMs,maxTimeMs, andlimit.
- Added the
allow-popups-to-escape-sandboxoption to the VM sandbox so that they can link to new browsing contexts. - Added the
language-modeloption to the VM iframe permission policy. - Made
for await...ofloop iterations not use energy.- These kinds of loops work asynchronously, so they aren't likely to cause the system to lock up due to an infinite loop.
- Added the
"-energy";directive to disable energy checks for a script.
π Bug Fixes
- Fixed an issue where the default page title contained HTML comments used for replacing it on server-based deployments.
- Fixed an issue where fractional
tokenModifierRatiovalues could cause the server to error because of mishandling of fractional values for AI chat billing. - Fixed an issue where Anthropic models would not be allowed to output more than
4096tokens. - Fixed an issue where the
insttag on theconfigBotwouldn't be properly populated for insts loaded viaos.loadInst(config).