Files
buzz/desktop/scripts/check-file-sizes.mjs
T
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7andWill Pfleger 45b0782011 feat(desktop): persona engram instantiation + fleet update + legacy sync gate
Write a mem/persona engram (kind:30174) when creating an agent from a
persona. The engram is NIP-44 encrypted under the agent-owner
conversation key with an HMAC-blinded d-tag, conforming to the existing
engram envelope contract. Content includes the persona snapshot plus
provenance (owner pubkey, kind:30175, slug, content SHA-256 digest).

Fleet update reconciles agent engrams against current persona content on
app launch and on persona save. Comparison is digest-based (not
timestamp) to handle clock skew and export/import round-trips. No agent
restart -- the live resolve path still reads the persona catalog at spawn;
the engram is provenance and future-proofing for when it becomes the
runtime source.

Gate the directory-backed team sync machinery (import_team_from_directory,
sync_team_from_dir, sync_team_personas) behind a legacy_team_sync feature
flag (default-enabled). Fleet update replaces sync_team_personas in the
launch sequence. The old code remains compilable for one release cycle as
a rollback path.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-06-10 11:13:08 -04:00

53 lines
1.6 KiB
JavaScript

import path from "node:path";
import { fileURLToPath } from "node:url";
import { runFileSizeCheck } from "../../scripts/check-file-sizes-core.mjs";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const projectRoot = path.resolve(__dirname, "..");
const MAX_LINES = 1000;
const rules = [
{ root: "src-tauri/src", extensions: new Set([".rs"]), maxLines: MAX_LINES },
{
root: "src/app",
extensions: new Set([".ts", ".tsx"]),
maxLines: MAX_LINES,
},
{
root: "src/features",
extensions: new Set([".ts", ".tsx"]),
maxLines: MAX_LINES,
},
{
root: "src/shared/api",
extensions: new Set([".ts", ".tsx"]),
maxLines: MAX_LINES,
},
];
// TEMP — these files exceed the 1000-line limit and are queued to be split.
// Do not add to this list; split the file instead. Remove each entry as its
// file is broken up. Tracked as a follow-up.
const overrides = new Map([
["src-tauri/src/commands/agents.rs", 1370],
["src-tauri/src/managed_agents/nest.rs", 1420],
["src-tauri/src/managed_agents/runtime.rs", 1465],
["src-tauri/src/managed_agents/personas.rs", 1080],
["src-tauri/src/managed_agents/persona_card.rs", 1050],
["src-tauri/src/huddle/tts.rs", 1364],
["src/shared/api/tauri.ts", 1196],
["src-tauri/src/nostr_convert.rs", 1116],
["src/shared/api/relayClientSession.ts", 1022],
["src-tauri/src/migration.rs", 1295],
["src-tauri/src/managed_agents/teams.rs", 1020],
]);
await runFileSizeCheck({
projectRoot,
rules,
overrides,
label: "Desktop",
scriptPath: "desktop/scripts/check-file-sizes.mjs",
});