import { lstatSync, readFileSync, readdirSync, realpathSync } from "node:fs"; import { basename, join } from "node:path"; import { parse } from "yaml"; import { Persona, personaHash } from "./persona.js"; import { Template, templateHash } from "./template.js"; export interface RegistryEntry { name: string; version: number; hash: string; definition: TDefinition; path: string; } export interface PublishedRegistryRow { name: string; version: number; hash: string; referencedByRun: boolean; } export interface RegistrySeedPlan { inserts: RegistryEntry[]; missingReferenced: PublishedRegistryRow[]; missingUnreferenced: PublishedRegistryRow[]; unchanged: RegistryEntry[]; } export type RegistryKind = "persona" | "template"; export function loadPersonaFiles(directory: string): RegistryEntry[] { return loadVersionedYamlFiles(directory, Persona, personaHash); } export function loadTemplateFiles(directory: string): RegistryEntry