{"_id":"@42a/ael-next","_rev":"2-464f9af1262d5f73888a36f50c04757e","name":"@42a/ael-next","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@42a/ael-next","version":"0.1.0","keywords":["nextjs","ael","llms.txt","mcp","ai-agents","42a"],"license":"GPL-2.0-or-later","_id":"@42a/ael-next@0.1.0","maintainers":[{"name":"sky42a","email":"sky@42a.ai"},{"name":"alon42a","email":"alon@42a.ai"}],"homepage":"https://www.42a.ai","dist":{"shasum":"79e5f47169933e121d57b442da1e620593735a3e","tarball":"https://registry.npmjs.org/@42a/ael-next/-/ael-next-0.1.0.tgz","fileCount":11,"integrity":"sha512-SID8Vluaa3VSoMjZ6bOzGqHVAws3HMJeGtyIS9P1MKdPM+IN24VM7BmMql+4/DabjtgE2QdS1URtbOaiQ3fRbA==","signatures":[{"sig":"MEYCIQDyrhiLFqE4N9xj184iFZChflBhHzEOO6xIrDACldTgQwIhAMaCj7t7B+GKuv00QBERZpSvLAHmaBCJPVDnTRGw+hQW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34254},"main":"./dist/index.js","type":"module","_from":"file:/tmp/claude-0/-home-user-mentiond/d63fdeb6-3136-5391-84b3-e681d884d1cb/scratchpad/pack/42a-ael-next-0.1.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=18.17"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./middleware":{"types":"./dist/middleware.d.ts","import":"./dist/middleware.js"},"./package.json":"./package.json"},"scripts":{"build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"sky42a","email":"sky@42a.ai"},"_resolved":"/tmp/claude-0/-home-user-mentiond/d63fdeb6-3136-5391-84b3-e681d884d1cb/scratchpad/pack/42a-ael-next-0.1.0.tgz","_integrity":"sha512-SID8Vluaa3VSoMjZ6bOzGqHVAws3HMJeGtyIS9P1MKdPM+IN24VM7BmMql+4/DabjtgE2QdS1URtbOaiQ3fRbA==","_npmVersion":"10.9.7","description":"Next.js (App Router) adapter for the 42a Agentic Enablement Layer: markdown page variants, llms.txt and an MCP server for your site in three small files.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","dependencies":{"@42a/ael":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"next":"14.2.25"},"peerDependencies":{"next":">=14"},"_npmOperationalInternal":{"tmp":"tmp/ael-next_0.1.0_1783861450142_0.6838642795655796","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@42a/ael-next","version":"0.1.1","description":"Next.js (App Router) adapter for the 42a Agentic Enablement Layer: markdown page variants, llms.txt and an MCP server for your site in three small files.","license":"Apache-2.0","homepage":"https://www.42a.ai","sideEffects":false,"publishConfig":{"access":"public"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./middleware":{"types":"./dist/middleware.d.ts","import":"./dist/middleware.js"},"./package.json":"./package.json"},"scripts":{"build":"tsup","typecheck":"tsc --noEmit"},"keywords":["nextjs","ael","llms.txt","mcp","ai-agents","42a"],"engines":{"node":">=18.17"},"dependencies":{"@42a/ael":"0.1.1"},"peerDependencies":{"next":">=14"},"devDependencies":{"next":"14.2.25"},"_id":"@42a/ael-next@0.1.1","_integrity":"sha512-Ooy/FK/cXwavqKzG17zd4I/7wOsHsv6GJvVIrrFLqXxZTNdg6j61pGPNbhAk2CE7KBhKUVS2FNDhZPIz51NBmg==","_resolved":"/tmp/claude-0/-home-user-mentiond/d63fdeb6-3136-5391-84b3-e681d884d1cb/scratchpad/pack/42a-ael-next-0.1.1.tgz","_from":"file:/tmp/claude-0/-home-user-mentiond/d63fdeb6-3136-5391-84b3-e681d884d1cb/scratchpad/pack/42a-ael-next-0.1.1.tgz","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-Ooy/FK/cXwavqKzG17zd4I/7wOsHsv6GJvVIrrFLqXxZTNdg6j61pGPNbhAk2CE7KBhKUVS2FNDhZPIz51NBmg==","shasum":"1c7238e6e3fe712567c219bb438aa0a16cc60851","tarball":"https://registry.npmjs.org/@42a/ael-next/-/ael-next-0.1.1.tgz","fileCount":11,"unpackedSize":27766,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCZ3qGbi0oxb8UCGsq7JC0y+6cEb7QumKzTSkpVgBmfMgIgHguc3waFKTMbN36Idgm6/dU52WpaJuWt2jqSnR/nwEU="}]},"_npmUser":{"name":"sky42a","email":"sky@42a.ai"},"directories":{},"maintainers":[{"name":"sky42a","email":"sky@42a.ai"},{"name":"alon42a","email":"alon@42a.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ael-next_0.1.1_1783863758686_0.7109498458527392"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-12T13:04:10.034Z","modified":"2026-07-12T13:42:38.975Z","0.1.0":"2026-07-12T13:04:10.294Z","0.1.1":"2026-07-12T13:42:38.846Z"},"license":"Apache-2.0","homepage":"https://www.42a.ai","keywords":["nextjs","ael","llms.txt","mcp","ai-agents","42a"],"description":"Next.js (App Router) adapter for the 42a Agentic Enablement Layer: markdown page variants, llms.txt and an MCP server for your site in three small files.","maintainers":[{"name":"sky42a","email":"sky@42a.ai"},{"name":"alon42a","email":"alon@42a.ai"}],"readme":"# @42a/ael-next\n\nNext.js (App Router) adapter for the [42a Agentic Enablement Layer](https://www.npmjs.com/package/@42a/ael): markdown page variants, `llms.txt`, and an on-site MCP server in three small files.\n\nRequires Next.js ≥ 14 with the App Router (Pages Router is not supported).\n\n## Install\n\n```bash\nnpm install @42a/ael @42a/ael-next\n```\n\n**1. `ael.config.ts`** (project root)\n\n```ts\nimport { defineAelConfig } from \"@42a/ael\";\n\nexport default defineAelConfig({\n  siteUrl: \"https://example.com\",\n});\n```\n\n**2. `middleware.ts`**\n\n```ts\nimport { createAelMiddleware, AEL_MATCHER } from \"@42a/ael-next/middleware\";\nimport aelConfig from \"./ael.config\";\n\nexport const middleware = createAelMiddleware(aelConfig);\nexport const config = { matcher: AEL_MATCHER };\n```\n\nAlready have middleware (Clerk, next-intl, …)? Compose instead:\n\n```ts\nimport { withAel } from \"@42a/ael-next/middleware\";\nexport const middleware = withAel(aelConfig, existingMiddleware);\n```\n\n**3. `app/api/ael/[[...path]]/route.ts`**\n\n```ts\nimport { createAelRouteHandlers } from \"@42a/ael-next\";\nimport aelConfig from \"../../../../ael.config\";\n\nexport const dynamic = \"force-dynamic\";\nexport const { GET, POST } = createAelRouteHandlers(aelConfig);\n```\n\nThat's it. The middleware rewrites `/llms.txt`, `/llms-full.txt`, `<path>.md`, `?format=markdown`, `Accept: text/markdown`, `/.well-known/mcp*`, and `POST /api/mcp` into the route handler, and adds a `Link: <…?format=markdown>; rel=\"alternate\"` header to your HTML pages so the markdown variants are discoverable — no layout edits.\n\nVerify with:\n\n```bash\nnpx @42a/ael doctor https://example.com\n```\n\n## Connect to 42a (optional)\n\n```bash\nnpx @42a/ael connect\n```\n\nMints a site token; add it as the `FORTYTWOA_SITE_TOKEN` environment variable and redeploy. Domain verification happens automatically via `/.well-known/42a.json`.\n\n## Notes\n\n- Runtime: Node by default; the core is edge-clean, so `export const runtime = \"edge\"` works too.\n- Caching: llms outputs get `s-maxage=43200` (12 h); converted markdown is cached in an in-memory KV per instance (pass `cache:` in the config for a persistent store).\n- Content: defaults to self-render (sitemap + own HTML). Pass a custom `provider` for CMS-backed sites — see the `@42a/ael` README.\n","readmeFilename":"README.md"}