docs: sync API and documentation coverage (#379)

* docs: sync API and docs coverage

* ci: pin pandoc for sandboxed conversions
This commit is contained in:
SnapOtter
2026-06-29 22:35:05 +08:00
committed by GitHub
parent fd6ebe77b5
commit 37dc0098ba
13 changed files with 5261 additions and 68 deletions
+4960 -45
View File
File diff suppressed because it is too large Load Diff
+14 -2
View File
@@ -2,6 +2,7 @@ import { readFileSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import scalarPlugin from "@scalar/fastify-api-reference";
import { SECTIONS, TOOLS, toolSection } from "@snapotter/shared";
import type { FastifyInstance } from "fastify";
import yaml from "js-yaml";
@@ -58,10 +59,21 @@ function generateLlmsTxt(spec: OpenAPISpec): string {
lines.push(`- ${tag.name} (${count} endpoints): ${tag.description || ""}`);
}
lines.push("");
lines.push("## Tools");
for (const section of SECTIONS) {
const tools = TOOLS.filter((tool) => toolSection(tool) === section.id);
lines.push(`- ${section.name} (${tools.length} tools)`);
for (const tool of tools) {
const mode = tool.executionHint === "long" ? "async" : "sync";
lines.push(` - ${tool.name} - ${tool.description} (${tool.id}, ${mode})`);
}
}
lines.push("");
lines.push("## Authentication");
lines.push("- Session token via `POST /api/auth/login` `Authorization: Bearer <token>`");
lines.push("- API key (prefixed `si_`) `Authorization: Bearer si_...`");
lines.push("- Session token via `POST /api/auth/login` -> `Authorization: Bearer <token>`");
lines.push("- API key (prefixed `si_`) -> `Authorization: Bearer si_...`");
return lines.join("\n");
}