Skip to content

Releases

v1.0.5(release)

Choose a tag to compare

@Lollipoprh Lollipoprh released this 03 Dec 14:15
a27aca5

v1.0.5

What's New

Page Interaction Tools

  • Drag element — Drag one element onto another. Supports both native HTML5 drag-and-drop and synthetic pointer events. Useful for sliders and draggable components.
  • Click at coordinates — Click at a specific pixel position inside an element. Useful for image-click captchas, canvas widgets, and any case where the click position matters.
  • Hover element — Trigger an element's hover logic (e.g. dropdown menus, tooltips). Note: synthetic events do not activate the CSS :hover pseudo-class — they only fire JavaScript event listeners. For CSS-driven hover visuals, use the set-element-style tool to apply the hover styles manually.

v1.0.5

更新内容

页面交互工具

  • 拖拽元素 — 可将一个元素拖到另一个元素上。支持原生 HTML5 拖放和模拟指针事件两种模式,适用于滑块、可拖动组件等场景。
  • 按坐标点击 — 可在元素内指定像素位置点击。适用于图片点选验证码、画布组件等需要精确点击位置的场景。
  • 悬浮元素 — 可触发元素的悬浮逻辑(如下拉菜单、悬浮提示)。注意:合成事件不会激活 CSS :hover 伪类,仅触发 JavaScript 事件监听器。对于纯 CSS 驱动的悬浮效果,请使用设置元素样式工具手动应用悬浮样式。

v1.0.4(release)

Choose a tag to compare

@Lollipoprh Lollipoprh released this 02 Dec 14:06
e51b4e8

Web Chat Helper v1.0.4

Released 2026-12-02 · Compare with v1.0.3 · Full changelog


English

Highlights

Inspect the requests a page has made

A new opt-in Network capture switch in the composer's Run policy menu records the requests the current page has already sent — URL, method, status code and duration — so you and the model can discover the APIs a site exposes.

  • Off by default. Nothing is recorded until you turn it on, and turning it off stops new records (existing history stays readable).
  • Metadata only. Request headers, cookies and response bodies are never read.
  • Secrets are redacted. Common sensitive query parameters are stripped before anything is stored.
  • Bounded and per-tab. History is kept per tab with a fixed limit, cleared when the tab closes, and can be wiped for the current page at any time.

Make HTTP requests from a task

The new http_request tool lets a task call an address directly and bring the result back into the conversation:

  • Always confirmed first. Each request asks you to Allow or Allow with cookies; cookies are never sent unless you explicitly choose that option. Local/private addresses and non-standard ports get an extra warning.
  • Responses split by type. Text goes into the task context (truncated when very large), images are shown in the conversation and passed to the model when it supports vision, and other binaries are saved to your Downloads folder.
  • Downloads are readable. Saved binaries are registered as read-only session files, so read_file and the Office read tools can open them later; write tools refuse them with a clear message.
  • Bounded transfers. Downloads stream with a 30 MB size cap and a 120-second timeout, and an in-flight request is aborted when you stop the task.

Fixed

  • Execution permission changes apply immediately — switching between Auto-run and Ask first during a task now takes effect on the very next action instead of waiting for the task to end.
  • Quieter console and smoother layout — resize measurements are coalesced into one animation frame, removing the recurring ResizeObserver loop completed with undelivered notifications error and the multi-frame layout settle it caused.
  • Less prompt noise — fewer repeated or pointless runtime error messages.

Permission and privacy

This release adds the webRequest permission, used only to observe request metadata while Network capture is on. It does not block, modify or replay requests, and it reads no headers, cookies or response bodies. Because the permission list changed, Chrome may ask you to accept the update after upgrading.

Upgrading

Build from source with pnpm install && pnpm build, then reload the unpacked extension from apps/chrome-extension/dist. See INSTALL.md for details.


中文

重点更新

查看页面已发出的请求

输入框的 运行策略 菜单新增 网络采集 开关,可记录当前页面已发出的请求(地址、方法、状态码、耗时),帮助你与模型发现页面暴露的接口。

  • 默认关闭。 未开启时不记录任何数据;关闭后只停止新增记录,已有历史仍可查看。
  • 只采集元数据。 不读取请求头、Cookie 与响应体。
  • 敏感参数已脱敏。 常见敏感查询参数在存储前会被移除。
  • 按标签页限量保存。 每个标签页只保留固定数量的最近记录,标签页关闭即清理,也可随时清空当前页面的记录。

任务中直接发起 HTTP 请求

新增 http_request 工具,任务可直接请求指定地址,并把结果带回会话:

  • 每次都要确认。 请求前需选择 允许 或 允许并携带 Cookie;只有明确选择后者才会发送 Cookie。目标为内网/本机地址或非常规端口时会额外提示。
  • 按类型处理响应。 文本进入任务上下文(过大时截断),图片显示在会话中并在模型支持视觉时交给模型查看,其他二进制文件保存到下载目录。
  • 下载文件可读。 保存的文件会登记为当前会话的只读文件,之后可用 read_file 与 Office 读取工具打开;写入工具会明确拒绝。
  • 传输受限。 下载按 30 MB 大小上限与 120 秒超时流式处理;停止任务时会中断进行中的请求。

修复

  • 执行权限切换立即生效 —— 任务运行中在 自动执行 与 需确认 之间切换,会立即作用于下一次操作,无需等待任务结束。
  • 控制台更安静、布局更稳定 —— 尺寸测量合并到单个动画帧,消除反复出现的 ResizeObserver loop completed with undelivered notifications 报错及其造成的多帧布局抖动。
  • 提示降噪 —— 减少重复、无效的运行时错误信息。

权限与隐私

本版本新增 webRequest 权限,仅在开启 网络采集 时用于观察请求元数据;不会拦截、修改或重放请求,也不读取请求头、Cookie 与响应体。由于权限列表发生变化,升级后 Chrome 可能要求你重新确认。

升级方式

使用 pnpm install && pnpm build 从源码构建,然后在 apps/chrome-extension/dist 重新加载已解压的扩展。详见 INSTALL-CN.md。

v1.0.3(release)

Choose a tag to compare

@Lollipoprh Lollipoprh released this 01 Dec 13:18
48ee141

Web Chat Helper v1.0.3

Multimodal conversations, multiple models per provider, screenshot and page-selection input, and message recall.

Highlights

  • Multimodal support. Image recognition and image generation are new in this release and work inside the conversation. A text-only main model can hand these jobs to a separately configured multimodal model, and generated images render directly in the chat.
  • Multiple models per provider. One provider can hold many models, each with its own capabilities and context window, with /models discovery and a one-click merge into your configuration.
  • Capture what you need. Take a region screenshot of the current page, or right-click selected text and send it to the current conversation draft as a read-only quote.
  • Message recall. Undo the last turn and remove it, the assistant reply and its run records, then restore your prompt and page quote to the composer.

