Commit Graph
7 Commits
Author SHA1 Message Date
Adrià Arrufat 4f8ed8547b Merge branch 'c-api' into macos-c-api-export 2026-08-03 09:57:57 +02:00
Adrià Arrufat c860215272 telemetry: remove enable_telemetry option
Remove the `enable_telemetry` option from `lp_options` and `Config`. Telemetry opt-out is now managed solely via the `LIGHTPANDA_DISABLE_TELEMETRY` environment variable.
2026-08-03 09:39:16 +02:00
Adrià Arrufat 11f38b9787 c_api: add lp_last_error functions
Expose `lp_last_error` and `lp_browser_last_error` in the C API to
retrieve the error name of the most recent failing call.
2026-08-03 09:24:58 +02:00
Adrià Arrufat 8c0e20cdbc c-api: use explicit string lengths 2026-08-03 09:16:05 +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 6f2fbb12ed build: rename lib-shared and lib-test targets 2026-07-31 21:15:42 +02: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