229 Commits
Author SHA1 Message Date
Adrià Arrufat 3cf612d390 Merge branch 'main' into c-api 2026-08-23 10:20:01 +02:00
Adrià Arrufat 9a57a34b46 tools: cap exa search highlights to 3 sentences 2026-08-19 16:42:43 +02:00
Adrià Arrufat d76ead300a browser: add exa search engine support 2026-08-18 21:10:45 +02:00
Adrià Arrufat 3e2f978cb7 Merge branch 'main' into c-api 2026-08-13 16:46:21 +02:00
Karl Seguin c95135b5c2 update v8 dep 2026-08-13 19:31:37 +08:00
Karl Seguin af99e845df dev: support for pre-build shared library
Supports prebuild-v8 shared library and adds a `download-v8-shared` make target.
Depends on: https://github.com/lightpanda-io/zig-v8-fork/pull/198

The auto-discovery of the .so is done in the build.zig, which is different than
the auto-discovery of the .a which is done in the Makefile. This is intentional
and if we inverse -Ddev_fast so that it's on by default, the .a's auto discovery
will be moved to build.zig for consistency and explicitness. As-is, we have no
way to tell whether -Dprebuilt_v8_path=v8.a is being injected by Makefile or
is explicit (which isn't a problem so long as we're not doing dev_fast by
default).
2026-08-13 19:28:21 +08:00
Adrià Arrufat f3157935c9 Merge branch 'main' into c-api 2026-08-11 15:23:37 +02:00
Karl Seguin 5d2910034c update v8 dep 2026-08-11 09:54:33 +08:00
Karl Seguin 77ef54f0ac dev: add -Ddev_fast flag
Only works in Debug mode. Only works on x86_64 Linux.