Added

  • Providers support multiple models, each with its own capabilities (streaming, tool calls, image input, image generation) and context window. Models can be discovered from the provider's /models endpoint, and the side panel remembers the last-used model per provider.
  • A "Multimodal Models" setting lets a text-only main conversation delegate image recognition and image generation to a separately configured model.
  • An "auto-recognize media" toggle lets the model pick relevant page images on its own; with it off, images are only read when you explicitly ask.
  • Region screenshot capture from the side panel, added to the conversation as an image.
  • Page context menu that sends selected text to the current conversation draft as a quote block. The quote is drafted only and never sent automatically.
  • Images are rendered and persisted inside chat bubbles, including Markdown image syntax and assistant-generated images.
  • Message recall on the last user message: removes the whole turn from the UI, local database, task ledger and media store, and restores the prompt and page quote into an empty composer without overwriting a draft.
  • A version log in settings that lists the user-facing changes of every release.
  • An auto-expand toggle for task records in the wide layout; the preference is persisted across panel instances.

New tools

  • list_page_media — lists images, videos and canvases on the current page with their addresses and sizes, so the model can discover media before reading it.
  • read_page_media — fetches an image from the page and shows it to a vision-capable main model as visual evidence.
  • recognize_image — when the main conversation is text-only, sends a page image to the configured vision model and returns a textual description or answer.
  • generate_image — creates images from a prompt, renders them inline in the conversation, and accepts reference images for editing, restyling or variations.

Changed

  • The composer starts at a minimum height of two rows.
  • Provider configuration is migrated automatically: the legacy single-model field and provider-level capability flags are moved onto each model.
  • Task records no longer always auto-expand when the panel becomes wide.

Fixed

  • Tool run status now displays correctly in assistant replies. Mixed success and failure runs show separate counts, and historical tasks that were mislabeled as completed are repaired on startup.

Upgrade notes

  • Existing provider configuration is migrated on load: if you used a single-model provider before, its model and capability flags now appear as the first entry in the per-model table.

Full changelog: v1.0.2...v1.0.3


Web Chat Helper v1.0.3

多模态对话、同一供应商多模型、截图与网页选区输入,以及消息撤回。

亮点

  • 多模态能力。 本版本新增图片识别与图片生成,可直接在会话中完成;主对话使用纯文本模型时,也可以交给单独配置的多模态模型处理,生成的图片会直接显示在对话里。
  • 同一供应商多模型。 一个供应商可配置多个模型,每个模型有自己的能力与上下文窗口,并支持从 /models 拉取模型后一键合并到配置中。
  • 按需截取内容。 可截取当前页面的任意区域,也可在网页中选中文字后通过右键菜单发送到当前会话草稿,作为只读引用块。
  • 消息撤回。 可撤回最后一轮对话,连同助手回答与运行记录一并移除,并把提问文字和网页引用恢复到输入框。

新增

  • 供应商支持配置多个模型,并可分别为每个模型设置可用能力(流式输出、工具调用、图片输入、图片生成)与上下文窗口。支持从供应商的 /models 接口发现模型,侧边栏会记住每个供应商最近使用的模型。
  • 新增「多模态模型」设置:主对话使用文本模型时,可将图片识别与图片生成交给单独配置的模型完成。
  • 新增「自动识别媒体」开关:开启后由模型自行挑选页面中的关键图片读取;关闭后,只有在你明确要求时才会读取图片。
  • 侧边栏新增区域截图,可将截取结果作为图片加入会话。
  • 新增网页右键菜单:可将选中的文字发送到当前会话草稿并显示为引用块。该内容只会进入草稿,不会自动发送。
  • 对话气泡支持直接显示并持久化图片,包括 Markdown 图片语法与助手生成的图片。
  • 新增消息撤回:可撤回最后一条用户消息,并从界面、本地数据库、任务记录与媒体库中整体移除该轮内容;提问文字和网页引用会恢复到空输入框,不会覆盖已有草稿。
  • 设置页新增「版本日志」,可查看每个版本面向用户的更新内容。
  • 宽布局下的任务记录新增自动展开开关,偏好设置会在多个面板实例之间保持同步。

新增工具

  • list_page_media —— 列出当前页面中的图片、视频与画布,附带地址和尺寸,供模型在读取前发现媒体。
  • read_page_media —— 下载页面图片,交给有视觉能力的主模型作为图像证据。
  • recognize_image —— 主对话为纯文本模型时,把页面图片交给配置好的视觉模型,只返回文字描述或回答。
  • generate_image —— 按提示词生成图片并直接显示在对话中,支持引用会话中的图片进行编辑、改风格或生成变体。

变更

  • 输入框默认最小高度调整为两行。
  • 供应商配置会自动迁移:旧的单模型字段与供应商级别的能力开关会迁移到每个模型上。
  • 面板拉宽时,任务记录不再总是自动展开。

修复

  • 修复运行记录在助手回复中的状态显示:成功与失败混合的运行会分别显示数量;历史上被错误标记为「已完成」的任务会在启动时自动修正。

升级说明

  • 已有供应商配置会在加载时自动迁移:如果你之前使用的是单模型供应商,原模型与能力开关会出现在多模型表格的第一项。

完整变更: v1.0.2...v1.0.3

v1.0.2(release)

Choose a tag to compare

@Lollipoprh Lollipoprh released this 29 Nov 15:58
ca537fc

v1.0.2

This release adds first-class Word and Excel support: read bound Office files, create new documents, and edit existing ones — all locally in the side panel, with no backend and no conversion service.

Full diff: v1.0.1...v1.0.2 · Changelog: CHANGELOG.md

Highlights

  • Read Office documents — read_office_outline and read_office_content parse bound .docx, .xlsx, .doc and .xls files with paged output.
  • Create Word and Excel files — create_docx renders Markdown, create_xlsx builds multi-sheet workbooks.
  • Edit bound documents in place — edit_docx and edit_xlsx change text, paragraphs, table cells, cell values and rows while preserving the rest of the package.
  • Paged plain-text reads — read_file now returns one bounded byte window per call instead of silently truncating large files.
  • One-step undo — overwritten files keep an in-memory snapshot that can be restored from the tool or the file preview dialog.

Office reading

  • New packages/office-parser: a pure Uint8Array parser with no chrome.*, DOM or Node dependencies.
  • Word (.docx): Markdown rendering plus heading outline; read by outline section or character offset.
  • Excel (.xlsx, .xls): workbook/sheet discovery and A1-range paging via SheetJS.
  • Legacy .doc: Word 97 piece-table extraction and Word 6/95 legacy code-page support.
  • Signature sniffing distinguishes docx/xlsx/doc/xls, detects encrypted files, and rejects PDF, RTF and PPT with clear messages.
  • Bounded ZIP extraction with entry-count, per-entry, total-size and compression-ratio limits. Caps: .docx ≤ 25 MB (word/document.xml ≤ 20 MB), .xlsx/.xls ≤ 10 MB.
  • read_office_outline and read_office_content return capped results with nextOffset or nextRange, so the model never receives a whole workbook or document.
  • read_file now diverts Office, PDF, RTF and ZIP signatures to the Office tools instead of decoding them as text; list_bound_files marks entries with their kind and format. write_file remains text-only.
  • Parsed files are cached in memory (LRU + single-flight, keyed by session, name, size and mtime) and never persisted.
  • Office tool results get a 24k context envelope in agent-core, while the tools still truncate semantically first.
  • SheetJS is pinned to 0.20.3 from the official CDN tarball (npm 0.18.5 is affected by CVE-2023-30533 / CVE-2024-22363) and lazy-loaded into its own chunk.

