diff --git a/apps/extension/package.json b/apps/extension/package.json index 4ce067c..8b82650 100644 --- a/apps/extension/package.json +++ b/apps/extension/package.json @@ -3,7 +3,7 @@ "private": true, "displayName": "Booster Tutor", "description": "An AI assistant to help you with your Booster application", - "version": "0.0.1", + "version": "0.0.2", "publisher": "BoosterFramework", "engines": { "vscode": "^1.77.0" diff --git a/apps/extension/src/extension.ts b/apps/extension/src/extension.ts index ed53f94..3fd0a65 100644 --- a/apps/extension/src/extension.ts +++ b/apps/extension/src/extension.ts @@ -1,41 +1,41 @@ import * as vscode from "vscode"; -import * as process from "node:process"; +// import * as process from "node:process"; import * as cp from "node:child_process"; import "./fetch-polyfill"; -const apiKeyName = "MSC_OPENAI_API_KEY"; +// const apiKeyName = "MSC_OPENAI_API_KEY"; -async function getApiKey( - context: vscode.ExtensionContext -): Promise { - const apiKey = context.globalState.get(apiKeyName); +// async function getApiKey( +// context: vscode.ExtensionContext +// ): Promise { +// const apiKey = context.globalState.get(apiKeyName); - if (apiKey) { - return apiKey; - } +// if (apiKey) { +// return apiKey; +// } - const inputApiKey = await vscode.window.showInputBox({ - prompt: "Enter your OpenAI API key", - placeHolder: "OpenAI API key", - ignoreFocusOut: true, - password: true, - }); +// const inputApiKey = await vscode.window.showInputBox({ +// prompt: "Enter your OpenAI API key", +// placeHolder: "OpenAI API key", +// ignoreFocusOut: true, +// password: true, +// }); - if (inputApiKey) { - await context.globalState.update(apiKeyName, inputApiKey); - } +// if (inputApiKey) { +// await context.globalState.update(apiKeyName, inputApiKey); +// } - return inputApiKey; -} +// return inputApiKey; +// } export async function activate(context: vscode.ExtensionContext) { console.log('Congratulations, your extension "chat-sidebar" is now active!'); - const apiKey = await getApiKey(context); - if (!apiKey) { - vscode.window.showErrorMessage("API key is required"); - return; - } + // const apiKey = await getApiKey(context); + // if (!apiKey) { + // vscode.window.showErrorMessage("API key is required"); + // return; + // } const outputChannel = vscode.window.createOutputChannel("Booster Tutor"); context.subscriptions.push(outputChannel); @@ -47,7 +47,7 @@ export async function activate(context: vscode.ExtensionContext) { global.console = { ...console, ...myCustomConsole }; - process.env["OPENAI_API_KEY"] = apiKey; + // process.env["OPENAI_API_KEY"] = apiKey; cp.exec("node --version", (error, stdout, stderr) => { if (error) { diff --git a/apps/extension/src/webview.tsx b/apps/extension/src/webview.tsx index f3adb4a..082c1bb 100644 --- a/apps/extension/src/webview.tsx +++ b/apps/extension/src/webview.tsx @@ -85,8 +85,9 @@ export const App: React.FC = () => { const [userMessage, setUserMessage] = React.useState(""); const [chatMessages, setChatMessages] = React.useState>([ new ChatMessage( - "user", - "**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nulla nec odio nec nunc" + "bot", + `## Hello! 🚀 + I'm thrilled to assist you with your Booster project! Whether you need guidance on **contributing to Booster**, getting health information from sensors, finding **beginner-friendly or more involved coding tasks**, improving documentation, creating GitHub issues, suggesting enhancements, or even just asking a quick question in the community, **I've got you covered!** Feel free to explore the Booster documentation for detailed instructions and resources, and don't hesitate to reach out if you need any further assistance. **Let's boost your project together!** 🌟` ), ]); const [loading, setLoading] = React.useState(false); @@ -101,13 +102,6 @@ export const App: React.FC = () => { }; React.useEffect(() => { - const sendInitialMessage = () => { - setTimeout(() => { - sendMessageToExtension( - "Greet me and give me a one paragraph detailed description of how can you help me with my Booster project. Use markdown to highlight the important parts." - ); - }, 500); - }; const listener = (event: MessageEvent) => { if (event.data.type === "from-bot") { const message = new ChatMessage("bot", event.data.content); @@ -121,7 +115,6 @@ export const App: React.FC = () => { }; window.addEventListener("message", listener); - window.addEventListener("load", sendInitialMessage); return () => window.removeEventListener("message", listener); }, []);