docs(cef): document hosting a widget outside the Vault - #9
Open
vasanth5528 wants to merge 4 commits into
Open
vasanth5528 wants to merge 4 commits into
vasanth5528 wants to merge 4 commits into
Conversation
@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>
`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>
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.
Documents hosting a CEF widget outside the Vault, and bumps the plugin version.
Required by
CEF-AI/sdk'sCLAUDE.md: when the widget surface changes, this plugin must be updated andplugin.jsonbumped. Pairs with CEF-AI/sdk#180.Why
@cef-ai/widget-runtimenow exportscreateWidgetHost— 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## Hosting a widget yourselfsection: when to reach for it, the minimalcreateWidgetHost({ widget, getIdentity, sign })call with its disposer, and the three non-optional rules — the gating requirement (and whywidgetbeatsallowedOriginsfor a sandboxed frame), verbatimed25519_signRawbytes (the<Bytes>…</Bytes>envelope verifies nowhere), and framed-means-no-fallback. Closes withv/ absent-means-v1 /WidgetProtocolVersionError.plugins/cef/.claude-plugin/plugin.json—0.1.5→0.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 arecef dev's standalone browser auth (still accurate), testing-harness wallets, and deploy credentials.Note
Opened from a fork:
CEF-AI/cef-pluginsis pull-only for me.🤖 Generated with Claude Code