import { resource } from "veryfront/resource";
import { defineSchema } from "veryfront/schemas";
const docsBySection: Record<string, string> = {
agents: "Agents accept messages, tools, context, and runtime options.",
tools: "Tools expose schema-backed callable capabilities.",
};
const docs = resource({
pattern: "docs/:section",
description: "API documentation",
paramsSchema: defineSchema((v) => v.object({ section: v.string() }))(),
load: ({ section }) => {
return { content: docsBySection[section] ?? "Section not found." };
},
});
const result = await docs.load({ section: "agents" });