Skip to content

OpenReel Video - Professional browser-based video editor. Open source CapCut alternative. 100% browser-based, no installation, no cloud uploads, no watermarks.

TypeScript
1.2 KB
Raw Blame
import { CAPABILITY_MANIFEST } from "@openreel/core/capabilities/manifest";
import { toCapabilityDoc, toolDefs } from "./registry";

/**
 * Renders the agent capability reference (tool catalog + capability manifest)
 * as Markdown. The source of truth is the tool registry, so this regenerates
 * docs/AGENT-CAPABILITIES.md without hand-maintenance.
 */
export function generateCapabilityMarkdown(): string {
  const count = toolDefs().length;
  return [
    "<!-- AUTO-GENERATED by @openreel/agent generateCapabilityMarkdown(). Do not edit by hand. -->",
    "",
    "# OpenReel Agent — Capability Reference",
    "",
    `The agent exposes **${count} tools** spanning read/observe, project, track, clip, transform, effect, color, speed, audio, subtitle, keyframe, transition, marker, text and graphics domains — plus \`execute_action\` and \`batch_actions\` escape hatches for any capability without a dedicated tool.`,
    "",
    "## Tools",
    "",
    toCapabilityDoc()
      .trim()
      .replace(/^#\s+OpenReel Agent Tools\n?/, ""),
    "",
    "## Capability manifest (enums + parameter ranges)",
    "",
    "```json",
    JSON.stringify(CAPABILITY_MANIFEST, null, 2),
    "```",
    "",
  ].join("\n");
}