File reading improvements

  • Paged read_file — new offset / max_chars arguments (default 8k, hard cap 12k) plus nextOffset; only the requested byte range is read through Blob.slice.
  • Incomplete UTF-8 tails are trimmed and pages are cut by code points, so multi-byte characters and emoji reassemble exactly across pages.
  • Offsets are clamped and the tool reports the byte range and end-of-file state.
  • Oversized ZIPs are rejected from the 8-byte signature prefix before the archive is loaded into memory, avoiding a pointless full read for files that can never be parsed.

Office writing and editing

  • create_docx — headings, paragraphs, nested bullet/ordered lists, GFM tables, fenced code blocks, and inline bold/italic/code/links. Saved to Downloads.
  • create_xlsx — multiple sheets, string/number/boolean cells, formulas starting with =, automatic column widths, and sheet-name sanitization/deduplication.
  • edit_docx — replace_text (single_run / paragraph), append_paragraph, insert_paragraph_after, delete_paragraph, and set_table_cell.
  • edit_xlsx — A1 cell writes and row appends; validates merged-cell anchors and shared formulas, expands the sheet dimension, marks formulas for recalculation, and removes calcChain to avoid stale results.
  • Editing performs OOXML surgery: only word/document.xml or the target sheet XML is replaced, and every other ZIP entry is copied byte-for-byte. Images, charts, headers, footers, pivot tables and macros are preserved.
  • Save-as or overwrite — edit confirmations offer both choices. Overwrites always require confirmation, even when global auto-run is enabled.
  • Write permission on demand — readwrite access is requested inside the confirmation click, with retry guidance when the prompt is not completed and clear messages when the file handle has expired.
  • Overwrites abort if the file changed externally after it was read; failed writes do not leave a partially written file.
  • undo_document_edit and a matching "Undo last edit" action in the file preview restore the previous content of an overwritten file.

Reliability and UI

  • Wide Markdown tables now stay inside the message column and scroll horizontally, and replies containing tables get the full panel width.
  • New confirmation contract fields — alwaysConfirm, confirmationChoices, requiresFileWritePermission — let tools require explicit approval and return the user's chosen save mode.
  • New Chinese and English copy for Office creation, editing, write permission and undo flows.

Notes and limitations

  • .doc and .xls remain read-only. They are not converted automatically; save a modern copy in Word or WPS first.
  • Office editing targets content correctness, not formatting fidelity. New paragraphs use default styling, and paragraph-level replacement may collapse run-level formatting.
  • Undo is in-memory and limited to one overwrite per file. It is lost when the side panel closes.
  • Charts, images, pivot tables and macros are preserved during editing but cannot be created or modified by these tools.
  • Opening an existing .docm / .xlsm for editing keeps vbaProject.bin intact.
  • The Office structure/content preview branch is still pending; the preview currently shows text files and exposes the undo action.

v1.0.2

本次发布加入完整的 Word 与 Excel 支持:读取已绑定的 Office 文件、生成新文档、原地编辑现有文档——全部在侧边栏本地完成,无后端、无转换服务。

完整差异: v1.0.1...v1.0.2 · 变更记录: CHANGELOG.md

亮点

  • 读取 Office 文档 —— read_office_outline 与 read_office_content 解析已绑定的 .docx、.xlsx、.doc、.xls,结果分页返回。
  • 生成 Word / Excel —— create_docx 渲染 Markdown,create_xlsx 生成多工作表工作簿。
  • 原地编辑已绑定文档 —— edit_docx 与 edit_xlsx 修改文字、段落、表格单元格、单元格值与行,同时保留包内其他内容。
  • 纯文本分页读取 —— read_file 改为每次返回一个有界字节窗口,不再静默截断大文件。
  • 一步撤销 —— 覆盖文件时保留内存快照,可通过工具或文件预览对话框恢复。

Office 读取

  • 新增 packages/office-parser:纯 Uint8Array 解析器,不依赖 chrome.*、DOM 或 Node API。
  • Word(.docx):Markdown 渲染与标题大纲;支持按大纲章节或字符偏移读取。
  • Excel(.xlsx、.xls):基于 SheetJS 的工作表发现与 A1 区域分页。
  • 旧版 .doc:支持 Word 97 piece table 提取与 Word 6/95 旧代码页。
  • 文件头识别区分 docx/xlsx/doc/xls,检测加密文件,并对 PDF、RTF、PPT 给出明确拒绝提示。
  • 有界 ZIP 解包,限制条目数、单条大小、总大小与压缩比。上限:.docx ≤ 25 MB(word/document.xml ≤ 20 MB),.xlsx/.xls ≤ 10 MB。
  • read_office_outline 与 read_office_content 返回带 nextOffset 或 nextRange 的分页结果,模型不会一次收到整份文档或工作簿。
  • read_file 会把 Office、PDF、RTF、ZIP 签名分流到 Office 工具,不再按文本解码;list_bound_files 标记文件的 kind/format。write_file 仍只处理纯文本。
  • 解析结果只缓存在内存(LRU + single-flight,按会话、文件名、大小与 mtime),不落盘。
  • Office 工具结果在 agent-core 中获得 24k 上下文上限,工具自身仍先做语义截断。
  • SheetJS 固定为官方 CDN 的 0.20.3(npm 0.18.5 受 CVE-2023-30533 / CVE-2024-22363 影响),并懒加载到独立 chunk。

文件读取改进

  • read_file 分页 —— 新增 offset / max_chars 参数(默认 8k,硬上限 12k)与 nextOffset;通过 Blob.slice 只读取请求的字节范围。
  • 自动裁掉不完整 UTF-8 尾部,并按码点切分,多字节字符与 emoji 可跨页精确拼接。
  • 偏移量会被收敛,工具消息会报告字节范围与文件结尾状态。
  • 超大 ZIP 在读取 8 字节签名后直接拒绝,不再把永远无法解析的压缩包整体读入内存。

Office 写入与编辑

  • create_docx —— 标题、段落、嵌套有序/无序列表、GFM 表格、代码块,以及行内加粗/斜体/代码/链接;保存到下载目录。
  • create_xlsx —— 多工作表、字符串/数字/布尔单元格、以 = 开头的公式、自动列宽,以及工作表名清洗与去重。
  • edit_docx —— replace_text(single_run / paragraph)、append_paragraph、insert_paragraph_after、delete_paragraph、set_table_cell。
  • edit_xlsx —— A1 单元格写入与追加行;校验合并单元格锚点与共享公式,扩展工作表 dimension,标记公式重算,并移除 calcChain 以避免旧缓存结果。
  • 编辑采用 OOXML 外科手术:只替换 word/document.xml 或目标工作表 XML,其余 ZIP 条目按字节原样复制。图片、图表、页眉页脚、透视表与宏均保留。
  • 另存或覆盖 —— 编辑确认条提供两种选择;即使开启全局自动执行,覆盖仍必须确认。
  • 按需申请写权限 —— 在确认点击内申请 readwrite;授权未完成时提示重试,句柄失效时给出明确提示。
  • 读取后文件被外部修改时中止覆盖;写入失败不会留下半截文件。
  • undo_document_edit 与文件预览中的「撤销上次编辑」可恢复被覆盖文件的上一版内容。

