Skip to content

Commit 118eb56

Browse files
author
Nick Tchayka
committed
fix: Hotfixes for release
1 parent a8f7e0d commit 118eb56

File tree

3 files changed

+30
-37
lines changed

3 files changed

+30
-37
lines changed

apps/extension/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"displayName": "Booster Tutor",
55
"description": "An AI assistant to help you with your Booster application",
6-
"version": "0.0.1",
6+
"version": "0.0.2",
77
"publisher": "BoosterFramework",
88
"engines": {
99
"vscode": "^1.77.0"

apps/extension/src/extension.ts

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
import * as vscode from "vscode";
2-
import * as process from "node:process";
2+
// import * as process from "node:process";
33
import * as cp from "node:child_process";
44
import "./fetch-polyfill";
55

6-
const apiKeyName = "MSC_OPENAI_API_KEY";
6+
// const apiKeyName = "MSC_OPENAI_API_KEY";
77

8-
async function getApiKey(
9-
context: vscode.ExtensionContext
10-
): Promise<string | undefined> {
11-
const apiKey = context.globalState.get<string>(apiKeyName);
8+
// async function getApiKey(
9+
// context: vscode.ExtensionContext
10+
// ): Promise<string | undefined> {
11+
// const apiKey = context.globalState.get<string>(apiKeyName);
1212

13-
if (apiKey) {
14-
return apiKey;
15-
}
13+
// if (apiKey) {
14+
// return apiKey;
15+
// }
1616

17-
const inputApiKey = await vscode.window.showInputBox({
18-
prompt: "Enter your OpenAI API key",
19-
placeHolder: "OpenAI API key",
20-
ignoreFocusOut: true,
21-
password: true,
22-
});
17+
// const inputApiKey = await vscode.window.showInputBox({
18+
// prompt: "Enter your OpenAI API key",
19+
// placeHolder: "OpenAI API key",
20+
// ignoreFocusOut: true,
21+
// password: true,
22+
// });
2323

24-
if (inputApiKey) {
25-
await context.globalState.update(apiKeyName, inputApiKey);
26-
}
24+
// if (inputApiKey) {
25+
// await context.globalState.update(apiKeyName, inputApiKey);
26+
// }
2727

28-
return inputApiKey;
29-
}
28+
// return inputApiKey;
29+
// }
3030

3131
export async function activate(context: vscode.ExtensionContext) {
3232
console.log('Congratulations, your extension "chat-sidebar" is now active!');
3333

34-
const apiKey = await getApiKey(context);
35-
if (!apiKey) {
36-
vscode.window.showErrorMessage("API key is required");
37-
return;
38-
}
34+
// const apiKey = await getApiKey(context);
35+
// if (!apiKey) {
36+
// vscode.window.showErrorMessage("API key is required");
37+
// return;
38+
// }
3939

4040
const outputChannel = vscode.window.createOutputChannel("Booster Tutor");
4141
context.subscriptions.push(outputChannel);
@@ -47,7 +47,7 @@ export async function activate(context: vscode.ExtensionContext) {
4747

4848
global.console = { ...console, ...myCustomConsole };
4949

50-
process.env["OPENAI_API_KEY"] = apiKey;
50+
// process.env["OPENAI_API_KEY"] = apiKey;
5151

5252
cp.exec("node --version", (error, stdout, stderr) => {
5353
if (error) {

apps/extension/src/webview.tsx

+3-10
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ export const App: React.FC = () => {
8585
const [userMessage, setUserMessage] = React.useState("");
8686
const [chatMessages, setChatMessages] = React.useState<Array<ChatMessage>>([
8787
new ChatMessage(
88-
"user",
89-
"**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nulla nec odio nec nunc"
88+
"bot",
89+
`## Hello! 🚀
90+
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!** 🌟`
9091
),
9192
]);
9293
const [loading, setLoading] = React.useState(false);
@@ -101,13 +102,6 @@ export const App: React.FC = () => {
101102
};
102103

103104
React.useEffect(() => {
104-
const sendInitialMessage = () => {
105-
setTimeout(() => {
106-
sendMessageToExtension(
107-
"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."
108-
);
109-
}, 500);
110-
};
111105
const listener = (event: MessageEvent) => {
112106
if (event.data.type === "from-bot") {
113107
const message = new ChatMessage("bot", event.data.content);
@@ -121,7 +115,6 @@ export const App: React.FC = () => {
121115
};
122116

123117
window.addEventListener("message", listener);
124-
window.addEventListener("load", sendInitialMessage);
125118
return () => window.removeEventListener("message", listener);
126119
}, []);
127120

0 commit comments

Comments
 (0)