Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…

Read the release notes

ai-summary

Summarise wrapped content via Chrome's Summarizer API, with provider-neutral inline endpoint and external deep-link fallbacks.

Overview

Wrap a block of content (typically an <article>) and ai-summary prepends a Summarize trigger that produces a streamed summary inline. The component is light DOM and progressively enhances — the wrapped article reads normally without JavaScript.

The provider is resolved once, when the component sets up (after an availability check), in this order: local Chrome Summarizer API → inline endpoint → external deep-link → unavailable. See AI page-tools v1 for the full contract. Changing endpoint or fallback-url afterwards does not re-resolve the provider.

Local Chrome Summarizer

In Chrome 138+ on a supported desktop, the component summarises on-device using Summarizer.summarizeStreaming(). The pass-through attributes type, length, and format map 1:1 to Summarizer.create() options. With format="plain-text" the result is shown as plain text (whitespace preserved) instead of going through <markdown-viewer>.

The on-device model accepts a limited amount of input. Where the browser exposes inputQuota and measureInputUsage(), content over the quota is trimmed to fit and a notice says how much was summarised; otherwise content over about 16,000 characters gets a warning that it may exceed the limit.

Inline endpoint fallback

Configure endpoint="…" to POST to a server you control when on-device AI isn't available. The component sends { prompt, content, mode: "summarize" } as JSON; the server streams back text/plain chunks (or returns one-shot application/json). Stream output appears inline in the same UI.

The wire format is documented in AI page-tools v1.1, §C. Implementations on the server side are unconstrained — wrap any AI provider that can produce text from a prompt.

External deep-link fallback

Configure fallback-url="…" with a URL template to send users to an external tool when neither on-device AI nor an inline endpoint is configured. Provider-neutral by design.

Template tokens (URL-encoded on substitution): {prompt}, {url}, {title} and {content}, the wrapped text capped at 1,500 characters so the URL stays within what browsers and providers accept. The trigger's accessible name ends in “(opens in new tab)” in deep-link mode. Override the default prompt with fallback-prompt="…":

State and events

The host element reflects lifecycle on data-state: checking → ready → streaming → complete, plus downloading, error, unavailable, and deep-link. Theme via CSS attribute selectors.

While a summary streams, a Stop button appears next to the trigger. Click it, press Escape inside the element, or call stop() to end it; what streamed so far is kept, marked “(stopped)”, and data-state returns to ready.

Composing with other VB components

ai-summary drops into <page-tools> as just another child — the toolbar's responsive collapse and FAB-into-popover behaviour come for free. Streamed output renders through <markdown-viewer> on completion so VB themes and code highlighting apply automatically. Model and endpoint output is treated as untrusted: the viewer is always created with sanitize, so scripts, on* handlers and javascript: links in a response are stripped before rendering. The output region carries aria-busy="true" while a summary streams.

↑