可靠性与界面

  • 宽 Markdown 表格保持在消息列内并横向滚动,含表格的回复气泡获得面板全宽。
  • 确认协议新增 alwaysConfirm、confirmationChoices、requiresFileWritePermission,支持工具强制确认并回传用户选择的保存方式。
  • 补齐 Office 生成、编辑、写权限与撤销流程的中英文案。

说明与限制

  • .doc / .xls 仍只读,不做自动转换;请先在 Word 或 WPS 中另存为现代格式。
  • Office 编辑保证内容正确,不追求版式还原。新增段落使用默认样式,段落级替换可能合并原有 run 格式。
  • 撤销仅保存在内存中,每个文件只保留一步;关闭侧边栏后失效。
  • 图表、图片、透视表和宏在编辑时原样保留,但这些工具不能新建或修改它们。
  • 编辑 .docm / .xlsm 时会保留 vbaProject.bin。
  • Office 结构/内容预览分支尚未落地;当前预览仍主要用于文本文件,并提供撤销入口。

v1.0.1(release)

Choose a tag to compare

@Lollipoprh Lollipoprh released this 26 Nov 07:50
928972b

v1.0.1 — Exports, tables and typing behave

Release date: 2026-11-26 · Type: patch · Upgrade from 1.0.0: drop-in, no migration

A patch release about the parts you touch every day. Exported files keep the name you asked
for, one deliverable now lands in one file instead of a folder of fragments, wide tables stay
readable in the narrow side panel, and the composer and dialogs stop moving under the cursor.


Added

  • One file per export — the agent now assembles the whole deliverable and calls
    download_file once per request, instead of writing one file per section, page or step. A
    later request that updates the same deliverable reuses its filename, so the old copy is
    replaced rather than left behind as a near-duplicate. The agent splits into several files only
    when you ask for separate files, or when the content is too large for one file.

Fixed

  • Exported filenames survive Chrome's rewriting — Chrome used to rewrite report.md into
    report.txt because the download was served as text/plain. The download MIME now follows
    the requested extension, so files land with the name you asked for.
  • Generic export names become real names — a file the model wanted to call 下载, export
    or untitled now takes the session title as its stem, and an export with no extension is
    saved as .md.
  • Wide tables stay readable — wide markdown tables scroll horizontally inside their own
    frame (slimmer scrollbar, labelled region for screen readers), and a reply that contains a
    table uses the full panel width instead of being squeezed into 88%.
  • The composer opens at the right height — it used to open at maximum height and snap back
    to one line on the first keystroke, because the placeholder was measured as content while the
    panel was still laying out. Measurements now ignore the placeholder and re-run when the
    panel's width changes.
  • Dialogs keep focus while you type — the focus trap re-ran on every keystroke inside a
    dialog input, which could pull the caret to another control. It now runs only when the dialog
    opens, and leaves focus alone when something inside the panel already holds it.

Upgrade notes

  • No data migration. Sessions, provider configs, digests and checkpoints are untouched;
    existing sessions keep working as-is.
  • No permission change. Still Manifest V3 with https://*/* host access and optional
    localhost access — the install prompt does not change.
  • Installing. Manual/unpacked installs need an extension reload; Chrome Web Store installs
    update on their own once this build is published.

Full changelog



v1.0.1 — 导出、表格与输入都更好用了

发布日期: 2026-11-26 · 类型: 补丁版本 · 从 1.0.0 升级: 直接覆盖,无需迁移

这是一次聚焦日常细节的补丁版本:导出的文件保住你要的文件名,一份交付物只落一个文件而不是
一堆碎片,宽表格在窄侧栏里也能读,输入框和弹窗不再在光标底下跳动。


新增

  • 每次请求一个导出文件 —— 模型会把整份产物攒好,在一次请求里只调用一次
    download_file,而不是按章节、页面或步骤各写一个文件。后续请求更新同一份产物时复用
    文件名,旧文件被覆盖,而不是留下一堆近似重复的副本;只有你明确要求拆成多个文件,或内容
    大到一文件放不下时,才会拆分。

修复

  • 导出文件名不再被 Chrome 改写 —— 过去下载按 text/plain 送达,report.md 会被
    Chrome 改写成 report.txt;现在下载 MIME 与目标扩展名对齐,文件按你要的名字落盘。
  • 通用文件名会换成真正的名字 —— 模型原本想叫 下载、export、untitled 的文件,
    改用会话标题命名;没写扩展名的导出补 .md。
  • 宽表格保持可读 —— 宽 markdown 表格在自身区域内横向滚动(更细的滚动条、带无障碍标签),
    含表格的回复气泡占满面板宽度,不再被压到 88%。
  • 输入框按正确高度打开 —— 过去刚打开侧栏时输入框顶到最高,敲第一个字又缩回一行,原因是
    面板还没完成布局时把占位文案当成了内容;现在测量时忽略占位文案,并在面板宽度变化时重算。
  • 弹窗输入时焦点不再被抢走 —— 焦点陷阱原先在弹窗里每敲一个字就重跑一遍,可能把光标拽到
    别的控件上;现在只在弹窗打开时执行,面板内已有焦点时不再干预。

升级说明

  • 无需数据迁移。 会话、供应商配置、摘要与断点均未改动,旧会话可继续使用。
  • 权限没有变化。 仍是 Manifest V3,https://*/* 主机权限 + 可选的 localhost 权限,
    安装提示不变。
  • 安装方式。 手动/解包安装的扩展需要重新加载;Chrome 应用商店的安装会在该构建发布后
    自动更新。

完整变更记录

v1.0.0(release)

Choose a tag to compare

@Lollipoprh Lollipoprh released this 23 Nov 14:09
2de72bd

Web Chat Helper 1.0.0

First stable release. The panel was rebuilt on a design-token base, and a run is now a
first-class thing you can read, trace, retry and resume — instead of a wall of text you had to
trust.

Highlights

  • Dark mode with a real design system. Semantic CSS-variable tokens, a light / dark /
    follow-system preference, and 20+ shared primitives used by both the panel and the settings page.
  • Every run is visible. Each assistant reply owns a run block: status · steps · duration when
    collapsed, the full step timeline when expanded — live while streaming, from the task log
    afterwards.
  • Recovery instead of dead ends. Regenerate the newest answer in place, or resume a run that
    was interrupted from the checkpoint banner.
  • Markdown replies. Headings, lists, tables, quotes and fenced code, with a copy button per
    code block. Rendered without innerHTML.
  • Faster everyday work. ⌘K / Ctrl+K opens a command palette over sessions, / commands,
    models and panel actions; page-aware task suggestions appear on an empty chat.
  • Artifacts, kept honest. Files written by download_file are listed for the session, and
    bound files can be previewed in place. Only metadata is stored — file contents stay in your
    Downloads folder.

Added

  • Design tokens, light/dark/system theme, and shared UI primitives (Button, IconButton, Dialog,
    Tooltip, Menu, Segmented, Chip, Markdown, and more)
  • Header HUD: session title with rename / new / delete beside it, run status, settings
  • Context strip: attached tab, bound files, compact usage meter
  • Run blocks with an expandable step timeline; message actions (copy, edit-and-resend)
  • Markdown rendering for assistant replies, with per-block copy
  • Session search and per-row delete in the session menu; rename from the header
  • Page-aware empty state: translate into your UI language / summarise / turn into a table
  • Task records with Locate — jump back to that run in the conversation and highlight it
  • Regenerate the newest reply; resume an interrupted run
  • File preview for bound files (first 200 lines / 12k characters)
  • Session artifacts for downloaded files, with "show in folder"
  • Command palette (⌘K / Ctrl+K)
  • Wide layout: from 600px the task records become a permanent right column

