mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-30 21:49:18 +01:00
feat(agents): persist personas and render cached avatar URLs
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
4042eb1c48
commit
f5cd8de1b3
65 files changed
+49857
-19
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import fs from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
const css = fs.readFileSync(new URL("../ui/src/index.css", import.meta.url), "utf8");
|
||||
const values = {};
|
||||
for (const [, name, channel, color] of css.matchAll(/--agent-cap-v1-([a-z-]+)-(a|b):\s*(#[0-9a-f]{6});/g)) {
|
||||
(values[name] ??= {})[channel] = color;
|
||||
}
|
||||
if (Object.keys(values).length !== 18 || Object.values(values).some(v => !v.a || !v.b)) throw new Error("Incomplete cap-v1 palette tokens");
|
||||
const output = "// Generated from ui/src/index.css by scripts/sync-agent-palette-tokens.mjs.\nexport const CAP_V1_COLORS = " + JSON.stringify(values, null, 2) + " as const;\n";
|
||||
const target = new URL("../packages/shared/src/cliplab/palette-tokens.ts", import.meta.url);
|
||||
if (process.argv.includes("--check")) {
|
||||
if (fs.readFileSync(target, "utf8") !== output) throw new Error("Run node scripts/sync-agent-palette-tokens.mjs");
|
||||
} else fs.writeFileSync(target, output);
|
||||
Reference in new issue
Block a user