import {
  listPrompts
} from "./chunk-CAY57CKF.js";
import "./chunk-KOO5733S.js";

// src/tools/list-prompts.ts
async function handleListPrompts() {
  const prompts = await listPrompts();
  if (!Array.isArray(prompts) || prompts.length === 0) {
    return "No prompts found in this project.";
  }
  const lines = [];
  lines.push(`# Prompts (${prompts.length} total)
`);
  lines.push("| Handle | Name | Latest Version |");
  lines.push("|--------|------|----------------|");
  for (const p of prompts) {
    const handle = p.handle || p.id || "N/A";
    const name = p.name || "Untitled";
    const versionNum = p.latestVersionNumber ?? p.version;
    const version = versionNum != null ? `v${versionNum}` : "N/A";
    lines.push(`| ${handle} | ${name} | ${version} |`);
  }
  lines.push(
    "\n> Use `platform_get_prompt` with the handle or ID to see full prompt details."
  );
  return lines.join("\n");
}
export {
  handleListPrompts
};
//# sourceMappingURL=list-prompts-C7GR72XL.js.map