Changed

  • Hover hints all go through the shared tooltip: no native title remains on interactive
    elements, and a tooltip flips sides instead of covering the button it describes
  • Rename / new / delete moved out of the session menu into the header; clearing moved to
    /clear; the task list is reached from the right-edge pull tab
  • The extension version is read from package.json at build time instead of being duplicated in
    manifest.config.ts

Fixed

  • The off-screen task pane could scroll the whole chat sideways by taking focus
  • Dropdowns no longer close when you scroll their own list
  • Dialogs no longer clip the focus ring of their first control at the top edge
  • download_file reports the real byte length instead of the character count

Upgrade notes

  • Existing sessions, messages, task logs and bound files are untouched: no data migration is
    required for 1.0.0.
  • After updating an unpacked build, reload the extension on chrome://extensions so the new
    version takes effect.
  • A bound file that loses permission (moved, deleted, or after a browser restart) shows an
    explicit error — bind it again from the attach button.

Compatibility

From 1.0.0 on, stored data, cross-context messages and tool contracts follow the 1.x policy in
docs/compatibility.md:
additive changes only, existing tool arguments keep their meaning, and breaking changes require a
major version plus a migration section in the release notes.

Requirements

  • Chrome 114+ (Side Panel API)
  • An OpenAI-compatible model endpoint (base URL, API key, model name). Keys are encrypted at rest
    and never leave the panel except toward the endpoint you configured.

Full Changelog: v0.1.6...v1.0.0



Web Chat Helper 1.0.0(中文)

首个稳定版本。界面重建在设计令牌之上,「一次运行」变成了可以被阅读、回溯、重试和续跑的东西,
而不是一段只能选择相信的长文本。

亮点

  • 深色模式与真正的设计系统。 语义化 CSS 变量令牌、浅色/深色/跟随系统三选,侧边栏与设置页
    共用 20+ 个基础组件。
  • 每次运行都看得见。 每条回复一个运行块:折叠显示状态 · 步数 · 耗时,展开是完整步骤时间线;
    流式时实时显示,结束后读任务日志。
  • 有恢复路径,不是死路。 最新回答可原地重新生成;被中断的任务可以从断点提示继续。
  • Markdown 回复。 标题、列表、表格、引用与代码块,代码块带复制按钮;全程不碰 innerHTML。
  • 日常更快。 ⌘K / Ctrl+K 打开命令面板(会话、/ 指令、模型、面板动作);
    空会话时按当前页面给出任务建议。
  • 产物诚实可见。 download_file 产出的文件按会话登记,绑定的文件可以就地预览;
    只存元数据,文件内容仍留在系统下载目录。

新增

  • 设计令牌、浅色/深色/跟随系统主题,以及共享 UI 组件(Button、IconButton、Dialog、Tooltip、
    Menu、Segmented、Chip、Markdown 等)
  • 头部 HUD:会话标题 + 右侧重命名/新建/删除、运行状态、设置
  • 上下文条:当前标签页、绑定文件、紧凑用量条
  • 运行块与可展开的步骤时间线;消息动作(复制、编辑后重发)
  • 助手回复的 Markdown 渲染,代码块可复制
  • 会话菜单内搜索与逐条删除;头部重命名
  • 场景化空状态:翻译成界面语言 / 总结要点 / 整理成表格
  • 任务记录与定位 —— 跳回对话并高亮那次运行
  • 最新回答重新生成;中断任务续跑
  • 绑定文件预览(前 200 行 / 12k 字符)
  • 会话产物列表,可在文件夹中定位
  • 命令面板(⌘K / Ctrl+K)
  • 宽栏两列:内容区 ≥600px 时任务记录固定为右列

变更

  • 悬浮提示统一走共享 Tooltip:交互元素不再使用原生 title,空间不足时提示换边,不遮挡触发元素
  • 重命名/新建/删除从会话菜单移到标题右侧;清空改为 /clear;任务列表用右边缘侧拉按钮进入
  • 扩展版本号改为构建时从 package.json 读取,不再在 manifest.config.ts 里重复

修复

  • 隐藏的任务面板可能因获得焦点把整个对话横向顶歪
  • 下拉菜单不再因为滚动自身列表而关闭
  • 对话框不再裁掉首个控件焦点环的上边
  • download_file 改报真实字节数(原为字符数)

升级说明

  • 已有会话、消息、任务日志与绑定文件不受影响:1.0.0 不需要任何数据迁移。
  • 更新未打包版本后,请在 chrome://extensions 重新加载扩展,新版本才会生效。
  • 绑定文件若权限失效(被移动、删除或浏览器重启后),会给出明确错误 —— 从附件按钮重新绑定即可。

兼容性

自 1.0.0 起,存储结构、跨上下文消息与工具契约遵循
docs/compatibility.md:
只做增量变更,已有工具参数含义不变;破坏性变更必须升主版本,并在发行说明里附迁移章节。

运行要求

  • Chrome 114+(Side Panel API)
  • 一个 OpenAI 兼容的模型端点(Base URL、API Key、模型名)。密钥加密存储,除了发往你自己配置的
    端点之外不会离开侧边栏。

完整变更:v0.1.6...v1.0.0

v0.1.6(release)

Choose a tag to compare

@Lollipoprh Lollipoprh released this 22 Nov 08:09
7979435

Web Chat Helper 0.1.6

English

Highlights

  • Resumable sessions — every request now carries a compact <session-memory> block built from the previous run's ledger and session digest, so interrupted or round-limited tasks can continue by simply sending the next message.
  • Built-in / commands — /compact, /memory, /help, /clear with arrow-key completion in the composer. Command notices are saved with the session and never sent to the model.
  • Accurate context meter — the usage bar tracks the current context instead of cumulative session tokens and drops immediately after /compact.

Changed

  • round_limit is now a distinct task status; the agent loop answers unexecuted tool calls and reports them as pending.
  • Tool results are hard-truncated before entering context (read_file 20k chars, others 8k).
  • The default context window for new providers is now 1,000,000 tokens.
  • Sending a built-in command clears the composer.

Upgrade

Reload the unpacked extension in chrome://extensions. Existing providers keep their saved context window; set it to 1M manually if desired.

中文

亮点

  • 可续跑会话 —— 每次请求自动携带由上一段运行账本与会话摘要组成的 <session-memory> 块,中断或跑满轮次后直接发下一句即可继续。
  • 内置 / 指令 —— 支持 /compact、/memory、/help、/clear,输入框提供方向键补全;指令回执随会话保存,且不会进入模型上下文。
  • 更准确的上下文进度条 —— 用量条改为跟随当前上下文,/compact 后立即回落。

变更

  • round_limit 成为独立任务状态;loop 会为未执行的工具调用补齐应答并标记为待执行。
  • 工具结果进入上下文前硬截断(read_file 2 万字符,其余 8k)。
  • 新建供应商的默认上下文窗口改为 1,000,000 tokens。
  • 发送内置指令后自动清空输入框。

