import type { OrganizationModel } from '..'
import { scaffoldKnowledgeNode } from './scaffoldKnowledgeNode'
import { scaffoldOntologyRecord } from './scaffoldOntologyRecord'
import { scaffoldResource } from './scaffoldResource'
import { scaffoldSystem } from './scaffoldSystem'
import type { OmScaffoldPlan, OmScaffoldSpec } from './types'

export function scaffoldOrganizationModel(model: OrganizationModel, spec: OmScaffoldSpec): OmScaffoldPlan {
  if (spec.intent === 'system') return scaffoldSystem(model, spec)
  if (spec.intent === 'ontology') return scaffoldOntologyRecord(model, spec)
  if (spec.intent === 'resource') return scaffoldResource(model, spec)
  return scaffoldKnowledgeNode(model, spec)
}

export * from './types'
export { scaffoldKnowledgeNode } from './scaffoldKnowledgeNode'
export { scaffoldOntologyRecord } from './scaffoldOntologyRecord'
export { scaffoldResource } from './scaffoldResource'
export { scaffoldSystem } from './scaffoldSystem'
