popeye-cli 2.2.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/dist/adapters/gemini.d.ts +14 -0
  2. package/dist/adapters/gemini.d.ts.map +1 -1
  3. package/dist/adapters/gemini.js +41 -6
  4. package/dist/adapters/gemini.js.map +1 -1
  5. package/dist/adapters/grok.d.ts +14 -0
  6. package/dist/adapters/grok.d.ts.map +1 -1
  7. package/dist/adapters/grok.js +42 -6
  8. package/dist/adapters/grok.js.map +1 -1
  9. package/dist/adapters/openai.d.ts +10 -0
  10. package/dist/adapters/openai.d.ts.map +1 -1
  11. package/dist/adapters/openai.js +44 -5
  12. package/dist/adapters/openai.js.map +1 -1
  13. package/dist/cli/commands/create.js +1 -1
  14. package/dist/cli/commands/create.js.map +1 -1
  15. package/dist/cli/interactive.d.ts.map +1 -1
  16. package/dist/cli/interactive.js +324 -20
  17. package/dist/cli/interactive.js.map +1 -1
  18. package/dist/generators/all.d.ts.map +1 -1
  19. package/dist/generators/all.js +3 -2
  20. package/dist/generators/all.js.map +1 -1
  21. package/dist/generators/doc-parser.d.ts +21 -6
  22. package/dist/generators/doc-parser.d.ts.map +1 -1
  23. package/dist/generators/doc-parser.js +55 -4
  24. package/dist/generators/doc-parser.js.map +1 -1
  25. package/dist/generators/templates/fullstack.js +1 -1
  26. package/dist/generators/templates/website-components.js +1 -1
  27. package/dist/generators/templates/website-components.js.map +1 -1
  28. package/dist/generators/templates/website-config.d.ts +4 -1
  29. package/dist/generators/templates/website-config.d.ts.map +1 -1
  30. package/dist/generators/templates/website-config.js +17 -11
  31. package/dist/generators/templates/website-config.js.map +1 -1
  32. package/dist/generators/templates/website-conversion.js +1 -1
  33. package/dist/generators/templates/website-conversion.js.map +1 -1
  34. package/dist/generators/templates/website-landing.js +1 -1
  35. package/dist/generators/templates/website-landing.js.map +1 -1
  36. package/dist/generators/templates/website-layout.d.ts +36 -4
  37. package/dist/generators/templates/website-layout.d.ts.map +1 -1
  38. package/dist/generators/templates/website-layout.js +466 -23
  39. package/dist/generators/templates/website-layout.js.map +1 -1
  40. package/dist/generators/templates/website-pricing.js +1 -1
  41. package/dist/generators/templates/website-pricing.js.map +1 -1
  42. package/dist/generators/templates/website-sections.js +1 -1
  43. package/dist/generators/templates/website-sections.js.map +1 -1
  44. package/dist/generators/templates/website-seo.d.ts.map +1 -1
  45. package/dist/generators/templates/website-seo.js +4 -1
  46. package/dist/generators/templates/website-seo.js.map +1 -1
  47. package/dist/generators/templates/website.d.ts +1 -1
  48. package/dist/generators/templates/website.d.ts.map +1 -1
  49. package/dist/generators/templates/website.js +1 -1
  50. package/dist/generators/templates/website.js.map +1 -1
  51. package/dist/generators/website-content-ai.d.ts +52 -0
  52. package/dist/generators/website-content-ai.d.ts.map +1 -0
  53. package/dist/generators/website-content-ai.js +141 -0
  54. package/dist/generators/website-content-ai.js.map +1 -0
  55. package/dist/generators/website-content-scanner.d.ts +1 -1
  56. package/dist/generators/website-content-scanner.d.ts.map +1 -1
  57. package/dist/generators/website-content-scanner.js +98 -1
  58. package/dist/generators/website-content-scanner.js.map +1 -1
  59. package/dist/generators/website-context.d.ts +34 -1
  60. package/dist/generators/website-context.d.ts.map +1 -1
  61. package/dist/generators/website-context.js +131 -9
  62. package/dist/generators/website-context.js.map +1 -1
  63. package/dist/generators/website-debug.d.ts +12 -0
  64. package/dist/generators/website-debug.d.ts.map +1 -1
  65. package/dist/generators/website-debug.js +16 -0
  66. package/dist/generators/website-debug.js.map +1 -1
  67. package/dist/generators/website.d.ts.map +1 -1
  68. package/dist/generators/website.js +26 -4
  69. package/dist/generators/website.js.map +1 -1
  70. package/dist/pipeline/auto-recovery.d.ts +56 -0
  71. package/dist/pipeline/auto-recovery.d.ts.map +1 -0
  72. package/dist/pipeline/auto-recovery.js +185 -0
  73. package/dist/pipeline/auto-recovery.js.map +1 -0
  74. package/dist/pipeline/change-request.d.ts +39 -0
  75. package/dist/pipeline/change-request.d.ts.map +1 -1
  76. package/dist/pipeline/change-request.js +40 -1
  77. package/dist/pipeline/change-request.js.map +1 -1
  78. package/dist/pipeline/check-runner.d.ts +30 -1
  79. package/dist/pipeline/check-runner.d.ts.map +1 -1
  80. package/dist/pipeline/check-runner.js +122 -1
  81. package/dist/pipeline/check-runner.js.map +1 -1
  82. package/dist/pipeline/command-resolver.d.ts.map +1 -1
  83. package/dist/pipeline/command-resolver.js +33 -2
  84. package/dist/pipeline/command-resolver.js.map +1 -1
  85. package/dist/pipeline/consensus/arbitrator-query.d.ts +22 -0
  86. package/dist/pipeline/consensus/arbitrator-query.d.ts.map +1 -0
  87. package/dist/pipeline/consensus/arbitrator-query.js +70 -0
  88. package/dist/pipeline/consensus/arbitrator-query.js.map +1 -0
  89. package/dist/pipeline/consensus/consensus-runner.d.ts +131 -7
  90. package/dist/pipeline/consensus/consensus-runner.d.ts.map +1 -1
  91. package/dist/pipeline/consensus/consensus-runner.js +809 -35
  92. package/dist/pipeline/consensus/consensus-runner.js.map +1 -1
  93. package/dist/pipeline/cr-lifecycle.d.ts +42 -0
  94. package/dist/pipeline/cr-lifecycle.d.ts.map +1 -0
  95. package/dist/pipeline/cr-lifecycle.js +89 -0
  96. package/dist/pipeline/cr-lifecycle.js.map +1 -0
  97. package/dist/pipeline/gate-engine.d.ts +1 -0
  98. package/dist/pipeline/gate-engine.d.ts.map +1 -1
  99. package/dist/pipeline/gate-engine.js +26 -7
  100. package/dist/pipeline/gate-engine.js.map +1 -1
  101. package/dist/pipeline/orchestrator.d.ts +1 -1
  102. package/dist/pipeline/orchestrator.d.ts.map +1 -1
  103. package/dist/pipeline/orchestrator.js +306 -16
  104. package/dist/pipeline/orchestrator.js.map +1 -1
  105. package/dist/pipeline/packets/consensus-packet-builder.d.ts +15 -4
  106. package/dist/pipeline/packets/consensus-packet-builder.d.ts.map +1 -1
  107. package/dist/pipeline/packets/consensus-packet-builder.js +29 -17
  108. package/dist/pipeline/packets/consensus-packet-builder.js.map +1 -1
  109. package/dist/pipeline/phases/architecture.d.ts.map +1 -1
  110. package/dist/pipeline/phases/architecture.js +5 -3
  111. package/dist/pipeline/phases/architecture.js.map +1 -1
  112. package/dist/pipeline/phases/audit.d.ts.map +1 -1
  113. package/dist/pipeline/phases/audit.js +5 -3
  114. package/dist/pipeline/phases/audit.js.map +1 -1
  115. package/dist/pipeline/phases/consensus-architecture.d.ts.map +1 -1
  116. package/dist/pipeline/phases/consensus-architecture.js +10 -1
  117. package/dist/pipeline/phases/consensus-architecture.js.map +1 -1
  118. package/dist/pipeline/phases/consensus-master-plan.d.ts.map +1 -1
  119. package/dist/pipeline/phases/consensus-master-plan.js +10 -3
  120. package/dist/pipeline/phases/consensus-master-plan.js.map +1 -1
  121. package/dist/pipeline/phases/consensus-role-plans.d.ts.map +1 -1
  122. package/dist/pipeline/phases/consensus-role-plans.js +10 -1
  123. package/dist/pipeline/phases/consensus-role-plans.js.map +1 -1
  124. package/dist/pipeline/phases/done.d.ts.map +1 -1
  125. package/dist/pipeline/phases/done.js +9 -4
  126. package/dist/pipeline/phases/done.js.map +1 -1
  127. package/dist/pipeline/phases/intake.d.ts.map +1 -1
  128. package/dist/pipeline/phases/intake.js +7 -3
  129. package/dist/pipeline/phases/intake.js.map +1 -1
  130. package/dist/pipeline/phases/phase-context.d.ts +2 -0
  131. package/dist/pipeline/phases/phase-context.d.ts.map +1 -1
  132. package/dist/pipeline/phases/phase-context.js +3 -1
  133. package/dist/pipeline/phases/phase-context.js.map +1 -1
  134. package/dist/pipeline/phases/production-gate.d.ts.map +1 -1
  135. package/dist/pipeline/phases/production-gate.js +28 -3
  136. package/dist/pipeline/phases/production-gate.js.map +1 -1
  137. package/dist/pipeline/phases/qa-validation.d.ts.map +1 -1
  138. package/dist/pipeline/phases/qa-validation.js +38 -5
  139. package/dist/pipeline/phases/qa-validation.js.map +1 -1
  140. package/dist/pipeline/phases/recovery-loop.d.ts +2 -0
  141. package/dist/pipeline/phases/recovery-loop.d.ts.map +1 -1
  142. package/dist/pipeline/phases/recovery-loop.js +200 -6
  143. package/dist/pipeline/phases/recovery-loop.js.map +1 -1
  144. package/dist/pipeline/phases/review.d.ts.map +1 -1
  145. package/dist/pipeline/phases/review.js +58 -28
  146. package/dist/pipeline/phases/review.js.map +1 -1
  147. package/dist/pipeline/phases/role-planning.d.ts.map +1 -1
  148. package/dist/pipeline/phases/role-planning.js +18 -2
  149. package/dist/pipeline/phases/role-planning.js.map +1 -1
  150. package/dist/pipeline/phases/stuck.d.ts.map +1 -1
  151. package/dist/pipeline/phases/stuck.js +10 -0
  152. package/dist/pipeline/phases/stuck.js.map +1 -1
  153. package/dist/pipeline/repo-snapshot.d.ts.map +1 -1
  154. package/dist/pipeline/repo-snapshot.js +3 -0
  155. package/dist/pipeline/repo-snapshot.js.map +1 -1
  156. package/dist/pipeline/role-execution-adapter.d.ts +2 -1
  157. package/dist/pipeline/role-execution-adapter.d.ts.map +1 -1
  158. package/dist/pipeline/role-execution-adapter.js +22 -7
  159. package/dist/pipeline/role-execution-adapter.js.map +1 -1
  160. package/dist/pipeline/skill-loader.d.ts +19 -0
  161. package/dist/pipeline/skill-loader.d.ts.map +1 -1
  162. package/dist/pipeline/skill-loader.js +22 -0
  163. package/dist/pipeline/skill-loader.js.map +1 -1
  164. package/dist/pipeline/skills/coverage-gate.d.ts +44 -0
  165. package/dist/pipeline/skills/coverage-gate.d.ts.map +1 -0
  166. package/dist/pipeline/skills/coverage-gate.js +143 -0
  167. package/dist/pipeline/skills/coverage-gate.js.map +1 -0
  168. package/dist/pipeline/skills/usage-registry.d.ts +48 -0
  169. package/dist/pipeline/skills/usage-registry.d.ts.map +1 -0
  170. package/dist/pipeline/skills/usage-registry.js +55 -0
  171. package/dist/pipeline/skills/usage-registry.js.map +1 -0
  172. package/dist/pipeline/strategy-context.d.ts +20 -0
  173. package/dist/pipeline/strategy-context.d.ts.map +1 -0
  174. package/dist/pipeline/strategy-context.js +55 -0
  175. package/dist/pipeline/strategy-context.js.map +1 -0
  176. package/dist/pipeline/type-defs/artifacts.d.ts +25 -5
  177. package/dist/pipeline/type-defs/artifacts.d.ts.map +1 -1
  178. package/dist/pipeline/type-defs/artifacts.js +4 -0
  179. package/dist/pipeline/type-defs/artifacts.js.map +1 -1
  180. package/dist/pipeline/type-defs/audit.d.ts +25 -13
  181. package/dist/pipeline/type-defs/audit.d.ts.map +1 -1
  182. package/dist/pipeline/type-defs/checks.d.ts +18 -8
  183. package/dist/pipeline/type-defs/checks.d.ts.map +1 -1
  184. package/dist/pipeline/type-defs/checks.js +4 -0
  185. package/dist/pipeline/type-defs/checks.js.map +1 -1
  186. package/dist/pipeline/type-defs/packets.d.ts +104 -18
  187. package/dist/pipeline/type-defs/packets.d.ts.map +1 -1
  188. package/dist/pipeline/type-defs/packets.js +17 -1
  189. package/dist/pipeline/type-defs/packets.js.map +1 -1
  190. package/dist/pipeline/type-defs/state.d.ts +160 -16
  191. package/dist/pipeline/type-defs/state.d.ts.map +1 -1
  192. package/dist/pipeline/type-defs/state.js +26 -1
  193. package/dist/pipeline/type-defs/state.js.map +1 -1
  194. package/dist/shared/text-utils.d.ts +23 -0
  195. package/dist/shared/text-utils.d.ts.map +1 -0
  196. package/dist/shared/text-utils.js +66 -0
  197. package/dist/shared/text-utils.js.map +1 -0
  198. package/dist/shared/website-strategy-format.d.ts +18 -0
  199. package/dist/shared/website-strategy-format.d.ts.map +1 -0
  200. package/dist/shared/website-strategy-format.js +47 -0
  201. package/dist/shared/website-strategy-format.js.map +1 -0
  202. package/dist/state/index.d.ts +2 -0
  203. package/dist/state/index.d.ts.map +1 -1
  204. package/dist/state/index.js +57 -8
  205. package/dist/state/index.js.map +1 -1
  206. package/dist/types/consensus.d.ts +1 -0
  207. package/dist/types/consensus.d.ts.map +1 -1
  208. package/dist/types/consensus.js.map +1 -1
  209. package/dist/types/website-strategy.d.ts +1 -1
  210. package/dist/types/workflow.d.ts +447 -0
  211. package/dist/types/workflow.d.ts.map +1 -1
  212. package/dist/types/workflow.js +3 -0
  213. package/dist/types/workflow.js.map +1 -1
  214. package/dist/upgrade/handlers.d.ts.map +1 -1
  215. package/dist/upgrade/handlers.js +6 -3
  216. package/dist/upgrade/handlers.js.map +1 -1
  217. package/dist/workflow/consensus.d.ts.map +1 -1
  218. package/dist/workflow/consensus.js +1 -0
  219. package/dist/workflow/consensus.js.map +1 -1
  220. package/dist/workflow/website-strategy.d.ts.map +1 -1
  221. package/dist/workflow/website-strategy.js +2 -29
  222. package/dist/workflow/website-strategy.js.map +1 -1
  223. package/dist/workflow/website-updater.d.ts.map +1 -1
  224. package/dist/workflow/website-updater.js +3 -2
  225. package/dist/workflow/website-updater.js.map +1 -1
  226. package/package.json +1 -1
  227. package/src/adapters/gemini.ts +51 -6
  228. package/src/adapters/grok.ts +51 -6
  229. package/src/adapters/openai.ts +53 -5
  230. package/src/cli/commands/create.ts +1 -1
  231. package/src/cli/interactive.ts +333 -19
  232. package/src/generators/all.ts +3 -2
  233. package/src/generators/doc-parser.ts +75 -15
  234. package/src/generators/templates/fullstack.ts +1 -1
  235. package/src/generators/templates/website-components.ts +1 -1
  236. package/src/generators/templates/website-config.ts +23 -11
  237. package/src/generators/templates/website-conversion.ts +1 -1
  238. package/src/generators/templates/website-landing.ts +1 -1
  239. package/src/generators/templates/website-layout.ts +491 -23
  240. package/src/generators/templates/website-pricing.ts +1 -1
  241. package/src/generators/templates/website-sections.ts +1 -1
  242. package/src/generators/templates/website-seo.ts +4 -1
  243. package/src/generators/templates/website.ts +3 -0
  244. package/src/generators/website-content-ai.ts +186 -0
  245. package/src/generators/website-content-scanner.ts +113 -1
  246. package/src/generators/website-context.ts +151 -12
  247. package/src/generators/website-debug.ts +26 -0
  248. package/src/generators/website.ts +28 -3
  249. package/src/pipeline/auto-recovery.ts +283 -0
  250. package/src/pipeline/change-request.ts +63 -1
  251. package/src/pipeline/check-runner.ts +141 -2
  252. package/src/pipeline/command-resolver.ts +34 -2
  253. package/src/pipeline/consensus/arbitrator-query.ts +101 -0
  254. package/src/pipeline/consensus/consensus-runner.ts +1099 -42
  255. package/src/pipeline/cr-lifecycle.ts +103 -0
  256. package/src/pipeline/gate-engine.ts +35 -7
  257. package/src/pipeline/orchestrator.ts +361 -16
  258. package/src/pipeline/packets/consensus-packet-builder.ts +44 -18
  259. package/src/pipeline/phases/architecture.ts +6 -3
  260. package/src/pipeline/phases/audit.ts +6 -3
  261. package/src/pipeline/phases/consensus-architecture.ts +10 -1
  262. package/src/pipeline/phases/consensus-master-plan.ts +10 -3
  263. package/src/pipeline/phases/consensus-role-plans.ts +10 -1
  264. package/src/pipeline/phases/done.ts +15 -4
  265. package/src/pipeline/phases/intake.ts +7 -3
  266. package/src/pipeline/phases/phase-context.ts +6 -1
  267. package/src/pipeline/phases/production-gate.ts +41 -3
  268. package/src/pipeline/phases/qa-validation.ts +51 -5
  269. package/src/pipeline/phases/recovery-loop.ts +229 -7
  270. package/src/pipeline/phases/review.ts +73 -30
  271. package/src/pipeline/phases/role-planning.ts +21 -2
  272. package/src/pipeline/phases/stuck.ts +10 -0
  273. package/src/pipeline/repo-snapshot.ts +3 -0
  274. package/src/pipeline/role-execution-adapter.ts +30 -4
  275. package/src/pipeline/skill-loader.ts +33 -0
  276. package/src/pipeline/skills/coverage-gate.ts +199 -0
  277. package/src/pipeline/skills/usage-registry.ts +87 -0
  278. package/src/pipeline/strategy-context.ts +60 -0
  279. package/src/pipeline/type-defs/artifacts.ts +4 -0
  280. package/src/pipeline/type-defs/checks.ts +4 -0
  281. package/src/pipeline/type-defs/packets.ts +18 -1
  282. package/src/pipeline/type-defs/state.ts +26 -1
  283. package/src/shared/text-utils.ts +70 -0
  284. package/src/shared/website-strategy-format.ts +56 -0
  285. package/src/state/index.ts +60 -8
  286. package/src/types/consensus.ts +1 -0
  287. package/src/types/workflow.ts +6 -0
  288. package/src/upgrade/handlers.ts +9 -3
  289. package/src/workflow/consensus.ts +1 -0
  290. package/src/workflow/website-strategy.ts +2 -36
  291. package/src/workflow/website-updater.ts +4 -2
  292. package/tests/adapters/gemini.test.ts +165 -0
  293. package/tests/adapters/grok.test.ts +137 -0
  294. package/tests/adapters/openai.test.ts +128 -0
  295. package/tests/generators/doc-parser.test.ts +88 -9
  296. package/tests/generators/quality-gate.test.ts +19 -3
  297. package/tests/generators/website-components.test.ts +34 -0
  298. package/tests/generators/website-content-ai.test.ts +308 -0
  299. package/tests/generators/website-content-scanner.test.ts +86 -0
  300. package/tests/generators/website-context.test.ts +3 -2
  301. package/tests/integration/smokestack-scaffold.test.ts +385 -0
  302. package/tests/pipeline/auto-recovery.test.ts +337 -0
  303. package/tests/pipeline/change-request.test.ts +70 -0
  304. package/tests/pipeline/command-resolver.test.ts +42 -0
  305. package/tests/pipeline/consensus/arbitrator-query.test.ts +107 -0
  306. package/tests/pipeline/consensus-runner.test.ts +1333 -10
  307. package/tests/pipeline/consensus-scoring.test.ts +602 -18
  308. package/tests/pipeline/gate-engine.test.ts +34 -0
  309. package/tests/pipeline/install-check.test.ts +261 -0
  310. package/tests/pipeline/orchestrator.test.ts +1506 -15
  311. package/tests/pipeline/packets/builders.test.ts +29 -6
  312. package/tests/pipeline/phases/role-planning.strategy.test.ts +204 -0
  313. package/tests/pipeline/pipeline-persistence.test.ts +230 -0
  314. package/tests/pipeline/recovery-loop-guidance.test.ts +280 -0
  315. package/tests/pipeline/role-execution-adapter.test.ts +88 -0
  316. package/tests/pipeline/skills/coverage-gate.test.ts +370 -0
  317. package/tests/pipeline/skills/usage-registry.test.ts +114 -0
  318. package/tests/pipeline/strategy-context.test.ts +148 -0
  319. package/tests/shared/text-utils.test.ts +155 -0
  320. package/tests/state/progress-analysis.test.ts +375 -0
  321. package/tests/upgrade/handlers.test.ts +33 -2
  322. package/tests/workflow/consensus.test.ts +6 -0
  323. package/tsconfig.json +1 -1
