import { loadPlanStore } from '../../core/plan.ts' /** * Get a single plan by ID. * * @example * import getPlan from 'kody:@kody/kody-factory/plans/get' * await getPlan({ id: 'plan_abc123' }) */ export default async function getPlan(input: { id: string }) { if (!input?.id) throw new Error('plans/get: id is required') const store = await loadPlanStore() const plan = store.plans[input.id] if (!plan) return { plan: null, found: false } return { plan, found: true } }