From a927b8ea75bc361a222a2c208fde771b81da4dfb Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 13 Jun 2023 10:05:05 +0100 Subject: [PATCH] feat: allow chat to request complete recipe from the binary --- src/webview/chat.js | 6 +++--- src/webview/recipes.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/webview/chat.js b/src/webview/chat.js index b03b4a50..34b6f1e3 100644 --- a/src/webview/chat.js +++ b/src/webview/chat.js @@ -69,7 +69,7 @@ const message = messageInput.value.trim(); messageInput.value = ""; addUserMessageToUI(message); - sendRequestToExtension(message); + sendRequestToExtension({ message, kind: "user_message" }); checkTextarea(); } @@ -77,12 +77,12 @@ // Ensure we don't add on to the previous message assistantMessageFinished(); addAssistantMessageToUI({ - textContent: "Executing Recipe: " + message, + textContent: "Executing Recipe: " + message.name, outcome: "success", }); // Ensure new responses don't get added on to this one assistantMessageFinished(); - sendRequestToExtension(message); + sendRequestToExtension({ ...message, kind: "recipe_request" }); } function assistantMessageFinished() { diff --git a/src/webview/recipes.js b/src/webview/recipes.js index 764ed3f6..f13ebb46 100644 --- a/src/webview/recipes.js +++ b/src/webview/recipes.js @@ -21,7 +21,7 @@ buttonContainer .querySelector(`.${recipes[i]["id"]}`) .addEventListener("click", () => { - sendMessageToExtension(recipes[i]["name"]); + sendMessageToExtension(recipes[i]); }); recipeSection.append(buttonContainer); }