- Use `std.meta.fieldNames` for the save mode prompt.
- Update terminal prompt functions to accept null-terminated strings.
- Respect the resolved save mode in `synthesizeSave`.
Removes the `-i`/`--interactive` CLI flag and live file-based
recording. Instead, the REPL now supports a `/load <path>` command
to run scripts from disk, and `/save` to export the in-memory
session recording.
The `Recorder` is simplified to be purely in-memory, and the script
runtime is moved to `src/script/Runtime.zig`.
BREAKING CHANGE: The `-i`/`--interactive` flag has been removed. Use
the `/save` and `/load` commands within the REPL instead.
Integrates isocline's top and bottom bar APIs to display the active
provider, model, and shortcut hints. Updates the status bar on
terminal resize and mode switches.
Removes the redundant `Primitive` enum and uses `BrowserTool` directly,
filtering by `isRecorded()`. This reduces duplication and simplifies
the mapping between JS primitives and browser tools.
Removes recordStart, recordStop, recordComment, scriptStep, and
scriptHeal MCP tools. Introduces a single 'save' tool that lets
the client synthesize and persist the script directly.
Applies the same/similar escaping logic as is already applied to identifiers
and values. Importantly, this allows matching for attribute names with a colon,
e.g. "ng:jq" which can be selected with "ng\:jq".
This fixes real issues with rendering Angular 1.x.
I'm hoping this is the cause of our flaky CI runs. The existing code kept
a reference to the CDD command-owned proxy address. This commit has HttpClient
dupe/own the proxy to ensure the correct lifetime.
Pretty basic, worker started with the {type: 'module'} option has 2 practical
differences:
1 - importScript isn't allowed (TypeError)
2 - the initial script is loaded as a module
Seen in various WPT tests, but also saw this usage on mastodon.
Since the CDP rework, error.ClientDisconnected surfaces to the Runner. There's
no reason to log this (especially as at an error level). It's perfectly normal
and has already been logged at the CDP level.
If you run WPT tests, you'll see a fair number of `FrameNotFound`. This
comes from the cdp frameNavigated notification handler and it happens because
our frame lookup only considers iframes, not popups.
This commit includes popup in the search. I don't expect this to change WPT
results.
Add the reflected attributes src, type, width and height to
HTMLEmbedElement per HTML 4.8.6
(https://html.spec.whatwg.org/multipage/iframe-embed-object.html#htmlembedelement).
src is a URL-reflecting attribute (resolved against the document base,
mirroring HTMLImageElement.src); type, width and height are plain
DOMString reflections. Mirrors the reflection idiom used by
HTMLMarqueeElement / HTMLImageElement.
The intercept state is currently split and hard to keep consistent and even
just reason about. InterceptLayer keeps the `intercepted` count, but CDP's
`BrowserContext` has its intercepted lookup. This isn't a problem per se, but
you BrowserContext.deinit tries to decrement `InterceptLayer.intercepted` which
is only safe if we can guarantee that the two are in sync. Which we can't.
This commit simplifies the upkeep of `InterceptLayer.intercepted` and uses the
Transfer's state on unpark/deinit to decrement it. The CDP layer no longer
cares about / has to maintain the count.
Driven by this crash report:
BrowserContext.deinit.intercepted
---
value: 0
/home/runner/work/browser/browser/src/lightpanda.zig:279:25: 0x2871842 in deinit (lightpanda)
/home/runner/work/browser/browser/src/cdp/CDP.zig:127:18: 0x28c3f45 in deinit (lightpanda)
/home/runner/work/browser/browser/src/Server.zig:186:21: 0x2827997 in handleConnection (lightpanda)
/home/runner/work/_temp/6dc322a8-c74f-4990-9660-4cc6dcfb9352/zig-x86_64-linux-0.15.2/lib/std/Thread.zig:509:13: 0x269c233 in entryFn (lightpanda)
???:?:?: 0x7fce7ccabd57 in ??? (libc.so.6)
Unwind information for `libc.so.6:0x7fce7ccabd57` was not available, trace may be incomplete
on 1.0.0-nightly.6542+94ba0791
Add the reflected DOMString attributes name and value to the
existing HTMLParamElement, per HTML 15.3
(https://html.spec.whatwg.org/multipage/obsolete.html#htmlparamelement).
Mirrors the reflection idiom used by HTMLTimeElement / HTMLDataElement.
Advances the html/dom/reflection-obsolete.html WPT row.
Updates the `zenai` dependency to support safety finish reasons. Tracks
when a model refuses a request due to safety, prints a specific warning
message, and avoids re-prompting.
Extract ZigToCurlAllocator to its own file and rename it to CurlDebugAllocator
to indicate that it is only used in debug. Also, only use it in debug.
In release mode, this just adds 16 bytes of overhead per allocation that curl
makes. In debug mode, it's the same overhead, but it at least hooks into the
std's DebugAllocator which can detect misuse.
A lot of WPT tests do something like:
```js
const frame = document.createElement("iframe");
t.add_cleanup(() => {
frame.remove();
});
... run a test
```
But our frame.remove (Element.remove) doesn't destroy the frame/context. It
can't. We don't know what is referencing it. So these WPT tests that create
_thousands_ of these quickly run into TooManyContexts errors.
As a quick solution, we now allow up to 8K contexts to be created when running
WPT tests (`-Dwpt_extensions`). Env.contexts becomes an arraylist rather than
an arary (so avoid having to pay that 8192 * 64 byte penalty for tests that
don't need 8K contexts).
An example of such a test is: /encoding/unsupported-labels.window.html
- Add `recordRaw` to record raw JS lines in the REPL.
- Only record commands if they succeed without error.
- Fix kitty terminal cursor keys by forcing legacy arrow encoding.
Stacked on https://github.com/lightpanda-io/browser/pull/2604 and driven by
a different WPT test: /html/dom/reflection-metadata.html
Goes from 1527 to 3074 passing cases. Largely just adding more attributes and
adding validation to attributes where necessary.