Files
buzz/desktop/scripts/check-file-sizes.mjs
Will Pfleger 7cf61d55f9 feat: normalized config schema with PersonaRecord.provider and SPROUT_AGENT_MODEL
sprout-agent personas all failed because the desktop never injected
SPROUT_AGENT_PROVIDER or model env vars at spawn time, and the goose
config fallback only understood the old flat format. Extract goose
config compat into an isolated submodule, add support for the newer
active_provider + nested providers format, and wire a normalized
config schema so Sprout injects the right env vars for any runtime.

Key changes:
- PersonaRecord.provider captures the LLM provider independently
- SPROUT_AGENT_MODEL works as a universal model fallback
- provider_env_var and model_env_var always injected at spawn time
- Pack import now stores resolved env vars (was always empty)
- runtime_env_vars() emits runtime-appropriate vars (SPROUT_AGENT_*
  vs GOOSE_*)
2026-06-08 11:31:51 -04:00

49 lines
1.4 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/managed_agents/nest.rs", 1420],
["src-tauri/src/managed_agents/runtime.rs", 1440],
["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", 1130],
]);
await runFileSizeCheck({
projectRoot,
rules,
overrides,
label: "Desktop",
scriptPath: "desktop/scripts/check-file-sizes.mjs",
});