Commit Graph

6660 Commits

Author SHA1 Message Date
Adrià Arrufat
19e3e7b74e agent: simplify spinner and remove tool failure state 2026-05-19 13:16:51 +02:00
Adrià Arrufat
e0af9c4168 refactor: unify tool results and rename CommandExecutor
Unifies tool outcomes into a `ToolResult` struct, replacing `EvalResult`.
Renames `CommandExecutor` to `CommandRunner` and simplifies error handling.
2026-05-19 13:01:39 +02:00
Adrià Arrufat
9eed73434c agent: make isHealAllowed exhaustive 2026-05-19 12:09:41 +02:00
Adrià Arrufat
74ba2fb6bd agent: reuse ToolExecutor.buildTools in SlashCommand tests 2026-05-19 12:03:50 +02:00
Adrià Arrufat
2ca26c8bbf agent: simplify slash command test helpers 2026-05-19 11:51:33 +02:00
Adrià Arrufat
8d102b8511 Merge branch 'main' into agent 2026-05-19 11:33:46 +02:00
Adrià Arrufat
92733763d8 refactor: use explicit type names and encapsulate spinner state
- Replace `Self` with `Recorder` and `Verifier` for improved clarity.
- Add `Spinner.isEnabled()` to encapsulate atomic state access.
- Shorten and refine various comments across the codebase.
2026-05-19 11:13:15 +02:00
Adrià Arrufat
8d250ac7b0 agent: rename --task-attachment to --attach
Adds the `-a` short flag, improves CLI validation for one-shot mode,
and ensures `--model` takes precedence over `--pick-model`.

BREAKING CHANGE: `--task-attachment` has been renamed to `--attach`.
2026-05-19 11:02:46 +02:00
Adrià Arrufat
7122dd5e52 agent: document Ctrl-C behavior in pickModel
Explains that Ctrl-C is ignored during the synchronous model listing
call because it occurs before SigBridge.attach.
2026-05-19 10:55:11 +02:00
Adrià Arrufat
66e7b1aafd script: improve verifier and recorder robustness
- Make `VerifyResult.failed` reason non-optional with an OOM fallback.
- Use `ElementProperty` enum for safer JS property injection.
- Ensure `Recorder` disables on all errors to prevent silent data loss.
- Add `CHECK` command round-trip test.
2026-05-19 10:51:13 +02:00
Adrià Arrufat
061a740dbb script: improve reliability, CRLF support, and formatting
- Prevent UB in `applyReplacements` with pointer assertions.
- Reorder `writeAtomic` to build content before writing backup.
- Strip trailing `\r` in `ScriptIterator` for CRLF compatibility.
- Use shorter representation for `SCROLL` commands.
2026-05-19 10:43:20 +02:00
Adrià Arrufat
678587fbfc tools: clarify search behavior and allow empty fill values 2026-05-19 10:33:39 +02:00
Adrià Arrufat
0efbcc1289 spinner: make enabled flag atomic
Updates the `enabled` field in `Spinner` to use `std.atomic.Value(bool)`.
This prevents potential race conditions between the agent thread and
the spinner worker thread when checking or updating the state.
2026-05-19 10:23:24 +02:00
Karl Seguin
fd0831fe93 Merge pull request #2469 from lightpanda-io/nikneym/samesite-strict-cookie-vulnerability
`Cookie`: honor SameSite=Strict on cross-site navigation
2026-05-19 16:20:08 +08:00
Adrià Arrufat
348e24d22d browser/tools: sort env vars by length for reverse substitution
Sorts environment variables by value length descending to prevent
shorter values from clobbering longer ones during substitution.
2026-05-19 10:15:23 +02:00
Adrià Arrufat
28d35f96ec fix: detach sig_bridge before agent deinit
Reorder defer statements in agentThread to ensure the signal bridge is
detached before the agent instance is deinitialized.
2026-05-19 10:09:57 +02:00
Halil Durak
f17a260d93 prefer initiator_url to calculate SameSite correctly when navigating
changes after rebase
2026-05-19 10:53:25 +03:00
Halil Durak
a8029c079e Cookie.zig: add a test for SameSite=Strict on cross-site navigation 2026-05-19 10:53:24 +03:00
Halil Durak
bdd456f76c Merge pull request #2491 from willmafh/improve-code-readability
more clean validateCookieString function to improve code readability
2026-05-18 17:53:45 +03:00
willmafh
2f66edc9b9 more clean validateCookieString function to improve code readability 2026-05-18 22:29:01 +08:00
Karl Seguin
b83cd9262b Merge pull request #2490 from lightpanda-io/blocking_read_failure_handling
On blocking read failure, break from loop
2026-05-18 21:19:40 +08:00
Karl Seguin
49aa0ad1a9 On blocking read failure, break from loop
Blocking read failure almost certainly means a disconnect client. As-is, that's
an endless loop. Instead, fail the request.
2026-05-18 19:44:25 +08:00
Pierre Tachoire
23a3d5476b Merge pull request #2458 from lightpanda-io/nikneym/cli-help-rework
`help`: rework `help` command
2026-05-18 11:54:29 +02:00
Adrià Arrufat
de00deb899 Merge branch 'main' into agent 2026-05-17 19:13:54 +02:00
Pierre Tachoire
8b098a3c97 Merge pull request #2488 from lightpanda-io/ci-mcp-smoke-jq-tighten 2026-05-17 12:50:23 +02:00
Adrià Arrufat
8981a6245c ci: tighten mcp-smoke jq assertions
Replace `grep '"id":N' | jq -e ...` with `jq -ec 'select(.id == N) | ...'`.
The grep form also matched `"id":10`, `"id":11`, ... and any tool description
containing that substring; numeric `select` is type-correct. `jq -e` still
fails the job when `select` produces no output (exit 4), so the smoke
semantics are preserved.