升级

在 chrome://extensions 重新加载未打包扩展。已有供应商保留原上下文窗口,可手动改为 1M。

v0.1.5(release)

Choose a tag to compare

@Lollipoprh Lollipoprh released this 21 Nov 06:13
be079c4

Web Chat Helper v0.1.5 — Release Notes

Release date: 2026-11-21
Compare: v0.1.4...v0.1.5 · Full changelog: CHANGELOG.md


English

v0.1.5 is a Side Panel polish release: files now belong to the chat session that added them, you can drop them straight onto the panel, and a colour-coded bar shows how much of the model's context window the conversation has consumed. No backend, no new permissions.

Highlights

  • Files are per session. Every chat session keeps its own file bindings, so the same filename can be attached to different sessions without collisions.
  • Drop to bind. Drag files from your file manager onto the chat panel or the composer to bind them to the current session.
  • See your context budget at a glance. A compact usage bar under the session toolbar shows cumulative input/output tokens against the provider's context window.

Added

Context usage meter. A slim bar sits below the session toolbar. The track is light blue, the input segment light green and the output segment yellow; once the configured window is full the whole bar turns orange-red. Token counts are read from the OpenAI-compatible usage field (streaming requests explicitly ask for stream_options.include_usage) and accumulated per session, so they survive reopening the session. The exact numbers — input, output and total window — appear only in a hover/focus tooltip instead of cluttering the panel.

Per-session local files. The "Add file" button now sits directly left of Send and opens the system file picker. Bindings are keyed by ${sessionId}::${name} in IndexedDB, listed above the composer only when the current session has files, and the file tools (list_bound_files and every read/write) can only touch files bound to the active session.

Drag-and-drop file binding. Dropping files onto the chat panel or the composer binds them to the current session via DataTransferItem.getAsFileSystemHandle(), with a highlight and a drop hint while dragging.

Provider context window setting. Each provider gains an editable contextWindow field (default 128000) in the options page, which drives the usage meter.

Reusable tooltip. A new Tooltip component in apps/chrome-extension/src/ui/Tooltip.tsx renders a frosted floating panel on hover or keyboard focus; the usage meter is its first consumer.

Changed

Compact header. The provider/model subtitle is gone from the Side Panel header — the model switcher at the bottom of the panel is now the single place that shows it. The settings entry is a gear icon and header padding is tighter, reclaiming vertical space for the conversation.

File bindings are stored per session. This changes the IndexedDB schema: the v5 upgrade recreates the file-handle object store with a by_sessionId index. Existing global bindings are intentionally not migrated.

Upgrade notes

  • Re-add your files. After upgrading, previously bound files no longer appear. Open each session, click "Add file" (or drop the file onto the panel) to bind it again. If a stored handle has gone stale — the file was moved or deleted — the extension tells you to unbind and re-add it rather than failing silently.
  • Check the context window value. It defaults to 128000; set it to your model's real window in Settings → Providers so the usage bar and its "full" state stay accurate.
  • No permission changes. v0.1.5 adds no new Chrome permissions or host permissions, and no settings are reset.

中文(简体)

v0.1.5 是一次侧边栏体验打磨:文件改为归各自会话所有,可以直接拖进面板绑定,并用一条彩色用量条显示当前对话占用了多少上下文。仍然不依赖后端,也没有新增权限。

亮点

  • 文件按会话隔离 —— 每个会话维护自己的文件绑定,同名文件可以分别绑定到不同会话,互不冲突。
  • 拖拽即可绑定 —— 从文件管理器把文件拖到会话面板或输入框,即可绑定到当前会话。
  • 上下文预算一目了然 —— 历史会话栏下方的紧凑用量条,直观展示累计输入/输出 token 与供应商上下文窗口的比例。

新增

会话用量条。 历史会话栏下方新增一条细长用量条:轨道浅蓝、输入段浅绿、输出段黄色;配置的窗口占满后整条变为橙红。用量取自 OpenAI 兼容接口的 usage 字段(流式请求显式索要 stream_options.include_usage),按会话累加持久化,重新打开会话仍然保留。具体数值(输入、输出、窗口总量)只在鼠标悬浮或键盘聚焦时通过悬浮框展示,不占用面板空间。

文件按会话隔离。 「添加文件」按钮移到发送键左侧并直接弹出系统文件选择器;绑定记录在 IndexedDB 中以 ${sessionId}::${name} 为键,仅在当前会话有文件时显示在输入框上方;文件工具(list_bound_files 及所有读写)只能访问当前会话绑定的文件。

拖拽绑定文件。 把文件拖到会话面板或输入框即可通过 DataTransferItem.getAsFileSystemHandle() 绑定到当前会话,拖拽过程中会高亮并显示提示。

供应商上下文窗口设置。 设置页的供应商表单新增可编辑的 contextWindow 字段(默认 128000),供用量条计算占用比例。

通用悬浮框组件。 新增 apps/chrome-extension/src/ui/Tooltip.tsx,在悬浮或键盘聚焦时展示毛玻璃浮层,用量条是它的第一个使用方。

变更

标题栏收紧。 侧边栏标题栏去掉供应商/模型副标题,模型信息统一由底部的模型切换器展示;设置入口改为齿轮图标,标题栏高度减小,把纵向空间留给对话内容。

文件绑定改为按会话存储。 IndexedDB 结构随之升级:v5 升级重建文件句柄存储并新增 by_sessionId 索引,旧的全局绑定不做迁移。

升级说明

  • 需要重新绑定文件。 升级后此前绑定的文件不再显示,请在对应会话中点击「添加文件」(或直接把文件拖进面板)重新绑定。如果存储的句柄已失效(文件被移动或删除),扩展会提示解绑后重新添加,而不是静默失败。
  • 确认上下文窗口数值。 默认值为 128000,请在「设置 → 供应商」中改成模型真实窗口大小,用量条及「占满」状态才准确。
  • 无权限变更。 v0.1.5 没有新增任何 Chrome 权限或主机权限,也不会重置现有设置。

Install: see INSTALL.md · 安装: 见 INSTALL-CN.md

v0.1.4(release)

Choose a tag to compare

@Lollipoprh Lollipoprh released this 18 Nov 11:59
95495af

Web Chat Helper v0.1.4

Release date: 2026-11-18 · Full changelog


English

This release makes whole-page translation a single right-click, gives the agent a small set of safe declarative DOM tools, and stops provider API keys from sitting in plaintext on disk.

Highlights

1. Translate the current page from the context menu

A new right-click entry — "Translate current page (WebChatHelper)" — opens the side panel, starts a fresh session and immediately runs a full-page translation in place. No prompt to type: the target language comes from the browser UI language (chrome.i18n.getUILanguage()), and each run is saved to session history. The entry only appears on http / https pages, where the content script can actually run.

2. Declarative DOM editing tools

Five new tools let the model edit the page without ever executing scripts:

Tool What it does
set_element_text Replace an element's text
set_element_attribute Set an attribute from an allowlist
set_element_style Set a CSS property from an allowlist
remove_element Remove an element
insert_element Sanitize and insert a small HTML fragment

