Skip to content

The fastest browser for AI agents to run browser automation, built for sharing your logged-in browser state with your AI agents, like Codex or Claude Code, without disturbing you. Zero cost, zero config.

969 B
Raw Blame
import { createHash } from "node:crypto";
import { readFile } from "node:fs/promises";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";

const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
const canonicalPath = join(packageRoot, "skill-body/SKILL.md");
const translationPath = join(
  packageRoot,
  "skill-body/workbench/SKILL.zh.v2.md",
);

let translation;
try {
  translation = await readFile(translationPath, "utf8");
} catch (error) {
  if (error?.code === "ENOENT") process.exit(0);
  throw error;
}

const canonical = await readFile(canonicalPath);
const actual = createHash("sha256").update(canonical).digest("hex");
const expected = translation.match(
  /<!-- source-skill-sha256: ([a-f0-9]{64}) -->/,
)?.[1];

if (expected !== actual) {
  throw new Error(
    `Local Chinese Skill is out of sync with ${canonicalPath}. ` +
      `Update the translation and set source-skill-sha256 to ${actual}.`,
  );
}