mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-25 08:48:08 +02:00
docs: add agent setup prompt endpoint
This commit is contained in:
parent
b42f418adc
commit
df0dde02e4
5 changed files with 238 additions and 1 deletions
|
|
@ -3,6 +3,11 @@ import {
|
|||
getLlmDocsPages,
|
||||
getPageMarkdown,
|
||||
} from "@/lib/llm-docs";
|
||||
import {
|
||||
agentSetupSlug,
|
||||
isAgentSetupSlug,
|
||||
readAgentSetupMarkdown,
|
||||
} from "@/lib/agent-setup-markdown";
|
||||
|
||||
export const dynamic = "force-static";
|
||||
|
||||
|
|
@ -11,6 +16,14 @@ export async function GET(
|
|||
props: { params: Promise<{ slug?: string[] }> },
|
||||
) {
|
||||
const params = await props.params;
|
||||
if (isAgentSetupSlug(params.slug)) {
|
||||
return new Response(await readAgentSetupMarkdown(), {
|
||||
headers: {
|
||||
"Content-Type": "text/markdown; charset=utf-8",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const page = getLlmDocsPage(params.slug);
|
||||
if (!page) {
|
||||
return new Response("Documentation page not found.\n", {
|
||||
|
|
@ -29,5 +42,8 @@ export async function GET(
|
|||
}
|
||||
|
||||
export function generateStaticParams() {
|
||||
return getLlmDocsPages().map((page) => ({ slug: page.slug }));
|
||||
return [
|
||||
...getLlmDocsPages().map((page) => ({ slug: page.slug })),
|
||||
{ slug: [...agentSetupSlug] },
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue