Commit Graph
8371 Commits
Author SHA1 Message Date
Adrià Arrufat a53fbcc6eb agent: introduce KeyOwnership union for credentials
Consolidates owned_key, session, and unowned env key management into a
tagged union KeyOwnership to simplify resource lifetime handling.
2026-07-28 12:44:37 +02:00
Adrià Arrufat 00cdc3ba8d agent: update zenai and switch auth to interruptible HTTP 2026-07-28 11:17:08 +02:00
Adrià Arrufat 01a7b091db agent: map models_dev_id and filter tool-call models 2026-07-28 10:56:24 +02:00
Adrià Arrufat 819aee3c07 agent: support login cancellation and provider completion` 2026-07-28 10:28:18 +02:00
Adrià Arrufat d7cc090ca1 Merge branch 'main' into codex 2026-07-28 10:11:31 +02:00
Adrià Arrufat c9f7a11e42 Merge pull request #3073 from lightpanda-io/agent-tool-cap
agent: reduce tool output cap to 64KB except for extract
2026-07-28 09:44:39 +02:00
Adrià Arrufat a2e8ce8f50 agent: reduce tool output cap to 64KB except for extract 2026-07-28 09:17:34 +02:00
Karl Seguin 5fe387a46a Merge pull request #3065 from lightpanda-io/remove-sendMessageToTarget-assertion
crash: remove Target.sendMessageToTarget session_id assertion
2026-07-28 09:23:51 +08:00
Karl Seguin f02d73e978 Merge pull request #3063 from lightpanda-io/js-error-metrics
metrics: Add JS error count
2026-07-28 09:20:54 +08:00
Karl Seguin 2312972097 Merge pull request #3062 from lightpanda-io/remove-session-injection
chore: remove Session injection code (nothing is using it)
2026-07-28 09:20:38 +08:00
Karl Seguin cc33bb38d1 Merge pull request #3061 from lightpanda-io/consistent-clocks
chore: make our use of clock/timestamp more consistent
2026-07-28 09:20:18 +08:00
Karl Seguin b7b910cae5 Merge pull request #3060 from lightpanda-io/unmanaged-memory-pool
chore: Replace deprecated MemoryPool with Managed Memory Pool
2026-07-28 09:19:55 +08:00
Adrià Arrufat 8b34853629 Merge pull request #3064 from lightpanda-io/translate-c
Replace @cImport with build-system translateC
2026-07-27 20:06:28 +02:00
Karl Seguin 470c0ef782 Merge pull request #3032 from mh0pe/codex/svg-07-text
webapi: add dependency-free SVG text DOM
2026-07-27 21:58:43 +08:00
Karl Seguin 700dfe5b74 count in utf-16, like a browser 2026-07-27 20:27:51 +08:00
Madison Steiner 5e6395c6ad webapi: add dependency-free SVG text DOM 2026-07-27 19:59:08 +08:00
Karl Seguin 1e6cd4f4bf Merge pull request #3029 from mh0pe/codex/svg-06-resources
webapi: add live SVG resource elements
2026-07-27 19:56:23 +08:00
Karl Seguin 51d63098fd Fix license header
more consistent formatting. More consistent results with Chrome
2026-07-27 19:37:34 +08:00
Madison Steiner bb063c77bd webapi: add live SVG resource elements 2026-07-27 19:06:05 +08:00
Karl Seguin 708835b08b crash: remove Target.sendMessageToTarget session_id assertion
closeTarget above implies that the state this assertion guards against IS valid
AND we just had a crash report confirming. That's enough for me to remove it.
2026-07-27 18:56:29 +08:00
Karl Seguin 302fc79a59 Merge pull request #3031 from mh0pe/codex/svg-05-structure
webapi: add SVG structural elements
2026-07-27 18:56:06 +08:00
Karl Seguin 00a0517df3 Add correct license header
Format / consistency with rest of the codebase
2026-07-27 18:36:51 +08:00
Madison Steiner 0648da895c webapi: add SVG structural elements 2026-07-27 18:13:13 +08:00
Adrià Arrufat cbce632401 Replace @cImport with build-system translateC
Zig 0.17 removes @cImport in favor of translate-c steps in the build
system. Each library's link function now creates an addTranslateC step
exposed as a module import: curl and isocline translate their headers
straight from the dependency tree, while sqlite3 uses the artifact's
emitted include tree since the amalgamation lives in a sub-dependency.

Terminal.zig and prompt_assist.zig previously instantiated two
independent @cImport namespaces for isocline; they now share one
translated module, so its types are identical across both files.
2026-07-27 12:07:28 +02:00
Karl Seguin 3a84a83d8c Merge pull request #3033 from mh0pe/codex/svg-04-geometry
webapi: implement SVG geometry
2026-07-27 18:04:44 +08:00
Karl Seguin b364a8d487 metrics: Add JS error count
This isn't exhaustive, but it covers _most_ cases where we call v8 (and the
most important ones, e.g. from ScriptManager and EventManager).

There's also a Page counter which, in the future, I'd like to expose in some way
such as via a custom cdp command or in a fetch --dump json to provide insight
on the "health" of the page/result.
2026-07-27 18:04:14 +08:00
Karl Seguin 952a860119 Add re-usable buffer (instead of frame.arena) to limit memory usage
Fix PathData.zig flatness bug.

Ensure tests pass on Chrome, and match implementation to that
2026-07-27 17:27:06 +08:00
Adrià Arrufat e99a5ab99b agent: pivot subscription auth from Claude Code to Codex
Replace the Anthropic Claude-Code-import flow with OpenAI Codex (ChatGPT
subscription) OAuth: device-code login, a real token store (auth.json,
0600) with refresh-grant, and JWT ChatGPT-Account-Id extraction. Codex is
now a distinct zenai provider, so the bearer-mode credential collapses to
provider==.codex; account_id threads to the client via InitOptions.

Unit-tested (build green): JWT account-id extraction, token store
round-trip, OAuth request-body encoding, token-response parsing. The
device-login / refresh network path is unverified pending a subscription.

Pins zenai to the codex branch (6967324).
2026-07-27 11:24:01 +02:00
Madison Steiner 2e89b805fc webapi: implement SVG geometry 2026-07-27 13:48:18 +08:00
Karl Seguin 5790670ec0 chore: remove Session injection code (nothing is using it) 2026-07-27 13:46:12 +08:00
Karl Seguin 8a256f59e0 Merge pull request #3030 from mh0pe/codex/svg-03-collections
webapi: add live SVG collections
2026-07-27 13:02:50 +08:00
Karl Seguin e50c3e9a3b Align with Chrome/Firefox
1 - Split out test to have more granular units
2 - Try to make our test and implementation consistent with Chrome and Firefox
    - Chrome and Firefox diverge here in a lot of ways (e.g. serialization),
      and there isn't always a WPT tests to break the tie.
3 - Removed some defensive code around OOM. OOM isn't generally recoverable
4 - SVGTransform no longer pretends to be 3D. #D writes drop the z/w component
    and stays SVG_TRANSFORM_MATRIX

Small improvement to WPT correctness with no regression (though, the WPT tests
here seem to be a little lacking from what I can tell, which probably helps
explain why Chrome and Firefox disagree on things).
2026-07-27 12:26:30 +08:00
Karl Seguin dcb98853b9 chore: make our use of clock/timestamp more consistent
Zig 0.16 changed clocks/timestamps. Our migration to Zig 0.16 took the path of
least resistance. For example, we kept 'monotonic' and 'real' even though Zig
0.16 renamed them to 'boot' and 'clock'

This commit tries to standardize all timestamp usage to: lp.datetime.timestamp
and lp.datetime.milliTimestamp using the new zig 0.16 names ('boot' and 'clock')
2026-07-27 09:28:48 +08:00
Karl Seguin 6716f1c12a chore: Replace deprecated MemoryPool with Managed Memory Pool 2026-07-27 07:56:30 +08:00
Madison Steiner 391993807d svg: make string list updates transactional 2026-07-26 11:58:11 -07:00
Madison Steiner 29109a2dea svg: make live collection mutations transactional
Keep SVGTransform.matrix synchronized with its owning transform and reflected attribute, including read-only animVal and 3D matrix state. Reserve collection storage before attribute commits so allocation failures cannot detach live objects or leave snapshots inconsistent.
2026-07-26 11:44:40 -07:00
Karl Seguin e4b6b3298d Optimize collections; Fix unsafe Frame reference
Applies the same dictionary lookup pattern we did in https://github.com/lightpanda-io/browser/pull/3034
to the new Graphics, Polyline and Polygon fields.

Caps total memory from snapshot and retired items by collecting them in a buffer
rather than the frame arena. This allows the memory to be re-used at each sync.

Remove the Frame dependency from DOMPointReadOnly and DOMPoint. These types are
also accessible from a Worker (which has no Frame). The frame is captured at
creation time which the callback can access.
2026-07-26 09:38:32 -07:00
Madison Steiner 2e45e6487a webapi: add live SVG collections 2026-07-26 09:38:32 -07:00
Adrià Arrufat b3f6b0a929 Merge pull request #3019 from lightpanda-io/brave-search
tools: add Brave search + /searchEngine metacommand
2026-07-26 17:44:13 +02:00
Adrià Arrufat f73aff0336 browser: stream search markdown and sanitize newlines 2026-07-26 17:32:59 +02:00
Karl Seguin c718235410 Merge pull request #3058 from navidemad/fix-select-optgroup-options
forms: include optgroup children in a select's list of options
2026-07-26 13:12:17 +08:00
Karl Seguin f697c2087c Merge pull request #3056 from arimu1/fix/3052-fetch-readablestream-body
fix(net): buffer closed ReadableStream bodies for fetch POST
2026-07-26 12:54:18 +08:00
Karl Seguin 7e6bec8673 Simplify OptionIterator and node_live option matcher 2026-07-26 12:52:59 +08:00
Karl Seguin e2f028ef8c Prevent double drain
Use existing toStringSmart to convert value to a string
2026-07-26 11:47:32 +08:00
Karl Seguin a0fba9ba33 Merge pull request #3059 from lightpanda-io/call_arena-2-local_arena
mem: Change more call_arenas to local_arenas
2026-07-26 07:28:58 +08:00
Karl Seguin 09ca1e5a57 mem: Change more call_arenas to local_arenas
local_arena should always be used when it's safe. It's released earlier and thus
helps reduce peak memory.
2026-07-25 20:41:02 +08:00
Karl Seguin f72cba80a8 Merge pull request #3037 from Ppsoft1991/fix/cdp-network-events
cdp: complete Network events and include worker requests
0.3.6
2026-07-25 12:32:18 +08:00
Karl Seguin 5acfd38250 Improve CDP response event data
Give accurate connectionId, connectionReused, initialPriority and securityState
values.

Always set `referrerPolicy` to `unsafe-url` as the most honest answer (we should
implement proper referrer policy!).

For workers, track the underlying frame_id so that it can be used for the
`documentURL` field.
2026-07-25 11:36:13 +08:00
Karl Seguin 063906ed23 Merge pull request #3036 from lightpanda-io/xhr-xmlresponse
webapi: XHR uses XML parser for XML content-type responses
2026-07-25 10:50:38 +08:00
Navid EMAD f239004bbb forms: include optgroup children in a select's list of options
HTMLSelectElement collected its options from its direct children only, so an
<option> inside an <optgroup> was invisible to options, length, value,
selectedIndex, selectedOptions and to form submission. A grouped select could
not be read, set or submitted, while querySelectorAll("option") still found
every option.

Per HTML §the-select-element a select's list of options is its option element
descendants: its option children plus the option children of its optgroup
children.

- add a select_options collection mode, and move selected_options onto the
  same walk, matching an option whose parent is the select or an optgroup
  child of the select
- add one OptionIterator in Select.zig, used by effectiveOption, setValue,
  getSelectedIndex, setSelectedIndex, getLength and add
- effectiveOption skips options disabled through <optgroup disabled>
  (concept-option-disabled); those options only become reachable now that
  grouped options are part of the list
- select.add(option, index) inserts into the optgroup when the option at that
  index lives in one, per §dom-select-add

Closes #3057
2026-07-25 04:31:41 +02:00