{"_id":"@arraypress/llms-txt-astro","_rev":"4-5ec4be1c5c187a305b14920a18ddaa86","name":"@arraypress/llms-txt-astro","dist-tags":{"latest":"2.1.0"},"versions":{"1.0.0":{"name":"@arraypress/llms-txt-astro","version":"1.0.0","keywords":["astro","llms-txt","llmstxt","ai","llm","agents","discovery","withastro"],"author":{"name":"ArrayPress"},"license":"MIT","_id":"@arraypress/llms-txt-astro@1.0.0","maintainers":[{"name":"arraypress","email":"davidmichaelsherlock@icloud.com"}],"homepage":"https://github.com/arraypress/llms-txt-astro#readme","bugs":{"url":"https://github.com/arraypress/llms-txt-astro/issues"},"dist":{"shasum":"05f2b28389dfdb39bb3c8a4883a44242d841db54","tarball":"https://registry.npmjs.org/@arraypress/llms-txt-astro/-/llms-txt-astro-1.0.0.tgz","fileCount":6,"integrity":"sha512-Z2oFZ4K6rI5546P3Ew4kNWezXuOtWAxT+xYZ5i+QE8K1UTghhHFJ0y2GAkOmMS5DmQCWLk09oG7udXNBEMHwnw==","signatures":[{"sig":"MEUCIB0sGVlg6qvVGrUsmLjnPF7yawukCSlWllAVME5URvZlAiEAu3essCKsUZiiXpfBKQ96g7LAVRA6yhhd8v5z8gl27ik=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8741},"type":"module","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./src/index.ts","default":"./src/index.ts"},"./types":{"types":"./src/types.ts","default":"./src/types.ts"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"arraypress","email":"davidmichaelsherlock@icloud.com"},"repository":{"url":"git+https://github.com/arraypress/llms-txt-astro.git","type":"git"},"_npmVersion":"11.17.0","description":"Idiomatic /llms.txt route for Astro — resolves the site origin and serves the file. A thin wrapper over @arraypress/llms-txt.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"@arraypress/llms-txt":"^1.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"astro":"^7.0.3","vitest":"^4.1.9","typescript":"^6.0.3"},"peerDependencies":{"astro":"^6.0.0 || ^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/llms-txt-astro_1.0.0_1785612711922_0.4479033415624738","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@arraypress/llms-txt-astro","version":"1.1.0","keywords":["astro","llms-txt","llmstxt","ai","llm","agents","discovery","withastro"],"author":{"name":"ArrayPress"},"license":"MIT","_id":"@arraypress/llms-txt-astro@1.1.0","maintainers":[{"name":"arraypress","email":"davidmichaelsherlock@icloud.com"}],"homepage":"https://github.com/arraypress/llms-txt-astro#readme","bugs":{"url":"https://github.com/arraypress/llms-txt-astro/issues"},"dist":{"shasum":"1c5f519fdce1b1692e407ffbb2be9c0e38339450","tarball":"https://registry.npmjs.org/@arraypress/llms-txt-astro/-/llms-txt-astro-1.1.0.tgz","fileCount":6,"integrity":"sha512-6cwHshVynjvmRf3lFOqKpeDFLrbE1Bqf1v42xi72XWpOCNDtNRWdO4k6KkV692O4V6oTUdO6KZD7gYSSC/3SDg==","signatures":[{"sig":"MEQCIEpgHS3odPRLGa793zbQUvZB00hkr5QSTsKO4zXivf0tAiBMGB1jo9aFGUWUFuBF3Fvdn/FWHRp9ohbc2qu7Jb8GHg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9697},"type":"module","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./src/index.ts","default":"./src/index.ts"},"./types":{"types":"./src/types.ts","default":"./src/types.ts"},"./package.json":"./package.json"},"gitHead":"4db6124b8b3f85c000c0ecca62270c7042b18882","scripts":{"test":"vitest run","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"arraypress","email":"davidmichaelsherlock@icloud.com"},"repository":{"url":"git+https://github.com/arraypress/llms-txt-astro.git","type":"git"},"_npmVersion":"11.19.0","description":"Idiomatic /llms.txt route for Astro — resolves the site origin and serves the file. A thin wrapper over @arraypress/llms-txt.","directories":{},"_nodeVersion":"26.7.0","dependencies":{"@arraypress/llms-txt":"^1.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"astro":"^7.0.3","vitest":"^4.1.9","typescript":"^6.0.3"},"peerDependencies":{"astro":"^6.0.0 || ^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/llms-txt-astro_1.1.0_1787065688927_0.5113525367378264","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@arraypress/llms-txt-astro","version":"2.0.0","keywords":["astro","llms-txt","llmstxt","ai","llm","agents","discovery","withastro"],"author":{"name":"ArrayPress"},"license":"MIT","_id":"@arraypress/llms-txt-astro@2.0.0","maintainers":[{"name":"arraypress","email":"davidmichaelsherlock@icloud.com"}],"homepage":"https://github.com/arraypress/llms-txt-astro#readme","bugs":{"url":"https://github.com/arraypress/llms-txt-astro/issues"},"dist":{"shasum":"f6495e2972c2ea44ecb00f0f3d8d92f6b15b1910","tarball":"https://registry.npmjs.org/@arraypress/llms-txt-astro/-/llms-txt-astro-2.0.0.tgz","fileCount":8,"integrity":"sha512-vSk0pzKCn9LFCewqke5ZOQhVBcX6IzzxrAh5cwwIFgq2npkqIFvoqfObC9wjyWo+XKC/JirDhpVd/6M2z96tcA==","signatures":[{"sig":"MEYCIQDbgojp8LugrSrniM/CBYgI5rZ8Ukfk0eG3NxR5J0NVuAIhAIOjwjuypYmLPv3PUsMKqMHSXFF35A4GVwN4KqCcnVQ/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16754},"type":"module","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./src/index.ts","default":"./src/index.ts"},"./core":{"types":"./src/core.d.ts","default":"./src/core.js"},"./types":{"types":"./src/types.ts","default":"./src/types.ts"},"./package.json":"./package.json"},"gitHead":"159589ed723bff96d844f8fb55ff9039a66796ec","scripts":{"test":"vitest run","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"arraypress","email":"davidmichaelsherlock@icloud.com"},"repository":{"url":"git+https://github.com/arraypress/llms-txt-astro.git","type":"git"},"_npmVersion":"11.19.0","description":"/llms.txt for Astro — an idiomatic route helper plus the builder behind it. Generates and parses the llms.txt AI-discovery format. Zero dependencies.","directories":{},"_nodeVersion":"26.7.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"astro":"^7.0.3","vitest":"^4.1.9","typescript":"^6.0.3"},"peerDependencies":{"astro":"^6.0.0 || ^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/llms-txt-astro_2.0.0_1787131892185_0.4168175243339396","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@arraypress/llms-txt-astro","version":"2.1.0","description":"/llms.txt for Astro — an idiomatic route helper plus the builder behind it. Generates and parses the llms.txt AI-discovery format, with an llms-full.txt route and content-collection helpers. Zero dependencies.","type":"module","exports":{".":{"types":"./src/index.ts","default":"./src/index.ts"},"./types":{"types":"./src/types.ts","default":"./src/types.ts"},"./package.json":"./package.json","./core":{"types":"./src/core.d.ts","default":"./src/core.js"}},"keywords":["astro","llms-txt","llmstxt","ai","llm","agents","discovery","withastro"],"author":{"name":"ArrayPress"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/arraypress/llms-txt-astro.git"},"engines":{"node":">=18.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"peerDependencies":{"astro":"^6.0.0 || ^7.0.0"},"scripts":{"test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit"},"devDependencies":{"astro":"^7.0.3","typescript":"^6.0.3","vitest":"^4.1.9"},"gitHead":"1ad4f0fbc8c85ee574f2ab7aac2ed8fc0bd33c4e","_id":"@arraypress/llms-txt-astro@2.1.0","bugs":{"url":"https://github.com/arraypress/llms-txt-astro/issues"},"homepage":"https://github.com/arraypress/llms-txt-astro#readme","_nodeVersion":"26.8.1","_npmVersion":"11.19.0","dist":{"integrity":"sha512-rmylMR1HX9lZ26/NWWWje0VOu4LHZhUiBGzSHfPUeWBaPJqsHVqUrHdJot6Sd9A+o18vt1OgRsITA1BoWOJ8qw==","shasum":"193a7458bb40df888f1b87418690d64b0bd68a91","tarball":"https://registry.npmjs.org/@arraypress/llms-txt-astro/-/llms-txt-astro-2.1.0.tgz","fileCount":8,"unpackedSize":31648,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFJDUlrranrHrf9efPnxIuMPauDAmfz4n5MHivbxKxeYAiB/wYHcZqQNmlXyx4ID7iDiRxAkczaVl/+F54mS+cOqCQ=="}]},"_npmUser":{"name":"arraypress","email":"davidmichaelsherlock@icloud.com"},"directories":{},"maintainers":[{"name":"arraypress","email":"davidmichaelsherlock@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/llms-txt-astro_2.1.0_1788520044387_0.5499141797347542"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-01T19:31:51.717Z","modified":"2026-09-04T11:07:24.768Z","1.0.0":"2026-08-01T19:31:52.075Z","1.1.0":"2026-08-18T15:08:09.063Z","2.0.0":"2026-08-19T09:31:32.350Z","2.1.0":"2026-09-04T11:07:24.530Z"},"bugs":{"url":"https://github.com/arraypress/llms-txt-astro/issues"},"author":{"name":"ArrayPress"},"license":"MIT","homepage":"https://github.com/arraypress/llms-txt-astro#readme","keywords":["astro","llms-txt","llmstxt","ai","llm","agents","discovery","withastro"],"repository":{"type":"git","url":"git+https://github.com/arraypress/llms-txt-astro.git"},"description":"/llms.txt for Astro — an idiomatic route helper plus the builder behind it. Generates and parses the llms.txt AI-discovery format, with an llms-full.txt route and content-collection helpers. Zero dependencies.","maintainers":[{"name":"arraypress","email":"davidmichaelsherlock@icloud.com"}],"readme":"# @arraypress/llms-txt-astro\n\nAn idiomatic `/llms.txt` route for Astro, plus the `build()` generator behind it. Returns a `Response`, with the site origin resolved for you.\n\n## Install\n\n```bash\nnpm install @arraypress/llms-txt-astro\n```\n\n## Usage\n\nDrop a file at `src/pages/llms.txt.ts`. Astro serves it at `/llms.txt` and prerenders it with the rest of a static build.\n\n```ts\nimport { llmsTxtRoute } from '@arraypress/llms-txt-astro';\nimport { posts } from '../data/posts';\n\nexport const GET = llmsTxtRoute((origin) => ({\n  name: 'My Site',\n  description: 'What this site is, in one line.',\n  sections: [\n    {\n      title: 'Writing',\n      links: posts.map((p) => ({ label: p.title, url: `${origin}/${p.slug}` })),\n    },\n  ],\n}));\n```\n\nFor a file with no absolute URLs, pass the options directly:\n\n```ts\nexport const GET = llmsTxtRoute({ name: 'My Site', description: 'One line.' });\n```\n\n## API\n\n### `llmsTxtRoute(options)`\n\nReturns an Astro `APIRoute` serving `text/plain`.\n\n`options` is either a [`build()`](https://www.npmjs.com/package/@arraypress/llms-txt) options object, or a factory `(origin, context) => options` — sync or async. The factory form is the usual one, since the spec wants absolute URLs and the origin isn't known until the request.\n\n### `originOf(context)`\n\nThe resolved origin, no trailing slash. Prefers Astro's configured `site`; falls back to the request URL's origin when `site` is unset, so `astro dev` emits usable links instead of `undefined/…`. Exported because a page occasionally needs the same value.\n\n## Content collections\n\n`collectionSection()` turns a collection into a section of links, and\n`collectionDocuments()` turns it into full-text documents. Both take the\nentries — you call `getCollection` yourself, because `astro:content` is a\nvirtual module this package can't import without breaking its own build.\n\n```ts\n// src/pages/llms.txt.ts\nimport { llmsTxtRoute, collectionSection } from '@arraypress/llms-txt-astro';\nimport { getCollection } from 'astro:content';\n\nexport const GET = llmsTxtRoute(async (origin) => ({\n  name: 'Acme',\n  description: 'One line about Acme.',\n  sections: [\n    collectionSection(await getCollection('docs'), { title: 'Docs', origin, base: '/docs' }),\n  ],\n}));\n```\n\nDrafts (`data.draft === true`) are dropped, entries sort by `data.order` then\ntitle, and URLs lose their file extension and any trailing `/index`. Pass\n`filter`, `sort`, or a `link` / `document` override to change any of it — the\noverride receives the computed default, so you can spread it and adjust one\nfield.\n\n## /llms-full.txt\n\n`llms.txt` is an index — an agent still has to fetch every link. `llms-full.txt`\nis the corpus, and both are worth publishing:\n\n```ts\n// src/pages/llms-full.txt.ts\nimport { llmsFullTxtRoute, collectionDocuments } from '@arraypress/llms-txt-astro';\nimport { getCollection } from 'astro:content';\n\nexport const GET = llmsFullTxtRoute(async (origin) => ({\n  name: 'Acme',\n  documents: collectionDocuments(await getCollection('docs'), { origin, base: '/docs' }),\n}));\n```\n\n**On the format:** [llmstxt.org](https://llmstxt.org) specifies `llms.txt` and\nsays nothing about `llms-full.txt` — the name is a de-facto convention from\ndocumentation platforms. This package follows it (llms.txt's header, then each\ndocument under its own H1 with a `Source:` line, separated by `---`), but\nthere's no standard to conform to, and the tests are honest about that. The\n`llms.txt` output *is* checked against the real spec.\n\n## Why a separate package?\n\n`@arraypress/llms-txt` is zero-dependency and runs anywhere. This package adds the two things every Astro site otherwise reimplements — resolving `Astro.site` down to a bare origin, and wrapping the result in a `Response` — without pulling Astro into the core library.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}