sets use_llvm = false and forces glibc 2.43 (1), causes v8 to be dynamically
linked (https://github.com/lightpanda-io/zig-v8-fork/pull/197).

For me, zig build -Ddev_fast is about 6x faster (~60 seconds -> ~10 seconds)

(1) https://codeberg.org/ziglang/zig/issues/31272
2026-08-11 09:39:45 +08:00
Adrià Arrufat 8e3d6adeee build: update zenai dependency
Pulls in the latest three zenai commits:

- f721fd4 feat(retry): honor Retry-After hints on retryable responses
- 103f5e1 feat(retry): treat 408 request timeout as retryable
- 75597b3 feat(types): sync with upstream Go SDK releases
2026-08-06 14:24:11 +02:00
Adrià Arrufat 4f8ed8547b Merge branch 'c-api' into macos-c-api-export 2026-08-03 09:57:57 +02:00
Karl Seguin dca3142166 Limit exported symbols to lp_* on MacOS
This was all Claude. I'm not good enough at builds. But the issue appears to be
that the MacOS build exports everything and the only solution is to hide them
at compile time. This does not work for v8 (which goes through its own build
system), but Claude says it's fine since those are mangled and would only
conflict if the user embedded v8 directly also.
2026-08-03 13:46:25 +08:00
Adrià Arrufat 65a88617ec c-api: expose liblightpanda.so and C header for embedding
A C ABI (include/lightpanda.h + src/c_api.zig) over the browser tool
surface: lp_init/lp_shutdown, lp_fetch, sessions with lp_call/pump/
cancel, lp_tools_json. Built as a shared library only; the version
script keeps everything but lp_* internal so the bundled OpenSSL/curl/
sqlite cannot collide with a host's own.

Embedders get a hidden 'embed' Config mode (not parseable from the
CLI) with telemetry defaulting off; crash reports honor the same
opt-out. ToolSession in lightpanda.zig owns the browser/session/
registry lifecycle the C API drives.

Build: C deps are always PIC (like boringssl's force_pic) and the
pinned zig-v8-fork always builds V8 library-safe, so 'zig build
shared-lib' needs no flags. It only refuses -Dprebuilt_v8_path:
today's published archives are exe-only (local-exec TLS, malloc
shim); the guard goes away once a fork release ships library-safe
archives. make lib-shared / lib-test / lib-shared-example drive it.
2026-07-31 17:49:02 +02:00
Adrià Arrufat a324ad9add build: update zenai dependency 2026-07-28 13:29:05 +02:00
Adrià Arrufat 8b6f7fe064 agent: simplify credential and key ownership handling 2026-07-28 13:05:46 +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 d7cc090ca1 Merge branch 'main' into codex 2026-07-28 10:11:31 +02: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
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
Karl Seguin e2f80ace33 update v8 dep 2026-07-24 11:34:45 +08:00
Adrià Arrufat 41cd1cd734 agent: support subscription auth via Claude Code 2026-07-23 14:56:41 +02:00
Adrià Arrufat bae9388f1c Merge branch 'main' into brave-search 2026-07-22 16:27:35 +02:00
Adrià Arrufat 99262190da feat(tools): add Brave search + /searchEngine metacommand
Add Brave as a second API-backed web search engine: the search tool's
auto mode tries Brave then Tavily (keyed on BRAVE_API_KEY/TAVILY_API_KEY)
before the DuckDuckGo scrape. A new /searchEngine REPL metacommand pins
the engine explicitly (auto|tavily|brave|duckduckgo) — an explicit
engine surfaces its failures instead of silently degrading — and is
persisted to .lp-agent.zon like the other REPL settings.

Bumps zenai to pick up the zenai.search.brave client.
2026-07-22 13:44:51 +02:00
Karl Seguin 802862120f update zenai dep (zig 0.16) 2026-07-22 13:26:06 +08:00
Karl Seguin 8e42d63c1c zig: Zig 0.16
Built against https://github.com/lightpanda-io/zig-v8-fork/tree/zig-0.16 but
it doesn't require a new v8 build.

Built against https://github.com/lightpanda-io/boringssl-zig/tree/zig-0.16
since the current fork we point to isn't updated.

A global std.Io instance, lp.io. Way easier this way and requires 0 changes to
our libcurl integration / event loop.

Network code uses a new layer that does what Zig 0.15's posix package used to
do. Again, quicker migration that way. But, as long as we have the global IO,
and given the half-baked nature of networking in std.Io 0.16, this just makes
sense. Things can be migrated as needed.

The std.time.* -> std.Io.Timestamp/Clock/Duration resulted in _a lot_ of
changes. ArrayList = .{} -> ArrayList -> .empty also resulted in a lot of
changes, but that's obviously superficial. As is the trimLeft/trimRight ->
trimStart/trimEnd rename.

Locking adopt the `Uncancelable` variants, e.g. mutex.lockUncancelable() to
preserve the error-free signature (and, because cancellation would be something
we'd have to put more thought into).

std.json.ObjectMap is now unmanaged, so the allocator had to be passed along.
However, there's still a deprecated managed variant of MemoryPool, so I switched
to it (we can do a small follow up PR to move to the unmanaged after).

I tried use_llvm = false, but it locks my computer, consuming RAM until MacOS
gives me a popup I've never seen before, begging me to start killing processes.

Agent and the networking stuff saw the most significant changes.
2026-07-22 13:26:03 +08:00
Adrià Arrufat f06681587d build: update zenai dependency 2026-07-13 14:47:09 +02:00
Adrià Arrufat 70b5d400fa build: bump zenai dependency 2026-07-12 22:56:27 +02:00
Adrià Arrufat 40b902fed5 build: update zenai dependency 2026-07-11 00:52:58 +02:00
Adrià Arrufat 049c5f08f2 feat(agent): add assistant text streaming 2026-07-11 00:50:01 +02:00
Karl Seguin 4253bd852d update v8 dep 2026-07-07 20:41:12 +08:00
Adrià Arrufat 1c9acfa6bc Merge pull request #2878 from lightpanda-io/agent-vertex
agent: add Google Vertex AI support
2026-07-04 12:10:32 +02:00
Karl Seguin a082dc2b07 update v8 2026-07-04 07:29:40 +08:00
Adrià Arrufat ff7545a8c3 agent: add Google Vertex AI support
Supports both express mode (via VERTEX_API_KEY) and project mode
(via GOOGLE_CLOUD_PROJECT and gcloud auth). Handles automatic
OAuth token retrieval and refresh.
2026-07-03 20:23:51 +02:00
Karl Seguin 1f8076b8be Merge pull request #2834 from lightpanda-io/update-v8
Update v8
2026-06-30 13:58:58 +08:00
Karl Seguin 98157e18ab update zig-v8-fork dep 2026-06-30 13:36:02 +08:00
Karl Seguin d9c76d0b0e update zig-v8-fork dep hash 2026-06-28 14:25:13 +08:00
Karl Seguin 8350076972 update intercepted type from u8 to u32 2026-06-28 14:18:12 +08:00
Karl Seguin d550a89330 v8, dep: Update v8
This update of zig-v8-fork is an update of v8 itself.
2026-06-28 08:03:02 +08:00
Karl Seguin b054b26e56 dep: update libcurl and nghttp2
Nothing major, but the feature that caught my eye was the addition of a
threadpool for DNS resolution, rather than a thread-per-resolution (1). I've
enabled it.

(1) https://github.com/curl/curl/commit/39036c90216e059bbee64b86b198eae3135e0cda
2026-06-27 19:06:47 +08: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
Adrià Arrufat 117c254923 build: bump zenai dependency to change Mistral's default model 2026-06-18 09:15:37 +02: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
Adrià Arrufat 6a3bc54dd5 build: update zenai dependency 2026-06-17 20:07:49 +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 88bfec4c7e agent: add support for Vercel AI Gateway and Mistral 2026-06-17 15:38:48 +02:00
Adrià Arrufat 285c5eb523 agent: support llama.cpp as local provider
Generalizes Ollama detection, completion, and model reconciliation
to support llama.cpp. Also improves API error reporting by formatting
and surfacing HTTP status and messages on failures.
2026-06-17 12:24:45 +02:00
Adrià Arrufat 78dfc03007 agent: probe Ollama reachability for completions
Lazily probes and caches Ollama server reachability for `/provider`
autocomplete. Validates Ollama availability when manually setting
the provider. Updates zenai dependency.
2026-06-15 23:13:56 +02:00
Adrià Arrufat e7cfc2f72a agent: avoid double Ollama probe at startup
Renames `wouldResolve` to `hasDetectableKey` and removes the Ollama
probe from it. Defers printing the welcome banner for Ollama-only
paths to prevent probing the local server twice. Also bumps zenai.
2026-06-15 22:56:20 +02:00