Also add `jq --version` up front so the job fails fast and loud if the
`ubuntu-latest` image ever stops shipping jq.
2026-05-17 10:43:03 +02:00
Pierre Tachoire
803e4303c2 Merge pull request #2481 from navidemad/ci-mcp-smoke
ci: smoke test the MCP stdio server
2026-05-17 10:39:18 +02:00
Pierre Tachoire
4e80db6cf0 Merge pull request #2483 from navidemad/dockerfile-pipefail-hygiene
Dockerfile: fix curl|sh pipefail; trim builder stage
2026-05-16 19:21:30 +02:00
Pierre Tachoire
a3944a3b40 Merge pull request #2484 from lightpanda-io/e2e_kill_between_steps
Force kill lightpanda between steps to prevent "port already in-use" …
2026-05-16 18:51:36 +02:00
Karl Seguin
ab63cfbf39 Merge pull request #2478 from navidemad/fix-c10-inline-media-evaluation
css: evaluate @media and matchMedia against viewport
2026-05-16 21:42:56 +08:00
Karl Seguin
d870972ceb Small tweaks to @media
- Depth counter when recursing
- Better comment support
- Small perf tweak (e.g. lowercase once into stack buffer before multiple
  compares)
- Few more test cases
2026-05-16 20:52:11 +08:00
Karl Seguin
21e74b46ea Merge pull request #2486 from willmafh/typo-fix
typo fix
2026-05-16 20:39:36 +08:00
willmafh
c52356b6d7 chore: lowercase demo word 2026-05-16 20:07:32 +08:00
willmafh
c1e64232e5 chore: typo fix 2026-05-16 20:05:52 +08:00
Karl Seguin
7f8cb145e6 Merge pull request #2485 from lightpanda-io/nikneym/timers-hash
`Timers`: prefer integer-optimized hashing
2026-05-16 16:52:53 +08:00
Halil Durak
33d594be43 Timers: prefer integer-optimized hashing 2026-05-16 10:19:33 +03:00
Karl Seguin
d926291241 Merge pull request #2467 from lightpanda-io/http_transfer
Cleanup HttpClient.Transfer
2026-05-16 08:52:12 +08:00
Karl Seguin
0b358fd410 Merge pull request #2474 from staylor/fix/2472-frame-id-reset
Fix #2472: scope frame ID generator to Browser, not Session
2026-05-16 08:46:27 +08:00
Karl Seguin
94e8b06583 Merge pull request #2482 from navidemad/make-v8-path
make: forward optional V8_PATH to zig build
2026-05-16 08:41:05 +08:00
Karl Seguin
a5c1068b85 Force kill lightpanda between steps to prevent "port already in-use" error in CI 2026-05-16 08:39:53 +08:00
Navid EMAD
54e09a5ace make: rename V8_PATH to generic ZIGFLAGS
Per review feedback, generalise the optional pass-through so any
`-D...` build option can be forwarded, not just the prebuilt V8 path.
2026-05-16 02:27:52 +02:00
Karl Seguin
5550b61d2d Merge pull request #2480 from navidemad/make-clean
make: add clean target
2026-05-16 07:35:09 +08:00
Karl Seguin
732e19c7b6 add cargo clean to html5ever 2026-05-16 07:34:35 +08:00
Karl Seguin
d3f3e7f335 Merge pull request #2475 from navidemad/fix-a41-json-undefined
js: emit `null` when JSON-stringifying unserializable values
2026-05-16 07:24:14 +08:00
Karl Seguin
2163a2fd5a Merge pull request #2463 from lightpanda-io/nikneym/nav-accept-header
Send `Accept` header when navigating
2026-05-16 06:39:40 +08:00
Navid EMAD
fd0700a572 dockerfile: fix curl|sh pipefail; trim builder stage
- Download rustup to a file then execute, so a failed curl is not
  masked by sh's exit code under /bin/sh (no pipefail).
