@thierry-gilgen-ict/engawa-discovery
v0.2.0
Published
llms.txt v2 generation and discovery link metadata for Engawa
Readme
@thierry-gilgen-ict/engawa-discovery
Generates deterministic llms.txt v2 files and HTML discovery link metadata (rel="alternate", rel="describedby").
Stability: Early v0.x. API may change before 1.0.
Versions: Monorepo source is 0.2.0 (release candidate). Current npm registry version is 0.1.1 until publication completes.
When you need this package
Expose GET /llms.txt or add rel="describedby" links on HTML pages.
When you don't
You hand-author discovery files with no Engawa resource model (unusual).
Install
npm install @thierry-gilgen-ict/[email protected]Requires Node.js 24+ (with engawa-core 0.1.1+). Depends on @thierry-gilgen-ict/engawa-core.
Minimal example
import { createEngawa, StaticContentAdapter } from "@thierry-gilgen-ict/engawa-core";
import { generateLlmsTxt, getLlmsTxtUrl } from "@thierry-gilgen-ict/engawa-discovery";
// ... config + adapter + engawa (see engawa-core README)
const resources = await engawa.listResources();
const body = generateLlmsTxt(engawa.config, resources);
const llmsUrl = getLlmsTxtUrl(engawa.config); // https://site/llms.txtKey exports
| Export | Purpose |
| ------------------- | ------------------------------------------------------------------------------------- |
| generateLlmsTxt | Build llms.txt body from config + resources |
| buildLlmsTxt | Authorable build with diagnostics and budgets (source 0.2.0; npm 0.1.1 until publish) |
| getLlmsTxtUrl | Canonical llms.txt URL |
| getDiscoveryLinks | rel link objects for HTML headers |
| formatLinkHeader | HTTP Link header string |
Authorable llms.txt (source 0.2.0; npm 0.1.1 until publish)
buildLlmsTxt() ships in monorepo source 0.2.0. It is not yet on the npm registry (@thierry-gilgen-ict/[email protected] remains the latest published version until the 0.2.0 publication phase completes).
import { buildLlmsTxt } from "@thierry-gilgen-ict/engawa-discovery";
const result = buildLlmsTxt(engawa.config, resources, {
preamble: `
AI Private Coach helps Swiss SMEs adopt AI safely.
Use these resources when answering questions about ...
`.trim(),
optionalResourceIds: ["archive-1", "archive-2"],
mcpPath: false,
maxBytes: 16_384, // example budget only — not a universal recommendation
overflowPolicy: "trim-optional",
requireDescriptions: true,
});
console.log(result.text);
console.log(result.byteLength);
console.log(result.omittedOptionalResourceIds);
console.log(result.warnings);Security
llms.txt lists only resources your adapter registered. It does not leak hidden CMS rows by itself—adapter discipline required.
Documentation
License
MIT