@@ -13,7 +13,7 @@ function escapeJsx(str: string): string {
13
13
  .replace(/\\/g, '\\\\')
14
14
  .replace(/'/g, "\\'")
15
15
  .replace(/`/g, '\\`')
16
- .replace(/\$/g, '\\$');
16
+ .replace(/\$(?=\{)/g, '\\$');
17
17
  }
18
18
 
19
19
  /**
@@ -209,6 +209,24 @@ export default function sitemap(): MetadataRoute.Sitemap {
209
209
  changeFrequency: 'daily',
210
210
  priority: 0.7,
211
211
  },
212
+ {
213
+ url: \`\${baseUrl}/contact\`,
214
+ lastModified: new Date(),
215
+ changeFrequency: 'monthly',
216
+ priority: 0.6,
217
+ },
218
+ {
219
+ url: \`\${baseUrl}/privacy\`,
220
+ lastModified: new Date(),
221
+ changeFrequency: 'yearly',
222
+ priority: 0.3,
223
+ },
224
+ {
225
+ url: \`\${baseUrl}/terms\`,
226
+ lastModified: new Date(),
227
+ changeFrequency: 'yearly',
228
+ priority: 0.3,
229
+ },
212
230
  ];
213
231
  }
214
232
  `;
@@ -391,52 +409,502 @@ describe('HomePage', () => {
391
409
  }
392
410
 
393
411
  /**
394
- * Generate docs page placeholder
412
+ * Generate documentation landing page with real content sections
413
+ *
414
+ * @param projectName - Project name for context
415
+ * @param context - Optional content context for product-aware copy
416
+ * @returns Documentation page source code
395
417
  */
396
- export function generateWebsiteDocsPage(): string {
418
+ export function generateWebsiteDocsPage(
419
+ projectName?: string,
420
+ context?: WebsiteContentContext
421
+ ): string {
422
+ const displayName = context?.productName || projectName
423
+ ?.split('-')
424
+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
425
+ .join(' ') || 'our platform';
426
+
427
+ const desc = context?.description || `Learn how to integrate ${displayName} into your projects`;
428
+
397
429
  return `import type { Metadata } from 'next';
430
+ import Header from '@/components/Header';
431
+ import Footer from '@/components/Footer';
398
432
 
399
433
  export const metadata: Metadata = {
400
434
  title: 'Documentation',
401
- description: 'Learn how to use our platform with comprehensive documentation.',
435
+ description: '${escapeJsx(desc)}.',
402
436
  };
403
437
 
438
+ const sections = [
439
+ {
440
+ title: 'Quick Start',
441
+ description:
442
+ 'Get ${escapeJsx(displayName)} running in your project in under five minutes. Install the SDK, configure your credentials, and make your first API call.',
443
+ code: \`npm install @${projectName ? escapeJsx(projectName) : 'my-project'}/sdk
444
+
445
+ import { createClient } from '@${projectName ? escapeJsx(projectName) : 'my-project'}/sdk';
446
+
447
+ const client = createClient({
448
+ apiKey: process.env.API_KEY,
449
+ });
450
+
451
+ const result = await client.run({ input: 'Hello' });
452
+ console.log(result);\`,
453
+ },
454
+ {
455
+ title: 'Core Concepts',
456
+ description:
457
+ '${escapeJsx(displayName)} is built around a small set of primitives that compose into powerful workflows. This section covers the data model, authentication, and the request lifecycle so you can design integrations with confidence.',
458
+ },
459
+ {
460
+ title: 'API Reference',
461
+ description:
462
+ 'The ${escapeJsx(displayName)} REST API provides endpoints for all platform operations. All endpoints require authentication via API key. Requests and responses use JSON. Rate limits and quotas depend on your subscription plan.',
463
+ },
464
+ {
465
+ title: 'SDK Integration',
466
+ description:
467
+ 'Official SDKs are available for popular languages and frameworks. Each SDK provides typed helpers, automatic retries, and idiomatic error handling so you can integrate ${escapeJsx(displayName)} without boilerplate.',
468
+ },
469
+ {
470
+ title: 'Deployment Guide',
471
+ description:
472
+ '${escapeJsx(displayName)} can be consumed as a managed cloud service or self-hosted in your own infrastructure. This guide covers both options including high-availability configurations, environment variables, and monitoring recommendations.',
473
+ },
474
+ ];
475
+
404
476
  export default function DocsPage() {
405
477
  return (
406
- <main className="py-20">
407
- <div className="container">
408
- <h1 className="text-4xl font-bold text-foreground">Documentation</h1>
409
- <p className="mt-4 text-lg text-muted-foreground">
410
- Documentation coming soon...
411
- </p>
412
- </div>
413
- </main>
478
+ <>
479
+ <Header />
480
+ <main className="py-20 sm:py-32">
481
+ <div className="container">
482
+ <div className="mx-auto max-w-3xl text-center">
483
+ <h1 className="text-4xl font-bold tracking-tight text-foreground sm:text-5xl">
484
+ Documentation
485
+ </h1>
486
+ <p className="mt-4 text-lg text-muted-foreground">
487
+ Everything you need to integrate ${escapeJsx(displayName)} into your projects.
488
+ </p>
489
+ </div>
490
+ <div className="mx-auto mt-16 max-w-3xl space-y-10">
491
+ {sections.map((section) => (
492
+ <div
493
+ key={section.title}
494
+ className="rounded-lg border border-border bg-card p-8"
495
+ >
496
+ <h2 className="text-2xl font-semibold text-foreground">
497
+ {section.title}
498
+ </h2>
499
+ <p className="mt-3 text-muted-foreground leading-7">
500
+ {section.description}
501
+ </p>
502
+ {section.code && (
503
+ <pre className="mt-6 overflow-x-auto rounded-md bg-foreground/5 p-4 text-sm leading-6">
504
+ <code>{section.code}</code>
505
+ </pre>
506
+ )}
507
+ </div>
508
+ ))}
509
+ </div>
510
+ </div>
511
+ </main>
512
+ <Footer />
513
+ </>
414
514
  );
415
515
  }
416
516
  `;
417
517
  }
418
518
 
419
519
  /**
420
- * Generate blog listing page placeholder
520
+ * Generate blog listing page with starter posts
521
+ *
522
+ * @param projectName - Project name for context
523
+ * @param context - Optional content context for product-aware copy
524
+ * @returns Blog page source code
421
525
  */
422
- export function generateWebsiteBlogPage(): string {
526
+ export function generateWebsiteBlogPage(
527
+ projectName?: string,
528
+ context?: WebsiteContentContext
529
+ ): string {
530
+ const displayName = context?.productName || projectName
531
+ ?.split('-')
532
+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
533
+ .join(' ') || 'Our Platform';
534
+
535
+ const tagline = context?.tagline || context?.description || `the ${displayName} platform`;
536
+
423
537
  return `import type { Metadata } from 'next';
538
+ import Header from '@/components/Header';
539
+ import Footer from '@/components/Footer';
424
540
 
425
541
  export const metadata: Metadata = {
426
542
  title: 'Blog',
427
- description: 'Latest news, updates, and insights from our team.',
543
+ description: 'Latest news, updates, and insights from the ${escapeJsx(displayName)} team.',
428
544
  };
429
545
 
546
+ const posts = [
547
+ {
548
+ title: 'Introducing ${escapeJsx(displayName)}',
549
+ date: 'January 15, 2025',
550
+ author: '${escapeJsx(displayName)} Team',
551
+ excerpt:
552
+ 'We are excited to announce ${escapeJsx(displayName)}. We built this platform to address a real gap we saw in the market: ${escapeJsx(tagline)}. In this post we share the motivation behind the project, the core design decisions we made, and our roadmap for the months ahead.',
553
+ },
554
+ {
555
+ title: 'How ${escapeJsx(displayName)} Works Under the Hood',
556
+ date: 'February 5, 2025',
557
+ author: '${escapeJsx(displayName)} Team',
558
+ excerpt:
559
+ 'A deep dive into the architecture of ${escapeJsx(displayName)}. We cover the request lifecycle, how data flows through the system, the performance optimizations that keep latency low, and the security model that keeps your data safe. Whether you are evaluating the platform or already using it, this post will help you understand what happens behind the API.',
560
+ },
561
+ {
562
+ title: 'Getting Started with ${escapeJsx(displayName)}: A Practical Guide',
563
+ date: 'February 20, 2025',
564
+ author: '${escapeJsx(displayName)} Team',
565
+ excerpt:
566
+ 'A step-by-step walkthrough for new users. We cover account setup, creating your first project, integrating the SDK into your application, and deploying to production. By the end of this guide you will have a working integration and a solid understanding of the core workflows.',
567
+ },
568
+ ];
569
+
430
570
  export default function BlogPage() {
431
571
  return (
432
- <main className="py-20">
433
- <div className="container">
434
- <h1 className="text-4xl font-bold text-foreground">Blog</h1>
435
- <p className="mt-4 text-lg text-muted-foreground">
436
- Blog posts coming soon...
437
- </p>
438
- </div>
439
- </main>
572
+ <>
573
+ <Header />
574
+ <main className="py-20 sm:py-32">
575
+ <div className="container">
576
+ <div className="mx-auto max-w-3xl text-center">
577
+ <h1 className="text-4xl font-bold tracking-tight text-foreground sm:text-5xl">
578
+ Blog
579
+ </h1>
580
+ <p className="mt-4 text-lg text-muted-foreground">
581
+ News, insights, and technical deep dives from the ${escapeJsx(displayName)} team.
582
+ </p>
583
+ </div>
584
+ <div className="mx-auto mt-16 max-w-3xl space-y-12">
585
+ {posts.map((post) => (
586
+ <article
587
+ key={post.title}
588
+ className="rounded-lg border border-border bg-card p-8"
589
+ >
590
+ <div className="flex items-center gap-3 text-sm text-muted-foreground">
591
+ <time>{post.date}</time>
592
+ <span aria-hidden="true">&middot;</span>
593
+ <span>{post.author}</span>
594
+ </div>
595
+ <h2 className="mt-3 text-2xl font-semibold text-foreground">
596
+ {post.title}
597
+ </h2>
598
+ <p className="mt-4 text-muted-foreground leading-7">
599
+ {post.excerpt}
600
+ </p>
601
+ </article>
602
+ ))}
603
+ </div>
604
+ </div>
605
+ </main>
606
+ <Footer />
607
+ </>
608
+ );
609
+ }
610
+ `;
611
+ }
612
+
613
+ /**
614
+ * Generate contact page with ContactForm component
615
+ *
616
+ * @param projectName - Project name for context
617
+ * @param context - Optional content context for product-aware copy
618
+ * @returns Contact page source code
619
+ */
620
+ export function generateWebsiteContactPage(
621
+ projectName?: string,
622
+ context?: WebsiteContentContext
623
+ ): string {
624
+ const displayName = context?.productName || projectName
625
+ ?.split('-')
626
+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
627
+ .join(' ') || 'Our Platform';
628
+
629
+ return `import type { Metadata } from 'next';
630
+ import Header from '@/components/Header';
631
+ import Footer from '@/components/Footer';
632
+ import ContactForm from '@/components/ContactForm';
633
+
634
+ export const metadata: Metadata = {
635
+ title: 'Contact Us',
636
+ description: 'Get in touch with the ${escapeJsx(displayName)} team. We are here to help with questions, feedback, and enterprise inquiries.',
637
+ };
638
+
639
+ export default function ContactPage() {
640
+ return (
641
+ <>
642
+ <Header />
643
+ <main className="py-20 sm:py-32">
644
+ <div className="container">
645
+ <div className="mx-auto max-w-2xl text-center">
646
+ <h1 className="text-4xl font-bold tracking-tight text-foreground sm:text-5xl">
647
+ Contact Us
648
+ </h1>
649
+ <p className="mt-4 text-lg text-muted-foreground">
650
+ Have questions about ${escapeJsx(displayName)}? Our team is here to help.
651
+ </p>
652
+ </div>
653
+ <div className="mx-auto mt-16 grid max-w-4xl gap-12 lg:grid-cols-2">
654
+ <div>
655
+ <h2 className="text-2xl font-semibold text-foreground">Send us a message</h2>
656
+ <p className="mt-2 text-muted-foreground">
657
+ Fill out the form and we will get back to you within 24 hours.
658
+ </p>
659
+ <div className="mt-8">
660
+ <ContactForm />
661
+ </div>
662
+ </div>
663
+ <div>
664
+ <h2 className="text-2xl font-semibold text-foreground">Other ways to reach us</h2>
665
+ <div className="mt-6 space-y-6">
666
+ <div>
667
+ <h3 className="text-sm font-semibold text-foreground">Email</h3>
668
+ <p className="mt-1 text-muted-foreground">support@${projectName || 'example'}.com</p>
669
+ </div>
670
+ <div>
671
+ <h3 className="text-sm font-semibold text-foreground">Response Time</h3>
672
+ <p className="mt-1 text-muted-foreground">
673
+ We typically respond within one business day. Enterprise customers receive priority support.
674
+ </p>
675
+ </div>
676
+ <div>
677
+ <h3 className="text-sm font-semibold text-foreground">Enterprise Inquiries</h3>
678
+ <p className="mt-1 text-muted-foreground">
679
+ For custom deployments, dedicated support, and volume licensing, reach out to our enterprise team.
680
+ </p>
681
+ </div>
682
+ </div>
683
+ </div>
684
+ </div>
685
+ </div>
686
+ </main>
687
+ <Footer />
688
+ </>
689
+ );
690
+ }
691
+ `;
692
+ }
693
+
694
+ /**
695
+ * Generate privacy policy page
696
+ *
697
+ * @param projectName - Project name for context
698
+ * @param context - Optional content context for product-aware copy
699
+ * @returns Privacy policy page source code
700
+ */
701
+ export function generateWebsitePrivacyPage(
702
+ projectName?: string,
703
+ context?: WebsiteContentContext
704
+ ): string {
705
+ const displayName = context?.productName || projectName
706
+ ?.split('-')
707
+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
708
+ .join(' ') || 'Our Platform';
709
+
710
+ return `import type { Metadata } from 'next';
711
+ import Header from '@/components/Header';
712
+ import Footer from '@/components/Footer';
713
+
714
+ export const metadata: Metadata = {
715
+ title: 'Privacy Policy',
716
+ description: '${escapeJsx(displayName)} privacy policy. Learn how we collect, use, and protect your data.',
717
+ };
718
+
719
+ export default function PrivacyPage() {
720
+ return (
721
+ <>
722
+ <Header />
723
+ <main className="py-20 sm:py-32">
724
+ <div className="container">
725
+ <div className="mx-auto max-w-3xl">
726
+ <h1 className="text-4xl font-bold tracking-tight text-foreground sm:text-5xl">
727
+ Privacy Policy
728
+ </h1>
729
+ <p className="mt-4 text-sm text-muted-foreground">
730
+ Last updated: January 1, 2025
731
+ </p>
732
+
733
+ <div className="mt-12 space-y-10 text-muted-foreground leading-7">
734
+ <section>
735
+ <h2 className="text-xl font-semibold text-foreground">1. Information We Collect</h2>
736
+ <p className="mt-3">
737
+ ${escapeJsx(displayName)} collects information you provide directly when you create an account, use the platform, or contact our support team. This includes your name, email address, organization name, and billing information. We also collect usage data such as API call logs and system performance metrics to improve our services.
738
+ </p>
739
+ </section>
740
+
741
+ <section>
742
+ <h2 className="text-xl font-semibold text-foreground">2. How We Use Your Information</h2>
743
+ <p className="mt-3">
744
+ We use collected information to provide and maintain the ${escapeJsx(displayName)} platform, process transactions, send service-related communications, improve our features, and comply with legal obligations. We do not sell your personal information to third parties.
745
+ </p>
746
+ </section>
747
+
748
+ <section>
749
+ <h2 className="text-xl font-semibold text-foreground">3. Data Sharing</h2>
750
+ <p className="mt-3">
751
+ ${escapeJsx(displayName)} shares your information only with service providers who assist in operating our platform, when required by law, or with your explicit consent. All third-party providers are bound by data processing agreements that ensure the protection of your information.
752
+ </p>
753
+ </section>
754
+
755
+ <section>
756
+ <h2 className="text-xl font-semibold text-foreground">4. Data Security</h2>
757
+ <p className="mt-3">
758
+ We implement industry-standard security measures including encryption at rest and in transit, regular security audits, access controls, and monitoring to protect your information.
759
+ </p>
760
+ </section>
761
+
762
+ <section>
763
+ <h2 className="text-xl font-semibold text-foreground">5. Cookies and Tracking</h2>
764
+ <p className="mt-3">
765
+ ${escapeJsx(displayName)} uses essential cookies to maintain your session and preferences. We use analytics cookies to understand how our website and platform are used. You can manage cookie preferences through your browser settings.
766
+ </p>
767
+ </section>
768
+
769
+ <section>
770
+ <h2 className="text-xl font-semibold text-foreground">6. Your Rights</h2>
771
+ <p className="mt-3">
772
+ You have the right to access, correct, or delete your personal data. You can export your data at any time through your account settings. To exercise these rights, contact us at privacy@${projectName || 'example'}.com. We will respond within 30 days.
773
+ </p>
774
+ </section>
775
+
776
+ <section>
777
+ <h2 className="text-xl font-semibold text-foreground">7. Changes to This Policy</h2>
778
+ <p className="mt-3">
779
+ We may update this privacy policy from time to time. We will notify you of material changes by posting the updated policy on our website and updating the last-updated date. Continued use of ${escapeJsx(displayName)} after changes constitutes acceptance of the revised policy.
780
+ </p>
781
+ </section>
782
+
783
+ <section>
784
+ <h2 className="text-xl font-semibold text-foreground">8. Contact</h2>
785
+ <p className="mt-3">
786
+ For questions about this privacy policy or our data practices, contact us at privacy@${projectName || 'example'}.com.
787
+ </p>
788
+ </section>
789
+ </div>
790
+ </div>
791
+ </div>
792
+ </main>
793
+ <Footer />
794
+ </>
795
+ );
796
+ }
797
+ `;
798
+ }
799
+
800
+ /**
801
+ * Generate terms of service page
802
+ *
803
+ * @param projectName - Project name for context
804
+ * @param context - Optional content context for product-aware copy
805
+ * @returns Terms of service page source code
806
+ */
807
+ export function generateWebsiteTermsPage(
808
+ projectName?: string,
809
+ context?: WebsiteContentContext
810
+ ): string {
811
+ const displayName = context?.productName || projectName
812
+ ?.split('-')
813
+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
814
+ .join(' ') || 'Our Platform';
815
+
816
+ return `import type { Metadata } from 'next';
817
+ import Header from '@/components/Header';
818
+ import Footer from '@/components/Footer';
819
+
820
+ export const metadata: Metadata = {
821
+ title: 'Terms of Service',
822
+ description: '${escapeJsx(displayName)} terms of service. Read the terms governing use of our platform.',
823
+ };
824
+
825
+ export default function TermsPage() {
826
+ return (
827
+ <>
828
+ <Header />
829
+ <main className="py-20 sm:py-32">
830
+ <div className="container">
831
+ <div className="mx-auto max-w-3xl">
832
+ <h1 className="text-4xl font-bold tracking-tight text-foreground sm:text-5xl">
833
+ Terms of Service
834
+ </h1>
835
+ <p className="mt-4 text-sm text-muted-foreground">
836
+ Last updated: January 1, 2025
837
+ </p>
838
+
839
+ <div className="mt-12 space-y-10 text-muted-foreground leading-7">
840
+ <section>
841
+ <h2 className="text-xl font-semibold text-foreground">1. Acceptance of Terms</h2>
842
+ <p className="mt-3">
843
+ By accessing or using the ${escapeJsx(displayName)} platform, you agree to be bound by these Terms of Service. If you are using ${escapeJsx(displayName)} on behalf of an organization, you represent that you have authority to bind that organization to these terms.
844
+ </p>
845
+ </section>
846
+
847
+ <section>
848
+ <h2 className="text-xl font-semibold text-foreground">2. Service Description</h2>
849
+ <p className="mt-3">
850
+ ${escapeJsx(displayName)} provides a software platform accessible via APIs, SDKs, and a web dashboard. Service features and availability may vary by subscription plan.
851
+ </p>
852
+ </section>
853
+
854
+ <section>
855
+ <h2 className="text-xl font-semibold text-foreground">3. Accounts and Access</h2>
856
+ <p className="mt-3">
857
+ You are responsible for maintaining the confidentiality of your account credentials and for all activities under your account. You must provide accurate registration information and promptly update it if it changes.
858
+ </p>
859
+ </section>
860
+
861
+ <section>
862
+ <h2 className="text-xl font-semibold text-foreground">4. Acceptable Use</h2>
863
+ <p className="mt-3">
864
+ You agree not to use ${escapeJsx(displayName)} to violate any applicable law, infringe on intellectual property rights, transmit malicious code, attempt to gain unauthorized access to our systems, or interfere with the platform operation. We reserve the right to suspend accounts that violate these terms.
865
+ </p>
866
+ </section>
867
+
868
+ <section>
869
+ <h2 className="text-xl font-semibold text-foreground">5. Intellectual Property</h2>
870
+ <p className="mt-3">
871
+ ${escapeJsx(displayName)} and its licensors retain all rights to the platform, including software, documentation, and branding. Your subscription grants a limited, non-exclusive, non-transferable license to use the platform. You retain all rights to the data and configurations you create.
872
+ </p>
873
+ </section>
874
+
875
+ <section>
876
+ <h2 className="text-xl font-semibold text-foreground">6. Limitation of Liability</h2>
877
+ <p className="mt-3">
878
+ To the maximum extent permitted by law, ${escapeJsx(displayName)} shall not be liable for any indirect, incidental, special, consequential, or punitive damages arising from your use of the platform. Our total liability shall not exceed the fees paid by you in the twelve months preceding the claim.
879
+ </p>
880
+ </section>
881
+
882
+ <section>
883
+ <h2 className="text-xl font-semibold text-foreground">7. Termination</h2>
884
+ <p className="mt-3">
885
+ Either party may terminate the agreement at any time. You may cancel your subscription through your account settings. We may suspend or terminate access for violation of these terms. Upon termination, you may export your data within 30 days, after which it will be deleted.
886
+ </p>
887
+ </section>
888
+
889
+ <section>
890
+ <h2 className="text-xl font-semibold text-foreground">8. Governing Law</h2>
891
+ <p className="mt-3">
892
+ These terms shall be governed by and construed in accordance with the laws of the State of Delaware, United States, without regard to conflict of law principles.
893
+ </p>
894
+ </section>
895
+
896
+ <section>
897
+ <h2 className="text-xl font-semibold text-foreground">9. Contact</h2>
898
+ <p className="mt-3">
899
+ For questions about these terms, contact us at legal@${projectName || 'example'}.com.
900
+ </p>
901
+ </section>
902
+ </div>
903
+ </div>
904
+ </div>
905
+ </main>
906
+ <Footer />
907
+ </>
440
908
  );
441
909
  }
442
910
  `;
@@ -13,7 +13,7 @@ function escapeJsx(str: string): string {
13
13
  .replace(/\\/g, '\\\\')
14
14
  .replace(/'/g, "\\'")
15
15
  .replace(/`/g, '\\`')
16
- .replace(/\$/g, '\\$');
16
+ .replace(/\$(?=\{)/g, '\\$');
17
17
  }
18
18
 
19
19
  /**
@@ -15,7 +15,7 @@ function escapeJsx(str: string): string {
15
15
  .replace(/\\/g, '\\\\')
16
16
  .replace(/'/g, "\\'")
17
17
  .replace(/`/g, '\\`')
18
- .replace(/\$/g, '\\$');
18
+ .replace(/\$(?=\{)/g, '\\$');
19
19
  }
20
20
 
21
21
  /**
@@ -15,7 +15,7 @@ function escapeJsx(str: string): string {
15
15
  .replace(/\\/g, '\\\\')
16
16
  .replace(/'/g, "\\'")
17
17
  .replace(/`/g, '\\`')
18
- .replace(/\$/g, '\\$');
18
+ .replace(/\$(?=\{)/g, '\\$');
19
19
  }
20
20
 
21
21
  /**
@@ -111,6 +111,9 @@ export function generateEnhancedSitemap(
111
111
  { path: '/pricing', pageType: 'pricing' },
112
112
  { path: '/docs', pageType: 'docs' },
113
113
  { path: '/blog', pageType: 'blog' },
114
+ { path: '/contact', pageType: 'contact' },
115
+ { path: '/privacy', pageType: 'legal' },
116
+ { path: '/terms', pageType: 'legal' },
114
117
  ];
115
118
 
116
119
  const priorityMap: Record<string, number> = {
@@ -22,6 +22,9 @@ export {
22
22
  generateWebsiteTest,
23
23
  generateWebsiteDocsPage,
24
24
  generateWebsiteBlogPage,
25
+ generateWebsiteContactPage,
26
+ generateWebsitePrivacyPage,
27
+ generateWebsiteTermsPage,
25
28
  } from './website-layout.js';
26
29
 
27
30
  // Reusable section generators