Skip to content

feat: web browsing on canvas via pap://domain.com#287

Merged
toadkicker merged 2 commits intomainfrom
feat/6b0d-browsing-the-web
Apr 15, 2026
Merged

feat: web browsing on canvas via pap://domain.com#287
toadkicker merged 2 commits intomainfrom
feat/6b0d-browsing-the-web

Conversation

@toadkicker
Copy link
Copy Markdown
Contributor

Summary

  • pap_uri.rs: Split is_registry_host into is_local_registry (localhost/IPv4/IPv6 → Registry) and is_web_domain (dotted FQDN → HttpsEndpoint). pap://ebay.com now resolves to https://ebay.com instead of misrouting to a registry peer. Registries are federated and announced at handshake time — not addressed via the URI scheme.
  • templates.rs: Add WebPageTemplate — renders schema:WebPage JSON-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: 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 unchanged.

End-to-end flow

pap://ebay.com  →  HttpsEndpoint("https://ebay.com")
  →  detect_intent: starts_with "https://"  →  Web Page Reader
  →  GET https://ebay.com  →  schema:WebPage JSON-LD
  →  WebPageTemplate.render()  →  browser-tab block on canvas
  →  links in block  →  pap://ebay.com/...  →  next browse block

Test plan

  • cargo test -p papillon-shared — 41 pap_uri tests green including bare_domain_browse, domain_with_path_browse, domain_with_port_browse, localhost_is_local_registry, localhost_with_port_is_local_registry
  • pap://ebay.com in address bar → canvas block with title, description, body text
  • pap://localhost:8080 → still routes to Registry (no regression)
  • https://ebay.com typed directly → still works
  • Clicking URL in WebPage block → new browse block

🤖 Generated with Claude Code

Todd Baur and others added 2 commits April 14, 2026 22:15
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>
@github-actions
Copy link
Copy Markdown

Benchmark Regression Report

PAP Protocol Benchmark Regression Check
========================================
Baseline: .bench-baseline/baseline.json
Threshold: 30%

  ed25519_keypair_generation                19.7 µs  (baseline: 19.7 µs, -0.3%)  [ok]
  did_key_derivation                         1.5 µs  (baseline: 1.5 µs, +0.0%)  [ok]
  mandate_create_sign                       23.9 µs  (baseline: 23.9 µs, -0.1%)  [ok]
  mandate_chain_verify_depth3              125.5 µs  (baseline: 126.9 µs, -1.1%)  [ok]
  sd_jwt_issue_5claims                      27.9 µs  (baseline: 27.9 µs, +0.0%)  [ok]
  sd_jwt_verify_disclose_3of5               44.5 µs  (baseline: 44.3 µs, +0.6%)  [ok]
  session_open_full_lifecycle              108.4 µs  (baseline: 108.7 µs, -0.3%)  [ok]
  receipt_create_cosign                     47.8 µs  (baseline: 48.9 µs, -2.2%)  [ok]
  federation_announce_local                 56.0 µs  (baseline: 56.0 µs, +0.0%)  [ok]

All benchmarks within 30% of baseline.

Threshold: 10% regression vs baseline from main

@toadkicker toadkicker merged commit 3efd664 into main Apr 15, 2026
24 checks passed
@toadkicker toadkicker deleted the feat/6b0d-browsing-the-web branch April 15, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant