Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ export default defineConfig({
// widely consumed by AI agents.
starlightLlmsTxt({
projectName: 'Warp',
optionalLinks: [
{
label: 'Oz Agent API (OpenAPI spec)',
url: 'https://docs.warp.dev/openapi.yaml',
description: 'Machine-readable OpenAPI 3.0 specification for the Oz Agent API.',
},
],
// Excludes pages that cause a stack overflow in hast-util-to-text
// due to their size. The upstream plugin only applies `exclude` to
// llms-small.txt; our patch (patches/starlight-llms-txt+0.8.1.patch)
Expand Down
2 changes: 2 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ Disallow: /*?*ask=*
Content-Signal: ai-train=yes, search=yes, ai-input=yes

Sitemap: https://docs.warp.dev/sitemap-index.xml
Llms-Txt: https://docs.warp.dev/llms.txt
OpenAPI: https://docs.warp.dev/openapi.yaml
18 changes: 18 additions & 0 deletions src/pages/openapi.yaml.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { APIRoute } from 'astro';
import fs from 'node:fs';

export const prerender = true;

/**
* Serves the raw Oz Agent API OpenAPI spec at /openapi.yaml so LLMs, crawlers,
* and developer tooling can consume the machine-readable definition directly.
*
* The spec source of truth is `developers/agent-api-openapi.yaml` (same file
* that `src/pages/api.astro` reads at build time for the Scalar reference).
*/
export const GET: APIRoute = async () => {
const yaml = fs.readFileSync('developers/agent-api-openapi.yaml', 'utf-8');
return new Response(yaml, {
headers: { 'Content-Type': 'text/yaml; charset=utf-8' },
});
};
Loading