| 1 |
import { generatePage } from '@agent/workflows/content/components/PageContentShell'; |
| 2 |
|
| 3 |
export default async ({ pageDescription }) => { |
| 4 |
// Input validation |
| 5 |
if (!pageDescription || pageDescription.trim().length === 0) { |
| 6 |
throw new Error('Page description cannot be empty'); |
| 7 |
} |
| 8 |
// this should return the page data |
| 9 |
const data = await generatePage(pageDescription); |
| 10 |
|
| 11 |
if (!data?.id) { |
| 12 |
throw new Error('Page creation failed'); |
| 13 |
} |
| 14 |
|
| 15 |
return { postId: Number(data.id) }; |
| 16 |
}; |
| 17 |
|