* fix(browser): 使用系统登录态时保留 Agent 浏览器里装的扩展 每次重拍登录快照都会清空 Cindy-real Default 里除登录库外的全部内容, 连带删掉 Extensions、Secure Preferences 等扩展状态,导致 Agent 浏览器 每次启动扩展都消失。扩展状态改为归 Agent 浏览器所有、跨快照保留: 扩展目录、扩展的 IndexedDB,以及 Preferences 的 extensions 子树; 站点数据仍按原逻辑清理,来源的扩展状态不拷入。 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com> * fix(browser): 来源 Preferences 损坏时保留目标扩展状态,清理失败阻止快照 - 来源 Preferences 不是合法 JSON 对象时,目标已有可用 Preferences 就原样保留, 不再用损坏内容覆盖 Agent 浏览器的 extensions 子树。 - 枚举 Default 或网站 IndexedDB 失败时抛错让本次快照失败,与删除失败的既有 行为一致,避免旧网站数据被静默留下。 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com> * fix(browser): 保留扩展 SQLite 库时连同 WAL 与 journal 边车一起保留 Extension Cookies 等扩展 SQLite 库只按主文件名保留,崩溃后留下的 -wal / -shm / -journal 会被清掉,可能丢失已提交的扩展 cookie 或损坏数据库。保留名单中的扩展 状态现连同 SQLite 边车一起保留。 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com> * fix(browser): 来源缺少 Preferences 时同样保留目标文件 来源 Preferences 缺失时此前会跳过合并,随后发布阶段把目标 Preferences 删掉, 丢失 Agent 浏览器的 extensions 子树。缺失与损坏现走同一条保留目标的逻辑。 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com> * fix(browser): 按名字含 Extension 保留扩展存储,不再逐个枚举 逐个列名的白名单会漏掉 Chrome 的扩展存储(如 DNR Extension Rules),每补一个 又冒出下一个。Chrome 的 profile 级扩展存储都以 Extension 命名,改为按词匹配, SQLite 边车随名字一并命中;Secure Preferences 仍单独保留。 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com> --------- Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
@cindy/browser-control-runtime
Neutral, in-process browser-automation runtime for Cindy. Exposes a small,
stable contract (BrowserControlRuntime) that the cindy_browser MCP and the
desktop host drive — without depending on any upstream product API or surfacing
an upstream product name in product code.
Layout
src/
types.ts Public contract: BrowserControlRuntime / Request / Result
runtime.ts createBrowserControlRuntime() — drives the vendored
in-process route dispatcher behind the contract
unavailable.ts A safe "not configured" runtime
shim/ Hand-written replacements for the upstream plugin-sdk
surface the vendored core imports (see shim-spec)
_local/ Faithful ports of small self-contained upstream helpers
(errors, ports, redact, tmp-dir, browser-cdp, text-utils)
_generated/ GENERATED — DO NOT EDIT. Produced by sync.mjs:
extension/ vendored browser core (extensions/browser/src/**)
leaf/ vendored SSRF / security leaf closure (src/infra, src/security)
packages/ vendored net-policy + normalization-core
vendor/fs-safe/ vendored @openclaw/fs-safe dist (zero-dep, version-pinned)
__tests__/ runtime + SSRF contract tests
upstream/
MAINTAINING.md 维护者必读:三层架构 + 踩坑清单 + 上游同步 + 中性约束
browser-runtime.lock.json pinned commit + fs-safe version + content hash
vendor-manifest.txt the 133 core files
shim-spec.md exact named-export surface each shim must provide
STATUS.md 交付现状
BUILD-PLAN.md 历史设计笔记
改这块代码前先读
upstream/MAINTAINING.md—— 它记录了集成层(desktop host + cindy_browser MCP)以及所有踩过的坑与不变量。
Updating from upstream
pnpm sync:browser-runtime --ref=<commit-or-branch>
pnpm --filter @cindy/browser-control-runtime build # surfaces any shim gaps
pnpm --filter @cindy/browser-control-runtime test # contract + SSRF guard
_generated/** is regenerated wholesale; never hand-edit it. To change behavior,
edit sync.mjs (vendor set / import rewrite) or the hand-written src/shim/*.
Security note
The SSRF/path-containment decision logic is vendored upstream code, not
re-implemented. src/shim/ssrf-runtime.ts only re-implements the thin fetch
shell that composes those vendored primitives (isBlockedHostnameOrIp,
resolvePinnedHostnameWithPolicy, createPinnedDispatcher). The SSRF contract
tests assert the real teeth still block cloud-metadata and private IPs, so a
future sync that weakens them fails CI.