@lssm/lib.presentation-runtime-next
v4.0.1
Published
Next.js lane for contract-driven marketing SEO/LLMO: metadata, JSON-LD, sitemap, robots, and llms.txt/agents.json route handlers
Maintainers
Readme
@lssm/lib.presentation-runtime-next
Next.js lane for contract-driven marketing SEO / LLMO. It maps the
framework-neutral metadata produced by
@lssm/lib.presentation-runtime-core/marketing into Next.js primitives and
serves AI-discovery artifacts.
This is the only presentation-runtime package allowed to import next.
presentation-runtime-core and presentation-runtime-react stay Next-free.
Adapters
| Export | Purpose |
| ------ | ------- |
| toNextMetadata(meta, opts?) | NormalizedMetadata → Next Metadata (hreflang via negotiateLocale). |
| JsonLd, StructuredData, serializeJsonLd | JSON-LD <script> rendering from resolved schema.org shapes. |
| buildSitemap(blueprint, opts?) | AppBlueprintSpec.routes → MetadataRoute.Sitemap. |
| buildRobots(aiDiscovery, opts?) | AiDiscoveryConfig.crawlerPolicy → MetadataRoute.Robots. |
| createLlmoRouteHandlers(emitter, opts?) | /llms.txt, /llms-full.md, /agents.json route handlers with CDN cache headers. |
Usage
Page metadata + JSON-LD
// app/pricing/page.tsx
import type { Metadata } from 'next';
import { transformAppConfigSeo } from '@lssm/lib.presentation-runtime-core/marketing';
import { toNextMetadata, StructuredData } from '@lssm/lib.presentation-runtime-next';
import { resolvedAppConfig } from '@/app-config';
const normalized = transformAppConfigSeo(resolvedAppConfig, { routePath: '/pricing' });
export const metadata: Metadata = toNextMetadata(normalized);
export default function PricingPage() {
return (
<>
<StructuredData metadata={normalized} />
{/* … */}
</>
);
}sitemap + robots
// app/sitemap.ts
import { buildSitemap } from '@lssm/lib.presentation-runtime-next';
import { blueprint } from '@/app-config';
export default function sitemap() {
return buildSitemap(blueprint, { supportedLocales: ['en', 'fr'], defaultLocale: 'en' });
}
// app/robots.ts
import { buildRobots } from '@lssm/lib.presentation-runtime-next';
import { blueprint } from '@/app-config';
export default function robots() {
return buildRobots(blueprint.aiDiscovery, {
baseUrl: 'https://contractspec.dev',
sitemapUrl: 'https://contractspec.dev/sitemap.xml',
});
}LLMO route handlers (ISR + CDN cache)
// app/llms.txt/route.ts
import { createLlmoRouteHandlers } from '@lssm/lib.presentation-runtime-next';
import { llmoEmitter } from '@/app-config'; // @lssm/lib.content-gen LlmoEmitter
// Next.js segment config must be statically analyzable; keep this literal in the route file.
export const revalidate = 3600;
export const GET = createLlmoRouteHandlers(llmoEmitter).llmsTxt;The LlmoEmitter contract is declared structurally in ./llmo-routes so the
concrete @lssm/lib.content-gen emitter is injected by the app.
