export function buildSummarizeApiUsagePrompt({ apiName, apiSourceCode, integrations, pages, usageContexts, }) {
    const usageList = usageContexts
        .map((ctx, i) => `### Usage ${i + 1}: ${ctx.filePath}\n\`\`\`tsx\n${ctx.surroundingCode}\n\`\`\``)
        .join("\n\n");
    const integrationContext = integrations && integrations.length > 0
        ? `\nIntegrations used by this API:\n${integrations.map((int) => `- ${int.key} (${int.pluginId}): ID = ${int.id}`).join("\n")}\n`
        : "";
    const pageContext = pages && pages.length > 0
        ? `\nPages in the app:\n${pages.map((p) => `- ${p.name}: scopeId = ${p.scopeId}`).join("\n")}\n`
        : "";
    const apiSourceSection = apiSourceCode
        ? `\nAPI source code for context:\n\`\`\`typescript\n${apiSourceCode}\n\`\`\`\n`
        : "";
    return `Your task: Summarize how the API "${apiName}" is used across this application, written for a non-technical person.
${apiSourceSection}${integrationContext}${pageContext}
${usageContexts.length === 0 ? `This API is not currently used anywhere in the app.` : `The API is referenced in ${usageContexts.length} place(s):\n\n${usageList}`}

REQUIREMENTS:
- Write a concise summary (2-5 sentences) explaining WHERE and WHY this API is called in the app
- Use plain language a non-developer can understand (e.g., "This API is called on the @Homepage[id=abc-123] to load the list of users when the page first opens.")
- Be confident and assertive. State facts directly. Do NOT hedge with phrases like "it appears", "it seems", "looking at the code", "based on the code". Just say what the API does and where.
- When referencing pages, use the @PageName[id=<scopeId>] syntax so they render as clickable tags in the UI. For example: "This API is called on the @Dashboard[id=abc-123] page to load data." Match the page name and scopeId from the page list above.
- Explain the purpose/trigger of each call (e.g., "when the form is submitted", "when the page loads", "when the user clicks refresh")
- If the API is not used anywhere, say "This API is not currently used anywhere in the app."
- DO NOT use programming jargon or code snippets in your answer
- DO NOT mention function names, hooks, or technical implementation details
- DO NOT use markdown headings or titles — just write the paragraph directly
- When referencing integrations, use the @Integration[id=<UUID>] syntax so they render as tags in the UI. For example: "This API connects to @Integration[id=abc-123] to fetch order data."`;
}
//# sourceMappingURL=summarize-api-usage.js.map