Cole Medin commited on
Commit
f1b8c02
·
unverified ·
2 Parent(s): 8ce82b5 5f6a595

Merge branch 'main' into main

Browse files
.env.example CHANGED
@@ -35,5 +35,10 @@ OPENAI_LIKE_API_BASE_URL=
35
  # Get your OpenAI Like API Key
36
  OPENAI_LIKE_API_KEY=
37
 
 
 
 
 
 
38
  # Include this environment variable if you want more logging for debugging locally
39
  VITE_LOG_LEVEL=debug
 
35
  # Get your OpenAI Like API Key
36
  OPENAI_LIKE_API_KEY=
37
 
38
+ # Get your Mistral API Key by following these instructions -
39
+ # https://console.mistral.ai/api-keys/
40
+ # You only need this environment variable set if you want to use Mistral models
41
+ MISTRAL_API_KEY=
42
+
43
  # Include this environment variable if you want more logging for debugging locally
44
  VITE_LOG_LEVEL=debug
.github/workflows/github-build-push.yml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Build and Push Container
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ # paths:
8
+ # - 'Dockerfile'
9
+ workflow_dispatch:
10
+ jobs:
11
+ build-and-push:
12
+ runs-on: [ubuntu-latest]
13
+ steps:
14
+ - name: Checkout code
15
+ uses: actions/checkout@v4
16
+
17
+ - name: Set up QEMU
18
+ uses: docker/setup-qemu-action@v1
19
+
20
+ - name: Set up Docker Buildx
21
+ uses: docker/setup-buildx-action@v1
22
+
23
+ - name: Login to GitHub Container Registry
24
+ uses: docker/login-action@v1
25
+ with:
26
+ registry: ghcr.io
27
+ username: ${{ github.actor }}
28
+ password: ${{ secrets.GITHUB_TOKEN }}
29
+
30
+ - name: Build and Push Containers
31
+ uses: docker/build-push-action@v2
32
+ with:
33
+ context: .
34
+ file: Dockerfile
35
+ platforms: linux/amd64,linux/arm64
36
+ push: true
37
+ tags: |
38
+ ghcr.io/${{ github.repository }}:latest
39
+ ghcr.io/${{ github.repository }}:${{ github.sha }}
CONTRIBUTING.md CHANGED
@@ -1,110 +1,98 @@
1
- [![Bolt Open Source Codebase](./public/social_preview_index.jpg)](https://bolt.new)
2
 
3
- > Welcome to the **Bolt** open-source codebase! This repo contains a simple example app using the core components from bolt.new to help you get started building **AI-powered software development tools** powered by StackBlitz’s **WebContainer API**.
4
 
5
- ### Why Build with Bolt + WebContainer API
 
 
 
 
 
 
6
 
7
- By building with the Bolt + WebContainer API you can create browser-based applications that let users **prompt, run, edit, and deploy** full-stack web apps directly in the browser, without the need for virtual machines. With WebContainer API, you can build apps that give AI direct access and full control over a **Node.js server**, **filesystem**, **package manager** and **dev terminal** inside your users browser tab. This powerful combination allows you to create a new class of development tools that support all major JavaScript libraries and Node packages right out of the box, all without remote environments or local installs.
8
 
9
- ### What’s the Difference Between Bolt (This Repo) and [Bolt.new](https://bolt.new)?
10
 
11
- - **Bolt.new**: This is the **commercial product** from StackBlitz—a hosted, browser-based AI development tool that enables users to prompt, run, edit, and deploy full-stack web applications directly in the browser. Built on top of the [Bolt open-source repo](https://github.com/stackblitz/bolt.new) and powered by the StackBlitz **WebContainer API**.
12
 
13
- - **Bolt (This Repo)**: This open-source repository provides the core components used to make **Bolt.new**. This repo contains the UI interface for Bolt as well as the server components, built using [Remix Run](https://remix.run/). By leveraging this repo and StackBlitz’s **WebContainer API**, you can create your own AI-powered development tools and full-stack applications that run entirely in the browser.
 
 
 
 
14
 
15
- # Get Started Building with Bolt
 
 
 
 
16
 
17
- Bolt combines the capabilities of AI with sandboxed development environments to create a collaborative experience where code can be developed by the assistant and the programmer together. Bolt combines [WebContainer API](https://webcontainers.io/api) with [Claude Sonnet 3.5](https://www.anthropic.com/news/claude-3-5-sonnet) using [Remix](https://remix.run/) and the [AI SDK](https://sdk.vercel.ai/).
 
18
 
19
- ### WebContainer API
20
 
21
- Bolt uses [WebContainers](https://webcontainers.io/) to run generated code in the browser. WebContainers provide Bolt with a full-stack sandbox environment using [WebContainer API](https://webcontainers.io/api). WebContainers run full-stack applications directly in the browser without the cost and security concerns of cloud hosted AI agents. WebContainers are interactive and editable, and enables Bolt's AI to run code and understand any changes from the user.
 
 
 
 
22
 
23
- The [WebContainer API](https://webcontainers.io) is free for personal and open source usage. If you're building an application for commercial usage, you can learn more about our [WebContainer API commercial usage pricing here](https://stackblitz.com/pricing#webcontainer-api).
 
 
 
 
24
 
25
- ### Remix App
26
 
27
- Bolt is built with [Remix](https://remix.run/) and
28
- deployed using [CloudFlare Pages](https://pages.cloudflare.com/) and
29
- [CloudFlare Workers](https://workers.cloudflare.com/).
 
 
30
 
31
- ### AI SDK Integration
32
-
33
- Bolt uses the [AI SDK](https://github.com/vercel/ai) to integrate with AI
34
- models. At this time, Bolt supports using Anthropic's Claude Sonnet 3.5.
35
- You can get an API key from the [Anthropic API Console](https://console.anthropic.com/) to use with Bolt.
36
- Take a look at how [Bolt uses the AI SDK](https://github.com/stackblitz/bolt.new/tree/main/app/lib/.server/llm)
37
-
38
- ## Prerequisites
39
-
40
- Before you begin, ensure you have the following installed:
41
-
42
- - Node.js (v20.15.1)
43
- - pnpm (v9.4.0)
44
-
45
- ## Setup
46
-
47
- 1. Clone the repository (if you haven't already):
48
 
 
 
49
  ```bash
50
- git clone https://github.com/stackblitz/bolt.new.git
51
  ```
52
 
53
  2. Install dependencies:
54
-
55
  ```bash
56
  pnpm install
57
  ```
58
 
59
- 3. Create a `.env.local` file in the root directory and add your Anthropic API key:
60
-
61
- ```
 
 
 
62
  ANTHROPIC_API_KEY=XXX
 
63
  ```
64
-
65
- Optionally, you can set the debug level:
66
-
67
- ```
68
  VITE_LOG_LEVEL=debug
69
  ```
70
-
71
  **Important**: Never commit your `.env.local` file to version control. It's already included in .gitignore.
72
 
73
- ## Available Scripts
74
-
75
- - `pnpm run dev`: Starts the development server.
76
- - `pnpm run build`: Builds the project.
77
- - `pnpm run start`: Runs the built application locally using Wrangler Pages. This script uses `bindings.sh` to set up necessary bindings so you don't have to duplicate environment variables.
78
- - `pnpm run preview`: Builds the project and then starts it locally, useful for testing the production build. Note, HTTP streaming currently doesn't work as expected with `wrangler pages dev`.
79
- - `pnpm test`: Runs the test suite using Vitest.
80
- - `pnpm run typecheck`: Runs TypeScript type checking.
81
- - `pnpm run typegen`: Generates TypeScript types using Wrangler.
82
- - `pnpm run deploy`: Builds the project and deploys it to Cloudflare Pages.
83
-
84
- ## Development
85
-
86
- To start the development server:
87
-
88
  ```bash
89
  pnpm run dev
90
  ```
91
 
92
- This will start the Remix Vite development server.
93
-
94
- ## Testing
95
 
96
- Run the test suite with:
97
 
98
- ```bash
99
- pnpm test
100
- ```
101
-
102
- ## Deployment
103
-
104
- To deploy the application to Cloudflare Pages:
105
-
106
- ```bash
107
- pnpm run deploy
108
- ```
109
 
110
- Make sure you have the necessary permissions and Wrangler is correctly configured for your Cloudflare account.
 
1
+ # Contributing to Bolt.new Fork
2
 
3
+ First off, thank you for considering contributing to Bolt.new! This fork aims to expand the capabilities of the original project by integrating multiple LLM providers and enhancing functionality. Every contribution helps make Bolt.new a better tool for developers worldwide.
4
 
5
+ ## 📋 Table of Contents
6
+ - [Code of Conduct](#code-of-conduct)
7
+ - [How Can I Contribute?](#how-can-i-contribute)
8
+ - [Pull Request Guidelines](#pull-request-guidelines)
9
+ - [Coding Standards](#coding-standards)
10
+ - [Development Setup](#development-setup)
11
+ - [Project Structure](#project-structure)
12
 
13
+ ## Code of Conduct
14
 
15
+ 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.
16
 
17
+ ## How Can I Contribute?
18
 
19
+ ### 🐞 Reporting Bugs and Feature Requests
20
+ - Check the issue tracker to avoid duplicates
21
+ - Use the issue templates when available
22
+ - Include as much relevant information as possible
23
+ - For bugs, add steps to reproduce the issue
24
 
25
+ ### 🔧 Code Contributions
26
+ 1. Fork the repository
27
+ 2. Create a new branch for your feature/fix
28
+ 3. Write your code
29
+ 4. Submit a pull request
30
 
31
+ ### Becoming a Core Contributor
32
+ 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).
33
 
34
+ ## Pull Request Guidelines
35
 
36
+ ### 📝 PR Checklist
37
+ - [ ] Branch from the main branch
38
+ - [ ] Update documentation if needed
39
+ - [ ] Manually verify all new functionality works as expected
40
+ - [ ] Keep PRs focused and atomic
41
 
42
+ ### 👀 Review Process
43
+ 1. Manually test the changes
44
+ 2. At least one maintainer review required
45
+ 3. Address all review comments
46
+ 4. Maintain clean commit history
47
 
48
+ ## Coding Standards
49
 
50
+ ### 💻 General Guidelines
51
+ - Follow existing code style
52
+ - Comment complex logic
53
+ - Keep functions focused and small
54
+ - Use meaningful variable names
55
 
56
+ ## Development Setup
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
+ ### 🔄 Initial Setup
59
+ 1. Clone the repository:
60
  ```bash
61
+ git clone https://github.com/coleam00/bolt.new-any-llm.git
62
  ```
63
 
64
  2. Install dependencies:
 
65
  ```bash
66
  pnpm install
67
  ```
68
 
69
+ 3. Set up environment variables:
70
+ - Rename `.env.example` to `.env.local`
71
+ - Add your LLM API keys (only set the ones you plan to use):
72
+ ```bash
73
+ GROQ_API_KEY=XXX
74
+ OPENAI_API_KEY=XXX
75
  ANTHROPIC_API_KEY=XXX
76
+ ...
77
  ```
78
+ - Optionally set debug level:
79
+ ```bash
 
 
80
  VITE_LOG_LEVEL=debug
81
  ```
 
82
  **Important**: Never commit your `.env.local` file to version control. It's already included in .gitignore.
83
 
84
+ ### 🚀 Running the Development Server
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  ```bash
86
  pnpm run dev
87
  ```
88
 
89
+ **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.
 
 
90
 
91
+ ## Questions?
92
 
93
+ For any questions about contributing, please:
94
+ 1. Check existing documentation
95
+ 2. Search through issues
96
+ 3. Create a new issue with the question label
 
 
 
 
 
 
 
97
 
98
+ Thank you for contributing to Bolt.new! 🚀
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Node.js runtime as the base image
2
+ FROM node:20.15.1
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Install pnpm
8
+ RUN npm install -g [email protected]
9
+
10
+ # Copy package.json and pnpm-lock.yaml (if available)
11
+ COPY package.json pnpm-lock.yaml* ./
12
+
13
+ # Install dependencies
14
+ RUN pnpm install
15
+
16
+ # Copy the rest of the application code
17
+ COPY . .
18
+
19
+ # Build the application
20
+ RUN pnpm run build
21
+
22
+ # Make sure bindings.sh is executable
23
+ RUN chmod +x bindings.sh
24
+
25
+ # Expose the port the app runs on (adjust if you specified a different port)
26
+ EXPOSE 3000
27
+
28
+ # Start the application
29
+ CMD ["pnpm", "run", "start"]
README.md CHANGED
@@ -11,6 +11,7 @@ This fork of Bolt.new allows you to choose the LLM that you use for each prompt!
11
  - ✅ Autogenerate Ollama models from what is downloaded (@yunatamos)
12
  - ✅ Filter models by provider (@jasonm23)
13
  - ✅ Download project as ZIP (@fabwaseem)
 
14
  - ⬜ LM Studio Integration
15
  - ⬜ DeepSeek API Integration
16
  - ⬜ Together Integration
@@ -28,6 +29,7 @@ This fork of Bolt.new allows you to choose the LLM that you use for each prompt!
28
  - ⬜ Prompt caching
29
  - ⬜ Ability to enter API keys in the UI
30
  - ⬜ Prevent Bolt from rewriting files as often
 
31
 
32
  # Bolt.new: AI-Powered Full-Stack Web Development in the Browser
33
 
@@ -114,7 +116,7 @@ To start the development server:
114
  pnpm run dev
115
  ```
116
 
117
- This will start the Remix Vite development server. You will need Google Chrome Canary to run this locally! It's an easy install and a good browser for web development anyway.
118
 
119
  ## Tips and Tricks
120
 
 
11
  - ✅ Autogenerate Ollama models from what is downloaded (@yunatamos)
12
  - ✅ Filter models by provider (@jasonm23)
13
  - ✅ Download project as ZIP (@fabwaseem)
14
+ - ✅ Improvements to the main Bolt.new prompt in `app\lib\.server\llm\prompts.ts` (@kofi-bhr)
15
  - ⬜ LM Studio Integration
16
  - ⬜ DeepSeek API Integration
17
  - ⬜ Together Integration
 
29
  - ⬜ Prompt caching
30
  - ⬜ Ability to enter API keys in the UI
31
  - ⬜ Prevent Bolt from rewriting files as often
32
+ - ⬜ Have LLM plan the project in a MD file for better results/transparency
33
 
34
  # Bolt.new: AI-Powered Full-Stack Web Development in the Browser
35
 
 
116
  pnpm run dev
117
  ```
118
 
119
+ 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.
120
 
121
  ## Tips and Tricks
122
 
app/components/workbench/Workbench.client.tsx CHANGED
@@ -1,7 +1,7 @@
1
  import { useStore } from '@nanostores/react';
2
  import { motion, type HTMLMotionProps, type Variants } from 'framer-motion';
3
  import { computed } from 'nanostores';
4
- import { memo, useCallback, useEffect } from 'react';
5
  import { toast } from 'react-toastify';
6
  import {
7
  type OnChangeCallback as OnEditorChange,
@@ -55,6 +55,8 @@ const workbenchVariants = {
55
  export const Workbench = memo(({ chatStarted, isStreaming }: WorkspaceProps) => {
56
  renderLogger.trace('Workbench');
57
 
 
 
58
  const hasPreview = useStore(computed(workbenchStore.previews, (previews) => previews.length > 0));
59
  const showWorkbench = useStore(workbenchStore.showWorkbench);
60
  const selectedFile = useStore(workbenchStore.selectedFile);
@@ -99,6 +101,21 @@ export const Workbench = memo(({ chatStarted, isStreaming }: WorkspaceProps) =>
99
  workbenchStore.resetCurrentDocument();
100
  }, []);
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  return (
103
  chatStarted && (
104
  <motion.div
@@ -132,6 +149,10 @@ export const Workbench = memo(({ chatStarted, isStreaming }: WorkspaceProps) =>
132
  <div className="i-ph:code" />
133
  Download Code
134
  </PanelHeaderButton>
 
 
 
 
135
  <PanelHeaderButton
136
  className="mr-1 text-sm"
137
  onClick={() => {
@@ -141,6 +162,31 @@ export const Workbench = memo(({ chatStarted, isStreaming }: WorkspaceProps) =>
141
  <div className="i-ph:terminal" />
142
  Toggle Terminal
143
  </PanelHeaderButton>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  </>
145
  )}
146
  <IconButton
@@ -184,7 +230,6 @@ export const Workbench = memo(({ chatStarted, isStreaming }: WorkspaceProps) =>
184
  )
185
  );
186
  });
187
-
188
  interface ViewProps extends HTMLMotionProps<'div'> {
189
  children: JSX.Element;
190
  }
 
1
  import { useStore } from '@nanostores/react';
2
  import { motion, type HTMLMotionProps, type Variants } from 'framer-motion';
3
  import { computed } from 'nanostores';
4
+ import { memo, useCallback, useEffect, useState } from 'react';
5
  import { toast } from 'react-toastify';
6
  import {
7
  type OnChangeCallback as OnEditorChange,
 
55
  export const Workbench = memo(({ chatStarted, isStreaming }: WorkspaceProps) => {
56
  renderLogger.trace('Workbench');
57
 
58
+ const [isSyncing, setIsSyncing] = useState(false);
59
+
60
  const hasPreview = useStore(computed(workbenchStore.previews, (previews) => previews.length > 0));
61
  const showWorkbench = useStore(workbenchStore.showWorkbench);
62
  const selectedFile = useStore(workbenchStore.selectedFile);
 
101
  workbenchStore.resetCurrentDocument();
102
  }, []);
103
 
104
+ const handleSyncFiles = useCallback(async () => {
105
+ setIsSyncing(true);
106
+
107
+ try {
108
+ const directoryHandle = await window.showDirectoryPicker();
109
+ await workbenchStore.syncFiles(directoryHandle);
110
+ toast.success('Files synced successfully');
111
+ } catch (error) {
112
+ console.error('Error syncing files:', error);
113
+ toast.error('Failed to sync files');
114
+ } finally {
115
+ setIsSyncing(false);
116
+ }
117
+ }, []);
118
+
119
  return (
120
  chatStarted && (
121
  <motion.div
 
149
  <div className="i-ph:code" />
150
  Download Code
151
  </PanelHeaderButton>
152
+ <PanelHeaderButton className="mr-1 text-sm" onClick={handleSyncFiles} disabled={isSyncing}>
153
+ {isSyncing ? <div className="i-ph:spinner" /> : <div className="i-ph:cloud-arrow-down" />}
154
+ {isSyncing ? 'Syncing...' : 'Sync Files'}
155
+ </PanelHeaderButton>
156
  <PanelHeaderButton
157
  className="mr-1 text-sm"
158
  onClick={() => {
 
162
  <div className="i-ph:terminal" />
163
  Toggle Terminal
164
  </PanelHeaderButton>
165
+ <PanelHeaderButton
166
+ className="mr-1 text-sm"
167
+ onClick={() => {
168
+ const repoName = prompt("Please enter a name for your new GitHub repository:", "bolt-generated-project");
169
+ if (!repoName) {
170
+ alert("Repository name is required. Push to GitHub cancelled.");
171
+ return;
172
+ }
173
+ const githubUsername = prompt("Please enter your GitHub username:");
174
+ if (!githubUsername) {
175
+ alert("GitHub username is required. Push to GitHub cancelled.");
176
+ return;
177
+ }
178
+ const githubToken = prompt("Please enter your GitHub personal access token:");
179
+ if (!githubToken) {
180
+ alert("GitHub token is required. Push to GitHub cancelled.");
181
+ return;
182
+ }
183
+
184
+ workbenchStore.pushToGitHub(repoName, githubUsername, githubToken);
185
+ }}
186
+ >
187
+ <div className="i-ph:github-logo" />
188
+ Push to GitHub
189
+ </PanelHeaderButton>
190
  </>
191
  )}
192
  <IconButton
 
230
  )
231
  );
232
  });
 
233
  interface ViewProps extends HTMLMotionProps<'div'> {
234
  children: JSX.Element;
235
  }
app/lib/.server/llm/api-key.ts CHANGED
@@ -19,8 +19,12 @@ export function getAPIKey(cloudflareEnv: Env, provider: string) {
19
  return env.GROQ_API_KEY || cloudflareEnv.GROQ_API_KEY;
20
  case 'OpenRouter':
21
  return env.OPEN_ROUTER_API_KEY || cloudflareEnv.OPEN_ROUTER_API_KEY;
22
- case "OpenAILike":
23
- return env.OPENAI_LIKE_API_KEY || cloudflareEnv.OPENAI_LIKE_API_KEY;
 
 
 
 
24
  default:
25
  return "";
26
  }
 
19
  return env.GROQ_API_KEY || cloudflareEnv.GROQ_API_KEY;
20
  case 'OpenRouter':
21
  return env.OPEN_ROUTER_API_KEY || cloudflareEnv.OPEN_ROUTER_API_KEY;
22
+ case 'Deepseek':
23
+ return env.DEEPSEEK_API_KEY || cloudflareEnv.DEEPSEEK_API_KEY
24
+ case 'Mistral':
25
+ return env.MISTRAL_API_KEY || cloudflareEnv.MISTRAL_API_KEY;
26
+ case "OpenAILike":
27
+ return env.OPENAI_LIKE_API_KEY || cloudflareEnv.OPENAI_LIKE_API_KEY;
28
  default:
29
  return "";
30
  }
app/lib/.server/llm/constants.ts CHANGED
@@ -1,5 +1,5 @@
1
  // see https://docs.anthropic.com/en/docs/about-claude/models
2
- export const MAX_TOKENS = 8192;
3
 
4
  // limits the number of model responses that can be returned in a single request
5
  export const MAX_RESPONSE_SEGMENTS = 2;
 
1
  // see https://docs.anthropic.com/en/docs/about-claude/models
2
+ export const MAX_TOKENS = 8000;
3
 
4
  // limits the number of model responses that can be returned in a single request
5
  export const MAX_RESPONSE_SEGMENTS = 2;
app/lib/.server/llm/model.ts CHANGED
@@ -6,6 +6,8 @@ import { createOpenAI } from '@ai-sdk/openai';
6
  import { createGoogleGenerativeAI } from '@ai-sdk/google';
7
  import { ollama } from 'ollama-ai-provider';
8
  import { createOpenRouter } from "@openrouter/ai-sdk-provider";
 
 
9
 
10
  export function getAnthropicModel(apiKey: string, model: string) {
11
  const anthropic = createAnthropic({
@@ -30,6 +32,14 @@ export function getOpenAIModel(apiKey: string, model: string) {
30
  return openai(model);
31
  }
32
 
 
 
 
 
 
 
 
 
33
  export function getGoogleModel(apiKey: string, model: string) {
34
  const google = createGoogleGenerativeAI(
35
  apiKey,
@@ -53,6 +63,15 @@ export function getOllamaModel(baseURL: string, model: string) {
53
  return Ollama;
54
  }
55
 
 
 
 
 
 
 
 
 
 
56
  export function getOpenRouterModel(apiKey: string, model: string) {
57
  const openRouter = createOpenRouter({
58
  apiKey
@@ -78,6 +97,10 @@ export function getModel(provider: string, model: string, env: Env) {
78
  return getGoogleModel(apiKey, model)
79
  case 'OpenAILike':
80
  return getOpenAILikeModel(baseURL,apiKey, model);
 
 
 
 
81
  default:
82
  return getOllamaModel(baseURL, model);
83
  }
 
6
  import { createGoogleGenerativeAI } from '@ai-sdk/google';
7
  import { ollama } from 'ollama-ai-provider';
8
  import { createOpenRouter } from "@openrouter/ai-sdk-provider";
9
+ import { mistral } from '@ai-sdk/mistral';
10
+ import { createMistral } from '@ai-sdk/mistral';
11
 
12
  export function getAnthropicModel(apiKey: string, model: string) {
13
  const anthropic = createAnthropic({
 
32
  return openai(model);
33
  }
34
 
35
+ export function getMistralModel(apiKey: string, model: string) {
36
+ const mistral = createMistral({
37
+ apiKey
38
+ });
39
+
40
+ return mistral(model);
41
+ }
42
+
43
  export function getGoogleModel(apiKey: string, model: string) {
44
  const google = createGoogleGenerativeAI(
45
  apiKey,
 
63
  return Ollama;
64
  }
65
 
66
+ export function getDeepseekModel(apiKey: string, model: string){
67
+ const openai = createOpenAI({
68
+ baseURL: 'https://api.deepseek.com/beta',
69
+ apiKey,
70
+ });
71
+
72
+ return openai(model);
73
+ }
74
+
75
  export function getOpenRouterModel(apiKey: string, model: string) {
76
  const openRouter = createOpenRouter({
77
  apiKey
 
97
  return getGoogleModel(apiKey, model)
98
  case 'OpenAILike':
99
  return getOpenAILikeModel(baseURL,apiKey, model);
100
+ case 'Deepseek':
101
+ return getDeepseekModel(apiKey, model)
102
+ case 'Mistral':
103
+ return getMistralModel(apiKey, model);
104
  default:
105
  return getOllamaModel(baseURL, model);
106
  }
app/lib/.server/llm/prompts.ts CHANGED
@@ -29,7 +29,32 @@ You are Bolt, an expert AI assistant and exceptional senior software developer w
29
 
30
  IMPORTANT: When choosing databases or npm packages, prefer options that don't rely on native binaries. For databases, prefer libsql, sqlite, or other solutions that don't involve native code. WebContainer CANNOT execute arbitrary native binaries.
31
 
32
- Available shell commands: cat, chmod, cp, echo, hostname, kill, ln, ls, mkdir, mv, ps, pwd, rm, rmdir, xxd, alias, cd, clear, curl, env, false, getconf, head, sort, tail, touch, true, uptime, which, code, jq, loadenv, node, python3, wasm, xdg-open, command, exit, export, source
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  </system_constraints>
34
 
35
  <code_formatting_info>
@@ -84,6 +109,36 @@ You are Bolt, an expert AI assistant and exceptional senior software developer w
84
  </${MODIFICATIONS_TAG_NAME}>
85
  </diff_spec>
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  <artifact_info>
88
  Bolt creates a SINGLE, comprehensive artifact for each project. The artifact contains all necessary steps and components, including:
89
 
 
29
 
30
  IMPORTANT: When choosing databases or npm packages, prefer options that don't rely on native binaries. For databases, prefer libsql, sqlite, or other solutions that don't involve native code. WebContainer CANNOT execute arbitrary native binaries.
31
 
32
+ Available shell commands:
33
+ File Operations:
34
+ - cat: Display file contents
35
+ - cp: Copy files/directories
36
+ - ls: List directory contents
37
+ - mkdir: Create directory
38
+ - mv: Move/rename files
39
+ - rm: Remove files
40
+ - rmdir: Remove empty directories
41
+ - touch: Create empty file/update timestamp
42
+
43
+ System Information:
44
+ - hostname: Show system name
45
+ - ps: Display running processes
46
+ - pwd: Print working directory
47
+ - uptime: Show system uptime
48
+ - env: Environment variables
49
+
50
+ Development Tools:
51
+ - node: Execute Node.js code
52
+ - python3: Run Python scripts
53
+ - code: VSCode operations
54
+ - jq: Process JSON
55
+
56
+ Other Utilities:
57
+ - curl, head, sort, tail, clear, which, export, chmod, scho, hostname, kill, ln, xxd, alias, false, getconf, true, loadenv, wasm, xdg-open, command, exit, source
58
  </system_constraints>
59
 
60
  <code_formatting_info>
 
109
  </${MODIFICATIONS_TAG_NAME}>
110
  </diff_spec>
111
 
112
+ <chain_of_thought_instructions>
113
+ Before providing a solution, BRIEFLY outline your implementation steps. This helps ensure systematic thinking and clear communication. Your planning should:
114
+ - List concrete steps you'll take
115
+ - Identify key components needed
116
+ - Note potential challenges
117
+ - Be concise (2-4 lines maximum)
118
+
119
+ Example responses:
120
+
121
+ User: "Create a todo list app with local storage"
122
+ Assistant: "Sure. I'll start by:
123
+ 1. Set up Vite + React
124
+ 2. Create TodoList and TodoItem components
125
+ 3. Implement localStorage for persistence
126
+ 4. Add CRUD operations
127
+
128
+ Let's start now.
129
+
130
+ [Rest of response...]"
131
+
132
+ User: "Help debug why my API calls aren't working"
133
+ Assistant: "Great. My first steps will be:
134
+ 1. Check network requests
135
+ 2. Verify API endpoint format
136
+ 3. Examine error handling
137
+
138
+ [Rest of response...]"
139
+
140
+ </chain_of_thought_instructions>
141
+
142
  <artifact_info>
143
  Bolt creates a SINGLE, comprehensive artifact for each project. The artifact contains all necessary steps and components, including:
144
 
app/lib/stores/workbench.ts CHANGED
@@ -11,6 +11,7 @@ import { PreviewsStore } from './previews';
11
  import { TerminalStore } from './terminal';
12
  import JSZip from 'jszip';
13
  import { saveAs } from 'file-saver';
 
14
 
15
  export interface ArtifactState {
16
  id: string;
@@ -280,21 +281,22 @@ export class WorkbenchStore {
280
 
281
  for (const [filePath, dirent] of Object.entries(files)) {
282
  if (dirent?.type === 'file' && !dirent.isBinary) {
283
- // Remove '/home/project/' from the beginning of the path
284
  const relativePath = filePath.replace(/^\/home\/project\//, '');
285
 
286
- // Split the path into segments
287
  const pathSegments = relativePath.split('/');
288
 
289
- // If there's more than one segment, we need to create folders
290
  if (pathSegments.length > 1) {
291
  let currentFolder = zip;
 
292
  for (let i = 0; i < pathSegments.length - 1; i++) {
293
  currentFolder = currentFolder.folder(pathSegments[i])!;
294
  }
295
  currentFolder.file(pathSegments[pathSegments.length - 1], dirent.content);
296
  } else {
297
- // If there's only one segment, it's a file in the root
298
  zip.file(relativePath, dirent.content);
299
  }
300
  }
@@ -303,6 +305,140 @@ export class WorkbenchStore {
303
  const content = await zip.generateAsync({ type: 'blob' });
304
  saveAs(content, 'project.zip');
305
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  }
307
 
308
  export const workbenchStore = new WorkbenchStore();
 
11
  import { TerminalStore } from './terminal';
12
  import JSZip from 'jszip';
13
  import { saveAs } from 'file-saver';
14
+ import { Octokit } from "@octokit/rest";
15
 
16
  export interface ArtifactState {
17
  id: string;
 
281
 
282
  for (const [filePath, dirent] of Object.entries(files)) {
283
  if (dirent?.type === 'file' && !dirent.isBinary) {
284
+ // remove '/home/project/' from the beginning of the path
285
  const relativePath = filePath.replace(/^\/home\/project\//, '');
286
 
287
+ // split the path into segments
288
  const pathSegments = relativePath.split('/');
289
 
290
+ // if there's more than one segment, we need to create folders
291
  if (pathSegments.length > 1) {
292
  let currentFolder = zip;
293
+
294
  for (let i = 0; i < pathSegments.length - 1; i++) {
295
  currentFolder = currentFolder.folder(pathSegments[i])!;
296
  }
297
  currentFolder.file(pathSegments[pathSegments.length - 1], dirent.content);
298
  } else {
299
+ // if there's only one segment, it's a file in the root
300
  zip.file(relativePath, dirent.content);
301
  }
302
  }
 
305
  const content = await zip.generateAsync({ type: 'blob' });
306
  saveAs(content, 'project.zip');
307
  }
308
+
309
+ async syncFiles(targetHandle: FileSystemDirectoryHandle) {
310
+ const files = this.files.get();
311
+ const syncedFiles = [];
312
+
313
+ for (const [filePath, dirent] of Object.entries(files)) {
314
+ if (dirent?.type === 'file' && !dirent.isBinary) {
315
+ const relativePath = filePath.replace(/^\/home\/project\//, '');
316
+ const pathSegments = relativePath.split('/');
317
+ let currentHandle = targetHandle;
318
+
319
+ for (let i = 0; i < pathSegments.length - 1; i++) {
320
+ currentHandle = await currentHandle.getDirectoryHandle(pathSegments[i], { create: true });
321
+ }
322
+
323
+ // create or get the file
324
+ const fileHandle = await currentHandle.getFileHandle(pathSegments[pathSegments.length - 1], { create: true });
325
+
326
+ // write the file content
327
+ const writable = await fileHandle.createWritable();
328
+ await writable.write(dirent.content);
329
+ await writable.close();
330
+
331
+ syncedFiles.push(relativePath);
332
+ }
333
+ }
334
+
335
+ return syncedFiles;
336
+ }
337
+
338
+ async pushToGitHub(repoName: string, githubUsername: string, ghToken: string) {
339
+
340
+ try {
341
+ // Get the GitHub auth token from environment variables
342
+ const githubToken = ghToken;
343
+
344
+ const owner = githubUsername;
345
+
346
+ if (!githubToken) {
347
+ throw new Error('GitHub token is not set in environment variables');
348
+ }
349
+
350
+ // Initialize Octokit with the auth token
351
+ const octokit = new Octokit({ auth: githubToken });
352
+
353
+ // Check if the repository already exists before creating it
354
+ let repo
355
+ try {
356
+ repo = await octokit.repos.get({ owner: owner, repo: repoName });
357
+ } catch (error) {
358
+ if (error instanceof Error && 'status' in error && error.status === 404) {
359
+ // Repository doesn't exist, so create a new one
360
+ const { data: newRepo } = await octokit.repos.createForAuthenticatedUser({
361
+ name: repoName,
362
+ private: false,
363
+ auto_init: true,
364
+ });
365
+ repo = newRepo;
366
+ } else {
367
+ console.log('cannot create repo!');
368
+ throw error; // Some other error occurred
369
+ }
370
+ }
371
+
372
+ // Get all files
373
+ const files = this.files.get();
374
+ if (!files || Object.keys(files).length === 0) {
375
+ throw new Error('No files found to push');
376
+ }
377
+
378
+ // Create blobs for each file
379
+ const blobs = await Promise.all(
380
+ Object.entries(files).map(async ([filePath, dirent]) => {
381
+ if (dirent?.type === 'file' && dirent.content) {
382
+ const { data: blob } = await octokit.git.createBlob({
383
+ owner: repo.owner.login,
384
+ repo: repo.name,
385
+ content: Buffer.from(dirent.content).toString('base64'),
386
+ encoding: 'base64',
387
+ });
388
+ return { path: filePath.replace(/^\/home\/project\//, ''), sha: blob.sha };
389
+ }
390
+ })
391
+ );
392
+
393
+ const validBlobs = blobs.filter(Boolean); // Filter out any undefined blobs
394
+
395
+ if (validBlobs.length === 0) {
396
+ throw new Error('No valid files to push');
397
+ }
398
+
399
+ // Get the latest commit SHA (assuming main branch, update dynamically if needed)
400
+ const { data: ref } = await octokit.git.getRef({
401
+ owner: repo.owner.login,
402
+ repo: repo.name,
403
+ ref: `heads/${repo.default_branch || 'main'}`, // Handle dynamic branch
404
+ });
405
+ const latestCommitSha = ref.object.sha;
406
+
407
+ // Create a new tree
408
+ const { data: newTree } = await octokit.git.createTree({
409
+ owner: repo.owner.login,
410
+ repo: repo.name,
411
+ base_tree: latestCommitSha,
412
+ tree: validBlobs.map((blob) => ({
413
+ path: blob!.path,
414
+ mode: '100644',
415
+ type: 'blob',
416
+ sha: blob!.sha,
417
+ })),
418
+ });
419
+
420
+ // Create a new commit
421
+ const { data: newCommit } = await octokit.git.createCommit({
422
+ owner: repo.owner.login,
423
+ repo: repo.name,
424
+ message: 'Initial commit from your app',
425
+ tree: newTree.sha,
426
+ parents: [latestCommitSha],
427
+ });
428
+
429
+ // Update the reference
430
+ await octokit.git.updateRef({
431
+ owner: repo.owner.login,
432
+ repo: repo.name,
433
+ ref: `heads/${repo.default_branch || 'main'}`, // Handle dynamic branch
434
+ sha: newCommit.sha,
435
+ });
436
+
437
+ alert(`Repository created and code pushed: ${repo.html_url}`);
438
+ } catch (error) {
439
+ console.error('Error pushing to GitHub:', error instanceof Error ? error.message : String(error));
440
+ }
441
+ }
442
  }
443
 
444
  export const workbenchStore = new WorkbenchStore();
app/types/global.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ interface Window {
2
+ showDirectoryPicker(): Promise<FileSystemDirectoryHandle>;
3
+ }
app/utils/constants.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ModelInfo } from './types';
2
 
3
  export const WORK_DIR_NAME = 'project';
4
  export const WORK_DIR = `/home/${WORK_DIR_NAME}`;
@@ -10,6 +10,8 @@ export const DEFAULT_PROVIDER = 'Anthropic';
10
  const staticModels: ModelInfo[] = [
11
  { name: 'claude-3-5-sonnet-20240620', label: 'Claude 3.5 Sonnet', provider: 'Anthropic' },
12
  { name: 'gpt-4o', label: 'GPT-4o', provider: 'OpenAI' },
 
 
13
  { name: 'deepseek/deepseek-coder', label: 'Deepseek-Coder V2 236B (OpenRouter)', provider: 'OpenRouter' },
14
  { name: 'google/gemini-flash-1.5', label: 'Google Gemini Flash 1.5 (OpenRouter)', provider: 'OpenRouter' },
15
  { name: 'google/gemini-pro-1.5', label: 'Google Gemini Pro 1.5 (OpenRouter)', provider: 'OpenRouter' },
@@ -30,18 +32,29 @@ const staticModels: ModelInfo[] = [
30
  { name: 'gpt-4-turbo', label: 'GPT-4 Turbo', provider: 'OpenAI' },
31
  { name: 'gpt-4', label: 'GPT-4', provider: 'OpenAI' },
32
  { name: 'gpt-3.5-turbo', label: 'GPT-3.5 Turbo', provider: 'OpenAI' },
 
 
 
 
 
 
 
 
 
 
 
33
  ];
34
 
35
  export let MODEL_LIST: ModelInfo[] = [...staticModels];
36
 
37
  async function getOllamaModels(): Promise<ModelInfo[]> {
38
  try {
39
- const base_url =import.meta.env.OLLAMA_API_BASE_URL || "http://localhost:11434";
40
  const url = new URL(base_url).toString();
41
- const response = await fetch(`${url}api/tags`);
42
- const data = await response.json();
43
 
44
- return data.models.map((model: any) => ({
45
  name: model.name,
46
  label: `${model.name} (${model.details.parameter_size})`,
47
  provider: 'Ollama',
 
1
+ import type { ModelInfo, OllamaApiResponse, OllamaModel } from './types';
2
 
3
  export const WORK_DIR_NAME = 'project';
4
  export const WORK_DIR = `/home/${WORK_DIR_NAME}`;
 
10
  const staticModels: ModelInfo[] = [
11
  { name: 'claude-3-5-sonnet-20240620', label: 'Claude 3.5 Sonnet', provider: 'Anthropic' },
12
  { name: 'gpt-4o', label: 'GPT-4o', provider: 'OpenAI' },
13
+ { name: 'anthropic/claude-3.5-sonnet', label: 'Anthropic: Claude 3.5 Sonnet (OpenRouter)', provider: 'OpenRouter' },
14
+ { name: 'anthropic/claude-3-haiku', label: 'Anthropic: Claude 3 Haiku (OpenRouter)', provider: 'OpenRouter' },
15
  { name: 'deepseek/deepseek-coder', label: 'Deepseek-Coder V2 236B (OpenRouter)', provider: 'OpenRouter' },
16
  { name: 'google/gemini-flash-1.5', label: 'Google Gemini Flash 1.5 (OpenRouter)', provider: 'OpenRouter' },
17
  { name: 'google/gemini-pro-1.5', label: 'Google Gemini Pro 1.5 (OpenRouter)', provider: 'OpenRouter' },
 
32
  { name: 'gpt-4-turbo', label: 'GPT-4 Turbo', provider: 'OpenAI' },
33
  { name: 'gpt-4', label: 'GPT-4', provider: 'OpenAI' },
34
  { name: 'gpt-3.5-turbo', label: 'GPT-3.5 Turbo', provider: 'OpenAI' },
35
+ { name: 'deepseek-coder', label: 'Deepseek-Coder', provider: 'Deepseek'},
36
+ { name: 'deepseek-chat', label: 'Deepseek-Chat', provider: 'Deepseek'},
37
+ { name: 'open-mistral-7b', label: 'Mistral 7B', provider: 'Mistral' },
38
+ { name: 'open-mixtral-8x7b', label: 'Mistral 8x7B', provider: 'Mistral' },
39
+ { name: 'open-mixtral-8x22b', label: 'Mistral 8x22B', provider: 'Mistral' },
40
+ { name: 'open-codestral-mamba', label: 'Codestral Mamba', provider: 'Mistral' },
41
+ { name: 'open-mistral-nemo', label: 'Mistral Nemo', provider: 'Mistral' },
42
+ { name: 'ministral-8b-latest', label: 'Mistral 8B', provider: 'Mistral' },
43
+ { name: 'ministral-small-latest', label: 'Mistral Small', provider: 'Mistral' },
44
+ { name: 'codestral-latest', label: 'Codestral', provider: 'Mistral' },
45
+ { name: 'ministral-large-latest', label: 'Mistral Large Latest', provider: 'Mistral' },
46
  ];
47
 
48
  export let MODEL_LIST: ModelInfo[] = [...staticModels];
49
 
50
  async function getOllamaModels(): Promise<ModelInfo[]> {
51
  try {
52
+ const base_url = import.meta.env.OLLAMA_API_BASE_URL || "http://localhost:11434";
53
  const url = new URL(base_url).toString();
54
+ const response = await fetch(`${url}/api/tags`);
55
+ const data = await response.json() as OllamaApiResponse;
56
 
57
+ return data.models.map((model: OllamaModel) => ({
58
  name: model.name,
59
  label: `${model.name} (${model.details.parameter_size})`,
60
  provider: 'Ollama',
app/utils/types.ts CHANGED
@@ -8,7 +8,7 @@ interface OllamaModelDetails {
8
  quantization_level: string;
9
  }
10
 
11
- interface OllamaModel {
12
  name: string;
13
  model: string;
14
  modified_at: string;
 
8
  quantization_level: string;
9
  }
10
 
11
+ export interface OllamaModel {
12
  name: string;
13
  model: string;
14
  modified_at: string;
docker-compose.yml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ bolt-app:
3
+ build:
4
+ context: .
5
+ dockerfile: Dockerfile
6
+ ports:
7
+ - "3000:3000"
8
+ environment:
9
+ - NODE_ENV=production
10
+ # Add any other environment variables your app needs
11
+ # - OPENAI_API_KEY=${OPENAI_API_KEY}
12
+ # - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
13
+ # - GROQ_API_KEY=${GROQ_API_KEY}
14
+ # - OPEN_ROUTER_API_KEY=${OPEN_ROUTER_API_KEY}
15
+ volumes:
16
+ # This volume is for development purposes, allowing live code updates
17
+ # Comment out or remove for production
18
+ - .:/app
19
+ # This volume is to prevent node_modules from being overwritten by the above volume
20
+ - /app/node_modules
21
+ command: pnpm run start
22
+
23
+ volumes:
24
+ node_modules:
package.json CHANGED
@@ -3,7 +3,6 @@
3
  "description": "StackBlitz AI Agent",
4
  "private": true,
5
  "license": "MIT",
6
- "packageManager": "[email protected]",
7
  "sideEffects": false,
8
  "type": "module",
9
  "scripts": {
@@ -14,7 +13,7 @@
14
  "test:watch": "vitest",
15
  "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
16
  "lint:fix": "npm run lint -- --fix",
17
- "start": "bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings",
18
  "typecheck": "tsc",
19
  "typegen": "wrangler types",
20
  "preview": "pnpm run build && pnpm run start"
@@ -26,6 +25,7 @@
26
  "@ai-sdk/anthropic": "^0.0.39",
27
  "@ai-sdk/google": "^0.0.52",
28
  "@ai-sdk/openai": "^0.0.66",
 
29
  "@codemirror/autocomplete": "^6.17.0",
30
  "@codemirror/commands": "^6.6.0",
31
  "@codemirror/lang-cpp": "^6.0.2",
@@ -45,6 +45,8 @@
45
  "@iconify-json/svg-spinners": "^1.1.2",
46
  "@lezer/highlight": "^1.2.0",
47
  "@nanostores/react": "^0.7.2",
 
 
48
  "@openrouter/ai-sdk-provider": "^0.0.5",
49
  "@radix-ui/react-dialog": "^1.1.1",
50
  "@radix-ui/react-dropdown-menu": "^2.1.1",
@@ -94,6 +96,7 @@
94
  "is-ci": "^3.0.1",
95
  "node-fetch": "^3.3.2",
96
  "prettier": "^3.3.2",
 
97
  "typescript": "^5.5.2",
98
  "unified": "^11.0.5",
99
  "unocss": "^0.61.3",
 
3
  "description": "StackBlitz AI Agent",
4
  "private": true,
5
  "license": "MIT",
 
6
  "sideEffects": false,
7
  "type": "module",
8
  "scripts": {
 
13
  "test:watch": "vitest",
14
  "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
15
  "lint:fix": "npm run lint -- --fix",
16
+ "start": "bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings --ip 0.0.0.0 --port 3000",
17
  "typecheck": "tsc",
18
  "typegen": "wrangler types",
19
  "preview": "pnpm run build && pnpm run start"
 
25
  "@ai-sdk/anthropic": "^0.0.39",
26
  "@ai-sdk/google": "^0.0.52",
27
  "@ai-sdk/openai": "^0.0.66",
28
+ "@ai-sdk/mistral": "^0.0.43",
29
  "@codemirror/autocomplete": "^6.17.0",
30
  "@codemirror/commands": "^6.6.0",
31
  "@codemirror/lang-cpp": "^6.0.2",
 
45
  "@iconify-json/svg-spinners": "^1.1.2",
46
  "@lezer/highlight": "^1.2.0",
47
  "@nanostores/react": "^0.7.2",
48
+ "@octokit/rest": "^21.0.2",
49
+ "@octokit/types": "^13.6.1",
50
  "@openrouter/ai-sdk-provider": "^0.0.5",
51
  "@radix-ui/react-dialog": "^1.1.1",
52
  "@radix-ui/react-dropdown-menu": "^2.1.1",
 
96
  "is-ci": "^3.0.1",
97
  "node-fetch": "^3.3.2",
98
  "prettier": "^3.3.2",
99
+ "sass-embedded": "^1.80.3",
100
  "typescript": "^5.5.2",
101
  "unified": "^11.0.5",
102
  "unocss": "^0.61.3",
pnpm-lock.yaml CHANGED
@@ -17,6 +17,9 @@ importers:
17
  '@ai-sdk/google':
18
  specifier: ^0.0.52
19
  version: 0.0.52([email protected])
 
 
 
20
  '@ai-sdk/openai':
21
  specifier: ^0.0.66
22
  version: 0.0.66([email protected])
@@ -77,6 +80,12 @@ importers:
77
  '@nanostores/react':
78
  specifier: ^0.7.2
79
 
 
 
 
 
 
80
  '@openrouter/ai-sdk-provider':
81
  specifier: ^0.0.5
82
  version: 0.0.5([email protected])
@@ -264,6 +273,12 @@ packages:
264
  peerDependencies:
265
  zod: ^3.0.0
266
 
 
 
 
 
 
 
267
  '@ai-sdk/[email protected]':
268
  resolution: {integrity: sha512-V4XeDnlNl5/AY3GB3ozJUjqnBLU5pK3DacKTbCNH3zH8/MggJoH6B8wRGdLUPVFMcsMz60mtvh4DC9JsIVFrKw==}
269
  engines: {node: '>=18'}
@@ -1230,6 +1245,58 @@ packages:
1230
  resolution: {integrity: sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==}
1231
  engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
1232
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1233
  '@openrouter/[email protected]':
1234
  resolution: {integrity: sha512-AfxXQhISpxQSeUjU/4jo9waM5GRNX6eIkfTFS9l7vHkD1TKDP81Y/dXrE0ttJeN/Kap3tPF3Jwh49me0gWwjSw==}
1235
  engines: {node: '>=18'}
@@ -2211,6 +2278,9 @@ packages:
2211
  resolution: {integrity: sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==}
2212
  engines: {node: '>= 0.8'}
2213
 
 
 
 
2214
2215
  resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
2216
  engines: {node: '>=8'}
@@ -4970,9 +5040,6 @@ packages:
4970
  engines: {node: '>=14.17'}
4971
  hasBin: true
4972
 
4973
4974
- resolution: {integrity: sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==}
4975
-
4976
4977
  resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==}
4978
 
@@ -5053,6 +5120,9 @@ packages:
5053
5054
  resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==}
5055
 
 
 
 
5056
5057
  resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
5058
  engines: {node: '>= 10.0.0'}
@@ -5387,6 +5457,12 @@ snapshots:
5387
  json-schema: 0.4.0
5388
  zod: 3.23.8
5389
 
 
 
 
 
 
 
5390
5391
  dependencies:
5392
  '@ai-sdk/provider': 0.0.24
@@ -6363,6 +6439,67 @@ snapshots:
6363
  dependencies:
6364
  which: 3.0.1
6365
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6366
6367
  dependencies:
6368
  '@ai-sdk/provider': 0.0.12
@@ -7530,6 +7667,8 @@ snapshots:
7530
  safe-buffer: 5.1.2
7531
  optional: true
7532
 
 
 
7533
7534
 
7535
@@ -9972,7 +10111,7 @@ snapshots:
9972
  dependencies:
9973
  destr: 2.0.3
9974
  node-fetch-native: 1.6.4
9975
- ufo: 1.5.3
9976
 
9977
9978
  dependencies:
@@ -11002,8 +11141,6 @@ snapshots:
11002
 
11003
11004
 
11005
11006
-
11007
11008
 
11009
@@ -11122,6 +11259,8 @@ snapshots:
11122
  unist-util-is: 6.0.0
11123
  unist-util-visit-parents: 6.0.1
11124
 
 
 
11125
11126
 
11127
 
17
  '@ai-sdk/google':
18
  specifier: ^0.0.52
19
  version: 0.0.52([email protected])
20
+ '@ai-sdk/mistral':
21
+ specifier: ^0.0.43
22
+ version: 0.0.43([email protected])
23
  '@ai-sdk/openai':
24
  specifier: ^0.0.66
25
  version: 0.0.66([email protected])
 
80
  '@nanostores/react':
81
  specifier: ^0.7.2
82
83
+ '@octokit/rest':
84
+ specifier: ^21.0.2
85
+ version: 21.0.2
86
+ '@octokit/types':
87
+ specifier: ^13.6.1
88
+ version: 13.6.1
89
  '@openrouter/ai-sdk-provider':
90
  specifier: ^0.0.5
91
  version: 0.0.5([email protected])
 
273
  peerDependencies:
274
  zod: ^3.0.0
275
 
276
+ '@ai-sdk/[email protected]':
277
+ resolution: {integrity: sha512-YcneVvO57bbmseUmnvQaj6OolMj7/q1W/oeiFj1h+CJZsXIOX8P9i2Cmo2B7HMBbt73NIcvtyPze3GjaczZRqw==}
278
+ engines: {node: '>=18'}
279
+ peerDependencies:
280
+ zod: ^3.0.0
281
+
282
  '@ai-sdk/[email protected]':
283
  resolution: {integrity: sha512-V4XeDnlNl5/AY3GB3ozJUjqnBLU5pK3DacKTbCNH3zH8/MggJoH6B8wRGdLUPVFMcsMz60mtvh4DC9JsIVFrKw==}
284
  engines: {node: '>=18'}
 
1245
  resolution: {integrity: sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==}
1246
  engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
1247
 
1248
+ '@octokit/[email protected]':
1249
+ resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==}
1250
+ engines: {node: '>= 18'}
1251
+
1252
+ '@octokit/[email protected]':
1253
+ resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==}
1254
+ engines: {node: '>= 18'}
1255
+
1256
+ '@octokit/[email protected]':
1257
+ resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==}
1258
+ engines: {node: '>= 18'}
1259
+
1260
+ '@octokit/[email protected]':
1261
+ resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==}
1262
+ engines: {node: '>= 18'}
1263
+
1264
+ '@octokit/[email protected]':
1265
+ resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==}
1266
+
1267
+ '@octokit/[email protected]':
1268
+ resolution: {integrity: sha512-cgwIRtKrpwhLoBi0CUNuY83DPGRMaWVjqVI/bGKsLJ4PzyWZNaEmhHroI2xlrVXkk6nFv0IsZpOp+ZWSWUS2AQ==}
1269
+ engines: {node: '>= 18'}
1270
+ peerDependencies:
1271
+ '@octokit/core': '>=6'
1272
+
1273
+ '@octokit/[email protected]':
1274
+ resolution: {integrity: sha512-n/lNeCtq+9ofhC15xzmJCNKP2BWTv8Ih2TTy+jatNCCq/gQP/V7rK3fjIfuz0pDWDALO/o/4QY4hyOF6TQQFUw==}
1275
+ engines: {node: '>= 18'}
1276
+ peerDependencies:
1277
+ '@octokit/core': '>=6'
1278
+
1279
+ '@octokit/[email protected]':
1280
+ resolution: {integrity: sha512-wMsdyHMjSfKjGINkdGKki06VEkgdEldIGstIEyGX0wbYHGByOwN/KiM+hAAlUwAtPkP3gvXtVQA9L3ITdV2tVw==}
1281
+ engines: {node: '>= 18'}
1282
+ peerDependencies:
1283
+ '@octokit/core': '>=6'
1284
+
1285
+ '@octokit/[email protected]':
1286
+ resolution: {integrity: sha512-IlBTfGX8Yn/oFPMwSfvugfncK2EwRLjzbrpifNaMY8o/HTEAFqCA1FZxjD9cWvSKBHgrIhc4CSBIzMxiLsbzFQ==}
1287
+ engines: {node: '>= 18'}
1288
+
1289
+ '@octokit/[email protected]':
1290
+ resolution: {integrity: sha512-V+TFhu5fdF3K58rs1pGUJIDH5RZLbZm5BI+MNF+6o/ssFNT4vWlCh/tVpF3NxGtP15HUxTTMUbsG5llAuU2CZA==}
1291
+ engines: {node: '>= 18'}
1292
+
1293
+ '@octokit/[email protected]':
1294
+ resolution: {integrity: sha512-+CiLisCoyWmYicH25y1cDfCrv41kRSvTq6pPWtRroRJzhsCZWZyCqGyI8foJT5LmScADSwRAnr/xo+eewL04wQ==}
1295
+ engines: {node: '>= 18'}
1296
+
1297
+ '@octokit/[email protected]':
1298
+ resolution: {integrity: sha512-PHZE9Z+kWXb23Ndik8MKPirBPziOc0D2/3KH1P+6jK5nGWe96kadZuE4jev2/Jq7FvIfTlT2Ltg8Fv2x1v0a5g==}
1299
+
1300
  '@openrouter/[email protected]':
1301
  resolution: {integrity: sha512-AfxXQhISpxQSeUjU/4jo9waM5GRNX6eIkfTFS9l7vHkD1TKDP81Y/dXrE0ttJeN/Kap3tPF3Jwh49me0gWwjSw==}
1302
  engines: {node: '>=18'}
 
2278
  resolution: {integrity: sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==}
2279
  engines: {node: '>= 0.8'}
2280
 
2281
2282
+ resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==}
2283
+
2284
2285
  resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
2286
  engines: {node: '>=8'}
 
5040
  engines: {node: '>=14.17'}
5041
  hasBin: true
5042
 
 
 
 
5043
5044
  resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==}
5045
 
 
5120
5121
  resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==}
5122
 
5123
5124
+ resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==}
5125
+
5126
5127
  resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
5128
  engines: {node: '>= 10.0.0'}
 
5457
  json-schema: 0.4.0
5458
  zod: 3.23.8
5459
 
5460
5461
+ dependencies:
5462
+ '@ai-sdk/provider': 0.0.24
5463
+ '@ai-sdk/provider-utils': 1.0.20([email protected])
5464
+ zod: 3.23.8
5465
+
5466
5467
  dependencies:
5468
  '@ai-sdk/provider': 0.0.24
 
6439
  dependencies:
6440
  which: 3.0.1
6441
 
6442
+ '@octokit/[email protected]': {}
6443
+
6444
+ '@octokit/[email protected]':
6445
+ dependencies:
6446
+ '@octokit/auth-token': 5.1.1
6447
+ '@octokit/graphql': 8.1.1
6448
+ '@octokit/request': 9.1.3
6449
+ '@octokit/request-error': 6.1.5
6450
+ '@octokit/types': 13.6.1
6451
+ before-after-hook: 3.0.2
6452
+ universal-user-agent: 7.0.2
6453
+
6454
+ '@octokit/[email protected]':
6455
+ dependencies:
6456
+ '@octokit/types': 13.6.1
6457
+ universal-user-agent: 7.0.2
6458
+
6459
+ '@octokit/[email protected]':
6460
+ dependencies:
6461
+ '@octokit/request': 9.1.3
6462
+ '@octokit/types': 13.6.1
6463
+ universal-user-agent: 7.0.2
6464
+
6465
+ '@octokit/[email protected]': {}
6466
+
6467
+ '@octokit/[email protected](@octokit/[email protected])':
6468
+ dependencies:
6469
+ '@octokit/core': 6.1.2
6470
+ '@octokit/types': 13.6.1
6471
+
6472
+ '@octokit/[email protected](@octokit/[email protected])':
6473
+ dependencies:
6474
+ '@octokit/core': 6.1.2
6475
+
6476
+ '@octokit/[email protected](@octokit/[email protected])':
6477
+ dependencies:
6478
+ '@octokit/core': 6.1.2
6479
+ '@octokit/types': 13.6.1
6480
+
6481
+ '@octokit/[email protected]':
6482
+ dependencies:
6483
+ '@octokit/types': 13.6.1
6484
+
6485
+ '@octokit/[email protected]':
6486
+ dependencies:
6487
+ '@octokit/endpoint': 10.1.1
6488
+ '@octokit/request-error': 6.1.5
6489
+ '@octokit/types': 13.6.1
6490
+ universal-user-agent: 7.0.2
6491
+
6492
+ '@octokit/[email protected]':
6493
+ dependencies:
6494
+ '@octokit/core': 6.1.2
6495
+ '@octokit/plugin-paginate-rest': 11.3.5(@octokit/[email protected])
6496
+ '@octokit/plugin-request-log': 5.3.1(@octokit/[email protected])
6497
+ '@octokit/plugin-rest-endpoint-methods': 13.2.6(@octokit/[email protected])
6498
+
6499
+ '@octokit/[email protected]':
6500
+ dependencies:
6501
+ '@octokit/openapi-types': 22.2.0
6502
+
6503
6504
  dependencies:
6505
  '@ai-sdk/provider': 0.0.12
 
7667
  safe-buffer: 5.1.2
7668
  optional: true
7669
 
7670
7671
+
7672
7673
 
7674
 
10111
  dependencies:
10112
  destr: 2.0.3
10113
  node-fetch-native: 1.6.4
10114
+ ufo: 1.5.4
10115
 
10116
10117
  dependencies:
 
11141
 
11142
11143
 
 
 
11144
11145
 
11146
 
11259
  unist-util-is: 6.0.0
11260
  unist-util-visit-parents: 6.0.1
11261
 
11262
11263
+
11264
11265
 
11266
vite.config.ts CHANGED
@@ -28,6 +28,13 @@ export default defineConfig((config) => {
28
  config.mode === 'production' && optimizeCssModules({ apply: 'build' }),
29
  ],
30
  envPrefix:["VITE_","OPENAI_LIKE_API_","OLLAMA_API_BASE_URL"],
 
 
 
 
 
 
 
31
  };
32
  });
33
 
 
28
  config.mode === 'production' && optimizeCssModules({ apply: 'build' }),
29
  ],
30
  envPrefix:["VITE_","OPENAI_LIKE_API_","OLLAMA_API_BASE_URL"],
31
+ css: {
32
+ preprocessorOptions: {
33
+ scss: {
34
+ api: 'modern-compiler',
35
+ },
36
+ },
37
+ },
38
  };
39
  });
40
 
worker-configuration.d.ts CHANGED
@@ -6,4 +6,5 @@ interface Env {
6
  OLLAMA_API_BASE_URL: string;
7
  OPENAI_LIKE_API_KEY: string;
8
  OPENAI_LIKE_API_BASE_URL: string;
 
9
  }
 
6
  OLLAMA_API_BASE_URL: string;
7
  OPENAI_LIKE_API_KEY: string;
8
  OPENAI_LIKE_API_BASE_URL: string;
9
+ DEEPSEEK_API_KEY: string;
10
  }