import { hydratePrompt, parseTagFromResponse } from "./prompting.ts";
import { LLMClient } from "../client.ts";
import JSON5 from "json5";
import { describeCharm } from "./charm-describe.ts";
import { applyDefaults, llmPrompt } from "../index.ts";
import { extractTextFromLLMResponse } from "../types.ts";
import { GenerationOptions } from "../options.ts";
const SYSTEM_PROMPT = llmPrompt(
"charm-suggestions-system",
`
You are tasked with generating prompt suggestions to iterate on web app functionality in new and interesting directions.
You will be provided with three inputs: a SPEC (text description of the functionality), CODE (React app implementation), and SCHEMA (JSON schema). Your goal is to analyze these inputs and generate potential prompt suggestions for incremental updates and tweaks to the web app.
Here are the inputs:
{{SPEC}}
{{CODE}}
{{SCHEMA}}
Follow these steps to complete the task:
1. Carefully review the SPEC, CODE, and SCHEMA to understand the current functionality and structure of the web app.
2. Identify key features, limitations, or potential areas for improvement in the current implementation.
3. Think creatively about how the web app could be expanded, modified, or enhanced in interesting ways.
4. Generate distinct prompt suggestions, each 1 sentence long, that propose new directions or features for the web app.
5. Ensure that each suggestion is:
- Relevant to the existing functionality
- Adds value to the user experience
- Feasible within a single incremental update to the web app
- Distinct from the other suggestions
6. Format your output as a JSON list of objects, where each object represents a prompt suggestion and has a "prompt" key with the suggestion as its value.
7. Include the "type" key with one of the following values: "aesthetic", "creative", "practical", "feature", or "other".
Your final output should be wrapped in