{"_id":"@agent-seo/core","_rev":"3-76fc7e9c5c94d468c910c8acd3d98363","name":"@agent-seo/core","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@agent-seo/core","version":"1.0.0","keywords":["seo","ai","llm","markdown","html-to-markdown","readability","llms-txt","agent","bot","crawler"],"license":"MIT","_id":"@agent-seo/core@1.0.0","maintainers":[{"name":"pontidev","email":"felipontiggia@gmail.com"}],"homepage":"https://github.com/pontiggia/agent-seo#readme","bugs":{"url":"https://github.com/pontiggia/agent-seo/issues"},"dist":{"shasum":"6f77d4a8c2ac867477885f930854c005cb71a880","tarball":"https://registry.npmjs.org/@agent-seo/core/-/core-1.0.0.tgz","fileCount":16,"integrity":"sha512-rdmWglV+UwO61hz7Oi5n4ajG8CZongicpJ6qrC8TQKbCmPfz7TAmeBUGy+jLb2gIxckwGhJf0ZhSy9gQPRTCaA==","signatures":[{"sig":"MEUCIHG7vPAunzsxLXE/lzD4/eagLjWqPjP08t4XBfKjoS+sAiEA7UWqU6LKFGk8QJmSub7CUV/dJyILdh9+3bHO7WdSrWg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":242218},"main":"dist/index.cjs","type":"module","_from":"file:agent-seo-core-1.0.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./edge":{"import":{"types":"./dist/edge.d.ts","default":"./dist/edge.js"},"require":{"types":"./dist/edge.d.cts","default":"./dist/edge.cjs"}}},"scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"pontidev","email":"felipontiggia@gmail.com"},"_resolved":"/private/var/folders/mk/mybmm3tj2c306r_kcz9bjr4h0000gn/T/fb2847d797ef3b91e5e39b2c0588f9e7/agent-seo-core-1.0.0.tgz","_integrity":"sha512-rdmWglV+UwO61hz7Oi5n4ajG8CZongicpJ6qrC8TQKbCmPfz7TAmeBUGy+jLb2gIxckwGhJf0ZhSy9gQPRTCaA==","repository":{"url":"git+https://github.com/pontiggia/agent-seo.git","type":"git","directory":"packages/core"},"_npmVersion":"10.9.4","description":"Core HTML-to-Markdown transformation engine for AI-readable websites","directories":{},"_nodeVersion":"22.21.0","dependencies":{"isbot":"^5.1.0","jsdom":"^26.0.0 || ^27.0.0 || ^28.0.0","turndown":"^7.2.0","lru-cache":"^11.0.0","turndown-plugin-gfm":"^1.0.2","@mozilla/readability":"^0.6.0"},"_hasShrinkwrap":false,"devDependencies":{"cheerio":"^1.0.0","@types/jsdom":"^27.0.0","@types/turndown":"^5.0.5"},"_npmOperationalInternal":{"tmp":"tmp/core_1.0.0_1771297463236_0.6242147847115809","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@agent-seo/core","version":"1.0.1","keywords":["seo","ai","llm","markdown","html-to-markdown","readability","llms-txt","agent","bot","crawler"],"license":"MIT","_id":"@agent-seo/core@1.0.1","maintainers":[{"name":"pontidev","email":"felipontiggia@gmail.com"}],"homepage":"https://github.com/pontiggia/agent-seo#readme","bugs":{"url":"https://github.com/pontiggia/agent-seo/issues"},"dist":{"shasum":"abe32e978a6012981d7effc69e4920498cbdd67a","tarball":"https://registry.npmjs.org/@agent-seo/core/-/core-1.0.1.tgz","fileCount":17,"integrity":"sha512-ySA5mOg7VGkh4SCTHE+RcTNHTPkmg22O9cByle5fcMNZJGj209XzuVnWbzqQY4dT3doB2goBlVPcb1tzwuQmlg==","signatures":[{"sig":"MEUCIQDMPdk6fi1Zh7YxSMCGYgAhyN0iHttlBugKpKbvvM1UZwIgYOa/EUlayxg2WQ7TFK/Fpjm45CuV9pdbzJ0z5DyU2+g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":244666},"main":"dist/index.cjs","type":"module","_from":"file:agent-seo-core-1.0.1.tgz","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./edge":{"import":{"types":"./dist/edge.d.ts","default":"./dist/edge.js"},"require":{"types":"./dist/edge.d.cts","default":"./dist/edge.cjs"}}},"scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"pontidev","email":"felipontiggia@gmail.com"},"_resolved":"/private/var/folders/mk/mybmm3tj2c306r_kcz9bjr4h0000gn/T/5d1f294410a3c14f6ab5029f24067916/agent-seo-core-1.0.1.tgz","_integrity":"sha512-ySA5mOg7VGkh4SCTHE+RcTNHTPkmg22O9cByle5fcMNZJGj209XzuVnWbzqQY4dT3doB2goBlVPcb1tzwuQmlg==","repository":{"url":"git+https://github.com/pontiggia/agent-seo.git","type":"git","directory":"packages/core"},"_npmVersion":"10.9.4","description":"Core HTML-to-Markdown transformation engine for AI-readable websites","directories":{},"_nodeVersion":"22.21.0","dependencies":{"isbot":"^5.1.0","jsdom":"^26.0.0 || ^27.0.0 || ^28.0.0","turndown":"^7.2.0","lru-cache":"^11.0.0","turndown-plugin-gfm":"^1.0.2","@mozilla/readability":"^0.6.0"},"_hasShrinkwrap":false,"devDependencies":{"cheerio":"^1.0.0","@types/jsdom":"^27.0.0","@types/turndown":"^5.0.5"},"_npmOperationalInternal":{"tmp":"tmp/core_1.0.1_1771297969289_0.4739366715972855","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@agent-seo/core","version":"1.0.2","description":"Core HTML-to-Markdown transformation engine for AI-readable websites","license":"MIT","repository":{"type":"git","url":"git+https://github.com/pontiggia/agent-seo.git","directory":"packages/core"},"homepage":"https://github.com/pontiggia/agent-seo#readme","bugs":{"url":"https://github.com/pontiggia/agent-seo/issues"},"keywords":["seo","ai","llm","markdown","html-to-markdown","readability","llms-txt","agent","bot","crawler"],"type":"module","engines":{"node":">=20.0.0"},"main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./edge":{"import":{"types":"./dist/edge.d.ts","default":"./dist/edge.js"},"require":{"types":"./dist/edge.d.cts","default":"./dist/edge.cjs"}}},"dependencies":{"@mozilla/readability":"^0.6.0","isbot":"^5.1.0","jsdom":"^26.1.0","lru-cache":"^11.0.0","turndown":"^7.2.0","turndown-plugin-gfm":"^1.0.2"},"devDependencies":{"@types/jsdom":"^27.0.0","@types/turndown":"^5.0.5","cheerio":"^1.0.0"},"scripts":{"build":"tsup","test":"vitest run","typecheck":"tsc --noEmit"},"_id":"@agent-seo/core@1.0.2","_integrity":"sha512-N3Il6ZaSeVCQFzEjhwX3eqk+O5oSE8suHwu3tlWLRlsRyXuRfG5cCimYbw5WDuNFYQFtQmDrRlhtTQu7OSOdug==","_resolved":"/private/var/folders/mk/mybmm3tj2c306r_kcz9bjr4h0000gn/T/c88cb0d408e6199d73d0d75c2f12407d/agent-seo-core-1.0.2.tgz","_from":"file:agent-seo-core-1.0.2.tgz","_nodeVersion":"22.21.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-N3Il6ZaSeVCQFzEjhwX3eqk+O5oSE8suHwu3tlWLRlsRyXuRfG5cCimYbw5WDuNFYQFtQmDrRlhtTQu7OSOdug==","shasum":"7b341bf179ba74534ab9d9f750f194bcce072792","tarball":"https://registry.npmjs.org/@agent-seo/core/-/core-1.0.2.tgz","fileCount":17,"unpackedSize":244644,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCFsY2Hp61DSfOLVz6Pt65VjOHCySkmhdbRqQlop1YG7QIhAM1x45oRzVXwjONpn7D/GxH3xfnUpvVX3/InGlBF3TIi"}]},"_npmUser":{"name":"pontidev","email":"felipontiggia@gmail.com"},"directories":{},"maintainers":[{"name":"pontidev","email":"felipontiggia@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_1.0.2_1771361135709_0.13410073268647604"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-17T03:04:23.175Z","modified":"2026-02-17T20:45:35.991Z","1.0.0":"2026-02-17T03:04:23.406Z","1.0.1":"2026-02-17T03:12:49.440Z","1.0.2":"2026-02-17T20:45:35.866Z"},"bugs":{"url":"https://github.com/pontiggia/agent-seo/issues"},"license":"MIT","homepage":"https://github.com/pontiggia/agent-seo#readme","keywords":["seo","ai","llm","markdown","html-to-markdown","readability","llms-txt","agent","bot","crawler"],"repository":{"type":"git","url":"git+https://github.com/pontiggia/agent-seo.git","directory":"packages/core"},"description":"Core HTML-to-Markdown transformation engine for AI-readable websites","maintainers":[{"name":"pontidev","email":"felipontiggia@gmail.com"}],"readme":"# @agent-seo/core\n\nFramework-agnostic HTML-to-Markdown transformation engine for AI-readable websites.\n\n## Install\n\n```bash\nnpm install @agent-seo/core\n```\n\n## What It Does\n\n- **Detects 19 AI bots** via User-Agent (GPTBot, ClaudeBot, PerplexityBot, etc.)\n- **Transforms HTML to Markdown** — Readability extracts content, Turndown converts to clean Markdown\n- **YAML frontmatter** — title, description, URL, lang, last-modified\n- **JSON-LD extraction** — structured data from `<script type=\"application/ld+json\">`\n- **Generates `/llms.txt`** — auto-discovers routes following the [llmstxt.org](https://llmstxt.org) spec\n- **LRU cache** — in-memory caching of transformed results\n\n## Usage\n\n### Transform HTML to Markdown\n\n```typescript\nimport { transform } from '@agent-seo/core';\n\nconst result = await transform('<html>...</html>', {\n  url: 'https://example.com/about',\n});\n\nconsole.log(result.markdown);\n// ---\n// title: \"About Us\"\n// description: \"Learn more about our company\"\n// url: \"https://example.com/about\"\n// ---\n// # About Us\n// ...\n```\n\n### Detect AI Bots\n\n```typescript\nimport { detectAgent, shouldServeMarkdown } from '@agent-seo/core';\n\nconst ctx = detectAgent(request.headers.get('user-agent'));\nif (ctx.isAIBot) {\n  console.log(ctx.bot.name);     // 'GPTBot'\n  console.log(ctx.bot.operator); // 'OpenAI'\n  console.log(ctx.bot.purpose);  // 'training'\n}\n\n// Or simply:\nif (shouldServeMarkdown(userAgent, acceptHeader)) {\n  // serve markdown\n}\n```\n\n### Generate llms.txt\n\n```typescript\nimport { generateLlmsTxt, discoverNextRoutes } from '@agent-seo/core';\n\nconst routes = discoverNextRoutes('/path/to/app');\nconst result = generateLlmsTxt({\n  siteName: 'My App',\n  siteDescription: 'A brief description for AI systems.',\n  baseUrl: 'https://myapp.com',\n}, routes);\n\nconsole.log(result.llmsTxt);\n```\n\n## Edge Runtime\n\nFor edge/Cloudflare Workers (no JSDOM), use the lightweight edge export:\n\n```typescript\nimport { detectAgent, shouldServeMarkdown } from '@agent-seo/core/edge';\n```\n\n## Framework Adapters\n\nUse the framework-specific packages for zero-config integration:\n\n- [`@agent-seo/next`](https://www.npmjs.com/package/@agent-seo/next) — Next.js\n- [`@agent-seo/express`](https://www.npmjs.com/package/@agent-seo/express) — Express\n- [`@agent-seo/fastify`](https://www.npmjs.com/package/@agent-seo/fastify) — Fastify\n- [`@agent-seo/hono`](https://www.npmjs.com/package/@agent-seo/hono) — Hono\n\n## License\n\nMIT\n","readmeFilename":"README.md"}