postMessage handed the same js.Value.Temp to every receiver's MessageEvent,
which broke two things:
1. No structured clone. Receivers got the literal object the sender posted,
so a mutation in one receiver was visible to the others and to the sender
(received === payload). The spec requires the message to be cloned for
each destination.
2. Shared temp freed after the first delivery (latent use-after-free). Events
are refcounted and deinit'd synchronously at the end of each dispatch, and
MessageEvent.deinit release()s its data value. With a shared temp, the first
receiver's teardown reset the v8 persistent slot, leaving later receivers
reading a dead handle.
Fix, following the Worker.postMessage precedent: StructuredSerialize the
message once, synchronously, in postMessage (so an unserializable value throws
a DataCloneError to the caller per spec, and cloning stays off the scheduler
tick). A TryCatch contains any v8 exception from a failed serialize so it is
re-raised as a clean DataCloneError. Delivery then re-clones the sanitized
snapshot per receiver, giving every MessageEvent its own independently owned
temp. The snapshot is released by the callback (cancelled finalizer covers the
dropped-task path).
Remove redundant `detectOllama` and `detectLlamaCpp` wrappers in
settings, calling `detectLocalProvider` directly instead. Also clean
up some logic in Agent.zig.
Allows tools like `/getEnv` with a single optional field to accept
positional arguments. Also adds autocompletion and ghost hints for
live `LP_*` environment variables.
Additionally, fixes a memory leak in `settings.zig` when parsing
invalid ZON configurations.
Generalizes Ollama detection, completion, and model reconciliation
to support llama.cpp. Also improves API error reporting by formatting
and surfacing HTTP status and messages on failures.
A few APIs already support [LegacyNullToEmptyString], this extends it to various
setInnerHTML (Element, DocumentFragment, Template) and a few other places.
Also changes how Range.createContextualFragment. Unlike other fragment parsers
(e.g. setInnerHTML) this one _does_ run scripts.
Move away from hard-coded 512KB (WS) and 4K (http) limits. Introduces two new
serve-specific command line arguments:
--cdp-max-message-size <INT>
Maximum allowed incoming websocket message size.
Defaults to 1048576 (1MB)
--cdp-max-http-message-size <INT>
Maximum allowed HTTP request size
Defaults to 4096 (maximum allowed: 16383)
--cdp-max-message-size has been bumped from 512KB to 1MB default.
Meant to provide a more robust solution than https://github.com/lightpanda-io/browser/pull/2717
Largely aimed at /mimesniff/mime-types/parsing.*.html. Adds ~2000 passing cases.
The blob API is now a bit simpler (hence FormData/REquest/Response/WebSocket)
being touched, but more logic is now in Mime.zig to parse/validate MIME types.
Better escaping support, correct casing and handling edge cases with multiple
charset, or "charset" as a value, .etc...
Headers also hook into this to validate / normalize header name and values.
`note` is the highest log level (e.g. cannot be turned off), and thus will
always be displayed. The purpose is to make sure that people who use --port 0
can see the listening port WITHOUT giving up log-level filtering (e.g. having
to use --log-level info JUST to see the listening port).
I'm personally a fan of using .note only when (port == 0), but we can tweak it
later if people complain about it showing up despite using a warn/error/fatal
log level.