import type { ApplogValue } from '../applog/datom-types.ts' import type { ISchemaAdapter, VMAttributeDef } from './types.ts' /** * Helper to create a simple schema adapter from a plain attribute list. * Useful for quick VM definitions or when you don't have a formal schema library. */ export function createAdapterFromAttributes>( config: { attributes: VMAttributeDef[] entityPrefix: string defaults?: Partial }, ): ISchemaAdapter { return { getAttributeDefs: () => config.attributes, getDefaults: () => (config.defaults ?? {}) as Partial, getEntityPrefix: () => config.entityPrefix, } } /** * Helper to build at-paths from attribute names and an entity prefix. */ export function buildAtPath(entityPrefix: string, attrName: string): string { return `${entityPrefix}/${attrName}` }