Repository navigation
Conversation
The widget site owners add with <script src=".../embed.js"> now lives here, next to the extension code it is built from, instead of in a separate repo that pinned this one as a submodule. - embed/src/bundle.js assembles embed.js from src/chrome's accessibility tree, content script, activity indicator, activity brain, markdown renderer and calculator, plus embed/src/widget-runtime.js (launcher, chat panel, agent loop). - embed/src/agent-spec.js exports the Ask and Act prompts and tools as tools.json, so the server answering the widget uses the extension's own definitions. - npm run build writes embed/dist/: embed.js, tools.json, icons, VERSION.json (version, commit, source link) and SHA256SUMS. - The Embed widget workflow builds and tests on pull requests that touch embed/ or the bundled extension files, and publishes a GitHub release on embed-v* tags (never marked as the latest release). The widget is GPL-3.0-or-later like the rest of WebBrain; every embed.js states its license and links to its source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EsDq6DxFiLVCyWkC3JtHbh
|
@esokullu is attempting to deploy a commit to the esokullu's projects Team on Vercel. A member of the Team first needs to authorize it. |
Security and privacy:
- navigate only follows http(s) URLs and keeps the unsaved-changes guard.
- Tool results no longer carry password, hidden or other credential field
values (uses the extension's credential-fields.js).
- Page content, the page title and URL, selections and inline-trigger text
are wrapped like the extension's _wrapUntrusted, with a per-call nonce.
- data-webbrain-act only stages its prompt for the visitor to send, and
synthetic clicks (the agent's own) never start a run.
- The widget runs only the tools tools.json lists for the turn's mode, and
Act stays off unless the site config sets modePolicy: "ask_and_act".
Agent loop:
- Each run has its own abort signal and history, so a stopped or replaced
run never acts again and Stop no longer shows a null.signal error.
- done, Stop and the step limit leave no tool call without a result.
- Hiding the widget host during page actions is re-entrant and skipped for
waits, so the widget can't be left inert and Stop works during waits.
- The activity indicator gets a heartbeat and is not hidden by an older run.
Tools and UI:
- read_page uses the extension's windowed path; results and page text are
capped. get_interactive_elements uses the ordering click({index}) reads.
- get_accessibility_tree defaults to "all" and continuationArgs are spread.
- Rich-editor typing and synthetic key presses report what they can't do.
- Wait timeouts follow the requested timeout; content.js gets a deadline.
- Hidden quick chips no longer take page clicks; IME Enter doesn't send;
widget keys don't reach site shortcuts; `$` in page text stays literal.
Build and CI:
- The bundle is parsed as a classic script, and the build fails when an
extension helper the widget uses is renamed.
- New test:browser loads embed.js in Chrome; CI runs it and watches
src/chrome/** plus the root package files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Moves the WebBrain for websites widget (the script site owners add with
<script src=".../embed.js">) into this repo asembed/, next to the extension code it is built from. Until now it lived in a separate private repo that pinned this one as a submodule.Why here
embed.jsbundles the extension's GPL-3.0-or-later code (accessibility tree, content script, activity indicator, markdown renderer, calculator) and is sent to every visitor of every site that uses it, so its source has to be public. This repo already is.What is added
embed/src/bundle.js: assemblesembed.jsfromsrc/chromeplusembed/src/widget-runtime.js(launcher, chat panel, agent loop). Same logic as before, with paths pointing atsrc/chromeinstead ofupstream/webbrain.embed/src/agent-spec.js: exports the Ask and Act prompts and tools astools.json, so the server that answers the widget uses the extension's own definitions.npm run buildwritesembed/dist/:embed.js,tools.json, icons,VERSION.json(version, commit, source link) andSHA256SUMS. No dependencies to install.embed/test/embed.test.mjs: tool filtering by mode, the bundle's contents (license header and source link included), the agent spec, and the release files and their checksums..github/workflows/embed.yml: builds and tests on pull requests that touchembed/or the bundled extension files. Pushing a tag likeembed-v1.0.0publishes a GitHub release with the files above. The release is never marked as the latest, so extension releases stay on top.How it is used
sites.webbrain.one (private
webbrain-sitesrepo) pins a release withphp bin/update-embed.php 1.0.0, which verifies every file againstSHA256SUMS, and reports the version and source link fromGET /api/meta.Checks
cd embed && npm run build && npm test: 4/4 pass (Node 22 here, Node 26 on macOS), including in a copy of the repo withoutnode_modules, the way CI runs it.node test/run.js: 2542 passed, 4 failed. The same 4 fail onmainwithout this change (WebGPU worker contracts, new locales in dropdowns, streamed raw tool-call text, Providers page search box).After merging, push
embed-v1.0.0to publish the first release.🤖 Generated with Claude Code
https://claude.ai/code/session_01EsDq6DxFiLVCyWkC3JtHbh