* agent: add a /model command to chnage current model
And remove the pick-model CLI option
* agent: add /provider to change the current provider
* agent: extract requireLlmNoArg helper
* agent: simplify provider detection
* repl: add tab completion for /model and /provider
Changes `/model` and `/provider` to accept an optional name argument
instead of prompting with a numbered list. Bare commands now print the
current selection, while Tab dynamically completes candidates. Model
lists are fetched and cached to prevent redundant network requests.
* agent: remember last selected provider and model
Persists the last selected AI provider and model in a local
`.lp-agent` file and resumes it on startup. Removes the
interactive provider picker in favor of deterministic auto-detection.
* agent: simplify requireLlm and model resolution
Changes `requireLlm` to return a boolean instead of credentials, and
cleans up the model initialization logic to use `resolved` directly.
Also removes unused user errors.
---------
Co-authored-by: Adrià Arrufat <adria.arrufat@gmail.com>
Replaces the string `name` in `ToolCall` with `action: browser_tools.Action`.
This avoids repeated string-to-enum parsing and simplifies schema lookups.
Also updates `zenai` dependency to use its JSON duplication helper.
- Simplify prompt handling by relying on default markers.
- Enable brace insertion in the terminal.
- Optimize `lpEnvNames` by pre-allocating capacity.
- Clean up and trim verbose comments across `Terminal.zig`.
Replaces the linenoise library with isocline for improved REPL
functionality. Updates build scripts and moves completion state from
global variables into the Terminal struct.
Integrates the Tavily Search API as the primary search provider when
TAVILY_API_KEY is set. Falls back to scraping Google and DuckDuckGo
on failure or if the key is missing. Updates zenai dependency.
Depends on https://github.com/lightpanda-io/zig-v8-fork/pull/175
This started as an investigation into errors when loading recaptcha. Turns out
our atob/btoa is naive. Specifically, we take a `[]const u8` input which, via
the bridge, goes through the v8 utf8 path. This can result in the input being
fundamentally altered.
This commit introduces a new discriminatory type, js.String.OneByte which uses
the String::NewFromOneByte when going from js->zig and String:WriteOneByte when
going from zig->js, avoiding any changes to the raw data.
Also adds a placeholder MessageEvent.ports getter (which showed up in debugging)
Links to libidn2 and builds libcurl with it. This makes libcurl work, and by
extension browser, work on international domain names, e.g.
zig build run -- fetch "https://räksmörgås.se/"
With it available, we can use it in our WebAPIs which should also support these
domains, e.g:
testing.expectEqual('xn--rksmrgs-5wao1o.se', new URL('https://räksmörgås.se').hostname);
There is more integration to be done here, but this is a first step.
claude wrote all of the build.zig code.
I don't have a strong opinion about this feature, I just dislike that our WPT
/url/* tests are at 1704 / 9095 and, this is the biggest chunk (although, this
specific commit just does the basic integration and probably won't fix too many
WPT cases directly).
Fired when elements are moved from one document to another. I don't think this
is really used much, but it helps pass a number of WPT cases.
This required tweaking insertAdjacentHTML as it was creating a full document
and trigger spurious callbacks in the new code. A DocumentFragment is now used
instead.
Support `new MyElement()` syntax to create custom element. The implementation
for this is pretty straightforward, but it depends on:
https://github.com/lightpanda-io/zig-v8-fork/pull/173.
Also modify the `attributeChangedCallback` and pass a missing parameter: the
namespace. Currently, we pass `null`, but this is less likely to cause issues
than not passing anything.