import React, { useMemo, useState, useEffect } from "react"; /* -------- Types (JS version via JSDoc) -------- */ /** @typedef {"web"|"code"|"retrieval"|"image"|"vision"} BuiltInTool */ const defaultConfig = { schemaVersion: "1.0", name: "Untitled Custom GPT", description: "", instructions: "You are a helpful assistant.", language: "en", persona: { writingTone: "friendly", emojiUse: "light", responseLength: "medium" }, builtInTools: ["web"], customActions: [], knowledge: { enabled: false, documents: [] }, memory: { enabled: false, scope: "user", dataRetentionDays: 180 }, safety: { jailbreakDefense: true, blockDisallowedContent: true, piiRedaction: false, customDisallowedPhrases: [] }, conversationStarters: [{ title: "What can you do?", prompt: "Give me a quick overview of your abilities." }], sampleQuestions: ["How do I get started?"], tags: ["starter"], createdAt: new Date().toISOString(), }; /* -------- Small UI atoms -------- */ function Label({ children }) { return ; } function TextArea({ label, value, onChange, rows = 6, placeholder }) { return (