- Add --no-install-recommends and apt-list cleanup to both apt stages
  (stage 0 drops from 156 to 116 packages, 1144 MB to 605 MB).
- Add --retry 3 --retry-delay 2 to all 4 external downloads.
- Use git clone --depth 1 (28 MB to 9.6 MB working tree).
- Drop -v from tar for minisign and zig extractions (log noise only).

Final shipped image is unchanged; the wins live in the builder stage
and build-cache footprint.
2026-05-15 23:45:06 +02:00
Navid EMAD
f08a1fef12 ci: smoke test the MCP stdio server
Sends initialize + notifications/initialized + tools/list over stdin
and asserts the JSON-RPC responses with jq. Catches regressions in
the agentic surface (./lightpanda mcp) without needing a node client.

Reuses the existing lightpanda-build-release artifact, so the new
job costs about a minute on top of zig-build-release.
2026-05-15 22:53:38 +02:00
Navid EMAD
d1a0203d88 make: forward optional V8_PATH to zig build
Without -Dprebuilt_v8_path, the build/test targets rebuild V8 from
source (10+ minutes per invocation). Contributors who already have a
cached archive can now short-circuit by exporting V8_PATH:

    V8_PATH=v8/libc_v8.a mise exec -- make test

When V8_PATH is empty (default), behavior is unchanged.
2026-05-15 22:53:00 +02:00
Navid EMAD
ee1cbf1bb3 make: add clean target 2026-05-15 22:51:54 +02:00
Navid EMAD
dd5e335262 css: harden media-query evaluator and @media boundary
Address review feedback on PR #2478:

- MediaQuery.zig: strip CSS `/* ... */` comments before tokenization so
  `screen and /*x*/ (min-width: 1px)` evaluates the same as without the
  comment.
- MediaQuery.zig: bound-check `em` / `rem` multiplication via
  `std.math.mul` so a u32-overflowing length (e.g. `268435456em`) fails
  closed instead of panicking in debug or wrapping in release.
- StyleManager.zig: prelude brace search skips `/* ... */` comments, so
  `@media /* { fake */ screen { ... }` splits at the real opening brace
  rather than the one inside the comment.
- Tests: unit tests for stripped comments, em/rem overflow, and
  unimplemented units (cm/mm/pt/in/vw). HTML fixtures cover commented
  preludes/queries and the `replaceSync` cascade path.
2026-05-15 20:49:45 +02:00