Commit Graph
7526 Commits
Author SHA1 Message Date
Adrià Arrufat 98a5458205 agent: allow paths in --save option 2026-06-19 07:46:42 +02:00
Adrià Arrufat 69d302fabe agent: add --save flag to synthesize scripts from tasks 2026-06-18 17:45:26 +02:00
Pierre Tachoire a83b9b1e7e Merge pull request #2781 from lightpanda-io/agent-help-providers
agent: list Vercel, Mistral, llama.cpp in --help
2026-06-18 13:20:46 +00:00
Adrià Arrufat 1cfdd9ae3b agent: list Vercel, Mistral, llama.cpp in --help
The agent already supports these providers (via zenai), but the agent
command's help text still listed only anthropic/openai/gemini/huggingface/
ollama. Bring --help in sync:

- Add vercel, mistral, and llama_cpp to the --provider allowed values
- Add AI_GATEWAY_API_KEY and MISTRAL_API_KEY to the auto-detect and
  env-key lists
- Document llama.cpp as a keyless local server (base http://localhost:8080/v1)
- Note that a provider can set its own effort default (Mistral -> none)

This realigns --help with the docs at lightpanda.io/docs/usage/agent.
2026-06-18 13:48:49 +02:00
Adrià Arrufat 8bcd0a9567 Merge pull request #2780 from lightpanda-io/agent-default-effort
agent: support provider-specific default effort
2026-06-18 13:35:13 +02:00
Adrià Arrufat 59dc69f1fe agent: support provider-specific default effort
Updates the zenai dependency and resolves the agent's effort based on
the configured provider's default. Also dynamically updates the active
effort when switching providers.
2026-06-18 13:22:29 +02:00
Pierre Tachoire 80603902be Merge pull request #2570 from lightpanda-io/cache-revalidation
Cache Revalidation
2026-06-18 09:46:02 +00:00
Karl Seguin 4281e0f0f4 Merge pull request #2779 from lightpanda-io/async_tests
tests: Migrate all legacy testing.async(cb) to new testing.async flow
2026-06-18 17:40:23 +08:00
Pierre Tachoire 6726da4293 Merge pull request #2777 from lightpanda-io/ci-agent-alias
ci: upload on s3 an agent alias
2026-06-18 09:37:08 +00:00
Karl Seguin 7cafd05e21 Merge pull request #2767 from lightpanda-io/broadcastchannel
implement BroadcastChannel
2026-06-18 17:26:25 +08:00
Karl Seguin 397176d868 tests: Migrate all legacy testing.async(cb) to new testing.async flow
The legacy testing.async(async() => {...}); was simple to use, but it only
worked in simple cases. Any microtasks which wasn't immediately resolve would
still fail.

The newer testing.async code is more robust and can handle any async scenario.
It's a bit more verbose and it's limited to 1 per <script type=module>. This
commit migrates all remaining legacy usages to the new flow. While the simpler
one was nice, having both approaches is confusing (to humans and ai).
2026-06-18 17:22:20 +08:00
Karl Seguin 31404bf511 Merge pull request #2772 from lightpanda-io/worker_navigator
webapi, worker: Expose Navigator on Worker
2026-06-18 17:13:25 +08:00
Adrià Arrufat 7677fb142a Merge pull request #2778 from lightpanda-io/agent-save-effort-fix
agent: respect configured reasoning effort
2026-06-18 11:08:36 +02:00
Pierre Tachoire d3ba85818b Merge pull request #2776 from lightpanda-io/remove_external_connection_from_unit_test
tests: remove external connection from unit tests
2026-06-18 08:58:22 +00:00
Adrià Arrufat 275ed43b1e agent: respect configured reasoning effort
Respect the user's configured reasoning effort during save synthesis
and user message processing. This prevents API errors on models that
do not support reasoning effort (like Mistral) when `.none` is set.
2026-06-18 10:53:59 +02:00
Pierre Tachoire b2f7bdd935 ci: upload on s3 an agent alias 2026-06-18 10:10:59 +02:00
Karl Seguin 723b961be7 tests: remove external connection from unit tests
A unit test was hitting http://example.com/. As far as I can tell, there was no
good reason for this. Replaced it with hitting the local test server and the
test continues to pass.

Three reasons to avoid hitting an external resource in a unit test:
1 - it can be slow
2 - if it's flaky, it's outside our control
3 - since every zig build test generates a new binary, my firewall warns me
    about a new outgoing connection every test
2026-06-18 15:43:37 +08:00
Karl Seguin 314d341169 worker: BroadcastChannel
Expose BroadcastChannel to Worker. This change also enables actual broadcast
messages across frames/workers/poppus on the same origin. The key here is the
introduction of Page.executionsForOrigin(origin) which returns a list of
executions for a given origin. This allows the BroadcastChannel task to iterate
through _all_ candidate broadcast channels for the origin to find targets.

Also changed tests to use new/robust async testing. I'm going to do a follow
up PR to remove all the  "legacy" variants of this.
2026-06-18 15:35:53 +08:00
Adrià Arrufat 01e75268fb Merge pull request #2775 from lightpanda-io/update-zenai
build: bump zenai dependency to change Mistral's default model
2026-06-18 09:31:00 +02:00
Adrià Arrufat 117c254923 build: bump zenai dependency to change Mistral's default model 2026-06-18 09:15:37 +02:00
Pierre Tachoire f27407294b Merge pull request #2774 from lightpanda-io/nix-update-26.05
Update nixpkgs to 26.05
2026-06-18 06:12:17 +00:00
Muki Kiboigo 148bb7d3b7 update nixpkgs to 26.05 2026-06-17 22:11:48 -07:00
Karl Seguin af67a95a2e Merge pull request #2742 from lightpanda-io/window_reuse
uaf, webapi: Window reuse
2026-06-18 11:34:39 +08:00
Muki Kiboigo 6433ca7df2 rename RenewRequest to RenewResponse 2026-06-17 20:32:58 -07:00
Muki Kiboigo 438a5f4320 properly use response headers for renew 2026-06-17 20:30:14 -07:00
Karl Seguin 0b85904967 update v8 dep 2026-06-18 11:19:18 +08:00
Karl Seguin cecc7d27fd Add global object (window) identity across navigates
Essentially makes it so that:

```
var w = iframe.contentWindow
iframe.src = 'spice.html';
w === iframe.contentWindow
```

Depends on https://github.com/lightpanda-io/zig-v8-fork/pull/182 and leverages
v8's own ability to re-use globals.

This uses v8
2026-06-18 11:16:09 +08:00
Karl Seguin f94d69a8cd uaf: Window reuse on iframe/popup navigation
This commit re-uses the allocated *Window on frame/popup navigation. It's simple
to understand why this is needed:

```
var opener = window.open('page1.html');
opener.location = 'page2.html'
opener <-- should still be valid
```

What's harder to understand is why this mostly works and why it started to fail.
This mostly works because the *Window is allocated on the page's arena and thus
lives for the duration of the page AND, because we re-use the frame address,
`window._frame` always points to a valid/current Frame (as far as JS is
concerned).

Why is started to fail is because of the move to rust-url (1). On frame.deinit
we now free the underlying window._location._url._url rust-owned memory. So
while the window stays alive and most things work, getting that URL is a UAF.
By re-using the window, we don't change the lifetime of the rust-owned URL, but
we do give the existing window a new location + url. (Which is correct, as
opener.location should reflect the new URL post-navigation).

(1) https://github.com/lightpanda-io/browser/pull/2658
2026-06-18 11:16:08 +08:00
Karl Seguin ba433059c0 Merge pull request #2764 from lightpanda-io/nikneym/various-crypto-fixes
`SubtleCrypto`: various fixes
2026-06-18 08:48:58 +08:00
Karl Seguin ca1191d103 Merge pull request #2752 from lightpanda-io/domparsing
webapi; WPT domparsing improvements
2026-06-18 07:39:20 +08:00
Karl Seguin 6e7867a8ae zig fmt 2026-06-18 07:38:59 +08:00
Karl Seguin d052a79241 webapi, worker: Expose Navigator on Worker
This includes everything the Navigator depends on: NavigatorUAData, Permissions
and StorageManager.
2026-06-18 07:34:35 +08:00
Pierre Tachoire b556d3221d webapi: structured-clone BroadcastChannel messages per receiver
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).
2026-06-17 21:27:56 +02:00
Adrià Arrufat d872238189 Merge pull request #2770 from lightpanda-io/agent-simplify-local-provider
agent: simplify local provider detection
2026-06-17 20:45:01 +02:00
Adrià Arrufat 6a3bc54dd5 build: update zenai dependency 2026-06-17 20:07:49 +02:00
Adrià Arrufat 34f6afb019 agent: simplify local provider detection
Remove redundant `detectOllama` and `detectLlamaCpp` wrappers in
settings, calling `detectLocalProvider` directly instead. Also clean
up some logic in Agent.zig.
2026-06-17 20:03:11 +02:00
Adrià Arrufat 5fa5d09394 Merge pull request #2769 from lightpanda-io/update-zenai
build: update zenai dependency
2026-06-17 17:43:16 +02:00
Adrià Arrufat bc522c4aa3 build: update zenai dependency
preserve unknown enum values during JSON parsing
2026-06-17 17:31:50 +02:00
Adrià Arrufat f244478dbe Merge pull request #2768 from lightpanda-io/terminal-single-positional-arg
terminal: support positional args for single-field schemas
2026-06-17 16:52:22 +02:00
Adrià Arrufat 144b3a58a0 terminal: support positional args for single-field schemas
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.
2026-06-17 16:26:43 +02:00
Adrià Arrufat 8bbb4a5474 Merge pull request #2766 from lightpanda-io/vercel-mistral
agent: add support for Vercel AI Gateway and Mistral
2026-06-17 16:04:05 +02:00
Pierre Tachoire 7c4df82903 implement BroadcastChannel 2026-06-17 16:03:35 +02:00
Adrià Arrufat 88bfec4c7e agent: add support for Vercel AI Gateway and Mistral 2026-06-17 15:38:48 +02:00
Adrià Arrufat 94148cb567 Merge pull request #2763 from lightpanda-io/llama.cpp
agent: support llama.cpp as local provider
2026-06-17 14:59:57 +02:00
Halil Durak bf16a64387 Crypto: update tests 2026-06-17 14:31:54 +03:00
Halil Durak b9c718642b Crypto(X25519): don't check for deriveBits permission twice 2026-06-17 14:31:46 +03:00
Halil Durak 6f47466b34 Crypto(AES-CTR): proper counter-wrap handling 2026-06-17 14:30:00 +03:00
Halil Durak 79c90cf876 Crypto(HMAC): check signature length and sign length are equal 2026-06-17 14:28:05 +03:00
Halil Durak 7675de2c26 Crypto(HMAC): error on 0-sized block 2026-06-17 14:27:26 +03:00
Adrià Arrufat 45dd56258b agent: simplify and shorten comments 2026-06-17 12:45:18 +02:00