Commit Graph

8321 Commits

Author SHA1 Message Date
Francis Bouvier
fba0390b92 Update src/browser/webapi/element/DOMStringMap.zig
Co-authored-by: Karl Seguin <karlseguin@users.noreply.github.com>
2026-07-14 14:36:13 +02:00
Francis Bouvier
640776c9ee Update src/browser/webapi/element/DOMStringMap.zig
Co-authored-by: Karl Seguin <karlseguin@users.noreply.github.com>
2026-07-14 14:36:06 +02:00
Francis Bouvier
5f553144fb Update src/browser/webapi/element/Attribute.zig
Co-authored-by: Karl Seguin <karlseguin@users.noreply.github.com>
2026-07-14 14:35:58 +02:00
Francis Bouvier
2bf5c4abb3 Update src/browser/webapi/collections/HTMLCollection.zig
Co-authored-by: Karl Seguin <karlseguin@users.noreply.github.com>
2026-07-14 14:34:51 +02:00
Karl Seguin
adef5c39af Merge pull request #2942 from lightpanda-io/dom-pr-01-abort-signal
webapi: AbortSignal conformance fixes (dependent signals, null reason, timeout after detach)
2026-07-14 20:07:03 +08:00
Karl Seguin
123b093bba Merge pull request #2940 from rohitsux/feat/htmlarea-reflect-attributes
feat(webapi): reflect HTMLAreaElement attributes
2026-07-14 19:43:42 +08:00
Adrià Arrufat
c67b9f3ad3 terminal: stream markdown rendering to writer
Changes `md_term.render` to write directly to a writer instead of
allocating a string. Also simplifies horizontal rule parsing.
2026-07-14 12:19:26 +02:00
Adrià Arrufat
133e6ebe16 docs(skill): clarify HTTP concurrency limits
Update prose to explain the 6 per host limit and same-site fan-out.
2026-07-14 12:10:48 +02:00
Adrià Arrufat
8c0ec3d73a Merge branch 'main' into pandascript-skill 2026-07-14 12:06:05 +02:00
Karl Seguin
4d433ad028 websocket: Process WebSocket message through delivery query
This piggybacks on the HttpClient rework (1) and makes incoming WebSocket
messages get delivered in a similar fashion. Namely, WebSocket events (connect,
data, close) are queued and only delivered at safe points. The goal is to make
sure JS is never run during a libcurl callback. This has historically caused
issues and currently requires the HttpClient to have various guards (e.g.
performing flag, dirty queue, etc..).

This change removes the last cases where JS could be executed within a libcurl
callback. Consequently, HttpClient is simplified. It no longer has a perfoming
flag nor a dirty queue nor ready queue.

(1) https://github.com/lightpanda-io/browser/pull/2889
2026-07-14 17:25:52 +08:00
Rohit
9ad833c844 feat(webapi): reflect HTMLAreaElement attributes
HTMLAreaElement only implemented the URL/HTMLHyperlinkElementUtils mixin
(href, origin, protocol, host, ...). The area-specific reflected IDL
attributes were missing, so alt, coords, shape, target, download, rel,
referrerPolicy and relList all read back as undefined.

Reflect them the same way HTMLAnchorElement and HTMLLinkElement do:
plain string reflection for alt/coords/shape/target/download/rel,
enumerated reflection for referrerPolicy, and the shared DOMTokenList
helper for relList (guarded to html/svg namespaces). ping is left out to
match the current HTMLAnchorElement precedent. Adds an area.html test.
2026-07-14 13:57:25 +05:30
Karl Seguin
cfe771e776 Merge pull request #2938 from lightpanda-io/fix-debug
ooops: remove stray debug print
2026-07-14 15:39:36 +08:00
Karl Seguin
15744bca37 ooops: remove stray debug print 2026-07-14 15:15:10 +08:00
Karl Seguin
93e86cbe6a Merge pull request #2936 from lightpanda-io/silence-expected-test-errors
test: Filter out expected error messages from tests
2026-07-14 15:10:31 +08:00
Karl Seguin
3b266359d2 Merge pull request #2937 from lightpanda-io/support-large-content-length
http: u32 -> usize for [very] large content length
2026-07-14 15:10:21 +08:00
Karl Seguin
d8b2551baf Merge pull request #2911 from lightpanda-io/eventsource
webapi: Add EventSource
2026-07-14 14:45:45 +08:00
Karl Seguin
0f589567f9 update for new v8 global management 2026-07-14 14:21:44 +08:00
Karl Seguin
8ad4bd9015 webapi: Add EventSource
The EventSource API only requires a simple line-based parser. It's pretty
straightforward. It's RC'd by v8 and itself, but also by scheduled tasks (e.g.
to reconnect).

The bigger change is to the HttpClient to support streaming requests. This
changes to things:
1 - A transfer doesn't only deliver() once
2 - A transfer can be in the multi while delivering

