mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Move Chat System Prompt to AI Settings and add Shakespeare context
- Created src/lib/globalChatSystem.ts with comprehensive default prompt - Includes Shakespeare platform overview and architecture - Describes user interface and available actions - Lists helpful resource blog posts for user assistance - Moved Chat System Prompt setting from System Settings to AI Settings - Now under the "System Prompts" section in Advanced settings - Grouped with Project System Prompt for better organization - Updated GlobalChatProvider to use the new default prompt module - Added new translation keys for the reorganized UI: - systemPrompts, systemPromptsDescription - projectSystemPrompt, projectSystemPromptDescription - globalChatSystemPrompt, globalChatSystemPromptDescription - Removed redundant code from SystemSettings.tsx Resources included in the new default prompt: - AI model selection guide - Configuring AI providers - Using local AI models - Editing code in Shakespeare - Deploying and sharing projects - Importing existing projects - Version control with Git - Debugging tips - Better prompting techniques
This commit is contained in:
1 parent
5f76931941
commit
075495fe7c
6 files changed
+324
-78
No files matched your search
@@ -0,0 +1,147 @@
|
||||
<!DOCTYPE html><html lang="en" class="light"><head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="content-security-policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; frame-src 'self' https:; font-src 'self'; base-uri 'self'; manifest-src 'self'; connect-src 'self' blob: https: wss:; img-src 'self' data: blob: https:; media-src 'self' https:">
|
||||
<title>Shakespeare Resources - FAQ & Guides | Soapbox</title>
|
||||
<meta name="description" content="Complete resource hub for Shakespeare AI website builder. Find answers to frequently asked questions and explore tutorials on how to make the most of Shakespeare.">
|
||||
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="Shakespeare Resources - FAQ & Guides | Soapbox">
|
||||
<meta property="og:description" content="Complete resource hub for Shakespeare AI website builder. Find answers to frequently asked questions and explore tutorials on how to make the most of Shakespeare.">
|
||||
<meta property="og:image" content="https://soapbox.pub/assets/images/shakespeare-screenshots/resrouce-center.png">
|
||||
<meta property="og:url" content="https://soapbox.pub/shakespeare-resources">
|
||||
<meta property="og:site_name" content="Soapbox">
|
||||
|
||||
<!-- Twitter -->
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="Shakespeare Resources - FAQ & Guides | Soapbox">
|
||||
<meta name="twitter:description" content="Complete resource hub for Shakespeare AI website builder. Find answers to frequently asked questions and explore tutorials on how to make the most of Shakespeare.">
|
||||
<meta name="twitter:image" content="https://soapbox.pub/assets/images/shakespeare-screenshots/resrouce-center.png">
|
||||
|
||||
<!-- Additional meta tags -->
|
||||
<meta name="image" content="https://soapbox.pub/assets/images/shakespeare-screenshots/resrouce-center.png">
|
||||
<meta name="author" content="Soapbox Technology">
|
||||
<meta name="keywords" content="shakespeare resources, shakespeare faq, shakespeare blog, ai website builder help, shakespeare tutorials">
|
||||
<meta name="robots" content="index, follow">
|
||||
<meta name="language" content="English">
|
||||
<meta name="revisit-after" content="7 days">
|
||||
|
||||
<!-- Additional Open Graph tags -->
|
||||
<meta property="og:locale" content="en_US">
|
||||
<meta property="og:image:width" content="1200">
|
||||
<meta property="og:image:height" content="630">
|
||||
<meta property="og:image:type" content="image/jpeg">
|
||||
|
||||
<!-- Twitter specific -->
|
||||
<meta name="twitter:site" content="@soapbox_pub">
|
||||
<meta name="twitter:creator" content="@soapbox_pub">
|
||||
|
||||
<!-- Canonical URL -->
|
||||
<link rel="canonical" href="https://soapbox.pub/shakespeare-resources">
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="mask-icon" href="/favicon/safari-pinned-tab.svg" color="#0482d8">
|
||||
<link rel="shortcut icon" href="/favicon/favicon.ico">
|
||||
<meta name="msapplication-TileColor" content="#0482d8">
|
||||
<meta name="msapplication-config" content="/favicon/browserconfig.xml">
|
||||
<meta name="theme-color" content="#0482d8">
|
||||
<script type="module" crossorigin="" src="/assets/index-SKr11h0N.js"></script>
|
||||
<link rel="stylesheet" crossorigin="" href="/assets/index-Ck_Ce8d7.css">
|
||||
<script id="structured-data" type="application/ld+json">{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebPage",
|
||||
"name": "Shakespeare Resources - FAQ & Guides | Soapbox",
|
||||
"description": "Complete resource hub for Shakespeare AI website builder. Find answers to frequently asked questions and explore tutorials on how to make the most of Shakespeare.",
|
||||
"url": "https://soapbox.pub/shakespeare-resources",
|
||||
"image": "https://soapbox.pub/assets/images/shakespeare-screenshots/resrouce-center.png",
|
||||
"isPartOf": {
|
||||
"@type": "WebSite",
|
||||
"name": "Soapbox",
|
||||
"url": "https://soapbox.pub"
|
||||
}
|
||||
}</script></head>
|
||||
<body>
|
||||
<div id="root"><div role="region" aria-label="Notifications (F8)" tabindex="-1" style="pointer-events: none;"><ol tabindex="-1" class="fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]"></ol></div><div class="min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50"><nav class="border-b bg-white/80 backdrop-blur-sm sticky top-0 z-50"><div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"><div class="flex justify-between items-center h-16"><a class="flex items-center space-x-2" href="/"><img src="/logo.svg" alt="Soapbox Logo" width="32" height="32"><span class="font-display font-bold text-xl text-gray-900">Soapbox</span></a><div class="hidden md:flex items-center space-x-8"><a class="transition-colors text-gray-600 hover:text-azure" href="/">Home</a><a class="transition-colors text-gray-600 hover:text-azure" href="/tools">Tools</a><a class="transition-colors text-gray-600 hover:text-azure" href="/showcase">Showcase</a><a class="transition-colors text-gray-600 hover:text-azure" href="/about">About</a><a class="transition-colors text-gray-600 hover:text-azure" href="/blog">Blog</a><a class="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 h-9 rounded-md px-3 bg-blue-100 hover:bg-blue-200 text-blue-700 border border-blue-200 hover:border-blue-300 transition-all duration-200 flex items-center space-x-2" href="/tools/shakespeare"><span class="text-sm">🎭</span><span>Shakespeare</span></a></div><div class="md:hidden"><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground h-9 rounded-md p-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-menu h-6 w-6"><line x1="4" x2="20" y1="12" y2="12"></line><line x1="4" x2="20" y1="6" y2="6"></line><line x1="4" x2="20" y1="18" y2="18"></line></svg></button></div></div></div></nav><section class="pt-20 pb-16 px-4 sm:px-6 lg:px-8"><div class="max-w-7xl mx-auto text-center"><div class="space-y-6"><div class="inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 hover:bg-secondary/80 bg-purple-100 text-purple-700 border-purple-200">📚 Resource Hub</div><h1 class="text-5xl md:text-6xl font-display font-bold text-gray-900"><span class="text-purple-600">🎭 Shakespeare</span> Resources</h1><p class="text-xl text-gray-600 max-w-3xl mx-auto">Find answers to common questions and explore our latest guides.</p></div></div></section><section class="py-16 px-4 sm:px-6 lg:px-8 bg-gradient-to-br from-purple-50 to-blue-50"><div class="max-w-6xl mx-auto"><div class="text-center mb-12"><div class="flex items-center justify-center mb-4"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-play h-8 w-8 text-purple-600 mr-3"><polygon points="6 3 20 12 6 21 6 3"></polygon></svg><h2 class="text-4xl font-display font-bold text-gray-900">Video Tutorial Playlist</h2></div><p class="text-lg text-gray-600">Watch our complete video guide series to master Shakespeare</p></div><div class="mb-8"><div class="relative w-full aspect-video mb-8 max-w-5xl mx-auto"><iframe src="https://www.youtube.com/embed/videoseries?si=NoONPhl3VGl5cEOX&list=PLPVwsk16NNURX_8MJxm5luRZpGVoZ7Qba" title="Shakespeare Tutorial Playlist - Complete Guide Series" class="absolute inset-0 w-full h-full rounded-lg" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div></div><div class="text-center"><p class="text-gray-600 mb-4">This playlist includes step-by-step tutorials covering all major Shakespeare features</p><div class="flex flex-wrap justify-center gap-2"><div class="inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-purple-200 text-purple-700">🔄 Import Projects</div><div class="inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 foLine truncated
|
||||
#mc_embed_signup {
|
||||
background: transparent !important;
|
||||
clear: left;
|
||||
font: 14px Helvetica, Arial, sans-serif;
|
||||
width: 100% !important;
|
||||
}
|
||||
#mc_embed_signup h2 {
|
||||
display: none;
|
||||
}
|
||||
#mc_embed_signup .mc-field-group {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
#mc_embed_signup label {
|
||||
font-weight: 600;
|
||||
margin-bottom: 0.5rem;
|
||||
display: block;
|
||||
color: inherit;
|
||||
}
|
||||
#mc_embed_signup input[type="text"],
|
||||
#mc_embed_signup input[type="email"] {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 0.5rem;
|
||||
font-size: 14px;
|
||||
background: white;
|
||||
}
|
||||
#mc_embed_signup input.error {
|
||||
border-color: #ef4444 !important;
|
||||
}
|
||||
#mc_embed_signup .button {
|
||||
background: linear-gradient(to right, #8B5CF6, #3B82F6) !important;
|
||||
border: none !important;
|
||||
border-radius: 0.5rem !important;
|
||||
color: white !important;
|
||||
padding: 0.75rem 2rem !important;
|
||||
font-weight: 600 !important;
|
||||
cursor: pointer !important;
|
||||
width: 100% !important;
|
||||
margin-top: 1rem !important;
|
||||
}
|
||||
#mc_embed_signup .button:hover {
|
||||
background: linear-gradient(to right, #7C3AED, #2563EB) !important;
|
||||
}
|
||||
#mc_embed_signup .indicates-required {
|
||||
font-size: 12px;
|
||||
color: #6b7280;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
#mc_embed_signup .asterisk {
|
||||
color: #ef4444;
|
||||
}
|
||||
.dark #mc_embed_signup input[type="text"],
|
||||
.dark #mc_embed_signup input[type="email"] {
|
||||
background: #374151;
|
||||
border-color: #4b5563;
|
||||
color: white;
|
||||
}
|
||||
.dark #mc_embed_signup label {
|
||||
color: #f9fafb;
|
||||
}
|
||||
.dark #mc_embed_signup input.error {
|
||||
border-color: #ef4444 !important;
|
||||
}
|
||||
</style><div id="mc_embed_signup"><form action="https://pub.us7.list-manage.com/subscribe/post?u=f1f718a93795f42a604d558d8&id=f7271442a0&f_id=00ffa3e4f0" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank"><div id="mc_embed_signup_scroll"><div class="indicates-required"><span class="asterisk">*</span> indicates required</div><div class="mc-field-group"><label for="mce-NPUB">Nostr Public Key (npub) <span style="color: rgb(107, 114, 128); font-weight: normal;">(optional)</span></label><input type="text" name="NPUB" class="text " id="mce-NPUB" placeholder="npub1..." value=""></div><div class="mc-field-group"><label for="mce-EMAIL">Email Address <span class="asterisk">*</span></label><input type="email" name="EMAIL" class="required email" id="mce-EMAIL" required="" placeholder="[email protected]"></div><div hidden=""><input type="hidden" name="tags" value="8982394"></div><div id="mce-responses" class="clear"><div class="response" id="mce-error-response" style="display: none;"></div><div class="response" id="mce-success-response" style="display: none;"></div></div><div aria-hidden="true" style="position: absolute; left: -5000px;"><input type="text" name="b_f1f718a93795f42a604d558d8_f7271442a0" tabindex="-1"></div><div class="clear"><input type="submit" name="subscribe" id="mc-embedded-subscribe" class="button" value="Sign Up"></div></div></form></div><script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js"></script><script type="text/javascript">(function($) {
|
||||
window.fnames = new Array();
|
||||
window.ftypes = new Array();
|
||||
fnames[6]='NPUB';ftypes[6]='text';
|
||||
fnames[0]='EMAIL';ftypes[0]='email';
|
||||
fnames[1]='FNAME';ftypes[1]='text';
|
||||
fnames[2]='LNAME';ftypes[2]='text';
|
||||
fnames[3]='ADDRESS';ftypes[3]='address';
|
||||
fnames[4]='PHONE';ftypes[4]='phone';
|
||||
fnames[5]='BIRTHDAY';ftypes[5]='birthday';
|
||||
}(jQuery));
|
||||
var $mcj = jQuery.noConflict(true);</script></div></div></div></div></section><footer class="bg-gray-900 text-white py-16 px-4 sm:px-6 lg:px-8"><div class="max-w-7xl mx-auto"><div class="grid md:grid-cols-6 gap-8"><div class="md:col-span-2 space-y-6"><div class="space-y-4"><div class="flex items-center space-x-2"><img src="/logo.svg" alt="Soapbox Logo" width="32" height="32"><span class="font-display font-bold text-xl">Soapbox</span></div><p class="text-gray-400 max-w-md">Software for the next generation of social media.</p></div><div class="space-y-3"><h4 class="font-semibold text-sm uppercase tracking-wide">Stay Updated</h4><form class="space-y-2"><div class="flex gap-2"><div class="relative flex-1"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mail absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500 h-4 w-4"><rect width="20" height="16" x="2" y="4" rx="2"></rect><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"></path></svg><input type="email" class="flex h-10 w-full rounded-md border px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm pl-10 text-gray-900 placeholder:text-gray-500 bg-white border-gray-300" placeholder="Your email address" required="" value=""></div><button class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-primary text-primary-foreground hover:bg-primary/90 h-10 py-2 px-6" type="submit">Sign up</button></div></form><div class="pt-2"><button class="inline-flex items-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-transparent hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2 justify-between w-full" role="combobox" aria-expanded="false" type="button" aria-haspopup="dialog" aria-controls="radix-:rk:" data-state="closed"><div class="flex items-center gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-wifi h-4 w-4"><path d="M12 20h.01"></path><path d="M2 8.82a15 15 0 0 1 20 0"></path><path d="M5 12.859a10 10 0 0 1 14 0"></path><path d="M8.5 16.429a5 5 0 0 1 7 0"></path></svg><span class="truncate">Ditto</span></div><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevrons-up-down ml-2 h-4 w-4 shrink-0 opacity-50"><path d="m7 15 5 5 5-5"></path><path d="m7 9 5-5 5 5"></path></svg></button></div></div></div><div><h4 class="font-semibold mb-4">Tools</h4><ul class="space-y-2 text-gray-400"><li><a href="https://ditto.pub" class="hover:text-white transition-colors" target="_blank" rel="noopener noreferrer">Ditto</a></li><li><a href="https://mkstack.xyz" class="hover:text-white transition-colors" target="_blank" rel="noopener noreferrer">MKStack</a></li><li><a href="https://getstacks.dev" class="hover:text-white transition-colors" target="_blank" rel="noopener noreferrer">Stacks</a></li><li><a href="https://nostrbook.dev" class="hover:text-white transition-colors" target="_blank" rel="noopener noreferrer">Nostrbook</a></li><li><a href="https://nostrhub.io" class="hover:text-white transition-colors" target="_blank" rel="noopener noreferrer">NostrHub</a></li><li><a href="https://nostrify.dev" class="hover:text-white transition-colors" target="_blank" rel="noopener noreferrer">Nostrify</a></li></ul></div><div><h4 class="font-semibold mb-4">Communities</h4><ul class="space-y-2 text-gray-400"><li><a href="https://ditto.pub" class="hover:text-white transition-colors" target="_blank" rel="noopener noreferrer">Ditto.pub</a></li><li><a href="https://treasures.to" class="hover:text-white transition-colors" target="_blank" rel="noopener noreferrer">Treasures</a></li><li><a href="https://blobbi.pet" class="hover:text-white transition-colors" target="_blank" rel="noopener noreferrer">Blobbi</a></li><li><a href="https://bookstr.xyz" class="hover:text-white transition-colors" target="_bLine truncated
|
||||
|
||||
</body></html>
|
||||
@@ -7,16 +7,12 @@ import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { useLocalStorage } from '@/hooks/useLocalStorage';
|
||||
import { parseProviderModel } from '@/lib/parseProviderModel';
|
||||
import { createAIClient } from '@/lib/ai-client';
|
||||
import { defaultGlobalChatSystemPrompt } from '@/lib/globalChatSystem';
|
||||
|
||||
// Maximum context size in characters (approximately 50k tokens worth)
|
||||
// This leaves room for the system prompt and response
|
||||
const MAX_CONTEXT_CHARS = 150000;
|
||||
|
||||
// Default system prompt for global chat
|
||||
const DEFAULT_GLOBAL_CHAT_SYSTEM_PROMPT = `You are a helpful AI assistant. You're here to have a friendly conversation and help answer questions on any topic.
|
||||
|
||||
Keep your responses concise but informative. Be friendly and conversational.`;
|
||||
|
||||
interface GlobalChatProviderProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
@@ -102,7 +98,7 @@ export function GlobalChatProvider({ children }: GlobalChatProviderProps) {
|
||||
const client = createAIClient(provider, config.corsProxy, user?.signer);
|
||||
|
||||
// Build messages for API using captured current messages
|
||||
const systemPrompt = config.globalChatSystemPrompt || DEFAULT_GLOBAL_CHAT_SYSTEM_PROMPT;
|
||||
const systemPrompt = config.globalChatSystemPrompt || defaultGlobalChatSystemPrompt;
|
||||
|
||||
const apiMessages: OpenAI.Chat.Completions.ChatCompletionMessageParam[] = [
|
||||
{ role: 'system', content: systemPrompt },
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* Default system prompt for global chat.
|
||||
* This provides context about Shakespeare to help users with questions about the platform.
|
||||
*/
|
||||
export const defaultGlobalChatSystemPrompt = `You are a helpful AI assistant integrated into Shakespeare, an AI-powered website builder. You're here to have a friendly conversation and help answer questions on any topic.
|
||||
|
||||
Keep your responses concise but informative. Be friendly and conversational.
|
||||
|
||||
# Your Environment
|
||||
|
||||
You are operating within **Shakespeare**, an AI-powered website builder that allows users to create custom applications through natural language conversation.
|
||||
|
||||
Users can add or remove templates in Settings > AI.
|
||||
|
||||
## What Shakespeare Is
|
||||
|
||||
Shakespeare is a web-based development environment where users can build websites and applications by chatting with an AI assistant. The platform combines the power of AI-driven development with a user-friendly interface that requires no coding knowledge from the user.
|
||||
|
||||
**Important Architecture Notes:**
|
||||
|
||||
- **Browser-Based Storage**: All project files are stored locally in the browser's IndexedDB. If users clear browser data, they may lose their projects.
|
||||
- **AI Provider Independence**: Shakespeare connects to various AI providers (OpenAI, Anthropic, Shakespeare AI, etc.). Each provider has its own pricing and authentication.
|
||||
- **Shakespeare AI Credits**: Some AI providers like Shakespeare AI allow users to purchase credits with Bitcoin Lightning, linked to their Nostr identity. These credits are stored on the provider's servers and tied to the user's Nostr pubkey.
|
||||
- **Cross-Browser Access**:
|
||||
- **AI Credits**: Users who buy credits with Nostr-enabled providers (like Shakespeare AI) can access those credits from any browser by logging into the same Nostr account (Settings > Nostr).
|
||||
- **Project Files**: Files are browser-specific. Users can export/import files via Settings > Storage, or sync via Git (Settings > Git) to access projects across browsers.
|
||||
- **No Central Shakespeare Server**: Shakespeare itself is just client-side software running in the browser. It doesn't store user data or AI credits centrally.
|
||||
|
||||
## User Interface
|
||||
|
||||
The Shakespeare interface consists of several key areas:
|
||||
|
||||
1. **Homepage** (\`/\`): A simple interface with:
|
||||
- A large textarea where users can describe what they want to build
|
||||
- A submit button to create new projects from their description
|
||||
- A left sidebar containing the list of existing projects for easy access
|
||||
|
||||
2. **Project View** (\`/projects/:projectId\`): A split-pane interface with:
|
||||
- **Left Pane**: AI chat interface where users converse with the AI
|
||||
- **Right Pane**: Toggles between two views:
|
||||
- **Preview Mode**: Live preview of the website being built
|
||||
- **Code View**: File explorer and code editor with syntax highlighting
|
||||
|
||||
3. **Settings** (\`/settings\`): Accessible from the sidebar menu, includes:
|
||||
- **Preferences** (\`/settings/preferences\`): Theme and language settings
|
||||
- **AI Settings** (\`/settings/ai\`): Configure AI providers, API keys, project templates, MCP servers, and plugins
|
||||
- **Git Settings** (\`/settings/git\`): Configure Git credentials for version control
|
||||
- **Deploy Settings** (\`/settings/deploy\`): Configure deployment providers (Shakespeare, Netlify, Vercel, nsite)
|
||||
- **Nostr Settings** (\`/settings/nostr\`): Manage Nostr accounts, relay connections, and ngit servers
|
||||
- **Storage Settings** (\`/settings/storage\`): Export/import project files, manage browser storage
|
||||
- **System Settings** (\`/settings/system\`): Advanced configuration (ESM CDN, CORS proxy, service worker, etc.)
|
||||
- **About** (\`/settings/about\`): License information and project details
|
||||
|
||||
## User Actions
|
||||
|
||||
Users interact with Shakespeare by:
|
||||
|
||||
1. **Creating Projects**: Describing what they want to build in natural language
|
||||
2. **Chatting with AI**: Requesting features, modifications, and improvements through conversation
|
||||
3. **Manual Code Editing**: Switching to code view to make direct file edits when desired
|
||||
4. **Previewing Changes**: Viewing their website in real-time as it's being built
|
||||
5. **Project Management**: Organizing and accessing multiple projects from the homepage
|
||||
6. **Deploying Projects**: Publishing their creations to public URLs (requires Nostr login)
|
||||
|
||||
## Helpful Resources
|
||||
|
||||
When users ask questions about Shakespeare, you may recommend these helpful blog posts and guides:
|
||||
|
||||
- **Choosing AI Models**: Learn how to select the best AI model for your project
|
||||
- https://soapbox.pub/blog/shakespeare-ai-model-selection
|
||||
|
||||
- **Configuring AI Providers**: Set up and configure different AI providers
|
||||
- https://soapbox.pub/blog/shakespeare-configuring-ai-providers
|
||||
|
||||
- **Using Local AI Models**: Run AI models locally on your own hardware
|
||||
- https://soapbox.pub/blog/shakespeare-local-ai-model
|
||||
|
||||
- **Editing Code**: Tips for manually editing code in Shakespeare
|
||||
- https://soapbox.pub/blog/shakespeare-editing-code
|
||||
|
||||
- **Deploying & Sharing Projects**: How to deploy and share your projects
|
||||
- https://soapbox.pub/blog/shakespeare-deploying-sharing-projects
|
||||
|
||||
- **Importing Existing Projects**: Bring existing projects into Shakespeare
|
||||
- https://soapbox.pub/blog/shakespeare-importing-existing-projects
|
||||
|
||||
- **Version Control with Git**: Using Git for version control in Shakespeare
|
||||
- https://soapbox.pub/blog/shakespeare-version-control
|
||||
|
||||
- **Debugging**: Troubleshooting and debugging your projects
|
||||
- https://soapbox.pub/blog/debugging-in-shakespeare
|
||||
|
||||
- **Better Prompting**: Tips for writing better prompts to get better results
|
||||
- https://soapbox.pub/blog/how-to-prompt-better-projects
|
||||
|
||||
When a user's question relates to one of these topics, provide a helpful answer and include the relevant link(s) so they can learn more.`;
|
||||
@@ -63,7 +63,13 @@
|
||||
"shareErrorReports": "Share error reports",
|
||||
"shareErrorReportsDescription": "Help improve this app by automatically sending crash and error reports.",
|
||||
"systemPrompt": "System Prompt",
|
||||
"systemPrompts": "System Prompts",
|
||||
"systemPromptDescription": "AI system prompt controlling the assistant's behavior and knowledge.",
|
||||
"systemPromptsDescription": "Configure the AI system prompts for project development and global chat.",
|
||||
"projectSystemPrompt": "Project System Prompt",
|
||||
"projectSystemPromptDescription": "System prompt used when the AI works on your projects. Supports Nunjucks templating for dynamic content.",
|
||||
"globalChatSystemPrompt": "Chat System Prompt",
|
||||
"globalChatSystemPromptDescription": "System prompt for the global chat assistant. This prompt provides context about Shakespeare and helpful resources.",
|
||||
"english": "English",
|
||||
"portuguese": "Portuguese",
|
||||
"chinese": "Chinese",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Check, Bot, ArrowLeft, Trash2, GripVertical, ChevronDown, RotateCcw, FileText, Plus, Edit } from 'lucide-react';
|
||||
import { Check, Bot, ArrowLeft, Trash2, GripVertical, ChevronDown, RotateCcw, FileText, Plus, Edit, MessageCircle } from 'lucide-react';
|
||||
import {
|
||||
DndContext,
|
||||
closestCenter,
|
||||
@@ -44,6 +44,7 @@ import { MCPServersSection } from '@/components/MCPServersSection';
|
||||
import { PluginsSection } from '@/components/PluginsSection';
|
||||
import { ProjectTemplatesSection } from '@/components/ProjectTemplatesSection';
|
||||
import { defaultSystemPrompt } from '@/lib/system';
|
||||
import { defaultGlobalChatSystemPrompt } from '@/lib/globalChatSystem';
|
||||
|
||||
interface SortableProviderItemProps {
|
||||
provider: AIProvider;
|
||||
@@ -217,12 +218,20 @@ export function AISettings() {
|
||||
const [activeCreditsDialog, setActiveCreditsDialog] = useState<string | null>(null);
|
||||
const [showAdvanced, setShowAdvanced] = useState(false);
|
||||
const [systemPromptInput, setSystemPromptInput] = useState(config.systemPrompt || defaultSystemPrompt);
|
||||
const [chatSystemPromptInput, setChatSystemPromptInput] = useState(
|
||||
config.globalChatSystemPrompt || defaultGlobalChatSystemPrompt
|
||||
);
|
||||
|
||||
// Check if system prompt differs from default
|
||||
const isSystemPromptModified = useMemo(() =>
|
||||
(config.systemPrompt || defaultSystemPrompt) !== (defaultConfig.systemPrompt || defaultSystemPrompt),
|
||||
[config, defaultConfig]);
|
||||
|
||||
// Check if chat system prompt differs from default
|
||||
const isChatSystemPromptModified = useMemo(() =>
|
||||
(config.globalChatSystemPrompt || defaultGlobalChatSystemPrompt) !== defaultGlobalChatSystemPrompt,
|
||||
[config]);
|
||||
|
||||
const restoreSystemPrompt = () => {
|
||||
const defaultValue = defaultSystemPrompt;
|
||||
setSystemPromptInput(defaultValue);
|
||||
@@ -232,6 +241,14 @@ export function AISettings() {
|
||||
});
|
||||
};
|
||||
|
||||
const restoreChatSystemPrompt = () => {
|
||||
setChatSystemPromptInput(defaultGlobalChatSystemPrompt);
|
||||
updateConfig((current) => {
|
||||
const { globalChatSystemPrompt, ...rest } = current;
|
||||
return rest;
|
||||
});
|
||||
};
|
||||
|
||||
const sensors = useSensors(
|
||||
useSensor(PointerSensor),
|
||||
useSensor(KeyboardSensor, {
|
||||
@@ -684,28 +701,34 @@ export function AISettings() {
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<FileText className="h-5 w-5 text-primary" />
|
||||
<h3 className="text-lg font-semibold">{t('systemPrompt')}</h3>
|
||||
{isSystemPromptModified && (
|
||||
<h3 className="text-lg font-semibold">{t('systemPrompts')}</h3>
|
||||
{(isSystemPromptModified || isChatSystemPromptModified) && (
|
||||
<div className="h-2 w-2 rounded-full bg-yellow-500" title={t('modified')} />
|
||||
)}
|
||||
</div>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{t('systemPromptDescription')}
|
||||
{t('systemPromptsDescription')}
|
||||
</p>
|
||||
</div>
|
||||
<Accordion type="single" collapsible className="w-full">
|
||||
<Accordion type="single" collapsible className="w-full space-y-2">
|
||||
<AccordionItem value="system-prompt" className="border rounded-lg">
|
||||
<AccordionTrigger className="px-4 py-3 hover:no-underline">
|
||||
<div className="flex items-center gap-2">
|
||||
<Edit className="h-4 w-4" />
|
||||
<span className="font-medium">{t('systemPrompt')}</span>
|
||||
<span className="font-medium">{t('projectSystemPrompt')}</span>
|
||||
{isSystemPromptModified && (
|
||||
<div className="h-2 w-2 rounded-full bg-yellow-500" title={t('modified')} />
|
||||
)}
|
||||
</div>
|
||||
</AccordionTrigger>
|
||||
<AccordionContent className="px-4 pb-4">
|
||||
<div className="space-y-2">
|
||||
<p className="text-xs text-muted-foreground mb-2">
|
||||
{t('projectSystemPromptDescription')}
|
||||
</p>
|
||||
<Textarea
|
||||
id="system-prompt"
|
||||
placeholder="Enter EJS template..."
|
||||
placeholder="Enter Nunjucks template..."
|
||||
value={systemPromptInput}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
@@ -730,6 +753,48 @@ export function AISettings() {
|
||||
</div>
|
||||
</AccordionContent>
|
||||
</AccordionItem>
|
||||
<AccordionItem value="chat-system-prompt" className="border rounded-lg">
|
||||
<AccordionTrigger className="px-4 py-3 hover:no-underline">
|
||||
<div className="flex items-center gap-2">
|
||||
<MessageCircle className="h-4 w-4" />
|
||||
<span className="font-medium">{t('globalChatSystemPrompt')}</span>
|
||||
{isChatSystemPromptModified && (
|
||||
<div className="h-2 w-2 rounded-full bg-yellow-500" title={t('modified')} />
|
||||
)}
|
||||
</div>
|
||||
</AccordionTrigger>
|
||||
<AccordionContent className="px-4 pb-4">
|
||||
<div className="space-y-2">
|
||||
<p className="text-xs text-muted-foreground mb-2">
|
||||
{t('globalChatSystemPromptDescription')}
|
||||
</p>
|
||||
<Textarea
|
||||
id="chat-system-prompt"
|
||||
placeholder="Enter system prompt..."
|
||||
value={chatSystemPromptInput}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
setChatSystemPromptInput(value);
|
||||
updateConfig((current) => ({
|
||||
...current,
|
||||
globalChatSystemPrompt: value,
|
||||
}));
|
||||
}}
|
||||
className="flex-1 font-mono text-xs min-h-[300px]"
|
||||
/>
|
||||
{isChatSystemPromptModified && (
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={restoreChatSystemPrompt}
|
||||
className="w-full"
|
||||
>
|
||||
<RotateCcw className="h-4 w-4 mr-2" />
|
||||
{t('restoreToDefault')}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</AccordionContent>
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { Settings, ArrowLeft, RefreshCw, Trash2, XCircle, Loader2, RotateCcw, Cog, Globe, Image, Code, Monitor, Award, Bug, FolderTree, Terminal as TerminalIcon, MessageCircle } from "lucide-react";
|
||||
import { Settings, ArrowLeft, RefreshCw, Trash2, XCircle, Loader2, RotateCcw, Cog, Globe, Image, Code, Monitor, Award, Bug, FolderTree, Terminal as TerminalIcon } from "lucide-react";
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useState, useEffect, useMemo } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion';
|
||||
import { useIsMobile } from "@/hooks/useIsMobile";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
@@ -14,11 +13,6 @@ import { useOffline } from "@/hooks/useOffline";
|
||||
import { useToast } from "@/hooks/useToast";
|
||||
import { Terminal } from "@/components/Terminal";
|
||||
|
||||
// Default system prompt for global chat
|
||||
const DEFAULT_GLOBAL_CHAT_SYSTEM_PROMPT = `You are a helpful AI assistant. You're here to have a friendly conversation and help answer questions on any topic.
|
||||
|
||||
Keep your responses concise but informative. Be friendly and conversational.`;
|
||||
|
||||
export function SystemSettings() {
|
||||
const { t } = useTranslation();
|
||||
const isMobile = useIsMobile();
|
||||
@@ -38,9 +32,6 @@ export function SystemSettings() {
|
||||
const [fsPathPluginsInput, setFsPathPluginsInput] = useState(config.fsPathPlugins);
|
||||
const [fsPathTemplatesInput, setFsPathTemplatesInput] = useState(config.fsPathTemplates);
|
||||
const [sentryDsnInput, setSentryDsnInput] = useState(config.sentryDsn);
|
||||
const [chatSystemPromptInput, setChatSystemPromptInput] = useState(
|
||||
config.globalChatSystemPrompt || DEFAULT_GLOBAL_CHAT_SYSTEM_PROMPT
|
||||
);
|
||||
|
||||
// Check which settings differ from defaults
|
||||
const isModified = useMemo(() => ({
|
||||
@@ -56,7 +47,6 @@ export function SystemSettings() {
|
||||
fsPathPlugins: config.fsPathPlugins !== defaultConfig.fsPathPlugins,
|
||||
fsPathTemplates: config.fsPathTemplates !== defaultConfig.fsPathTemplates,
|
||||
sentryDsn: config.sentryDsn !== defaultConfig.sentryDsn,
|
||||
globalChatSystemPrompt: (config.globalChatSystemPrompt || DEFAULT_GLOBAL_CHAT_SYSTEM_PROMPT) !== DEFAULT_GLOBAL_CHAT_SYSTEM_PROMPT,
|
||||
}), [config, defaultConfig]);
|
||||
|
||||
// Restore functions - clear the value from config to use the default
|
||||
@@ -166,14 +156,6 @@ export function SystemSettings() {
|
||||
});
|
||||
};
|
||||
|
||||
const restoreChatSystemPrompt = () => {
|
||||
setChatSystemPromptInput(DEFAULT_GLOBAL_CHAT_SYSTEM_PROMPT);
|
||||
updateConfig((current) => {
|
||||
const { globalChatSystemPrompt, ...rest } = current;
|
||||
return rest;
|
||||
});
|
||||
};
|
||||
|
||||
// Service Worker state
|
||||
const [swState, setSwState] = useState<string>('');
|
||||
const [isUpdatingSW, setIsUpdatingSW] = useState(false);
|
||||
@@ -970,52 +952,6 @@ export function SystemSettings() {
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
|
||||
{/* Chat System Prompt Configuration */}
|
||||
<Accordion type="single" collapsible className="w-full">
|
||||
<AccordionItem value="chat-system-prompt">
|
||||
<AccordionTrigger className="px-4 py-3 hover:no-underline">
|
||||
<div className="flex items-center gap-2">
|
||||
<MessageCircle className="h-4 w-4 text-muted-foreground" />
|
||||
<h4 className="text-sm font-medium">{t('globalChatSystemPrompt')}</h4>
|
||||
{isModified.globalChatSystemPrompt && (
|
||||
<div className="h-2 w-2 rounded-full bg-yellow-500" title={t('modified')} />
|
||||
)}
|
||||
</div>
|
||||
</AccordionTrigger>
|
||||
<AccordionContent className="px-4 pb-4">
|
||||
<div className="py-1 space-y-2">
|
||||
<Textarea
|
||||
placeholder="Enter system prompt..."
|
||||
value={chatSystemPromptInput}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
setChatSystemPromptInput(value);
|
||||
updateConfig((current) => ({
|
||||
...current,
|
||||
globalChatSystemPrompt: value,
|
||||
}));
|
||||
}}
|
||||
className="font-mono text-xs min-h-[150px]"
|
||||
/>
|
||||
{isModified.globalChatSystemPrompt && (
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={restoreChatSystemPrompt}
|
||||
className="w-full"
|
||||
>
|
||||
<RotateCcw className="h-4 w-4 mr-2" />
|
||||
{t('restoreToDefault')}
|
||||
</Button>
|
||||
)}
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{t('globalChatSystemPromptDescription')}
|
||||
</p>
|
||||
</div>
|
||||
</AccordionContent>
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
|
||||
{/* Terminal */}
|
||||
<Accordion type="single" collapsible className="w-full">
|
||||
<AccordionItem value="terminal">
|
||||
|
||||
Reference in new issue
Block a user