Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,22 @@ lightpanda({

Available formats are `markdown`, `json`, and `semantic_tree`.

### Experimental WebFetch backend

On OpenCode V2.4.3 or later, opt in through the plugin options:

```jsonc
{
"plugins": [
{ "package": "opencode-lightpanda", "options": { "webfetch": true } }
]
}
```

In this mode, `webfetch` tries Lightpanda first for `markdown`, `text`, and `html`. Markdown renders pages, while HTML returns the original response and text extracts text from HTML. Plain text, JSON, and XML are returned without wrapping or reformatting. PNG, JPEG, GIF, and WebP can be returned as image attachments. Raw responses require a Lightpanda build that supports `lightpanda run`; other binary formats and failed browser attempts fall back to native WebFetch. The Lightpanda attempt is bounded and shares the request's timeout budget.

OpenCode checks the requested URL against `webfetch` permissions, then checks the separate `lightpanda` permission for browser access. The browser can follow public redirects and load public subresources under that permission; those requests are not checked against the native WebFetch URL rules. Leave this option off if your WebFetch rules must apply to every redirect. The standalone `lightpanda` tool remains available either way.

## Local Development

```sh
Expand Down
Loading