Neither of these are surprising, but they both add complexity.
2026-07-14 14:19:27 +08:00
Karl Seguin
cebd8f15f6 Merge pull request #2904 from lightpanda-io/metrics
ops: Add prometheus metrics
2026-07-14 14:17:13 +08:00
Karl Seguin
a0549b072d http: u32 -> usize for [very] large content length
There's 1 WPT test that returns a 8GB value content-length (testing failures)
and the u32 limit fails to parse it and makes it as though no content-length
header exists.
2026-07-14 14:09:01 +08:00
Karl Seguin
46e90a984f zig fmt 2026-07-14 11:55:59 +08:00
Karl Seguin
10e91d0503 test: Filter out expected error messages from tests
Please enter the commit message for your changes. Lines starting
2026-07-14 11:50:22 +08:00
Karl Seguin
1ac4435660 extend test buffer size 2026-07-14 11:45:17 +08:00
Karl Seguin
f0784de015 add http metrics 2026-07-14 11:32:52 +08:00
Karl Seguin
4d81e48e44 ops: Add prometheus metrics
Adds a /metrics endpoint in serve mode. Can be disabled via --disable-metrics.

In fetch, dumps the metrics if --metrics is specified (defaults to false).

None of the metrics being collected are on a hot path, so they're just always
collected using atomic operations (i.e. no `if (!enabled) return;`). Because
the operations are cheap and infrequent enough not to matter.

The one place I want to add more metrics is in HttpClient (bytes, status,
counts, ...) but after the pending HttpClient-related PR is merged.

./lightpanda fetch --log-level fatal --metrics "https://lightpanda.io/"

```
build_info{version="1.0.0-dev.7837+70493ce35"} 1
cdp_connections_total 0
cdp_connection_limit_total 0
cdp_active_connections 0
cdp_commands_total 0
cdp_unknown_commands_total 0
js_heap_limits_total 0
script_errors_total 0
arena_hit_total{size="tiny"} 908
arena_hit_total{size="small"} 35
arena_hit_total{size="medium"} 0
arena_hit_total{size="large"} 27
arena_miss_total{size="tiny"} 193
arena_miss_total{size="small"} 31
arena_miss_total{size="medium"} 5
arena_miss_total{size="large"} 23
navigate_total{type="page"} 1
navigate_total{type="iframe"} 0
navigate_total{type="popup"} 0
js_heap_size_bytes_bucket{le="4194304"} 0
js_heap_size_bytes_bucket{le="8388608"} 0
js_heap_size_bytes_bucket{le="16777216"} 1
js_heap_size_bytes_bucket{le="33554432"} 1
js_heap_size_bytes_bucket{le="67108864"} 1
js_heap_size_bytes_bucket{le="134217728"} 1
js_heap_size_bytes_bucket{le="268435456"} 1
js_heap_size_bytes_bucket{le="536870912"} 1
js_heap_size_bytes_bucket{le="+Inf"} 1
js_heap_size_bytes_sum 11223040
js_heap_size_bytes_count 1
```
2026-07-14 09:17:14 +08:00
Karl Seguin
042e85e807 robots, mem: don't buffer body on a non-200 robots response 2026-07-14 09:16:00 +08:00
Karl Seguin
56c5701b7b Merge pull request #2925 from lightpanda-io/default-max-response-size
http: Change default max http size to 1GB (from unlimited)
2026-07-14 09:08:50 +08:00
Karl Seguin
3615c16589 Merge pull request #2934 from lightpanda-io/docs-fix-readme-typo
docs: fix typo in installation command for nightly build
2026-07-14 07:59:35 +08:00
Karl Seguin
bd6706b2b4 Merge pull request #2923 from lightpanda-io/domrect
webapi: Improve DOMRect
2026-07-14 07:59:06 +08:00
Karl Seguin
8ccb9b2948 Merge pull request #2922 from lightpanda-io/custom-element-extend-html-interfaces
webapi: Allow CustomElements to extend any HTMLElement interfaces.
2026-07-14 07:58:45 +08:00
Karl Seguin
c5f26cd7a0 Merge pull request #2924 from lightpanda-io/xhr-tweaks
webapi, minor: XHR Response-Type and invalid JSON parsing tweaks
2026-07-14 07:58:18 +08:00
Karl Seguin
2d325ce8b3 Merge pull request #2926 from lightpanda-io/set-outerHTML-document-protection
minor, webapi: Prevent outerHTML of document's element's from being w…
2026-07-14 07:57:37 +08:00
Karl Seguin
70278c0091 'GB' -> 'GiB' 2026-07-14 07:57:11 +08:00
Adrià Arrufat
fb36c20eb5 docs: fix typo in installation command for nightly build 2026-07-13 23:05:46 +02:00
Adrià Arrufat
830d90adc8 Merge pull request #2915 from lightpanda-io/agent-streaming
feat(agent): add assistant text streaming
2026-07-13 19:19:58 +02:00
Karl Seguin
1ae105f08f Merge pull request #2933 from lightpanda-io/fix-custom-element-recursion
fix: Custom-element constructor parser endless recursion
2026-07-13 23:40:36 +08:00
Karl Seguin
d4da7e1352 Merge pull request #2931 from lightpanda-io/ResizeObserver-Observer-Default
webapi: ResizeObserver.observer box option default
2026-07-13 23:28:18 +08:00
Karl Seguin
ca1e80a397 fix: Custom-element constructor parser endless recursion
In a custom element, when this.innerHTML = '....' is called, we need to be
careful to prevent endless recursion. The html5ever callback used to determine
the context element should not invoke the custom-element constructor, else we'll
enter an endless loop.

