@prompton-dev/indexer
v0.1.3
Published
Index Starlight content into Vectorize and KV for Prompton RAG
Readme
@prompton-dev/indexer
Turns a Starlight content directory into the index Prompton serves to its docs agent: heading-scoped chunks, a nav tree, and per-page markdown.
npm install @prompton-dev/indexerAs an Astro integration
Runs on astro:build:done and writes the index into your build output so the Worker's ASSETS
binding can serve it:
import { promptonIndexer } from "@prompton-dev/indexer/astro";
export default defineConfig({
integrations: [
promptonIndexer({ contentDir: "src/content/docs", outDir: ".prompton/index" }),
],
});As a CLI
npx prompton-index --content src/content/docs --out .prompton/index [--locale en]Output
.prompton/index/
manifest.json # generatedAt, pageCount, chunkCount, nav, pages
nav.json # NavItem[]
chunks.jsonl # one DocChunk per line
pages/<slug>.md # full page bodies (slashes in slugs become __)Markdown is split on #–### headings, each chunk keeping its headingPath for breadcrumbs and
deep links. Frontmatter draft: true pages and 404 are skipped.
Programmatic
import { indexDocs, collectDocs, chunkMarkdown, buildNav } from "@prompton-dev/indexer";
const manifest = await indexDocs({ contentDir, outDir, locale: "en" });License
MIT
