feat: web browsing on canvas via pap://domain.com#287
Merged
toadkicker merged 2 commits intomainfrom Apr 15, 2026
Merged
Conversation
Entering pap://ebay.com (or any external domain) in the address bar now
browses the site as a canvas block instead of misrouting to a registry peer.
Registries are federated and announced at handshake time — not addressed
via the URI scheme. The old is_registry_host() treated every dotted FQDN
as a registry, causing pap://domain.com to fall through to On-Device AI.
Changes:
- pap_uri.rs: split is_registry_host into is_local_registry (localhost/IP,
still Registry) and is_web_domain (dotted FQDN → HttpsEndpoint). External
domains now resolve to HttpsEndpoint("https://..."), triggering the
existing starts_with:["https://"] intent rule → Web Page Reader agent.
Path and port are preserved (pap://ebay.com/electronics works). 41 tests.
- templates.rs: add WebPageTemplate rendering schema:WebPage JSON-LD as a
browser-tab-style block — URL bar (pap:// link for in-canvas navigation),
title, byline (publisher · author · date), description, body text extract.
- mod.rs: register WebPageTemplate in create_default_registry().
- topbar.rs: pap:// suggestion dropdown now shows "Browse pap://domain.com"
for web domains and auto-submits on selection; catalog agent completions
are unchanged.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Benchmark Regression ReportThreshold: 10% regression vs baseline from main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pap_uri.rs: Splitis_registry_hostintois_local_registry(localhost/IPv4/IPv6 →Registry) andis_web_domain(dotted FQDN →HttpsEndpoint).pap://ebay.comnow resolves tohttps://ebay.cominstead of misrouting to a registry peer. Registries are federated and announced at handshake time — not addressed via the URI scheme.templates.rs: AddWebPageTemplate— rendersschema:WebPageJSON-LD as a browser-tab-style canvas block with URL bar (pap:// link for in-canvas navigation), title, byline, description, and body text extract.mod.rs: RegisterWebPageTemplateincreate_default_registry().topbar.rs:pap://suggestion dropdown now showsBrowse pap://domain.comfor web domains and auto-submits on selection; catalog agent completions unchanged.End-to-end flow
Test plan
cargo test -p papillon-shared— 41pap_uritests green includingbare_domain_browse,domain_with_path_browse,domain_with_port_browse,localhost_is_local_registry,localhost_with_port_is_local_registrypap://ebay.comin address bar → canvas block with title, description, body textpap://localhost:8080→ still routes to Registry (no regression)https://ebay.comtyped directly → still works🤖 Generated with Claude Code