This also fixes an ungating problem added with the new HttpClient when a
waitForImport can block forever.

Both issues were see on a WooCommerce site - though the HttpClient is only
due to an earlier HttpClient refactor.
2026-07-13 23:23:00 +08:00
Adrià Arrufat
98b89250aa agent: add OSC 8 links, blockquotes, rules, escapes to REPL markdown
- Links now emit OSC 8 hyperlinks (clickable where supported) with a dim
  url fallback; a bare link (label == url) drops the redundant suffix.
- Blockquote lines (`> `) render with a dim bar.
- Horizontal rules (`---`/`***`/`___`) render as a dim line.
- Backslash escapes unescape only markdown-special chars, leaving e.g.
  C:\\Users intact.
2026-07-13 15:46:38 +02:00
Adrià Arrufat
dd1fa4135c agent: render basic markdown in REPL output
Style the assistant's answer in the interactive agent REPL with ANSI
escapes: headings, bullet/numbered lists, bold/italic/inline-code/strike,
and links. Rendering is gated to the REPL on a real terminal, so
`--task`/piped output stays verbatim for programmatic consumption.

Adds src/agent/md_term.zig (markdown -> ANSI renderer) and wires it into
Terminal.printAssistant.
2026-07-13 15:37:01 +02:00
Adrià Arrufat
f06681587d build: update zenai dependency 2026-07-13 14:47:09 +02:00
Adrià Arrufat
8c575e2dc8 Merge branch 'main' into agent-streaming 2026-07-13 14:38:38 +02:00
Karl Seguin
9f47b28666 webapi: ResizeObserver.observer box option default
This should default to "content-box". Not that the value is important, but
without the default, we fail if an empty object is passed.
2026-07-13 20:30:43 +08:00
Karl Seguin
43b55b8013 http: Change default max http size to 1GB (from unlimited) 2026-07-13 18:55:05 +08:00
Karl Seguin
24d1051b1a Merge pull request #2919 from lightpanda-io/mcp-multi-session
mcp: add HTTP transport and multi-session support
2026-07-13 18:53:51 +08:00
Karl Seguin
23f0d7e988 webapi: Improve popup window
When deciding what type of window to return, we compare the origin of the popup
to its opener. If they match, we return a full Window. For this to work properly
we need to store the origin as soon as the window is opened, and not wait until
the async response is received.

Also, expand CrossOriginWindow to expose more methods, most notably: close.
2026-07-13 18:46:27 +08:00
Karl Seguin
6484161e2b Merge pull request #2928 from lightpanda-io/Dont-Log-JsException
ops: Reduce logging of JsException on event dispatch
2026-07-13 18:13:50 +08:00
Karl Seguin
77ec7d83e9 Merge pull request #2927 from lightpanda-io/Dont-Log-TryCatchRethrow
ops: Don't log TryCatchRethrow errors
2026-07-13 18:13:40 +08:00
Karl Seguin
fae6389bca Merge pull request #2889 from lightpanda-io/httpclient-pipeline-and-transfer-queue
refactor: HttpClient
2026-07-13 17:02:57 +08:00
Adrià Arrufat
3e801fb83b script: generate the PandaScript skill from the tool schemas
The /save script documentation lived as a hand-maintained string in
Agent.zig whose primitives table drifted whenever a tool changed. Move
it to src/script/skill.zig and render the reference (signatures, option
lists, enums, defaults, per-parameter descriptions) from Schema.all()
at first use, keeping the curated per-tool notes behind an exhaustive
switch on Tool so a new or renamed tool is a compile error until its
doc entry exists.

The rendered skill is shared by three consumers:
- the /save and revision system prompts (built lazily in Agent.zig)
- a new mcp://skill/pandascript resource
- `zig build skills`, which writes zig-out/skills/<name>/SKILL.md with
  Claude Code frontmatter via a registry-based generator exe, so
  future Lightpanda skills are one registry entry each

Schema.FieldEntry now retains per-parameter schema descriptions, which
previously existed only in the raw JSON.
2026-07-13 10:54:13 +02:00