mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-15 07:04:01 -06:00
fada067277
* feat(browser): add zero-click extension bootstrap Pre-register deterministic path-derived extension IDs and install a strict native messaging host. Keep the popup and options UI minimal while removing the obsolete copilot and page-share flows. * fix(browser): satisfy native bootstrap CI guards * test(browser): isolate native bootstrap Chrome roots * test(browser): flush native bootstrap profile before status * test(browser): seed Linux native bootstrap identity * fix(browser): preserve native bootstrap upgrade safety Allow immutable root-owned package inputs while keeping mutable state, manifests, and launchers user-owned. Preserve all retired copilot keys whenever active or unrecognized recovery custody remains. * fix(browser): preserve pending copilot custody Retired cleanup now removes copilot state only when the durable registry is exactly empty. Any session, archive, malformed value, future shape, or read failure preserves every retired key. * fix(browser): guard native bootstrap upgrades Fail closed while retired copilot custody remains and make discard durable across partial failures. Require exact launcher-embedded origins and repair full launcher drift without accepting mismatched registrations. * fix(browser): remove stale layout export * chore(release): leave changelog to release flow
46 lines
1.9 KiB
TypeScript
46 lines
1.9 KiB
TypeScript
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const extensionDir = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
describe("simplified Chrome extension package", () => {
|
|
it("declares only relay, access, storage, watchdog, and native bootstrap permissions", () => {
|
|
const manifest = JSON.parse(fs.readFileSync(path.join(extensionDir, "manifest.json"), "utf8"));
|
|
|
|
expect(manifest.permissions).toEqual([
|
|
"debugger",
|
|
"tabs",
|
|
"tabGroups",
|
|
"storage",
|
|
"alarms",
|
|
"nativeMessaging",
|
|
]);
|
|
expect(manifest).not.toHaveProperty("commands");
|
|
expect(manifest.options_ui).toEqual({ page: "options.html", open_in_tab: true });
|
|
});
|
|
|
|
it("contains no copilot, page-share, or side-panel runtime", () => {
|
|
const files = fs
|
|
.readdirSync(extensionDir, { recursive: true, withFileTypes: true })
|
|
.filter((entry) => entry.isFile())
|
|
.map((entry) => path.join(entry.parentPath, entry.name).slice(extensionDir.length + 1))
|
|
.filter((entry) => !entry.endsWith(".test.ts"));
|
|
|
|
expect(files.join("\n")).not.toMatch(/copilot|page-share|sidepanel/iu);
|
|
});
|
|
|
|
it("ships redacted retired-custody recovery guidance", () => {
|
|
const options = fs.readFileSync(path.join(extensionDir, "options.html"), "utf8");
|
|
const popup = fs.readFileSync(path.join(extensionDir, "popup.js"), "utf8");
|
|
|
|
expect(options).toContain("Automation is paused to protect a pre-upgrade copilot session.");
|
|
expect(options).toContain("Confirm old runs are finished");
|
|
expect(options).toContain("Disconnect and disable automatic setup");
|
|
expect(options).toContain("Use local OpenClaw");
|
|
expect(popup).toContain("Automation paused; open Settings");
|
|
expect(options).not.toMatch(/copilotSessionRegistryV1|sessionId|sessionKey|deviceToken/u);
|
|
});
|
|
});
|