Skip to content

armgit / bla

Public Imported from GitHub
0

🛡️ BLA (Blind LLM Agents) — Adversarial defense shield that protects binaries, Electron apps, JS bundles, Python, and WebAssembly against AI reverse-engineering agents like REA. Poison -> Exhaust -> Hallucinate.

chore(site): add sync:site script to mirror website/ to qybaihe/bla-site

qybaihe98c01c992f8d
diff --git a/package.json b/package.json
index a4c8f23..52b8843 100644
--- a/package.json
+++ b/package.json
@@ -65,6 +65,7 @@
"typecheck": "tsc --noEmit",
"benchmark": "node dist/cli.js benchmark",
"version": "node scripts/sync-version.mjs && git add src/identity.ts",
+ "sync:site": "node scripts/sync-site.mjs",
"release:patch": "npm version patch -m 'chore(release): bla-agents v%s' && git push --follow-tags",
"release:minor": "npm version minor -m 'chore(release): bla-agents v%s' && git push --follow-tags",
"prepublishOnly": "npm run build && npm test"
diff --git a/scripts/sync-site.mjs b/scripts/sync-site.mjs
new file mode 100644
index 0000000..c1c660c
--- /dev/null
+++ b/scripts/sync-site.mjs
@@ -0,0 +1,40 @@
+#!/usr/bin/env node
+/**
+ * Syncs ./website/* from qybaihe/bla to https://github.com/qybaihe/bla-site
+ * Usage: npm run sync:site
+ */
+import { execSync } from "node:child_process";
+import fs from "node:fs";
+import os from "node:os";
+import path from "node:path";
+import { fileURLToPath } from "node:url";
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+const rootDir = path.resolve(__dirname, "..");
+const websiteDir = path.join(rootDir, "website");
+const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "bla-site-sync-"));
+
+try {
+ console.log("Cloning qybaihe/bla-site...");
+ execSync(`git clone --depth 1 https://github.com/qybaihe/bla-site.git "${tmpDir}"`, {
+ stdio: "inherit",
+ });
+
+ // Copy all files from website/ to tmpDir
+ fs.cpSync(websiteDir, tmpDir, { recursive: true, force: true });
+
+ const status = execSync("git status --porcelain", { cwd: tmpDir, encoding: "utf8" }).trim();
+ if (!status) {
+ console.log("qybaihe/bla-site is already up to date with ./website.");
+ } else {
+ execSync("git add -A", { cwd: tmpDir, stdio: "inherit" });
+ execSync('git commit -m "chore(site): sync website from qybaihe/bla"', {
+ cwd: tmpDir,
+ stdio: "inherit",
+ });
+ execSync("git push origin main", { cwd: tmpDir, stdio: "inherit" });
+ console.log("Successfully synced ./website to https://github.com/qybaihe/bla-site");
+ }
+} finally {
+ fs.rmSync(tmpDir, { recursive: true, force: true });
+}