Skip to content

docs(cef): document hosting a widget outside the Vault - #9

Open
vasanth5528 wants to merge 4 commits into
CEF-AI:mainfrom
vasanth5528:docs/widget-host-contract
Open

vasanth5528 wants to merge 4 commits into
CEF-AI:mainfrom
vasanth5528:docs/widget-host-contract

Conversation

@vasanth5528

Copy link
Copy Markdown

Documents hosting a CEF widget outside the Vault, and bumps the plugin version.

Required by CEF-AI/sdk's CLAUDE.md: when the widget surface changes, this plugin must be updated and plugin.json bumped. Pairs with CEF-AI/sdk#180.

Why

@cef-ai/widget-runtime now exports createWidgetHost — the host side of the widget↔host identity/signing bridge — so any page can supply a widget with an identity it has already authenticated, not just the Cere Vault. And a framed widget whose host answers nothing now fails signed-out instead of silently opening the legacy Cere wallet. An agent author following this skill needs both facts.

Changed

plugins/cef/skills/develop/references/widgets.md

  • New ## Hosting a widget yourself section: when to reach for it, the minimal createWidgetHost({ widget, getIdentity, sign }) call with its disposer, and the three non-optional rules — the gating requirement (and why widget beats allowedOrigins for a sandboxed frame), verbatim ed25519_signRaw bytes (the <Bytes>…</Bytes> envelope verifies nowhere), and framed-means-no-fallback. Closes with v / absent-means-v1 / WidgetProtocolVersionError.
  • Two stale assertions corrected while in there. The intro described a widget rendering "inside a host (the Cere Vault)" as though the Vault were the only host. The Embedded/Standalone section implied the mode is chosen by whether a host answers — it is chosen by framing. Both are load-bearing for anyone building an embedder.

plugins/cef/.claude-plugin/plugin.json0.1.50.1.6.

Checked

Grepped every file under plugins/cef/skills/** for host / wallet / iframe / embed / standalone / fallback language. Nothing else is made wrong by CEF-AI/sdk#180 — the other hits are cef dev's standalone browser auth (still accurate), testing-harness wallets, and deploy credentials.

Note

Opened from a fork: CEF-AI/cef-plugins is pull-only for me.

🤖 Generated with Claude Code

@cef-ai/widget-runtime now exports the widget↔host postMessage contract
and `createWidgetHost`, so any already-authenticated page can host a CEF
widget. Add a "Hosting a widget yourself" section to the develop skill's
widgets reference covering the minimal mount, the mandatory gating, the
verbatim `ed25519_signRaw` rule, and protocol versioning.

Also correct the embedded/standalone framing: the mode is decided by
whether the widget is framed, not by whether a host answers — a framed
widget with no host now fails with `WidgetSignedOutError` instead of
falling back to the standalone wallet.

Bump the cef plugin to 0.1.6 (widget surface changed).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vasanth5528 and others added 3 commits September 14, 2026 13:36
`document.querySelector("iframe#my-widget")` is `Element | null`, but
`WidgetHostOptions.widget` is `HTMLIFrameElement | Window` — an agent
copying the sample gets a compile error on the one option that gates
access to the user's key. Add the type parameter and the non-null
assertion.

Also record the two limits `createWidgetHost` enforces on a host
author's behalf: the 64 KiB / 0-255 byte validation, and the widget's
60 s sign deadline (a consent prompt left open fails, it does not hang).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The widgets.md sample passed only `widget`, so it no longer mounts:
`createWidgetHost` now throws unless `allowedOrigins` is non-empty. An
agent reading this reference would have written a host that throws.

Lead the sample with `allowedOrigins`, keep `widget` as the optional
extra narrowing, and rewrite the "Gate the listener" rule — a
`WindowProxy` keeps its identity across navigation, cross-origin
included, so the frame handle names the slot, not the document in it.
Adds the `'null'` sandboxed case and the canonical-origin spelling rule.

Bump the plugin to 0.1.7: the documented surface changed again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`cef dev` is documented as the primary test loop, and it signs in through the
legacy @cere/embed-wallet -> beta.openlogin.com, which no longer resolves
(console evidence in CEF-AI/sdk#144). An agent following this page waits on a
popup that cannot complete.

Points at the framed host-contract path as the working alternative rather than
rewriting the section: the fix belongs to #144/#146, but a skill file should not
promise a loop that does not run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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