Both attributes and CSS properties go through explicit allowlists. Inserted markup is sanitized through an allowlist of tags and attributes — scripts, iframes, forms, media, event handlers and javascript: URLs are dropped — and CSS values containing url(), expression(), @import or javascript: are rejected. Every mutation is read back from the DOM, so a no-op is reported as a failure instead of a success.

3. API keys encrypted at rest

Provider API keys are no longer stored as plaintext in chrome.storage.local. They are written as enc:v1: ciphertext produced with AES-256-GCM, using a key derived via PBKDF2-SHA256 (100,000 iterations) from a built-in master key and a per-installation random salt. Existing plaintext keys keep working and are re-encrypted on the next save.

This protects against casual inspection of extension storage. It is not a key vault — someone who can read the extension source can still derive the key.

What's changed

Added

  • Context-menu page translation entry, registered on install and update.
  • Declarative DOM tools: set_element_text, set_element_attribute, set_element_style, remove_element, insert_element.
  • API key encryption at rest with transparent migration of legacy plaintext values.

Changed

  • Whole-page translation now defaults to editing the page in place. When the user has not asked for a chat reply, the model rewrites visible text with find_elements + set_element_text, touching only text-only leaf elements. A chat answer is used only when explicitly requested, or when the page is protected, unauthorized, or keeps reverting the edits.

Upgrade notes

  • New permission: contextMenus, required for the right-click entry. Chrome may ask you to accept it after updating.
  • No manual migration. Plaintext API keys are detected on load and encrypted on the next write.
  • No changes to provider configuration, storage schema, or tool result formats.

Known limitations

  • Encryption raises the bar for casual inspection; it is not a substitute for an OS keychain.
  • In-place translation is temporary by design — reloading the page restores the original text.
  • The HTML sanitizer is intentionally narrow, so complex markup may be reduced to plain text.

中文

本次发布把整页翻译变成一次右键操作,为 Agent 增加了一组安全的声明式 DOM 工具,并让供应商 API Key 不再以明文形式留在磁盘上。

亮点

1. 右键翻译当前页面

网页右键菜单新增 「翻译当前页面(WebChatHelper)」:点击后自动打开侧边栏、新建会话,并立即就地翻译整页。无需输入任何指令,目标语言取自浏览器界面语言(chrome.i18n.getUILanguage()),每次执行都会写入会话记录。该菜单仅在 http / https 页面出现,因为这些页面才允许注入内容脚本。

2. 声明式 DOM 编辑工具

新增五个工具,让模型在不执行任何脚本的前提下修改页面:

工具 作用
set_element_text 替换元素文本
set_element_attribute 按白名单设置属性
set_element_style 按白名单设置 CSS 属性
remove_element 移除元素
insert_element 消毒后插入一段 HTML

属性名与 CSS 属性名都走显式白名单。插入的 HTML 按标签与属性白名单消毒——script、iframe、表单、媒体标签、事件处理器与 javascript: URL 全部丢弃;包含 url()、expression()、@import 或 javascript: 的 CSS 值直接拒绝。每次修改都会回读 DOM,未生效时返回失败而不是谎报成功。

3. API Key 落盘加密

供应商 API Key 不再以明文写入 chrome.storage.local,而是以 enc:v1: 前缀的密文存储。加密算法为 AES-256-GCM,密钥由内置主密钥与安装实例级随机 salt 经 PBKDF2-SHA256(10 万次迭代)派生。已有的明文 Key 仍可正常读取,并在下次保存时自动加密。

该机制用于抵御对扩展存储的随手查看,并非密钥保险库——能读取扩展源码的人仍可还原密钥。

变更内容

新增

  • 右键菜单整页翻译入口,安装与更新时自动注册。
  • 声明式 DOM 工具:set_element_text、set_element_attribute、set_element_style、remove_element、insert_element。
  • API Key 落盘加密,并透明迁移历史明文数据。

变更

  • 整页翻译默认改为就地修改页面。当用户没有要求对话回复时,模型用 find_elements + set_element_text 改写可见文本,且只处理纯文本叶子节点。仅在用户明确要求对话回复、页面受保护/未授权、或页面持续回滚修改时,才改为在聊天中给出译文。

升级说明

  • 新增 contextMenus 权限,用于右键菜单入口,更新后 Chrome 可能要求确认。
  • 无需手动迁移。明文 API Key 在加载时自动识别,并在下次写入时加密。
  • 供应商配置结构、存储结构与工具结果格式均无变化。

已知限制

  • 加密只是提高了随手查看的门槛,不能替代操作系统级密钥管理。
  • 就地翻译是临时修改,刷新页面即恢复原文。
  • HTML 消毒策略刻意收紧,复杂结构可能被降级为纯文本。

v0.1.3(release)

Choose a tag to compare

@Lollipoprh Lollipoprh released this 10 Nov 06:41
71eee0c

Release Notes · v0.1.3 · 2026-11-10


TL;DR

Problem. On a noticeable share of sites, fill_input visually wrote text into the field but
the page model never received it — React / Vue custom components, input masks, rich-text editors
(ProseMirror, Lexical, Slate, Draft.js, Quill) and contenteditable blocks all expose this in
different ways. The model was told "fill succeeded", clicked Submit, and got stuck in a
"required field / revert / try again" loop that it could not escape.

What changed. fill_input now writes through the browser's own editing pipeline first
(document.execCommand('insertText') → trusted events, native undo / selection preserved) and
falls back to prototype / instance value setters only after the page clearly rejected the first
attempt. Every write is read back after a short settle window, HTML5 constraints are checked, and
the tool returns either a success that carries evidence (valueLength is the read-back length,
strategy and validityValid are explicit) or an actionable execution_failed reason.


Highlights

1. Writing through the browser editing pipeline (the default path)

The old implementation set element.value via the prototype setter and synthesized a single
input event. That is enough for plain inputs but misses three cases:

  • Pages that install their own value accessor (input masks like IMask / cleave.js, jQuery
    plugins, some Web Components) — the prototype setter intentionally skips them, so the page
    model is never updated.
  • Editors (ProseMirror / Lexical / Slate / Draft.js / Quill) that build their edit transaction
    from beforeinput — the old code never dispatched it, so the editors saw the document as
    unchanged and did nothing.
  • contenteditable blocks that were rebuilt via element.textContent = text — the editor's
    model, undo stack, and selection all broke; afterwards the user could still type but backspace
    / paste were dead.

The new default strategy is document.execCommand('insertText', false, text), which the browser
routes through its full editing pipeline: trusted beforeinput and input events for editors
that listen on them, native undo stack updates, correct focus / selection preservation, and it
never touches element.value directly — so no accessor is ever skipped.

2. Real fallback, not guesswork

The strategy order is now driven by evidence, not by framework detection:

  1. insert-text-command — browser's own editor.
  2. native-value-setter — prototype setter + beforeinput + input + change + blur.
  3. instance-value-setter — only tried after strategy 2 was actually observed reverting the
    write, and only when the element genuinely owns a value accessor. This is the one that
    unblocks input masks and similar custom controls; it is intentionally guarded because running
    it on a React page writes directly into _valueTracker and silently suppresses onChange.

For number / date / time / month / week / datetime-local / range / color, where
the browser itself filters out-of-format input, the order starts from strategy 2 — insertText
there would just be silently discarded.

