From eb36ec6170bc7c943b57033dfe5a7169db5fb55d Mon Sep 17 00:00:00 2001 From: Rob Koch Date: Sat, 7 Dec 2024 18:11:38 -0800 Subject: [PATCH 01/54] basic context menu for folders --- app/components/workbench/FileTree.tsx | 75 +++++++++++++++++++++------ package.json | 1 + 2 files changed, 60 insertions(+), 16 deletions(-) diff --git a/app/components/workbench/FileTree.tsx b/app/components/workbench/FileTree.tsx index 0882e1f..5b6e7a9 100644 --- a/app/components/workbench/FileTree.tsx +++ b/app/components/workbench/FileTree.tsx @@ -2,6 +2,7 @@ import { memo, useEffect, useMemo, useState, type ReactNode } from 'react'; import type { FileMap } from '~/lib/stores/files'; import { classNames } from '~/utils/classNames'; import { createScopedLogger, renderLogger } from '~/utils/logger'; +import * as ContextMenu from '@radix-ui/react-context-menu'; const logger = createScopedLogger('FileTree'); @@ -159,23 +160,65 @@ interface FolderProps { onClick: () => void; } -function Folder({ folder: { depth, name }, collapsed, selected = false, onClick }: FolderProps) { +interface FolderContextMenuProps { + children: ReactNode; +} + +function ContextMenuItem({ children }: { children: ReactNode }) { return ( - - {name} - + + + {children} + + ); +} + +function FolderContextMenu({ children }: FolderContextMenuProps) { + return ( + + {children} + + + + New file... + New folder... + + + Copy path + Copy relative path + + + Rename... + Delete + + + + + ); +} + +function Folder({ folder, collapsed, selected = false, onClick }: FolderProps) { + return ( + + + {folder.name} + + ); } diff --git a/package.json b/package.json index 15f4d99..6463c96 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "@octokit/rest": "^21.0.2", "@octokit/types": "^13.6.2", "@openrouter/ai-sdk-provider": "^0.0.5", + "@radix-ui/react-context-menu": "^2.2.2", "@radix-ui/react-dialog": "^1.1.2", "@radix-ui/react-dropdown-menu": "^2.1.2", "@radix-ui/react-separator": "^1.1.0", From 13a15e9a3d29597b02d8597898cf9087a9c78d05 Mon Sep 17 00:00:00 2001 From: Rob Koch Date: Sun, 8 Dec 2024 15:22:46 -0800 Subject: [PATCH 02/54] copyPath and copyRelativePath for files and folders --- app/components/workbench/FileTree.tsx | 107 ++++++++++++++++++-------- 1 file changed, 73 insertions(+), 34 deletions(-) diff --git a/app/components/workbench/FileTree.tsx b/app/components/workbench/FileTree.tsx index 5b6e7a9..eb185cb 100644 --- a/app/components/workbench/FileTree.tsx +++ b/app/components/workbench/FileTree.tsx @@ -111,6 +111,22 @@ export const FileTree = memo( }); }; + const onCopyPath = (fileOrFolder: FileNode | FolderNode) => { + try { + navigator.clipboard.writeText(fileOrFolder.fullPath); + } catch (error) { + logger.error(error); + } + }; + + const onCopyRelativePath = (fileOrFolder: FileNode | FolderNode) => { + try { + navigator.clipboard.writeText(fileOrFolder.fullPath.substring((rootFolder || '').length)); + } catch (error) { + logger.error(error); + } + }; + return (
{filteredFileList.map((fileOrFolder) => { @@ -122,6 +138,12 @@ export const FileTree = memo( selected={selectedFile === fileOrFolder.fullPath} file={fileOrFolder} unsavedChanges={unsavedFiles?.has(fileOrFolder.fullPath)} + onCopyPath={() => { + onCopyPath(fileOrFolder); + }} + onCopyRelativePath={() => { + onCopyRelativePath(fileOrFolder); + }} onClick={() => { onFileSelect?.(fileOrFolder.fullPath); }} @@ -135,6 +157,12 @@ export const FileTree = memo( folder={fileOrFolder} selected={allowFolderSelection && selectedFile === fileOrFolder.fullPath} collapsed={collapsedFolders.has(fileOrFolder.fullPath)} + onCopyPath={() => { + onCopyPath(fileOrFolder); + }} + onCopyRelativePath={() => { + onCopyRelativePath(fileOrFolder); + }} onClick={() => { toggleCollapseState(fileOrFolder.fullPath); }} @@ -157,23 +185,30 @@ interface FolderProps { folder: FolderNode; collapsed: boolean; selected?: boolean; + onCopyPath: () => void; + onCopyRelativePath: () => void; onClick: () => void; } interface FolderContextMenuProps { + onCopyPath?: () => void; + onCopyRelativePath?: () => void; children: ReactNode; } -function ContextMenuItem({ children }: { children: ReactNode }) { +function ContextMenuItem({ onSelect, children }: { onSelect?: () => void; children: ReactNode }) { return ( - + {children} ); } -function FolderContextMenu({ children }: FolderContextMenuProps) { +function FileContextMenu({ onCopyPath, onCopyRelativePath, children }: FolderContextMenuProps) { return ( {children} @@ -183,16 +218,8 @@ function FolderContextMenu({ children }: FolderContextMenuProps) { className="border border-bolt-elements-borderColor rounded-md z-context-menu bg-bolt-elements-background-depth-1 dark:bg-bolt-elements-background-depth-2 data-[state=open]:animate-in animate-duration-100 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-98 w-56" > - New file... - New folder... - - - Copy path - Copy relative path - - - Rename... - Delete + Copy path + Copy relative path @@ -200,9 +227,9 @@ function FolderContextMenu({ children }: FolderContextMenuProps) { ); } -function Folder({ folder, collapsed, selected = false, onClick }: FolderProps) { +function Folder({ folder, collapsed, selected = false, onCopyPath, onCopyRelativePath, onClick }: FolderProps) { return ( - + {folder.name} - + ); } @@ -226,31 +253,43 @@ interface FileProps { file: FileNode; selected: boolean; unsavedChanges?: boolean; + onCopyPath: () => void; + onCopyRelativePath: () => void; onClick: () => void; } -function File({ file: { depth, name }, onClick, selected, unsavedChanges = false }: FileProps) { +function File({ + file: { depth, name }, + onClick, + onCopyPath, + onCopyRelativePath, + selected, + unsavedChanges = false, +}: FileProps) { return ( - -
+ -
{name}
- {unsavedChanges && } -
-
+
+
{name}
+ {unsavedChanges && } +
+ + ); } From 6eb2d84dfffd9ebada1167a6fef4aec20998b87c Mon Sep 17 00:00:00 2001 From: Rob Koch Date: Sun, 8 Dec 2024 16:31:53 -0800 Subject: [PATCH 03/54] pnpm lock file --- pnpm-lock.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e355d04..17bdc89 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -95,6 +95,9 @@ importers: '@openrouter/ai-sdk-provider': specifier: ^0.0.5 version: 0.0.5(zod@3.23.8) + '@radix-ui/react-context-menu': + specifier: ^2.2.2 + version: 2.2.2(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-dialog': specifier: ^1.1.2 version: 1.1.2(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -1557,6 +1560,19 @@ packages: '@types/react': optional: true + '@radix-ui/react-context-menu@2.2.2': + resolution: {integrity: sha512-99EatSTpW+hRYHt7m8wdDlLtkmTovEe8Z/hnxUPV+SKuuNL5HWNhQI4QSdjZqNSgXHay2z4M3Dym73j9p2Gx5Q==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@radix-ui/react-context@1.1.0': resolution: {integrity: sha512-OKrckBy+sMEgYM/sMmqmErVn0kZqrHPJze+Ql3DzYsDDp0hl0L62nx/2122/Bvps1qz645jlcu2tD9lrRSdf8A==} peerDependencies: @@ -7032,6 +7048,20 @@ snapshots: optionalDependencies: '@types/react': 18.3.12 + '@radix-ui/react-context-menu@2.2.2(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-context': 1.1.1(@types/react@18.3.12)(react@18.3.1) + '@radix-ui/react-menu': 2.1.2(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.12)(react@18.3.1) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.12)(react@18.3.1) + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.12 + '@types/react-dom': 18.3.1 + '@radix-ui/react-context@1.1.0(@types/react@18.3.12)(react@18.3.1)': dependencies: react: 18.3.1 From 8bcd82c9d40f53792a34cf97546ddc15f3e51d51 Mon Sep 17 00:00:00 2001 From: Meet Patel <113581962+meetpateltech@users.noreply.github.com> Date: Sat, 14 Dec 2024 11:59:10 +0530 Subject: [PATCH 04/54] feat: added perplexity model --- .env.example | 5 +++++ app/commit.json | 2 +- app/lib/.server/llm/api-key.ts | 2 ++ app/lib/.server/llm/model.ts | 11 +++++++++++ app/utils/constants.ts | 24 ++++++++++++++++++++++++ worker-configuration.d.ts | 1 + 6 files changed, 44 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 7306f36..5baa3d4 100644 --- a/.env.example +++ b/.env.example @@ -70,6 +70,11 @@ LMSTUDIO_API_BASE_URL= # You only need this environment variable set if you want to use xAI models XAI_API_KEY= +# Get your Perplexity API Key here - +# https://www.perplexity.ai/settings/api +# You only need this environment variable set if you want to use Perplexity models +PERPLEXITY_API_KEY= + # Include this environment variable if you want more logging for debugging locally VITE_LOG_LEVEL=debug diff --git a/app/commit.json b/app/commit.json index beebd2b..ff64112 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "55094392cf4c5bc607aff796680ad50236a4cf20" } +{ "commit": "9666b2ab67d25345542722ab9d870b36ad06252e" } diff --git a/app/lib/.server/llm/api-key.ts b/app/lib/.server/llm/api-key.ts index 30cf2cd..e82d08e 100644 --- a/app/lib/.server/llm/api-key.ts +++ b/app/lib/.server/llm/api-key.ts @@ -39,6 +39,8 @@ export function getAPIKey(cloudflareEnv: Env, provider: string, userApiKeys?: Re return env.TOGETHER_API_KEY || cloudflareEnv.TOGETHER_API_KEY; case 'xAI': return env.XAI_API_KEY || cloudflareEnv.XAI_API_KEY; + case 'Perplexity': + return env.PERPLEXITY_API_KEY || cloudflareEnv.PERPLEXITY_API_KEY; case 'Cohere': return env.COHERE_API_KEY; case 'AzureOpenAI': diff --git a/app/lib/.server/llm/model.ts b/app/lib/.server/llm/model.ts index 2588c2b..1a5aab7 100644 --- a/app/lib/.server/llm/model.ts +++ b/app/lib/.server/llm/model.ts @@ -128,6 +128,15 @@ export function getXAIModel(apiKey: OptionalApiKey, model: string) { return openai(model); } +export function getPerplexityModel(apiKey: OptionalApiKey, model: string) { + const perplexity = createOpenAI({ + baseURL: 'https://api.perplexity.ai/', + apiKey, + }); + + return perplexity(model); +} + export function getModel( provider: string, model: string, @@ -170,6 +179,8 @@ export function getModel( return getXAIModel(apiKey, model); case 'Cohere': return getCohereAIModel(apiKey, model); + case 'Perplexity': + return getPerplexityModel(apiKey, model); default: return getOllamaModel(baseURL, model); } diff --git a/app/utils/constants.ts b/app/utils/constants.ts index 3247fb2..f312c73 100644 --- a/app/utils/constants.ts +++ b/app/utils/constants.ts @@ -292,6 +292,30 @@ const PROVIDER_LIST: ProviderInfo[] = [ ], getApiKeyLink: 'https://api.together.xyz/settings/api-keys', }, + { + name: 'Perplexity', + staticModels: [ + { + name: 'llama-3.1-sonar-small-128k-online', + label: 'Sonar Small Online', + provider: 'Perplexity', + maxTokenAllowed: 8192, + }, + { + name: 'llama-3.1-sonar-large-128k-online', + label: 'Sonar Large Online', + provider: 'Perplexity', + maxTokenAllowed: 8192, + }, + { + name: 'llama-3.1-sonar-huge-128k-online', + label: 'Sonar Huge Online', + provider: 'Perplexity', + maxTokenAllowed: 8192, + }, + ], + getApiKeyLink: 'https://www.perplexity.ai/settings/api', + }, ]; export const DEFAULT_PROVIDER = PROVIDER_LIST[0]; diff --git a/worker-configuration.d.ts b/worker-configuration.d.ts index 4eaf210..ed2afca 100644 --- a/worker-configuration.d.ts +++ b/worker-configuration.d.ts @@ -14,4 +14,5 @@ interface Env { GOOGLE_GENERATIVE_AI_API_KEY: string; MISTRAL_API_KEY: string; XAI_API_KEY: string; + PERPLEXITY_API_KEY: string; } From 1e73e8863a904e95ba21f9ed5b2307a78b6d0ebd Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sat, 14 Dec 2024 19:30:36 -0500 Subject: [PATCH 05/54] ui-ux: Setting Modal Changes Enhancement - move the connection tab below chat history in left side of settings Enhancement - on chat tab Delete all chats, should prompt to make sure you want to Enhancement - Debug tab change copy debug info from a popup to a toast notification --- app/components/settings/SettingsWindow.tsx | 2 +- app/components/settings/chat-history/ChatHistoryTab.tsx | 8 +++++--- app/components/settings/debug/DebugTab.tsx | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/components/settings/SettingsWindow.tsx b/app/components/settings/SettingsWindow.tsx index aae0a86..541323f 100644 --- a/app/components/settings/SettingsWindow.tsx +++ b/app/components/settings/SettingsWindow.tsx @@ -27,8 +27,8 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => { const tabs: { id: TabType; label: string; icon: string; component?: ReactElement }[] = [ { id: 'chat-history', label: 'Chat History', icon: 'i-ph:book', component: }, { id: 'providers', label: 'Providers', icon: 'i-ph:key', component: }, - { id: 'features', label: 'Features', icon: 'i-ph:star', component: }, { id: 'connection', label: 'Connection', icon: 'i-ph:link', component: }, + { id: 'features', label: 'Features', icon: 'i-ph:star', component: }, ...(debug ? [ { diff --git a/app/components/settings/chat-history/ChatHistoryTab.tsx b/app/components/settings/chat-history/ChatHistoryTab.tsx index 76a0f21..bd98f3d 100644 --- a/app/components/settings/chat-history/ChatHistoryTab.tsx +++ b/app/components/settings/chat-history/ChatHistoryTab.tsx @@ -22,17 +22,20 @@ export default function ChatHistoryTab() { }; const handleDeleteAllChats = async () => { + const confirmDelete = window.confirm("Are you sure you want to delete all chats? This action cannot be undone."); + if (!confirmDelete) { + return; // Exit if the user cancels + } + if (!db) { const error = new Error('Database is not available'); logStore.logError('Failed to delete chats - DB unavailable', error); toast.error('Database is not available'); - return; } try { setIsDeleting(true); - const allChats = await getAll(db); await Promise.all(allChats.map((chat) => deleteById(db!, chat.id))); logStore.logSystem('All chats deleted successfully', { count: allChats.length }); @@ -52,7 +55,6 @@ export default function ChatHistoryTab() { const error = new Error('Database is not available'); logStore.logError('Failed to export chats - DB unavailable', error); toast.error('Database is not available'); - return; } diff --git a/app/components/settings/debug/DebugTab.tsx b/app/components/settings/debug/DebugTab.tsx index e18607d..c5b1661 100644 --- a/app/components/settings/debug/DebugTab.tsx +++ b/app/components/settings/debug/DebugTab.tsx @@ -1,6 +1,7 @@ import React, { useCallback, useEffect, useState } from 'react'; import { useSettings } from '~/lib/hooks/useSettings'; import commit from '~/commit.json'; +import { toast } from 'react-toastify'; interface ProviderStatus { name: string; @@ -308,8 +309,9 @@ export default function DebugTab() { Version: versionHash, Timestamp: new Date().toISOString(), }; + navigator.clipboard.writeText(JSON.stringify(debugInfo, null, 2)).then(() => { - alert('Debug information copied to clipboard!'); + toast.success('Debug information copied to clipboard!'); }); }, [activeProviders, systemInfo]); From d4aa189cee73eab4931f8341f5fcfe48684dd9e0 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sat, 14 Dec 2024 19:40:37 -0500 Subject: [PATCH 06/54] ui-ux: Renamed feature Enhancement - on feature tab Change 'Enable Local Models' to 'Experimental Providers' --- app/components/settings/features/FeaturesTab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/settings/features/FeaturesTab.tsx b/app/components/settings/features/FeaturesTab.tsx index 9c9e4a0..88dd4d4 100644 --- a/app/components/settings/features/FeaturesTab.tsx +++ b/app/components/settings/features/FeaturesTab.tsx @@ -24,7 +24,7 @@ export default function FeaturesTab() { Disclaimer: Experimental features may be unstable and are subject to change.

- Enable Local Models + Experimental Providers
From 5893629306d1af61d885978aae5fb9ce64ca3ada Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sat, 14 Dec 2024 19:43:43 -0500 Subject: [PATCH 07/54] ui-ux: combined optional features on features tab combined (debug info and event logs) into 'Debug Features' --- app/components/settings/features/FeaturesTab.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/components/settings/features/FeaturesTab.tsx b/app/components/settings/features/FeaturesTab.tsx index 88dd4d4..0ef7a5d 100644 --- a/app/components/settings/features/FeaturesTab.tsx +++ b/app/components/settings/features/FeaturesTab.tsx @@ -4,17 +4,19 @@ import { useSettings } from '~/lib/hooks/useSettings'; export default function FeaturesTab() { const { debug, enableDebugMode, isLocalModel, enableLocalModels, eventLogs, enableEventLogs } = useSettings(); + + const handleToggle = (enabled: boolean) => { + enableDebugMode(enabled); + enableEventLogs(enabled); + }; + return (

Optional Features

- Debug Info - -
-
- Event Logs - + Debug Features +
From bb03c30ddde8987a065bdbcedffe083645f9197d Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sat, 14 Dec 2024 20:09:25 -0500 Subject: [PATCH 08/54] Update DebugTab.tsx Fixed Check for Update not getting the correct commit --- app/components/settings/debug/DebugTab.tsx | 26 +++++++++------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/app/components/settings/debug/DebugTab.tsx b/app/components/settings/debug/DebugTab.tsx index e18607d..3f19a48 100644 --- a/app/components/settings/debug/DebugTab.tsx +++ b/app/components/settings/debug/DebugTab.tsx @@ -35,6 +35,7 @@ const versionHash = commit.commit; const GITHUB_URLS = { original: 'https://api.github.com/repos/stackblitz-labs/bolt.diy/commits/main', fork: 'https://api.github.com/repos/Stijnus/bolt.new-any-llm/commits/main', + commitJson: 'https://raw.githubusercontent.com/stackblitz-labs/bolt.diy/main/app/commit.json', }; function getSystemInfo(): SystemInfo { @@ -257,29 +258,22 @@ export default function DebugTab() { setIsCheckingUpdate(true); setUpdateMessage('Checking for updates...'); - const [originalResponse, forkResponse] = await Promise.all([ - fetch(GITHUB_URLS.original), - fetch(GITHUB_URLS.fork), - ]); - - if (!originalResponse.ok || !forkResponse.ok) { + // Fetch the commit data from the specified URL + const localCommitResponse = await fetch(GITHUB_URLS.commitJson); + if (!localCommitResponse.ok) { throw new Error('Failed to fetch repository information'); } - const [originalData, forkData] = await Promise.all([ - originalResponse.json() as Promise<{ sha: string }>, - forkResponse.json() as Promise<{ sha: string }>, - ]); + const localCommitData = await localCommitResponse.json(); + const originalCommitHash = localCommitData.commit; // Use the fetched commit hash - const originalCommitHash = originalData.sha; - const forkCommitHash = forkData.sha; - const isForked = versionHash === forkCommitHash && forkCommitHash !== originalCommitHash; + const currentLocalCommitHash = commit.commit; // Your current local commit hash - if (originalCommitHash !== versionHash) { + if (originalCommitHash !== currentLocalCommitHash) { setUpdateMessage( `Update available from original repository!\n` + - `Current: ${versionHash.slice(0, 7)}${isForked ? ' (forked)' : ''}\n` + - `Latest: ${originalCommitHash.slice(0, 7)}`, + `Current: ${currentLocalCommitHash.slice(0, 7)}\n` + + `Latest: ${originalCommitHash.slice(0, 7)}` ); } else { setUpdateMessage('You are on the latest version from the original repository'); From a976a25094b4a683178168660dc2e631716848ca Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sat, 14 Dec 2024 20:11:20 -0500 Subject: [PATCH 09/54] Update DebugTab.tsx fixed the Local LLM Status not showing BaseURL's --- app/components/settings/debug/DebugTab.tsx | 38 ++++++++++++---------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/app/components/settings/debug/DebugTab.tsx b/app/components/settings/debug/DebugTab.tsx index 3f19a48..9b2a1b3 100644 --- a/app/components/settings/debug/DebugTab.tsx +++ b/app/components/settings/debug/DebugTab.tsx @@ -27,6 +27,7 @@ interface IProviderConfig { name: string; settings: { enabled: boolean; + baseUrl?: string; }; } @@ -213,29 +214,30 @@ export default function DebugTab() { try { const entries = Object.entries(providers) as [string, IProviderConfig][]; - const statuses = entries - .filter(([, provider]) => LOCAL_PROVIDERS.includes(provider.name)) - .map(async ([, provider]) => { - const envVarName = - provider.name.toLowerCase() === 'ollama' - ? 'OLLAMA_API_BASE_URL' - : provider.name.toLowerCase() === 'lmstudio' + const statuses = await Promise.all( + entries + .filter(([, provider]) => LOCAL_PROVIDERS.includes(provider.name)) + .map(async ([, provider]) => { + const envVarName = + provider.name.toLowerCase() === 'ollama' + ? 'OLLAMA_API_BASE_URL' + : provider.name.toLowerCase() === 'lmstudio' ? 'LMSTUDIO_API_BASE_URL' : `REACT_APP_${provider.name.toUpperCase()}_URL`; - // Access environment variables through import.meta.env - const url = import.meta.env[envVarName] || null; - console.log(`[Debug] Using URL for ${provider.name}:`, url, `(from ${envVarName})`); + // Access environment variables through import.meta.env + const url = import.meta.env[envVarName] || provider.settings.baseUrl || null; // Ensure baseUrl is used + console.log(`[Debug] Using URL for ${provider.name}:`, url, `(from ${envVarName})`); - const status = await checkProviderStatus(url, provider.name); + const status = await checkProviderStatus(url, provider.name); + return { + ...status, + enabled: provider.settings.enabled ?? false, + }; + }) + ); - return { - ...status, - enabled: provider.settings.enabled ?? false, - }; - }); - - Promise.all(statuses).then(setActiveProviders); + setActiveProviders(statuses); } catch (error) { console.error('[Debug] Failed to update provider statuses:', error); } From e0d0c4b697ff4a5d9c02e3c9bf1c2401104024f8 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sat, 14 Dec 2024 20:26:56 -0500 Subject: [PATCH 10/54] Branding updates changed Bolt.diy to bolt.diy reworded the bottom of the README --- CONTRIBUTING.md | 4 ++-- FAQ.md | 29 +++++++++--------------- README.md | 60 +++++++++++++++++++++++++------------------------ 3 files changed, 44 insertions(+), 49 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 304b140..bdb02ff 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ -# Contributing to oTToDev +# Contributing to bolt.diy -First off, thank you for considering contributing to Bolt.diy! This fork aims to expand the capabilities of the original project by integrating multiple LLM providers and enhancing functionality. Every contribution helps make Bolt.diy a better tool for developers worldwide. +First off, thank you for considering contributing to bolt.diy! This fork aims to expand the capabilities of the original project by integrating multiple LLM providers and enhancing functionality. Every contribution helps make bolt.diy a better tool for developers worldwide. ## 📋 Table of Contents - [Code of Conduct](#code-of-conduct) diff --git a/FAQ.md b/FAQ.md index c9467bb..ecd4158 100644 --- a/FAQ.md +++ b/FAQ.md @@ -1,12 +1,12 @@ -[![Bolt.new: AI-Powered Full-Stack Web Development in the Browser](./public/social_preview_index.jpg)](https://bolt.new) +[![bolt.diy: AI-Powered Full-Stack Web Development in the Browser](./public/social_preview_index.jpg)](https://bolt.diy) -# Bolt.new Fork by Cole Medin - Bolt.diy +# bolt.diy ## FAQ -### How do I get the best results with Bolt.diy? +### How do I get the best results with bolt.diy? -- **Be specific about your stack**: If you want to use specific frameworks or libraries (like Astro, Tailwind, ShadCN, or any other popular JavaScript framework), mention them in your initial prompt to ensure Bolt scaffolds the project accordingly. +- **Be specific about your stack**: If you want to use specific frameworks or libraries (like Astro, Tailwind, ShadCN, or any other popular JavaScript framework), mention them in your initial prompt to ensure bolt scaffolds the project accordingly. - **Use the enhance prompt icon**: Before sending your prompt, try clicking the 'enhance' icon to have the AI model help you refine your prompt, then edit the results before submitting. @@ -14,36 +14,29 @@ - **Batch simple instructions**: Save time by combining simple instructions into one message. For example, you can ask Bolt.diy to change the color scheme, add mobile responsiveness, and restart the dev server, all in one go saving you time and reducing API credit consumption significantly. -### Do you plan on merging Bolt.diy back into the official Bolt.new repo? - -More news coming on this coming early next month - stay tuned! - ### Why are there so many open issues/pull requests? -Bolt.diy was started simply to showcase how to edit an open source project and to do something cool with local LLMs on my (@ColeMedin) YouTube channel! However, it quickly -grew into a massive community project that I am working hard to keep up with the demand of by forming a team of maintainers and getting as many people involved as I can. -That effort is going well and all of our maintainers are ABSOLUTE rockstars, but it still takes time to organize everything so we can efficiently get through all -the issues and PRs. But rest assured, we are working hard and even working on some partnerships behind the scenes to really help this project take off! +bolt.diy was started simply to showcase how to edit an open source project and to do something cool with local LLMs on my (@ColeMedin) YouTube channel! However, it quickly grew into a massive community project that I am working hard to keep up with the demand of by forming a team of maintainers and getting as many people involved as I can. That effort is going well and all of our maintainers are ABSOLUTE rockstars, but it still takes time to organize everything so we can efficiently get through all the issues and PRs. But rest assured, we are working hard and even working on some partnerships behind the scenes to really help this project take off! -### How do local LLMs fair compared to larger models like Claude 3.5 Sonnet for Bolt.diy/Bolt.new? +### How do local LLMs fair compared to larger models like Claude 3.5 Sonnet for bolt.diy/bolt.new? As much as the gap is quickly closing between open source and massive close source models, you’re still going to get the best results with the very large models like GPT-4o, Claude 3.5 Sonnet, and DeepSeek Coder V2 236b. This is one of the big tasks we have at hand - figuring out how to prompt better, use agents, and improve the platform as a whole to make it work better for even the smaller local LLMs! ### I'm getting the error: "There was an error processing this request" -If you see this error within Bolt.diy, that is just the application telling you there is a problem at a high level, and this could mean a number of different things. To find the actual error, please check BOTH the terminal where you started the application (with Docker or pnpm) and the developer console in the browser. For most browsers, you can access the developer console by pressing F12 or right clicking anywhere in the browser and selecting “Inspect”. Then go to the “console” tab in the top right. +If you see this error within bolt.diy, that is just the application telling you there is a problem at a high level, and this could mean a number of different things. To find the actual error, please check BOTH the terminal where you started the application (with Docker or pnpm) and the developer console in the browser. For most browsers, you can access the developer console by pressing F12 or right clicking anywhere in the browser and selecting “Inspect”. Then go to the “console” tab in the top right. ### I'm getting the error: "x-api-key header missing" -We have seen this error a couple times and for some reason just restarting the Docker container has fixed it. This seems to be Ollama specific. Another thing to try is try to run Bolt.diy with Docker or pnpm, whichever you didn’t run first. We are still on the hunt for why this happens once and a while! +We have seen this error a couple times and for some reason just restarting the Docker container has fixed it. This seems to be Ollama specific. Another thing to try is try to run bolt.diy with Docker or pnpm, whichever you didn’t run first. We are still on the hunt for why this happens once and a while! -### I'm getting a blank preview when Bolt.diy runs my app! +### I'm getting a blank preview when bolt.diy runs my app! -We promise you that we are constantly testing new PRs coming into Bolt.diy and the preview is core functionality, so the application is not broken! When you get a blank preview or don’t get a preview, this is generally because the LLM hallucinated bad code or incorrect commands. We are working on making this more transparent so it is obvious. Sometimes the error will appear in developer console too so check that as well. +We promise you that we are constantly testing new PRs coming into bolt.diy and the preview is core functionality, so the application is not broken! When you get a blank preview or don’t get a preview, this is generally because the LLM hallucinated bad code or incorrect commands. We are working on making this more transparent so it is obvious. Sometimes the error will appear in developer console too so check that as well. ### How to add a LLM: -To make new LLMs available to use in this version of Bolt.new, head on over to `app/utils/constants.ts` and find the constant MODEL_LIST. Each element in this array is an object that has the model ID for the name (get this from the provider's API documentation), a label for the frontend model dropdown, and the provider. +To make new LLMs available to use in this version of bolt.new, head on over to `app/utils/constants.ts` and find the constant MODEL_LIST. Each element in this array is an object that has the model ID for the name (get this from the provider's API documentation), a label for the frontend model dropdown, and the provider. By default, Anthropic, OpenAI, Groq, and Ollama are implemented as providers, but the YouTube video for this repo covers how to extend this to work with more providers if you wish! diff --git a/README.md b/README.md index 44852f6..dedae4e 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ -[![Bolt.diy: AI-Powered Full-Stack Web Development in the Browser](./public/social_preview_index.jpg)](https://bolt.diy) +[![bolt.diy: AI-Powered Full-Stack Web Development in the Browser](./public/social_preview_index.jpg)](https://bolt.diy) -# Bolt.diy (Previously oTToDev) +# bolt.diy (Previously oTToDev) -Welcome to Bolt.diy, the official open source version of Bolt.new (previously known as oTToDev and Bolt.new ANY LLM), which allows you to choose the LLM that you use for each prompt! Currently, you can use OpenAI, Anthropic, Ollama, OpenRouter, Gemini, LMStudio, Mistral, xAI, HuggingFace, DeepSeek, or Groq models - and it is easily extended to use any other model supported by the Vercel AI SDK! See the instructions below for running this locally and extending it to include more models. +Welcome to bolt.diy, the official open source version of Bolt.new (previously known as oTToDev and bolt.new ANY LLM), which allows you to choose the LLM that you use for each prompt! Currently, you can use OpenAI, Anthropic, Ollama, OpenRouter, Gemini, LMStudio, Mistral, xAI, HuggingFace, DeepSeek, or Groq models - and it is easily extended to use any other model supported by the Vercel AI SDK! See the instructions below for running this locally and extending it to include more models. -Check the [Bolt.diy Docs](https://stackblitz-labs.github.io/bolt.diy/) for more information. This documentation is still being updated after the transfer. +Check the [bolt.diy Docs](https://stackblitz-labs.github.io/bolt.diy/) for more information. This documentation is still being updated after the transfer. -Bolt.diy was originally started by [Cole Medin](https://www.youtube.com/@ColeMedin) but has quickly grown into a massive community effort to build the BEST open source AI coding assistant! +bolt.diy was originally started by [Cole Medin](https://www.youtube.com/@ColeMedin) but has quickly grown into a massive community effort to build the BEST open source AI coding assistant! -## Join the community for Bolt.diy! +## Join the community for bolt.diy! https://thinktank.ottomator.ai @@ -20,7 +20,7 @@ https://thinktank.ottomator.ai - ✅ Autogenerate Ollama models from what is downloaded (@yunatamos) - ✅ Filter models by provider (@jasonm23) - ✅ Download project as ZIP (@fabwaseem) -- ✅ Improvements to the main Bolt.new prompt in `app\lib\.server\llm\prompts.ts` (@kofi-bhr) +- ✅ Improvements to the main bolt.new prompt in `app\lib\.server\llm\prompts.ts` (@kofi-bhr) - ✅ DeepSeek API Integration (@zenith110) - ✅ Mistral API Integration (@ArulGandhi) - ✅ "Open AI Like" API Integration (@ZerxZ) @@ -45,7 +45,7 @@ https://thinktank.ottomator.ai - ✅ Attach images to prompts (@atrokhym) - ✅ Detect package.json and commands to auto install and run preview for folder and git import (@wonderwhy-er) - ✅ Selection tool to target changes visually (@emcconnell) -- ⬜ **HIGH PRIORITY** - Prevent Bolt from rewriting files as often (file locking and diffs) +- ⬜ **HIGH PRIORITY** - Prevent bolt from rewriting files as often (file locking and diffs) - ⬜ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start) - ⬜ **HIGH PRIORITY** - Run agents in the backend as opposed to a single model call - ⬜ Deploy directly to Vercel/Netlify/other similar platforms @@ -57,7 +57,7 @@ https://thinktank.ottomator.ai - ⬜ Perplexity Integration - ⬜ Vertex AI Integration -## Bolt.diy Features +## bolt.diy Features - **AI-powered full-stack web development** directly in your browser. - **Support for multiple LLMs** with an extensible architecture to integrate additional models. @@ -67,7 +67,7 @@ https://thinktank.ottomator.ai - **Download projects as ZIP** for easy portability. - **Integration-ready Docker support** for a hassle-free setup. -## Setup Bolt.diy +## Setup bolt.diy If you're new to installing software from GitHub, don't worry! If you encounter any issues, feel free to submit an "issue" using the provided links or improve this documentation by forking the repository, editing the instructions, and submitting a pull request. The following instruction will help you get the stable branch up and running on your local machine in no time. @@ -175,7 +175,7 @@ DEFAULT_NUM_CTX=8192 ### Update Your Local Version to the Latest -To keep your local version of Bolt.diy up to date with the latest changes, follow these steps for your operating system: +To keep your local version of bolt.diy up to date with the latest changes, follow these steps for your operating system: #### 1. **Navigate to your project folder** Navigate to the directory where you cloned the repository and open a terminal: @@ -201,34 +201,36 @@ To keep your local version of Bolt.diy up to date with the latest changes, follo pnpm run dev ``` -This ensures that you're running the latest version of Bolt.diy and can take advantage of all the newest features and bug fixes. +This ensures that you're running the latest version of bolt.diy and can take advantage of all the newest features and bug fixes. --- -## Available Scripts +## Available Scripts -Here are the available commands for managing the application: +- **`pnpm run dev`**: Starts the development server. +- **`pnpm run build`**: Builds the project. +- **`pnpm run start`**: Runs the built application locally using Wrangler Pages. +- **`pnpm run preview`**: Builds and runs the production build locally. +- **`pnpm test`**: Runs the test suite using Vitest. +- **`pnpm run typecheck`**: Runs TypeScript type checking. +- **`pnpm run typegen`**: Generates TypeScript types using Wrangler. +- **`pnpm run deploy`**: Deploys the project to Cloudflare Pages. +- **`pnpm run lint:fix`**: Automatically fixes linting issues. -- `pnpm run dev`: Start the development server. -- `pnpm run build`: Build the project. -- `pnpm run start`: Run the built application locally (uses Wrangler Pages). -- `pnpm run preview`: Build and start the application locally for production testing. -- `pnpm test`: Run the test suite using Vitest. -- `pnpm run typecheck`: Perform TypeScript type checking. -- `pnpm run typegen`: Generate TypeScript types using Wrangler. -- `pnpm run deploy`: Build and deploy the project to Cloudflare Pages. -- `pnpm lint:fix`: Run the linter and automatically fix issues. +--- -## How do I contribute to Bolt.diy? +## Contributing -[Please check out our dedicated page for contributing to Bolt.diy here!](CONTRIBUTING.md) +We welcome contributions! Check out our [Contributing Guide](CONTRIBUTING.md) to get started. -## What are the future plans for Bolt.diy? +--- -[Check out our Roadmap here!](https://roadmap.sh/r/ottodev-roadmap-2ovzo) +## Roadmap -Lot more updates to this roadmap coming soon! +Explore upcoming features and priorities on our [Roadmap](https://roadmap.sh/r/ottodev-roadmap-2ovzo). + +--- ## FAQ -[Please check out our dedicated page for FAQ's related to Bolt.diy here!](FAQ.md) +For answers to common questions, visit our [FAQ Page](FAQ.md). From aa3559149f7db835bbbdd5b7cc896031ecb18f06 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sat, 14 Dec 2024 20:35:41 -0500 Subject: [PATCH 11/54] Update DebugTab.tsx --- app/components/settings/debug/DebugTab.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/components/settings/debug/DebugTab.tsx b/app/components/settings/debug/DebugTab.tsx index 9b2a1b3..1eacd11 100644 --- a/app/components/settings/debug/DebugTab.tsx +++ b/app/components/settings/debug/DebugTab.tsx @@ -266,7 +266,12 @@ export default function DebugTab() { throw new Error('Failed to fetch repository information'); } - const localCommitData = await localCommitResponse.json(); + // Define the expected structure of the commit data + interface CommitData { + commit: string; + } + + const localCommitData: CommitData = await localCommitResponse.json(); // Explicitly define the type here const originalCommitHash = localCommitData.commit; // Use the fetched commit hash const currentLocalCommitHash = commit.commit; // Your current local commit hash From 2cb8c825d077c08b209e8aa11e897db772ce7850 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sat, 14 Dec 2024 22:25:28 -0500 Subject: [PATCH 12/54] ui-ux: prompt enhanced toast notification changed prompt enhanced to give a toast notification instead of changing the ui. --- app/components/chat/BaseChat.tsx | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index 09f3c16..162241d 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -27,6 +27,7 @@ import { ModelSelector } from '~/components/chat/ModelSelector'; import { SpeechRecognitionButton } from '~/components/chat/SpeechRecognition'; import type { IProviderSetting, ProviderInfo } from '~/types/model'; import { ScreenshotStateManager } from './ScreenshotStateManager'; +import { toast } from 'react-toastify'; const TEXTAREA_MIN_HEIGHT = 76; @@ -492,22 +493,16 @@ export const BaseChat = React.forwardRef( className={classNames( 'transition-all', enhancingPrompt ? 'opacity-100' : '', - promptEnhanced ? 'text-bolt-elements-item-contentAccent' : '', - promptEnhanced ? 'pr-1.5' : '', - promptEnhanced ? 'enabled:hover:bg-bolt-elements-item-backgroundAccent' : '', )} - onClick={() => enhancePrompt?.()} + onClick={() => { + enhancePrompt?.(); + toast.success('Prompt enhanced!'); + }} > {enhancingPrompt ? ( - <> -
-
Enhancing prompt...
- +
) : ( - <> -
- {promptEnhanced &&
Prompt enhanced
} - +
)} From b8e457eeb7fa5c07cfa320e3d115357210c58606 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 09:45:21 +0000 Subject: [PATCH 13/54] chore: update commit hash to b06f6e3a3e7e5b2b5f8d9b13a761422993559f3e --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index 1636c99..f5eca82 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "ece0213500a94a6b29e29512c5040baf57884014" } +{ "commit": "b06f6e3a3e7e5b2b5f8d9b13a761422993559f3e" } From 4ea38e8766324751cf6af0442d9a9bcd490e6492 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 09:52:57 +0000 Subject: [PATCH 14/54] chore: update commit hash to 25fe15232fcd6cee83f179adbd1d3e7d6a90acca --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index f5eca82..cad0f3e 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "b06f6e3a3e7e5b2b5f8d9b13a761422993559f3e" } +{ "commit": "25fe15232fcd6cee83f179adbd1d3e7d6a90acca" } From ecbf2f3bcd9832045c669ce5074e5f5e556481f5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 12:21:08 +0000 Subject: [PATCH 15/54] chore: update commit hash to a87cfd79503a62db2be00656f4874ec747d76a09 --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index cad0f3e..71ef89e 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "25fe15232fcd6cee83f179adbd1d3e7d6a90acca" } +{ "commit": "a87cfd79503a62db2be00656f4874ec747d76a09" } From 4541a3e9dd6797d13eb5928053639f49a985f65a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 13:08:52 +0000 Subject: [PATCH 16/54] chore: update commit hash to 7c3a3bbde6c61f374a6d37c888c6900a335e3d33 --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index 71ef89e..43e2b5a 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "a87cfd79503a62db2be00656f4874ec747d76a09" } +{ "commit": "7c3a3bbde6c61f374a6d37c888c6900a335e3d33" } From 61ac8f9808135bc47042373a8906ef61632a621b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 13:09:26 +0000 Subject: [PATCH 17/54] chore: update commit hash to d936c012bdeb210ee876be1941ef8e370ea0b2e3 --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index 43e2b5a..6404e85 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "7c3a3bbde6c61f374a6d37c888c6900a335e3d33" } +{ "commit": "d936c012bdeb210ee876be1941ef8e370ea0b2e3" } From fc13754788686fa55128c531bf09e27e5ddd4770 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 13:22:09 +0000 Subject: [PATCH 18/54] chore: update commit hash to b3f7a5c3785060c7937dcd681b38f17b5396fc84 --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index 6404e85..853bd90 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "d936c012bdeb210ee876be1941ef8e370ea0b2e3" } +{ "commit": "b3f7a5c3785060c7937dcd681b38f17b5396fc84" } From 558d4b2e10dd9db2e923a44c093ba1962ee8a470 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 08:44:57 -0500 Subject: [PATCH 19/54] ui: fallback icon for provider Added a fallback icon for providers --- app/components/settings/providers/ProvidersTab.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/components/settings/providers/ProvidersTab.tsx b/app/components/settings/providers/ProvidersTab.tsx index 0efbc66..1c6e87d 100644 --- a/app/components/settings/providers/ProvidersTab.tsx +++ b/app/components/settings/providers/ProvidersTab.tsx @@ -5,6 +5,9 @@ import { LOCAL_PROVIDERS, URL_CONFIGURABLE_PROVIDERS } from '~/lib/stores/settin import type { IProviderConfig } from '~/types/model'; import { logStore } from '~/lib/stores/logs'; +// Import a default fallback icon +import DefaultIcon from '/icons/Ollama.svg'; // Adjust the path as necessary + export default function ProvidersTab() { const { providers, updateProviderSettings, isLocalModel } = useSettings(); const [filteredProviders, setFilteredProviders] = useState([]); @@ -51,7 +54,14 @@ export default function ProvidersTab() { >
- {`${provider.name} + { // Fallback to default icon on error + e.currentTarget.src = DefaultIcon; + }} + alt={`${provider.name} icon`} + className="w-6 h-6 dark:invert" + /> {provider.name}
Date: Sun, 15 Dec 2024 13:48:21 +0000 Subject: [PATCH 20/54] chore: update commit hash to 23346f6271bf2f438489660357e6ffee803befb1 --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index 853bd90..053efc0 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "b3f7a5c3785060c7937dcd681b38f17b5396fc84" } +{ "commit": "23346f6271bf2f438489660357e6ffee803befb1" } From c54e6e588e06572feb8009b4c1bc4f2cf1bd5f01 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 09:04:44 -0500 Subject: [PATCH 21/54] Update README.md changed 'and' to '&' so that it would fit on one line --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dedae4e..405e388 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ https://thinktank.ottomator.ai - ✅ Mobile friendly (@qwikode) - ✅ Better prompt enhancing (@SujalXplores) - ✅ Attach images to prompts (@atrokhym) -- ✅ Detect package.json and commands to auto install and run preview for folder and git import (@wonderwhy-er) +- ✅ Detect package.json and commands to auto install & run preview for folder and git import (@wonderwhy-er) - ✅ Selection tool to target changes visually (@emcconnell) - ⬜ **HIGH PRIORITY** - Prevent bolt from rewriting files as often (file locking and diffs) - ⬜ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start) From 2bb9f609dce1f39adb0afeaecbc4a956aa77742e Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 10:19:31 -0500 Subject: [PATCH 22/54] add: Perplexity Provider Icon added the provider icon for Perplexity --- public/icons/Perplexity.svg | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 public/icons/Perplexity.svg diff --git a/public/icons/Perplexity.svg b/public/icons/Perplexity.svg new file mode 100644 index 0000000..950b09e --- /dev/null +++ b/public/icons/Perplexity.svg @@ -0,0 +1,4 @@ + + + + From 825137a44774425ac20c2717de9a4e4a9eebd228 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 15:25:48 +0000 Subject: [PATCH 23/54] chore: update commit hash to 9cd9ee9088467882e1e4efdf491959619307cc9d --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index 053efc0..30a055c 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "23346f6271bf2f438489660357e6ffee803befb1" } +{ "commit": "9cd9ee9088467882e1e4efdf491959619307cc9d" } From ed6433e8cd4acf1e5c742745e33d1a071f8f70b1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 15:27:46 +0000 Subject: [PATCH 24/54] chore: update commit hash to 87a90718d31bd8ec501cb32f863efd26156fb1e2 --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index 30a055c..5311377 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "9cd9ee9088467882e1e4efdf491959619307cc9d" } +{ "commit": "87a90718d31bd8ec501cb32f863efd26156fb1e2" } From a698fba1c74aacb6b89dfd97e81053030af61973 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 11:00:23 -0500 Subject: [PATCH 25/54] feat: start update by branch Here is a start to the update by branch --- .github/workflows/commit.yaml | 7 +++++-- app/commit.json | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index d5db06b..fc41e67 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -20,14 +20,17 @@ jobs: - name: Get the latest commit hash run: echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV + - name: Get the current branch name + run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV + - name: Update commit file run: | - echo "{ \"commit\": \"$COMMIT_HASH\" }" > app/commit.json + echo "{ \"commit\": \"$COMMIT_HASH\", \"branch\": \"$BRANCH_NAME\" }" > app/commit.json - name: Commit and push the update run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" git add app/commit.json - git commit -m "chore: update commit hash to $COMMIT_HASH" + git commit -m "chore: update commit hash to $COMMIT_HASH on branch $BRANCH_NAME" git push \ No newline at end of file diff --git a/app/commit.json b/app/commit.json index 1636c99..aba90c6 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "ece0213500a94a6b29e29512c5040baf57884014" } +{ "commit": "87a90718d31bd8ec501cb32f863efd26156fb1e2", "branch": "main" } From b160d23b4822b935f465c338c71892cff44adb42 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 11:06:33 -0500 Subject: [PATCH 26/54] update by branch --- app/components/settings/debug/DebugTab.tsx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/components/settings/debug/DebugTab.tsx b/app/components/settings/debug/DebugTab.tsx index 1eacd11..30f0fb4 100644 --- a/app/components/settings/debug/DebugTab.tsx +++ b/app/components/settings/debug/DebugTab.tsx @@ -36,7 +36,7 @@ const versionHash = commit.commit; const GITHUB_URLS = { original: 'https://api.github.com/repos/stackblitz-labs/bolt.diy/commits/main', fork: 'https://api.github.com/repos/Stijnus/bolt.new-any-llm/commits/main', - commitJson: 'https://raw.githubusercontent.com/stackblitz-labs/bolt.diy/main/app/commit.json', + commitJson: (branch: string) => `https://raw.githubusercontent.com/stackblitz-labs/bolt.diy/${branch}/app/commit.json`, }; function getSystemInfo(): SystemInfo { @@ -260,8 +260,11 @@ export default function DebugTab() { setIsCheckingUpdate(true); setUpdateMessage('Checking for updates...'); - // Fetch the commit data from the specified URL - const localCommitResponse = await fetch(GITHUB_URLS.commitJson); + // Get current branch from commit.json + const currentBranch = commit.branch || 'main'; + + // Fetch the commit data from the specified URL for the current branch + const localCommitResponse = await fetch(GITHUB_URLS.commitJson(currentBranch)); if (!localCommitResponse.ok) { throw new Error('Failed to fetch repository information'); } @@ -269,21 +272,22 @@ export default function DebugTab() { // Define the expected structure of the commit data interface CommitData { commit: string; + branch: string; } - const localCommitData: CommitData = await localCommitResponse.json(); // Explicitly define the type here - const originalCommitHash = localCommitData.commit; // Use the fetched commit hash + const localCommitData: CommitData = await localCommitResponse.json(); + const originalCommitHash = localCommitData.commit; - const currentLocalCommitHash = commit.commit; // Your current local commit hash + const currentLocalCommitHash = commit.commit; if (originalCommitHash !== currentLocalCommitHash) { setUpdateMessage( - `Update available from original repository!\n` + + `Update available from original repository (${currentBranch} branch)!\n` + `Current: ${currentLocalCommitHash.slice(0, 7)}\n` + `Latest: ${originalCommitHash.slice(0, 7)}` ); } else { - setUpdateMessage('You are on the latest version from the original repository'); + setUpdateMessage(`You are on the latest version from the original repository (${currentBranch} branch)`); } } catch (error) { setUpdateMessage('Failed to check for updates'); From 253e37f901f915867990f50ae75ff881f2234749 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 12:06:42 -0500 Subject: [PATCH 27/54] Update commit.yaml now runs on all branches for auto update to work correctly --- .github/workflows/commit.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index fc41e67..03ea02c 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -3,7 +3,7 @@ name: Update Commit Hash File on: push: branches: - - main + - '**' permissions: contents: write @@ -33,4 +33,4 @@ jobs: git config --global user.email "github-actions[bot]@users.noreply.github.com" git add app/commit.json git commit -m "chore: update commit hash to $COMMIT_HASH on branch $BRANCH_NAME" - git push \ No newline at end of file + git push From 348f396d32ef7b2ea96f9963737089770b8e61ec Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 12:10:44 -0500 Subject: [PATCH 28/54] Update commit.yaml --- .github/workflows/commit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index 03ea02c..f6c9a6e 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -3,7 +3,7 @@ name: Update Commit Hash File on: push: branches: - - '**' + - 'main' permissions: contents: write From fe24f3c011622cea50f1212cf4abd6457b92db8c Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 12:33:53 -0500 Subject: [PATCH 29/54] doc: branding update Changed Bolt to bolt and moved the section above the TOC to under it --- docs/docs/CONTRIBUTING.md | 14 +++++++------- docs/docs/FAQ.md | 16 ++++++++-------- docs/docs/index.md | 22 +++++++++++----------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/docs/CONTRIBUTING.md b/docs/docs/CONTRIBUTING.md index b1232f9..a309ec7 100644 --- a/docs/docs/CONTRIBUTING.md +++ b/docs/docs/CONTRIBUTING.md @@ -1,10 +1,4 @@ -# Contribution Guidelines - -## DEFAULT_NUM_CTX - -The `DEFAULT_NUM_CTX` environment variable can be used to limit the maximum number of context values used by the qwen2.5-coder model. For example, to limit the context to 24576 values (which uses 32GB of VRAM), set `DEFAULT_NUM_CTX=24576` in your `.env.local` file. - -First off, thank you for considering contributing to Bolt.diy! This fork aims to expand the capabilities of the original project by integrating multiple LLM providers and enhancing functionality. Every contribution helps make Bolt.diy a better tool for developers worldwide. +# bolt.diy Contribution Guidelines ## 📋 Table of Contents - [Code of Conduct](#code-of-conduct) @@ -210,6 +204,12 @@ Ensure you have the appropriate `.env.local` file configured before running the - Environment-specific configurations - Other required environment variables +## DEFAULT_NUM_CTX + +The `DEFAULT_NUM_CTX` environment variable can be used to limit the maximum number of context values used by the qwen2.5-coder model. For example, to limit the context to 24576 values (which uses 32GB of VRAM), set `DEFAULT_NUM_CTX=24576` in your `.env.local` file. + +First off, thank you for considering contributing to bolt.diy! This fork aims to expand the capabilities of the original project by integrating multiple LLM providers and enhancing functionality. Every contribution helps make bolt.diy a better tool for developers worldwide. + ## Notes - Port 5173 is exposed and mapped for both development and production environments diff --git a/docs/docs/FAQ.md b/docs/docs/FAQ.md index 0c339c6..0043366 100644 --- a/docs/docs/FAQ.md +++ b/docs/docs/FAQ.md @@ -1,15 +1,15 @@ -# Frequently Asked Questions (FAQ) +# bolt.diy Frequently Asked Questions (FAQ) -## How do I get the best results with Bolt.diy? +## How do I get the best results with bolt.diy? - **Be specific about your stack**: - Mention the frameworks or libraries you want to use (e.g., Astro, Tailwind, ShadCN) in your initial prompt. This ensures that Bolt.diy scaffolds the project according to your preferences. + Mention the frameworks or libraries you want to use (e.g., Astro, Tailwind, ShadCN) in your initial prompt. This ensures that bolt.diy scaffolds the project according to your preferences. - **Use the enhance prompt icon**: Before sending your prompt, click the *enhance* icon to let the AI refine your prompt. You can edit the suggested improvements before submitting. - **Scaffold the basics first, then add features**: - Ensure the foundational structure of your application is in place before introducing advanced functionality. This helps Bolt.diy establish a solid base to build on. + Ensure the foundational structure of your application is in place before introducing advanced functionality. This helps bolt.diy establish a solid base to build on. - **Batch simple instructions**: Combine simple tasks into a single prompt to save time and reduce API credit consumption. For example: @@ -17,14 +17,14 @@ --- -## How do I contribute to Bolt.diy? +## How do I contribute to bolt.diy? Check out our [Contribution Guide](CONTRIBUTING.md) for more details on how to get involved! --- -## What are the future plans for Bolt.diy? +## What are the future plans for bolt.diy? Visit our [Roadmap](https://roadmap.sh/r/ottodev-roadmap-2ovzo) for the latest updates. New features and improvements are on the way! @@ -33,13 +33,13 @@ New features and improvements are on the way! ## Why are there so many open issues/pull requests? -Bolt.diy began as a small showcase project on @ColeMedin's YouTube channel to explore editing open-source projects with local LLMs. However, it quickly grew into a massive community effort! +bolt.diy began as a small showcase project on @ColeMedin's YouTube channel to explore editing open-source projects with local LLMs. However, it quickly grew into a massive community effort! We’re forming a team of maintainers to manage demand and streamline issue resolution. The maintainers are rockstars, and we’re also exploring partnerships to help the project thrive. --- -## How do local LLMs compare to larger models like Claude 3.5 Sonnet for Bolt.diy? +## How do local LLMs compare to larger models like Claude 3.5 Sonnet for bolt.diy? While local LLMs are improving rapidly, larger models like GPT-4o, Claude 3.5 Sonnet, and DeepSeek Coder V2 236b still offer the best results for complex applications. Our ongoing focus is to improve prompts, agents, and the platform to better support smaller local LLMs. diff --git a/docs/docs/index.md b/docs/docs/index.md index 8a4d341..029444b 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -1,28 +1,28 @@ -# Welcome to Bolt DIY -Bolt.diy allows you to choose the LLM that you use for each prompt! Currently, you can use OpenAI, Anthropic, Ollama, OpenRouter, Gemini, LMStudio, Mistral, xAI, HuggingFace, DeepSeek, or Groq models - and it is easily extended to use any other model supported by the Vercel AI SDK! See the instructions below for running this locally and extending it to include more models. +# Welcome to bolt diy +bolt.diy allows you to choose the LLM that you use for each prompt! Currently, you can use OpenAI, Anthropic, Ollama, OpenRouter, Gemini, LMStudio, Mistral, xAI, HuggingFace, DeepSeek, or Groq models - and it is easily extended to use any other model supported by the Vercel AI SDK! See the instructions below for running this locally and extending it to include more models. Join the community! https://thinktank.ottomator.ai -## Whats Bolt.diy +## Whats bolt.diy -Bolt.diy is an AI-powered web development agent that allows you to prompt, run, edit, and deploy full-stack applications directly from your browser—no local setup required. If you're here to build your own AI-powered web dev agent using the Bolt open source codebase, [click here to get started!](./CONTRIBUTING.md) +bolt.diy is an AI-powered web development agent that allows you to prompt, run, edit, and deploy full-stack applications directly from your browser—no local setup required. If you're here to build your own AI-powered web dev agent using the Bolt open source codebase, [click here to get started!](./CONTRIBUTING.md) -## What Makes Bolt.diy Different +## What Makes bolt.diy Different -Claude, v0, etc are incredible- but you can't install packages, run backends, or edit code. That’s where Bolt.diy stands out: +Claude, v0, etc are incredible- but you can't install packages, run backends, or edit code. That’s where bolt.diy stands out: -- **Full-Stack in the Browser**: Bolt.diy integrates cutting-edge AI models with an in-browser development environment powered by **StackBlitz’s WebContainers**. This allows you to: +- **Full-Stack in the Browser**: bolt.diy integrates cutting-edge AI models with an in-browser development environment powered by **StackBlitz’s WebContainers**. This allows you to: - Install and run npm tools and libraries (like Vite, Next.js, and more) - Run Node.js servers - Interact with third-party APIs - Deploy to production from chat - Share your work via a URL -- **AI with Environment Control**: Unlike traditional dev environments where the AI can only assist in code generation, Bolt.diy gives AI models **complete control** over the entire environment including the filesystem, node server, package manager, terminal, and browser console. This empowers AI agents to handle the whole app lifecycle—from creation to deployment. +- **AI with Environment Control**: Unlike traditional dev environments where the AI can only assist in code generation, bolt.diy gives AI models **complete control** over the entire environment including the filesystem, node server, package manager, terminal, and browser console. This empowers AI agents to handle the whole app lifecycle—from creation to deployment. -Whether you’re an experienced developer, a PM, or a designer, Bolt.diy allows you to easily build production-grade full-stack applications. +Whether you’re an experienced developer, a PM, or a designer, bolt.diy allows you to easily build production-grade full-stack applications. For developers interested in building their own AI-powered development tools with WebContainers, check out the open-source Bolt codebase in this repo! @@ -150,7 +150,7 @@ pnpm run dev ## Adding New LLMs: -To make new LLMs available to use in this version of Bolt.diy, head on over to `app/utils/constants.ts` and find the constant MODEL_LIST. Each element in this array is an object that has the model ID for the name (get this from the provider's API documentation), a label for the frontend model dropdown, and the provider. +To make new LLMs available to use in this version of bolt.diy, head on over to `app/utils/constants.ts` and find the constant MODEL_LIST. Each element in this array is an object that has the model ID for the name (get this from the provider's API documentation), a label for the frontend model dropdown, and the provider. By default, Anthropic, OpenAI, Groq, and Ollama are implemented as providers, but the YouTube video for this repo covers how to extend this to work with more providers if you wish! @@ -179,7 +179,7 @@ This will start the Remix Vite development server. You will need Google Chrome C ## Tips and Tricks -Here are some tips to get the most out of Bolt.diy: +Here are some tips to get the most out of bolt.diy: - **Be specific about your stack**: If you want to use specific frameworks or libraries (like Astro, Tailwind, ShadCN, or any other popular JavaScript framework), mention them in your initial prompt to ensure Bolt scaffolds the project accordingly. From 69b1dc4c9a218046a994ba681c98be54a3ad7fb8 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 12:56:25 -0500 Subject: [PATCH 30/54] updated to use settings for branch selection --- .github/workflows/commit.yaml | 11 ++--- app/commit.json | 2 +- app/components/settings/debug/DebugTab.tsx | 41 ++++++++----------- .../settings/features/FeaturesTab.tsx | 17 ++++++-- app/lib/hooks/useSettings.tsx | 17 ++++++++ app/lib/stores/settings.ts | 2 + 6 files changed, 55 insertions(+), 35 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index f6c9a6e..d5db06b 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -3,7 +3,7 @@ name: Update Commit Hash File on: push: branches: - - 'main' + - main permissions: contents: write @@ -20,17 +20,14 @@ jobs: - name: Get the latest commit hash run: echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV - - name: Get the current branch name - run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - - name: Update commit file run: | - echo "{ \"commit\": \"$COMMIT_HASH\", \"branch\": \"$BRANCH_NAME\" }" > app/commit.json + echo "{ \"commit\": \"$COMMIT_HASH\" }" > app/commit.json - name: Commit and push the update run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" git add app/commit.json - git commit -m "chore: update commit hash to $COMMIT_HASH on branch $BRANCH_NAME" - git push + git commit -m "chore: update commit hash to $COMMIT_HASH" + git push \ No newline at end of file diff --git a/app/commit.json b/app/commit.json index aba90c6..5311377 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "87a90718d31bd8ec501cb32f863efd26156fb1e2", "branch": "main" } +{ "commit": "87a90718d31bd8ec501cb32f863efd26156fb1e2" } diff --git a/app/components/settings/debug/DebugTab.tsx b/app/components/settings/debug/DebugTab.tsx index d827652..9a8b12f 100644 --- a/app/components/settings/debug/DebugTab.tsx +++ b/app/components/settings/debug/DebugTab.tsx @@ -202,7 +202,7 @@ const checkProviderStatus = async (url: string | null, providerName: string): Pr }; export default function DebugTab() { - const { providers } = useSettings(); + const { providers, useLatestBranch } = useSettings(); const [activeProviders, setActiveProviders] = useState([]); const [updateMessage, setUpdateMessage] = useState(''); const [systemInfo] = useState(getSystemInfo()); @@ -261,34 +261,26 @@ export default function DebugTab() { setIsCheckingUpdate(true); setUpdateMessage('Checking for updates...'); - // Get current branch from commit.json - const currentBranch = commit.branch || 'main'; + const branchToCheck = useLatestBranch ? 'main' : 'stable'; + console.log(`[Debug] Checking for updates against ${branchToCheck} branch`); - // Fetch the commit data from the specified URL for the current branch - const localCommitResponse = await fetch(GITHUB_URLS.commitJson(currentBranch)); + const localCommitResponse = await fetch(GITHUB_URLS.commitJson(branchToCheck)); if (!localCommitResponse.ok) { throw new Error('Failed to fetch repository information'); } - // Define the expected structure of the commit data - interface CommitData { - commit: string; - branch: string; - } + const localCommitData = await localCommitResponse.json(); + const remoteCommitHash = localCommitData.commit; + const currentCommitHash = versionHash; - const localCommitData: CommitData = await localCommitResponse.json(); - const originalCommitHash = localCommitData.commit; - - const currentLocalCommitHash = commit.commit; - - if (originalCommitHash !== currentLocalCommitHash) { + if (remoteCommitHash !== currentCommitHash) { setUpdateMessage( - `Update available from original repository (${currentBranch} branch)!\n` + - `Current: ${currentLocalCommitHash.slice(0, 7)}\n` + - `Latest: ${originalCommitHash.slice(0, 7)}` + `Update available from ${branchToCheck} branch!\n` + + `Current: ${currentCommitHash.slice(0, 7)}\n` + + `Latest: ${remoteCommitHash.slice(0, 7)}` ); } else { - setUpdateMessage(`You are on the latest version from the original repository (${currentBranch} branch)`); + setUpdateMessage(`You are on the latest version from the ${branchToCheck} branch`); } } catch (error) { setUpdateMessage('Failed to check for updates'); @@ -296,7 +288,7 @@ export default function DebugTab() { } finally { setIsCheckingUpdate(false); } - }, [isCheckingUpdate]); + }, [isCheckingUpdate, useLatestBranch]); const handleCopyToClipboard = useCallback(() => { const debugInfo = { @@ -311,14 +303,17 @@ export default function DebugTab() { responseTime: provider.responseTime, url: provider.url, })), - Version: versionHash, + Version: { + hash: versionHash.slice(0, 7), + branch: useLatestBranch ? 'main' : 'stable' + }, Timestamp: new Date().toISOString(), }; navigator.clipboard.writeText(JSON.stringify(debugInfo, null, 2)).then(() => { toast.success('Debug information copied to clipboard!'); }); - }, [activeProviders, systemInfo]); + }, [activeProviders, systemInfo, useLatestBranch]); return (
diff --git a/app/components/settings/features/FeaturesTab.tsx b/app/components/settings/features/FeaturesTab.tsx index 0ef7a5d..c0b33ad 100644 --- a/app/components/settings/features/FeaturesTab.tsx +++ b/app/components/settings/features/FeaturesTab.tsx @@ -3,7 +3,7 @@ import { Switch } from '~/components/ui/Switch'; import { useSettings } from '~/lib/hooks/useSettings'; export default function FeaturesTab() { - const { debug, enableDebugMode, isLocalModel, enableLocalModels, eventLogs, enableEventLogs } = useSettings(); + const { debug, enableDebugMode, isLocalModel, enableLocalModels, eventLogs, enableEventLogs, useLatestBranch, enableLatestBranch } = useSettings(); const handleToggle = (enabled: boolean) => { enableDebugMode(enabled); @@ -14,9 +14,18 @@ export default function FeaturesTab() {

Optional Features

-
- Debug Features - +
+
+ Debug Features + +
+
+
+ Use Main Branch +

Check for updates against the main branch instead of stable

+
+ +
diff --git a/app/lib/hooks/useSettings.tsx b/app/lib/hooks/useSettings.tsx index 0e79651..52bfbaa 100644 --- a/app/lib/hooks/useSettings.tsx +++ b/app/lib/hooks/useSettings.tsx @@ -5,6 +5,7 @@ import { isLocalModelsEnabled, LOCAL_PROVIDERS, providersStore, + useLatestBranch, } from '~/lib/stores/settings'; import { useCallback, useEffect, useState } from 'react'; import Cookies from 'js-cookie'; @@ -16,6 +17,7 @@ export function useSettings() { const debug = useStore(isDebugMode); const eventLogs = useStore(isEventLogsEnabled); const isLocalModel = useStore(isLocalModelsEnabled); + const useLatest = useStore(useLatestBranch); const [activeProviders, setActiveProviders] = useState([]); // reading values from cookies on mount @@ -60,6 +62,13 @@ export function useSettings() { if (savedLocalModels) { isLocalModelsEnabled.set(savedLocalModels === 'true'); } + + // load latest branch setting from cookies + const savedLatestBranch = Cookies.get('useLatestBranch'); + + if (savedLatestBranch) { + useLatestBranch.set(savedLatestBranch === 'true'); + } }, []); // writing values to cookies on change @@ -111,6 +120,12 @@ export function useSettings() { Cookies.set('isLocalModelsEnabled', String(enabled)); }, []); + const enableLatestBranch = useCallback((enabled: boolean) => { + useLatestBranch.set(enabled); + logStore.logSystem(`Main branch updates ${enabled ? 'enabled' : 'disabled'}`); + Cookies.set('useLatestBranch', String(enabled)); + }, []); + return { providers, activeProviders, @@ -121,5 +136,7 @@ export function useSettings() { enableEventLogs, isLocalModel, enableLocalModels, + useLatestBranch: useLatest, + enableLatestBranch, }; } diff --git a/app/lib/stores/settings.ts b/app/lib/stores/settings.ts index abbb825..2d34270 100644 --- a/app/lib/stores/settings.ts +++ b/app/lib/stores/settings.ts @@ -46,3 +46,5 @@ export const isDebugMode = atom(false); export const isEventLogsEnabled = atom(false); export const isLocalModelsEnabled = atom(true); + +export const useLatestBranch = atom(false); From c5c3eee2675cb83774a1238735fd481e52851316 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 13:04:50 -0500 Subject: [PATCH 31/54] Update useSettings.tsx if it has not been set by the user yet set it correctly for them --- app/lib/hooks/useSettings.tsx | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/app/lib/hooks/useSettings.tsx b/app/lib/hooks/useSettings.tsx index 52bfbaa..e4716cd 100644 --- a/app/lib/hooks/useSettings.tsx +++ b/app/lib/hooks/useSettings.tsx @@ -11,6 +11,7 @@ import { useCallback, useEffect, useState } from 'react'; import Cookies from 'js-cookie'; import type { IProviderSetting, ProviderInfo } from '~/types/model'; import { logStore } from '~/lib/stores/logs'; // assuming logStore is imported from this location +import commit from '~/commit.json'; export function useSettings() { const providers = useStore(providersStore); @@ -20,6 +21,22 @@ export function useSettings() { const useLatest = useStore(useLatestBranch); const [activeProviders, setActiveProviders] = useState([]); + // Function to check if we're on stable version + const checkIsStableVersion = async () => { + try { + const stableResponse = await fetch('https://raw.githubusercontent.com/stackblitz-labs/bolt.diy/stable/app/commit.json'); + if (!stableResponse.ok) { + console.warn('Failed to fetch stable commit info'); + return false; + } + const stableData = await stableResponse.json(); + return commit.commit === stableData.commit; + } catch (error) { + console.warn('Error checking stable version:', error); + return false; + } + }; + // reading values from cookies on mount useEffect(() => { const savedProviders = Cookies.get('providers'); @@ -63,10 +80,16 @@ export function useSettings() { isLocalModelsEnabled.set(savedLocalModels === 'true'); } - // load latest branch setting from cookies + // load latest branch setting from cookies or determine based on version const savedLatestBranch = Cookies.get('useLatestBranch'); - - if (savedLatestBranch) { + if (savedLatestBranch === undefined) { + // If setting hasn't been set by user, check version + checkIsStableVersion().then(isStable => { + const shouldUseLatest = !isStable; + useLatestBranch.set(shouldUseLatest); + Cookies.set('useLatestBranch', String(shouldUseLatest)); + }); + } else { useLatestBranch.set(savedLatestBranch === 'true'); } }, []); From 51347edd28692934c4b4e72253a71607a5bde2fd Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 13:08:16 -0500 Subject: [PATCH 32/54] quick fix --- app/components/settings/debug/DebugTab.tsx | 8 ++++++-- app/lib/hooks/useSettings.tsx | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/components/settings/debug/DebugTab.tsx b/app/components/settings/debug/DebugTab.tsx index 9a8b12f..fea78c8 100644 --- a/app/components/settings/debug/DebugTab.tsx +++ b/app/components/settings/debug/DebugTab.tsx @@ -32,6 +32,10 @@ interface IProviderConfig { }; } +interface CommitData { + commit: string; +} + const LOCAL_PROVIDERS = ['Ollama', 'LMStudio', 'OpenAILike']; const versionHash = commit.commit; const GITHUB_URLS = { @@ -266,10 +270,10 @@ export default function DebugTab() { const localCommitResponse = await fetch(GITHUB_URLS.commitJson(branchToCheck)); if (!localCommitResponse.ok) { - throw new Error('Failed to fetch repository information'); + throw new Error('Failed to fetch local commit info'); } - const localCommitData = await localCommitResponse.json(); + const localCommitData = await localCommitResponse.json() as CommitData; const remoteCommitHash = localCommitData.commit; const currentCommitHash = versionHash; diff --git a/app/lib/hooks/useSettings.tsx b/app/lib/hooks/useSettings.tsx index e4716cd..038222c 100644 --- a/app/lib/hooks/useSettings.tsx +++ b/app/lib/hooks/useSettings.tsx @@ -13,6 +13,10 @@ import type { IProviderSetting, ProviderInfo } from '~/types/model'; import { logStore } from '~/lib/stores/logs'; // assuming logStore is imported from this location import commit from '~/commit.json'; +interface CommitData { + commit: string; +} + export function useSettings() { const providers = useStore(providersStore); const debug = useStore(isDebugMode); @@ -29,7 +33,7 @@ export function useSettings() { console.warn('Failed to fetch stable commit info'); return false; } - const stableData = await stableResponse.json(); + const stableData = await stableResponse.json() as CommitData; return commit.commit === stableData.commit; } catch (error) { console.warn('Error checking stable version:', error); From 30728ae5bdd79ef1c0ea43d6e417d6fd58d59d12 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 13:50:34 -0500 Subject: [PATCH 33/54] Update FAQ.md --- docs/docs/FAQ.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/FAQ.md b/docs/docs/FAQ.md index 0043366..95c4c75 100644 --- a/docs/docs/FAQ.md +++ b/docs/docs/FAQ.md @@ -1,4 +1,4 @@ -# bolt.diy Frequently Asked Questions (FAQ) +# Frequently Asked Questions (FAQ) ## How do I get the best results with bolt.diy? @@ -73,4 +73,4 @@ Local LLMs like Qwen-2.5-Coder are powerful for small applications but still exp --- -Got more questions? Feel free to reach out or open an issue in our GitHub repo! \ No newline at end of file +Got more questions? Feel free to reach out or open an issue in our GitHub repo! From aab917eb7e8c1b5df94832c9f1aa0f1bdc12796d Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 13:50:48 -0500 Subject: [PATCH 34/54] Update CONTRIBUTING.md --- docs/docs/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/CONTRIBUTING.md b/docs/docs/CONTRIBUTING.md index a309ec7..ce6d9f5 100644 --- a/docs/docs/CONTRIBUTING.md +++ b/docs/docs/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# bolt.diy Contribution Guidelines +# Contribution Guidelines ## 📋 Table of Contents - [Code of Conduct](#code-of-conduct) From b5c8d43d9e172d5efb271539268bccf79f6b60c9 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 14:06:37 -0500 Subject: [PATCH 35/54] quick fix --- app/lib/hooks/useSettings.tsx | 10 +++++----- app/lib/stores/settings.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/lib/hooks/useSettings.tsx b/app/lib/hooks/useSettings.tsx index 038222c..0a7d65e 100644 --- a/app/lib/hooks/useSettings.tsx +++ b/app/lib/hooks/useSettings.tsx @@ -5,7 +5,7 @@ import { isLocalModelsEnabled, LOCAL_PROVIDERS, providersStore, - useLatestBranch, + latestBranch, } from '~/lib/stores/settings'; import { useCallback, useEffect, useState } from 'react'; import Cookies from 'js-cookie'; @@ -22,7 +22,7 @@ export function useSettings() { const debug = useStore(isDebugMode); const eventLogs = useStore(isEventLogsEnabled); const isLocalModel = useStore(isLocalModelsEnabled); - const useLatest = useStore(useLatestBranch); + const useLatest = useStore(latestBranch); const [activeProviders, setActiveProviders] = useState([]); // Function to check if we're on stable version @@ -90,11 +90,11 @@ export function useSettings() { // If setting hasn't been set by user, check version checkIsStableVersion().then(isStable => { const shouldUseLatest = !isStable; - useLatestBranch.set(shouldUseLatest); + latestBranch.set(shouldUseLatest); Cookies.set('useLatestBranch', String(shouldUseLatest)); }); } else { - useLatestBranch.set(savedLatestBranch === 'true'); + latestBranch.set(savedLatestBranch === 'true'); } }, []); @@ -148,7 +148,7 @@ export function useSettings() { }, []); const enableLatestBranch = useCallback((enabled: boolean) => { - useLatestBranch.set(enabled); + latestBranch.set(enabled); logStore.logSystem(`Main branch updates ${enabled ? 'enabled' : 'disabled'}`); Cookies.set('useLatestBranch', String(enabled)); }, []); diff --git a/app/lib/stores/settings.ts b/app/lib/stores/settings.ts index 2d34270..2e410a6 100644 --- a/app/lib/stores/settings.ts +++ b/app/lib/stores/settings.ts @@ -47,4 +47,4 @@ export const isEventLogsEnabled = atom(false); export const isLocalModelsEnabled = atom(true); -export const useLatestBranch = atom(false); +export const latestBranch = atom(false); From 4caae9cec38e9c33346700899605519e07a9c08b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 19:12:29 +0000 Subject: [PATCH 36/54] chore: update commit hash to e223e9b6af1f6f31300fd7ed9ce498236cedd5dc --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index 5311377..88ecc1d 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "87a90718d31bd8ec501cb32f863efd26156fb1e2" } +{ "commit": "e223e9b6af1f6f31300fd7ed9ce498236cedd5dc" } From c4f94aa517a1b46168aaa4aaf1aff3178fea24f0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 19:14:42 +0000 Subject: [PATCH 37/54] chore: update commit hash to 4016f54933102bf67336b8ae58e14673dfad72ee --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index 88ecc1d..f60467a 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "e223e9b6af1f6f31300fd7ed9ce498236cedd5dc" } +{ "commit": "4016f54933102bf67336b8ae58e14673dfad72ee" } From 316c210e86c8d506b7f69844d998e92b6d32a7ef Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 15:17:05 -0500 Subject: [PATCH 38/54] Update mkdocs.yml changed Bolt to bolt --- docs/mkdocs.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 1153f8b..6b693a1 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Bolt.diy Docs +site_name: bolt.diy Docs site_dir: ../site theme: name: material @@ -31,7 +31,7 @@ theme: repo: fontawesome/brands/github # logo: assets/logo.png # favicon: assets/logo.png -repo_name: Bolt.diy +repo_name: bolt.diy repo_url: https://github.com/stackblitz-labs/bolt.diy edit_uri: "" @@ -40,16 +40,16 @@ extra: social: - icon: fontawesome/brands/github link: https://github.com/stackblitz-labs/bolt.diy - name: Bolt.diy + name: bolt.diy - icon: fontawesome/brands/discourse link: https://thinktank.ottomator.ai/ - name: Bolt.diy Discourse + name: bolt.diy Discourse - icon: fontawesome/brands/x-twitter link: https://x.com/bolt_diy - name: Bolt.diy on X + name: bolt.diy on X - icon: fontawesome/brands/bluesky link: https://bsky.app/profile/bolt.diy - name: Bolt.diy on Bluesky + name: bolt.diy on Bluesky From fb8191ebb0d069643442d606a1f56ca24d121912 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 15:20:22 -0500 Subject: [PATCH 39/54] Update vite.config.ts added v3_lazyRouteDiscovery to the fvite.config.ts without any side effects. this removes the warning in terminal --- vite.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vite.config.ts b/vite.config.ts index 0313812..f18b8b9 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -19,7 +19,8 @@ export default defineConfig((config) => { future: { v3_fetcherPersist: true, v3_relativeSplatPath: true, - v3_throwAbortReason: true + v3_throwAbortReason: true, + v3_lazyRouteDiscovery: true }, }), UnoCSS(), From 2819911b9627d4e26d2acbbd01f1bf60036845fe Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 15:25:31 -0500 Subject: [PATCH 40/54] Update constants.ts fixes the 'WARN Constants Failed to get LMStudio models: fetch failed' error as the user most likely just has it active in provider --- app/utils/constants.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/utils/constants.ts b/app/utils/constants.ts index 24c8668..75f4090 100644 --- a/app/utils/constants.ts +++ b/app/utils/constants.ts @@ -499,8 +499,6 @@ async function getLMStudioModels(_apiKeys?: Record, settings?: I })); } catch (e: any) { logStore.logError('Failed to get LMStudio models', e, { baseUrl: settings?.baseUrl }); - logger.warn('Failed to get LMStudio models: ', e.message || ''); - return []; } } From 15f624e0eee5e5d61eebfc1a2444a07243c711a9 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 15:31:07 -0500 Subject: [PATCH 41/54] add: a fav.ico Added a fav.ico --- public/favicon.ico | Bin 0 -> 4286 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 public/favicon.ico diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..333e9d11efe8ff015aad6ab9b3789da77a23b993 GIT binary patch literal 4286 zcmc(jT}u>E7{^cFpsTKhZo29-^hGi=B#Wqv0t?HipmHl;iYTGdFl;j_5FzY^=t7E6 z>cZ+Gh4P~JVijFmjQ%}8$DwhZ)X_7uXL)AMp4mD7=lsv}cGkId_Nl6JTwQ*>a~qs< zn@nuTZ82eduGzDVn*#|3oYNmkZ^xy!JJPOpXBL+r**sXArc=(@l-W-wA!%n@WpwC$DwSrXdxKJ4YqoyF9vthICZ?sCl9YcU?Kqbm5BLoJGW(?)q@+~;%ek9HQ4s<9O7nl1b{Bx=Id_9AMgIA?*g#e%Hj|r*$ZaVnj zl}oMhJvj0YpWf%6Qm)sZJ%Wk9o$QfLo8L#})J^IBi-q`n8~-YuxZx*0flquKFkhdv zJ)SHsl;W?&_>7Ewl$yHy_yl=se~0vPG#=}Jqazlh8m@TK!FXUU;$D*WYD_v{y2ImI zZJ#-g7^kDgZCqn7%J+xw4~GLA@}UEMf81>A!SgFj(>#X%iZB_x!)vt&KYH;wGjEW z#bQZTJ`-IBn4JAM12$eW9TIRBoo6+Du)qw@z;EWyp-IkTtHI?RFv4})`8)g{pi=k0 DfdM3B literal 0 HcmV?d00001 From 1c3582c4406ce288300f80d9dcf0c7791626eb4c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 20:34:30 +0000 Subject: [PATCH 42/54] chore: update commit hash to 1e7c3a4ff8f3153f53e0b0ed7cb13434825e41d9 --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index f60467a..0b9ba3f 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "4016f54933102bf67336b8ae58e14673dfad72ee" } +{ "commit": "1e7c3a4ff8f3153f53e0b0ed7cb13434825e41d9" } From e9376db70592a7b7a4432c3c20be70e37ccfded9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 20:42:22 +0000 Subject: [PATCH 43/54] chore: update commit hash to d75899d737243cd7303704adef16d77290de5a0b --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index 0b9ba3f..ee1a6f0 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "1e7c3a4ff8f3153f53e0b0ed7cb13434825e41d9" } +{ "commit": "d75899d737243cd7303704adef16d77290de5a0b" } From a340611310cc15e806d795fc5386a5151519c78e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 20:43:21 +0000 Subject: [PATCH 44/54] chore: update commit hash to b5867835f5da5c93bd9a8376df9e9d32b97acff5 --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index ee1a6f0..e212929 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "d75899d737243cd7303704adef16d77290de5a0b" } +{ "commit": "b5867835f5da5c93bd9a8376df9e9d32b97acff5" } From 02621e3545511ca8bc0279b70f92083218548655 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 20:50:39 +0000 Subject: [PATCH 45/54] chore: update commit hash to d22b32ae636b9f134cdb5f96a10e4398aa2171b7 --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index e212929..d74ab42 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "b5867835f5da5c93bd9a8376df9e9d32b97acff5" } +{ "commit": "d22b32ae636b9f134cdb5f96a10e4398aa2171b7" } From a053bfc96fa69a4dda77b7dd2f29a05badd3daf2 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 16:04:32 -0500 Subject: [PATCH 46/54] doc: mkdoc consistent style used a consistent style throughout the mkdoc's when separating sections --- docs/docs/CONTRIBUTING.md | 26 ++++++++++++++++++++++++++ docs/docs/index.md | 14 ++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/docs/docs/CONTRIBUTING.md b/docs/docs/CONTRIBUTING.md index ce6d9f5..226fcd0 100644 --- a/docs/docs/CONTRIBUTING.md +++ b/docs/docs/CONTRIBUTING.md @@ -8,10 +8,14 @@ - [Development Setup](#development-setup) - [Deploymnt with Docker](#docker-deployment-documentation) +--- + ## Code of Conduct This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers. +--- + ## How Can I Contribute? ### 🐞 Reporting Bugs and Feature Requests @@ -29,6 +33,8 @@ This project and everyone participating in it is governed by our Code of Conduct ### ✨ Becoming a Core Contributor We're looking for dedicated contributors to help maintain and grow this project. If you're interested in becoming a core contributor, please fill out our [Contributor Application Form](https://forms.gle/TBSteXSDCtBDwr5m7). +--- + ## Pull Request Guidelines ### 📝 PR Checklist @@ -43,6 +49,8 @@ We're looking for dedicated contributors to help maintain and grow this project. 3. Address all review comments 4. Maintain clean commit history +--- + ## Coding Standards ### 💻 General Guidelines @@ -51,6 +59,8 @@ We're looking for dedicated contributors to help maintain and grow this project. - Keep functions focused and small - Use meaningful variable names +--- + ## Development Setup ### 🔄 Initial Setup @@ -100,6 +110,8 @@ pnpm run dev **Note**: You will need Google Chrome Canary to run this locally if you use Chrome! It's an easy install and a good browser for web development anyway. +--- + ## Testing Run the test suite with: @@ -108,6 +120,8 @@ Run the test suite with: pnpm test ``` +--- + ## Deployment To deploy the application to Cloudflare Pages: @@ -118,6 +132,8 @@ pnpm run deploy Make sure you have the necessary permissions and Wrangler is correctly configured for your Cloudflare account. +--- + # Docker Deployment Documentation This guide outlines various methods for building and deploying the application using Docker. @@ -172,6 +188,8 @@ docker run -p 5173:5173 --env-file .env.local bolt-ai:development docker run -p 5173:5173 --env-file .env.local bolt-ai:production ``` +--- + ## Deployment with Coolify [Coolify](https://github.com/coollabsio/coolify) provides a straightforward deployment process: @@ -189,6 +207,8 @@ docker run -p 5173:5173 --env-file .env.local bolt-ai:production - Adjust other environment variables as needed 7. Deploy the application +--- + ## VS Code Integration The `docker-compose.yaml` configuration is compatible with VS Code dev containers: @@ -197,6 +217,8 @@ The `docker-compose.yaml` configuration is compatible with VS Code dev container 2. Select the dev container configuration 3. Choose the "development" profile from the context menu +--- + ## Environment Files Ensure you have the appropriate `.env.local` file configured before running the containers. This file should contain: @@ -204,12 +226,16 @@ Ensure you have the appropriate `.env.local` file configured before running the - Environment-specific configurations - Other required environment variables +--- + ## DEFAULT_NUM_CTX The `DEFAULT_NUM_CTX` environment variable can be used to limit the maximum number of context values used by the qwen2.5-coder model. For example, to limit the context to 24576 values (which uses 32GB of VRAM), set `DEFAULT_NUM_CTX=24576` in your `.env.local` file. First off, thank you for considering contributing to bolt.diy! This fork aims to expand the capabilities of the original project by integrating multiple LLM providers and enhancing functionality. Every contribution helps make bolt.diy a better tool for developers worldwide. +--- + ## Notes - Port 5173 is exposed and mapped for both development and production environments diff --git a/docs/docs/index.md b/docs/docs/index.md index 029444b..ae9442f 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -9,6 +9,8 @@ https://thinktank.ottomator.ai bolt.diy is an AI-powered web development agent that allows you to prompt, run, edit, and deploy full-stack applications directly from your browser—no local setup required. If you're here to build your own AI-powered web dev agent using the Bolt open source codebase, [click here to get started!](./CONTRIBUTING.md) +--- + ## What Makes bolt.diy Different Claude, v0, etc are incredible- but you can't install packages, run backends, or edit code. That’s where bolt.diy stands out: @@ -26,6 +28,8 @@ Whether you’re an experienced developer, a PM, or a designer, bolt.diy allows For developers interested in building their own AI-powered development tools with WebContainers, check out the open-source Bolt codebase in this repo! +--- + ## Setup Many of you are new users to installing software from Github. If you have any installation troubles reach out and submit an "issue" using the links above, or feel free to enhance this documentation by forking, editing the instructions, and doing a pull request. @@ -128,6 +132,8 @@ When you run the Docker Compose command with the development profile, any change make on your machine to the code will automatically be reflected in the site running on the container (i.e. hot reloading still applies!). +--- + ## Run Without Docker 1. Install dependencies using Terminal (or CMD in Windows with admin permissions): @@ -148,6 +154,8 @@ sudo npm install -g pnpm pnpm run dev ``` +--- + ## Adding New LLMs: To make new LLMs available to use in this version of bolt.diy, head on over to `app/utils/constants.ts` and find the constant MODEL_LIST. Each element in this array is an object that has the model ID for the name (get this from the provider's API documentation), a label for the frontend model dropdown, and the provider. @@ -156,6 +164,8 @@ By default, Anthropic, OpenAI, Groq, and Ollama are implemented as providers, bu When you add a new model to the MODEL_LIST array, it will immediately be available to use when you run the app locally or reload it. For Ollama models, make sure you have the model installed already before trying to use it here! +--- + ## Available Scripts - `pnpm run dev`: Starts the development server. @@ -167,6 +177,8 @@ When you add a new model to the MODEL_LIST array, it will immediately be availab - `pnpm run typegen`: Generates TypeScript types using Wrangler. - `pnpm run deploy`: Builds the project and deploys it to Cloudflare Pages. +--- + ## Development To start the development server: @@ -177,6 +189,8 @@ pnpm run dev This will start the Remix Vite development server. You will need Google Chrome Canary to run this locally if you use Chrome! It's an easy install and a good browser for web development anyway. +--- + ## Tips and Tricks Here are some tips to get the most out of bolt.diy: From f34c173aaa8190d2285f0812b6aab2a37d072543 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 21:37:17 +0000 Subject: [PATCH 47/54] chore: update commit hash to d9b2801434011b60dca700c19cabd0652f31f8e4 --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index d74ab42..eefbf12 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "d22b32ae636b9f134cdb5f96a10e4398aa2171b7" } +{ "commit": "d9b2801434011b60dca700c19cabd0652f31f8e4" } From 2119a9203166e2a47b2e981f145cafe5320a7fc5 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 16:41:25 -0500 Subject: [PATCH 48/54] doc: new section heading small update --- docs/docs/index.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/docs/index.md b/docs/docs/index.md index ae9442f..5667273 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -1,10 +1,14 @@ # Welcome to bolt diy bolt.diy allows you to choose the LLM that you use for each prompt! Currently, you can use OpenAI, Anthropic, Ollama, OpenRouter, Gemini, LMStudio, Mistral, xAI, HuggingFace, DeepSeek, or Groq models - and it is easily extended to use any other model supported by the Vercel AI SDK! See the instructions below for running this locally and extending it to include more models. -Join the community! +--- + +## Join the community! https://thinktank.ottomator.ai +--- + ## Whats bolt.diy bolt.diy is an AI-powered web development agent that allows you to prompt, run, edit, and deploy full-stack applications directly from your browser—no local setup required. If you're here to build your own AI-powered web dev agent using the Bolt open source codebase, [click here to get started!](./CONTRIBUTING.md) From a6fa133321c2789dde0858b2e9de2ad60e444b76 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 21:43:20 +0000 Subject: [PATCH 49/54] chore: update commit hash to 0157fddc76fd5eebc545085e2c3c4ab37d9ca925 --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index eefbf12..fd6d6d2 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "d9b2801434011b60dca700c19cabd0652f31f8e4" } +{ "commit": "0157fddc76fd5eebc545085e2c3c4ab37d9ca925" } From 66a445d548f24b55f48961e9b4f9fb5b4d9715a7 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 16:50:03 -0500 Subject: [PATCH 50/54] doc: Make links clickable in docs Made links clickable in docs --- docs/docs/FAQ.md | 1 - docs/docs/index.md | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/docs/FAQ.md b/docs/docs/FAQ.md index 95c4c75..de1b4b1 100644 --- a/docs/docs/FAQ.md +++ b/docs/docs/FAQ.md @@ -23,7 +23,6 @@ Check out our [Contribution Guide](CONTRIBUTING.md) for more details on how to g --- - ## What are the future plans for bolt.diy? Visit our [Roadmap](https://roadmap.sh/r/ottodev-roadmap-2ovzo) for the latest updates. diff --git a/docs/docs/index.md b/docs/docs/index.md index 5667273..389e74f 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -5,7 +5,7 @@ bolt.diy allows you to choose the LLM that you use for each prompt! Currently, y ## Join the community! -https://thinktank.ottomator.ai +[Join the community!](https://thinktank.ottomator.ai) --- @@ -38,9 +38,9 @@ For developers interested in building their own AI-powered development tools wit Many of you are new users to installing software from Github. If you have any installation troubles reach out and submit an "issue" using the links above, or feel free to enhance this documentation by forking, editing the instructions, and doing a pull request. -1. Install Git from https://git-scm.com/downloads +1. [Install Git from](https://git-scm.com/downloads) -2. Install Node.js from https://nodejs.org/en/download/ +2. [Install Node.js from](https://nodejs.org/en/download/) Pay attention to the installer notes after completion. @@ -70,11 +70,11 @@ defaults write com.apple.finder AppleShowAllFiles YES **NOTE**: you only have to set the ones you want to use and Ollama doesn't need an API key because it runs locally on your computer: -Get your GROQ API Key here: https://console.groq.com/keys +[Get your GROQ API Key here](https://console.groq.com/keys) -Get your Open AI API Key by following these instructions: https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key +[Get your Open AI API Key by following these instructions](https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key) -Get your Anthropic API Key in your account settings: https://console.anthropic.com/settings/keys +Get your Anthropic API Key in your [account settings](https://console.anthropic.com/settings/keys) ``` GROQ_API_KEY=XXX From a69cda51236b7b71909381e441ed80696d37ffca Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 16:52:11 -0500 Subject: [PATCH 51/54] Update CONTRIBUTING.md --- docs/docs/CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/docs/CONTRIBUTING.md b/docs/docs/CONTRIBUTING.md index 226fcd0..7b18010 100644 --- a/docs/docs/CONTRIBUTING.md +++ b/docs/docs/CONTRIBUTING.md @@ -176,6 +176,8 @@ docker-compose --profile development up docker-compose --profile production up ``` +--- + ## Running the Application After building using any of the methods above, run the container with: From 9e1c44a8c9465fd3fb1aeb931d4c7f6ab9bbc3c6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 22:13:52 +0000 Subject: [PATCH 52/54] chore: update commit hash to 810cc81a16955eebec943f7d504749dbcbb85b25 --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index fd6d6d2..cdc1186 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "0157fddc76fd5eebc545085e2c3c4ab37d9ca925" } +{ "commit": "810cc81a16955eebec943f7d504749dbcbb85b25" } From d0d0fcd88f294a96729f128e9bd202f501cda257 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 17:38:39 -0500 Subject: [PATCH 53/54] add: default provider icon Added and set a default provider icon --- app/components/settings/providers/ProvidersTab.tsx | 2 +- public/icons/Default.svg | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 public/icons/Default.svg diff --git a/app/components/settings/providers/ProvidersTab.tsx b/app/components/settings/providers/ProvidersTab.tsx index 1c6e87d..926a3c8 100644 --- a/app/components/settings/providers/ProvidersTab.tsx +++ b/app/components/settings/providers/ProvidersTab.tsx @@ -6,7 +6,7 @@ import type { IProviderConfig } from '~/types/model'; import { logStore } from '~/lib/stores/logs'; // Import a default fallback icon -import DefaultIcon from '/icons/Ollama.svg'; // Adjust the path as necessary +import DefaultIcon from '/icons/Default.svg'; // Adjust the path as necessary export default function ProvidersTab() { const { providers, updateProviderSettings, isLocalModel } = useSettings(); diff --git a/public/icons/Default.svg b/public/icons/Default.svg new file mode 100644 index 0000000..dd63997 --- /dev/null +++ b/public/icons/Default.svg @@ -0,0 +1,4 @@ + + + + From 960f532f8234663d0b3630d18033c959fac6882c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 22:52:33 +0000 Subject: [PATCH 54/54] chore: update commit hash to 6ba93974a02a98c83badf2f0002ff4812b8f75a9 --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index cdc1186..d39a980 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "810cc81a16955eebec943f7d504749dbcbb85b25" } +{ "commit": "6ba93974a02a98c83badf2f0002ff4812b8f75a9" }