1.1.73: open-source local-lab only; drop skills and knowledge base.

This commit is contained in:
叫我小杨同学 committed 2026-10-23 15:55:53 +08:00
commit 2b6487c69c
95 files changed
+54050

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { sealSlot } from "../lib/table-key.js";
const root = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
const src = path.join(root, "lib", "default-prompt-inject.md");
const dest = path.join(root, "lib", "asset-table.js");
if (!fs.existsSync(src)) {
throw new Error(`missing local source: ${src}`);
}
const text = fs.readFileSync(src, "utf8");
if (!text.trim()) throw new Error("local source is empty");
const packed = sealSlot(text);
const chunk = (s, n = 96) => {
const out = [];
for (let i = 0; i < s.length; i += n) out.push(s.slice(i, i + n));
return out;
};
const out = `const SLOT_ROWS = ${JSON.stringify(chunk(packed.SLOT), null, 2)};
export const SLOT = SLOT_ROWS.join("");
export const MASK = ${JSON.stringify(packed.MASK)};
export const TAG = ${JSON.stringify(packed.TAG)};
export const IV = ${JSON.stringify(packed.IV)};
`;
fs.writeFileSync(dest, out, "utf8");
process.stdout.write(`wrote ${path.relative(root, dest)} bytes=${text.length}\n`);