3. Reading back before trusting success

Rule 7 in AGENTS.md: "Success is evidence, not a status code." — this is the fix that finally
enforces that rule for input injection.

After each strategy attempt the extension:

  1. waits up to ~400ms for the field value to settle (masking libraries and async validators often
    rewrite the value on the next frame);
  2. compares the settled value against the expected text using five verdicts:
    committed / formatted (masks / separators added) / reverted / partial / empty;
  3. for input / textarea, blurs once and re-reads — some old forms only run validation on blur;
  4. returns the first strategy whose verdict is committed or formatted, or throws
    execution_failed with an explicit Chinese reason plus an actionable next step.

The beforeinput → preventDefault() case is not treated as a hard failure immediately:
ProseMirror-style editors cancel the default only to apply the edit themselves, so we read back
first and only decide it was a rejection when the value is genuinely missing afterwards.

4. Rich-text editors work again

contenteditable blocks no longer go through textContent = text. commitText uses exactly
the same command-based path as plain inputs, so the editor model stays intact and backspace /
paste / redo all continue to work after injection.

5. Select and submit made honest

  • select_option now calls focusDeep, dispatches form events, and reads select.value back.
    Pages that change the option back in their change handler (cascading validations) will produce
    committed: false instead of looking like they succeeded.
  • submitForm runs form.checkValidity() before requestSubmit(); when the form is invalid,
    it returns submitted: false with the first invalid field's validationMessage.
  • dispatchEnter now also emits keyCode: 13 and which: 13 for legacy pages that still read
    those deprecated fields.
  • focusDeep recurses through Shadow DOM activeElement so execCommand hits the right target.

What tool results look like now

Before (one size fits all, valueLength is the input length):

已向 input「手机号」填写 11 个字符

After (carries evidence):

已向 input「手机号」写入 11 个字符(原生编辑命令);已提交表单

Masked field (the page added separators):

已向 input「手机号」写入 15 个字符(组件赋值 + 事件)

Validation failed after write:

已向 input「手机号」写入 11 个字符(原生编辑命令);页面校验未通过:「请输入有效的手机号」,请先修正内容再提交

And when the page rejects the write entirely:

页面在 beforeinput 阶段取消了这次输入,「手机号」可能拒绝自动化写入;请让用户手动填写,或先用 click_element 聚焦后重试。

The new FillResult adds expectedLength, strategy, committed, validityValid,
validationMessage. The old valueLength is now the read-back length — this is an
intentional breaking change limited to tool result payloads, documented in the changelog.


Breaking change for consumers of FillResult / SelectResult

Field Before After
FillResult.valueLength length of the input parameter length of the read-back value (code points)
FillResult.expectedLength — new — length of the input parameter
FillResult.strategy — new — insert-text-command / native-value-setter / instance-value-setter / select-value
FillResult.committed — new — always true when the tool returns success
FillResult.validityValid — new — HTML5 constraint status, true for non-form controls
FillResult.validationMessage — new — empty if valid
SelectResult.committed — new

If any code in your workspace treated valueLength as "the text we asked to write", switch to
expectedLength. If it treated valueLength as "what the field actually holds", the new
semantics are what you wanted all along.


Verification

  • pnpm typecheck ✅ (all four packages)
  • pnpm test ✅ (53 tests, 17 new pure-logic tests for input-injection.ts)
  • pnpm build ✅ (manifest.json unchanged — no permissions added / removed)
  • pnpm map:check ✅ (codemap regenerated, 11 files consistent)
  • pnpm docs:check ✅ (280 doc references valid)

Manual fixture included at docs/manual-tests/input-injection.html with nine scenarios
(native required input, custom value accessor, beforeinput rejection, write reversion,
contenteditable, masking, blur-only validation, auto-save change count, clearing).
Loading the unpacked extension and exercising real sites is a manual step — it cannot be
automated from inside chrome://extensions.


中文摘要

问题 —— 在相当一部分页面上,fill_input 虽然看得见写进了文字,但页面 model
从未同步:React / Vue 自定义组件、输入掩码(IMask / cleave.js)、ProseMirror / Lexical /
Slate / Draft.js / Quill 等富文本编辑器、contenteditable 块各自以不同方式暴露这个问题。
模型被告知「填写成功」,点提交后卡在「必填 / 回滚 / 再填一次」的死循环里,而且因为
fill_input 是有副作用工具、签名会在执行前写入,模型换参数重试也只会拿到 duplicate_call。

本次修改 —— fill_input 优先走浏览器自己的编辑管线
(document.execCommand('insertText') → 可信事件、原生撤销栈、选区保持),只有在页面
明确拒绝第一次尝试后才降级到原型 / 实例 value setter。每次写入后先等待字段稳定再
回读,同时检查 HTML5 约束;工具要么返回带证据的成功(valueLength 是回读长度,
strategy 和 validityValid 明确可见),要么抛出带中文可行动原因的 execution_failed。

关键点

  1. 默认写入路径改成浏览器编辑命令。旧实现只调原型 setter + 一个合成 input 事件,
    对自带 value accessor 的掩码组件(IMask / cleave.js)、靠 beforeinput 构建编辑
    事务的编辑器、或 contenteditable(用 textContent 重建节点后 model / 撤销栈 /
    选区全部丢失,退格 / 粘贴死了)都无效。新路径走 insertText,浏览器自动发出可信
    的 beforeinput / input、维护撤销栈、保持选区,且从不碰 value accessor——谁也
    绕不过。

  2. 降级顺序靠观测,不靠框架探测。insert-text-command → native-value-setter →
    instance-value-setter(仅在观测到前一次被真的回滚、且元素确实有自己的
    value accessor 时才启用)。number / date / time 等浏览器自己过滤输入的
    类型,顺序直接从策略 2 开始。实例 setter 只在回滚后才开,是为了避免在 React 页面上
    直接写入 _valueTracker 导致 onChange 静默不触发——修好一个场景却把另一个场景
    变得更隐蔽。

  3. 写后回读是新的判定标准(AGENTS.md 第 7 条「Success is evidence, not a status code」
    终于在输入注入上落地)。每次尝试后:最多等 ~400ms 让掩码库 / 异步校验回写稳定;
    用五种 verdict 判定:committed / formatted(掩码加了分隔符)/ reverted /
    partial / empty;对 input / textarea 额外 blur 一次再读,兼容只在失焦时校验的
    老表单;返回第一个 committed / formatted 的策略,否则抛带中文可行动原因的
    execution_failed。beforeinput 被 preventDefault() 不立即判失败——ProseMirror
    就是取消默认后自己落地文本,先回读再决定是否真的被拒绝。

  4. 富文本编辑器恢复可用。contenteditable 现在不再用 textContent 重建,
    和普通 input 一样走命令路径,编辑器 model 保持完整,注入后退格 / 粘贴 / 重做继续工作。

  5. select 与 submit 诚实化。select_option 现在会 focus + 派发事件 + 回读
    select.value,页面在 change 里立即改回原值(常见于联动校验)时返回
    committed: false;submitForm 在 requestSubmit() 前先 form.checkValidity(),
    校验不通过时返回 submitted: false + 首个无效字段的 validationMessage...

Read more