From 2a3f9fb4fa4ff388fb758ff92b2452fe864cca1d Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Thu, 1 May 2025 14:32:48 +0900 Subject: [PATCH 01/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68894ee..f4ce2d1 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ WelsonJS is tailored for developers who need a reliable, lightweight JavaScript ## Specifications * Built-in transpilers: [TypeScript](https://www.typescriptlang.org/), [Rescript](https://rescript-lang.org/), [CoffeeScript 2](https://coffeescript.org/), [LiveScript](https://livescript.net/) * **Ready to use on Windows machine immediately. No additional software installation is required.** -* **WelsonJS Launcher**: Manage instances (Like a container), User-defined variable editor, [Microsoft Monaco Editor](https://github.com/microsoft/monaco-editor) (Pre-embedded rich code editor), [Microsoft Copilot](https://copilot.microsoft.com) on the code editor. +* **WelsonJS Launcher**: Manage instances (Like a container), User-defined variable editor, [Microsoft Monaco Editor](https://github.com/microsoft/monaco-editor) and [React](https://react.dev/) (Pre-embedded rich code editor), [Microsoft Copilot](https://copilot.microsoft.com), and [Azure AI Services](https://azure.microsoft.com/en-us/products/ai-services) on the code editor. * ES5(ECMAScript 5), XML, JSON, YAML compatibility: [core-js](https://github.com/zloirock/core-js), [JSON2.js](https://github.com/douglascrockford/JSON-js), [js-yaml](https://github.com/nodeca/js-yaml) * HTML5 compatibility on the built-in HTML rendering engine: [html5shiv](https://github.com/aFarkas/html5shiv), [jquery-html5-placeholder-shim](https://github.com/parndt/jquery-html5-placeholder-shim), [Respond](https://github.com/scottjehl/Respond), [selectivizr](https://github.com/keithclark/selectivizr), [ExplorerCanvas](https://github.com/arv/ExplorerCanvas), [Modernizr](https://github.com/Modernizr/Modernizr) * Classical CSS Frameworks: [cascadeframework](https://github.com/jslegers/cascadeframework), [golden-layout](https://github.com/golden-layout/golden-layout) From 5f10d50a3c7af51d33b85e96b92f12a6cb4eeeb1 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Thu, 8 May 2025 22:31:55 +0900 Subject: [PATCH 02/10] Create clean_chrome_pup.bat --- app/assets/bat/clean_chrome_pup.bat | 54 +++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 app/assets/bat/clean_chrome_pup.bat diff --git a/app/assets/bat/clean_chrome_pup.bat b/app/assets/bat/clean_chrome_pup.bat new file mode 100644 index 0000000..c9c1658 --- /dev/null +++ b/app/assets/bat/clean_chrome_pup.bat @@ -0,0 +1,54 @@ +@echo off +title Remove Chrome policies created by potentially unwanted programs +color 0C + +echo [INFO] This script must be run with administrator privileges. +echo [INFO] It will remove Chrome policies, enrollment tokens, forced extensions, and user profiles. +echo. + +:: Step 1: Remove policy-related registry keys +echo [STEP 1] Removing Chrome policy registry keys... + +reg delete "HKCU\Software\Google\Chrome" /f >nul 2>&1 +reg delete "HKCU\Software\Policies\Google\Chrome" /f >nul 2>&1 +reg delete "HKLM\Software\Google\Chrome" /f >nul 2>&1 +reg delete "HKLM\Software\Policies\Google\Chrome" /f >nul 2>&1 +reg delete "HKLM\Software\Policies\Google\Update" /f >nul 2>&1 +reg delete "HKLM\Software\WOW6432Node\Google\Enrollment" /f >nul 2>&1 + +:: Step 2: Remove CloudManagementEnrollmentToken value only +echo [STEP 2] Removing CloudManagementEnrollmentToken value... + +reg delete "HKLM\Software\WOW6432Node\Google\Update\ClientState\{430FD4D0-B729-4F61-AA34-91526481799D}" /v CloudManagementEnrollmentToken /f >nul 2>&1 + +:: Step 3: Remove policy-enforced extension installations +echo [STEP 3] Removing extension force-install policies... + +reg delete "HKCU\Software\Policies\Google\Chrome\ExtensionInstallForcelist" /f >nul 2>&1 +reg delete "HKLM\Software\Policies\Google\Chrome\ExtensionInstallForcelist" /f >nul 2>&1 + +:: Step 4: Remove Chrome policy directories +echo [STEP 4] Removing Chrome policy directories... + +if exist "%ProgramFiles(x86)%\Google\Policies" ( + rmdir /s /q "%ProgramFiles(x86)%\Google\Policies" +) + +if exist "%ProgramFiles%\Google\Policies" ( + rmdir /s /q "%ProgramFiles%\Google\Policies" +) + +if exist "%ProgramData%\Google\Policies" ( + rmdir /s /q "%ProgramData%\Google\Policies" +) + +:: Step 5: Remove entire user Chrome profile +echo [STEP 5] Removing entire Chrome user profile directory... +echo This includes all settings, cache, cookies, history, saved logins, extensions, etc. + +RD /S /Q "%LocalAppData%\Google\Chrome" + +echo. +echo [COMPLETE] Chrome has been fully reset and cleaned. +echo Restart Chrome or reboot the system to apply all changes. +pause From ef23e41e3a35742d96287348f4a7531dde8ebfe6 Mon Sep 17 00:00:00 2001 From: Jihoon Yi <44565599+baramofme@users.noreply.github.com> Date: Sat, 10 May 2025 15:50:55 +0900 Subject: [PATCH 03/10] Update language-inference-engine.js Fix gemini call broken --- lib/language-inference-engine.js | 37 +++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/lib/language-inference-engine.js b/lib/language-inference-engine.js index 52b822e..0cde9f6 100644 --- a/lib/language-inference-engine.js +++ b/lib/language-inference-engine.js @@ -185,33 +185,40 @@ var ENGINE_PROFILES = { }, []); } }, - "google": { + "gemini": { "type": "llm", "availableModels": [ + "gemini-2.0-flash", "gemini-1.5-flash" ], "headers": { "Content-Type": "application/json" }, "url": "https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={apikey}", - "warp": function(model, message, temperature) { + "wrap": function(model, message, temperature) { return { - "contents": [ - { - "parts": [ - { - "text": message - } - ] - } - ] + "contents": [{ + "role": "user", // Changed "developer" to "user" for the initial prompt. The overall prompt is still intended to guide the model, so this is reasonable. + "parts": [{ + "text": BIAS_MESSAGE + }] + }, { + "role": "user", + "parts": [{ + "text": message + }] + }], + "generationConfig": { + "temperature": temperature + } }; }, "callback": function(response) { + response = JSON.parse(response) if ("error" in response) { return ["Error: " + response.error.message]; } else { - return response.candidates.reduce(function(a, x) { + return response["candidates"].reduce(function(a, x) { x.content.parts.forEach(function(part) { if ("text" in part) { a.push(part.text); @@ -219,7 +226,6 @@ var ENGINE_PROFILES = { a.push("Not supported type"); } }); - return a; }, []); } @@ -508,6 +514,11 @@ function LanguageInferenceEngine() { var headers = this.engineProfile.headers; var wrap = this.engineProfile.wrap; var url = this.engineProfile.url; + if(this.provider === "gemini"){ + url = url + .replace(/{model}/g, this.model) + .replace(/{apikey}/g, apikey); + } var callback = this.engineProfile.callback; var response = HTTP.create("MSXML") From bcdfef3f6f72917dadc6b1e7b44fe04891516c70 Mon Sep 17 00:00:00 2001 From: Jihoon Yi <44565599+baramofme@users.noreply.github.com> Date: Sat, 10 May 2025 15:54:04 +0900 Subject: [PATCH 04/10] Create honoai_gemini.ai.js Add honoi ai call with gemini --- examples/honoai_gemini.ai.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 examples/honoai_gemini.ai.js diff --git a/examples/honoai_gemini.ai.js b/examples/honoai_gemini.ai.js new file mode 100644 index 0000000..a5f21c0 --- /dev/null +++ b/examples/honoai_gemini.ai.js @@ -0,0 +1,15 @@ +var LIE = require("lib/language-inference-engine") + +function main(args) { + + var provider = "gemini" + var text = "hanoi tower example" + + var res = LIE.create() + .setProvider(provider) + .inference(text, 0) + .join(' ') + console.log(res) +} + +exports.main = main; From b1078cd36c7d2e53784de4c2bf0a9d23c4374612 Mon Sep 17 00:00:00 2001 From: Jihoon Yi <44565599+baramofme@users.noreply.github.com> Date: Sat, 10 May 2025 16:22:08 +0900 Subject: [PATCH 05/10] Add missing model selection in honoai_gemini.ai.js Add missing model selection --- examples/honoai_gemini.ai.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/honoai_gemini.ai.js b/examples/honoai_gemini.ai.js index a5f21c0..cda3cec 100644 --- a/examples/honoai_gemini.ai.js +++ b/examples/honoai_gemini.ai.js @@ -7,6 +7,8 @@ function main(args) { var res = LIE.create() .setProvider(provider) + // If no model is specified, the first possible model is used. + .setModel("gemini-2.0-flash") .inference(text, 0) .join(' ') console.log(res) From d8a29eaeeefc8d9d50e494c1a7930b5f3010f2de Mon Sep 17 00:00:00 2001 From: Jihoon Yi <44565599+baramofme@users.noreply.github.com> Date: Sat, 10 May 2025 16:30:46 +0900 Subject: [PATCH 06/10] Update language-inference-engine.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add response type check before parsing - Wrap JSON.parse in a try/catch to handle potential malformed responses. - Use “system” role for the initial bias message on gemini model object's wrap --- lib/language-inference-engine.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/language-inference-engine.js b/lib/language-inference-engine.js index 0cde9f6..b40340f 100644 --- a/lib/language-inference-engine.js +++ b/lib/language-inference-engine.js @@ -196,9 +196,10 @@ var ENGINE_PROFILES = { }, "url": "https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={apikey}", "wrap": function(model, message, temperature) { + const BIAS_MESSAGE = BIAS_MESSAGE return { "contents": [{ - "role": "user", // Changed "developer" to "user" for the initial prompt. The overall prompt is still intended to guide the model, so this is reasonable. + "role": "system", "parts": [{ "text": BIAS_MESSAGE }] @@ -214,7 +215,6 @@ var ENGINE_PROFILES = { }; }, "callback": function(response) { - response = JSON.parse(response) if ("error" in response) { return ["Error: " + response.error.message]; } else { @@ -531,6 +531,14 @@ function LanguageInferenceEngine() { .send() .responseBody; + if(typeof response === 'string'){ + try { + response = JSON.parse(response) + } catch (e) { + return ["Error: Malformed response"]; + } + } + return callback(response); }; } From 452675273b817a5789dfbbf82711b8e130b1bcd0 Mon Sep 17 00:00:00 2001 From: Jihoon Yi <44565599+baramofme@users.noreply.github.com> Date: Sat, 10 May 2025 16:36:53 +0900 Subject: [PATCH 07/10] Update language-inference-engine.js --- lib/language-inference-engine.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/language-inference-engine.js b/lib/language-inference-engine.js index b40340f..1a71080 100644 --- a/lib/language-inference-engine.js +++ b/lib/language-inference-engine.js @@ -196,7 +196,6 @@ var ENGINE_PROFILES = { }, "url": "https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={apikey}", "wrap": function(model, message, temperature) { - const BIAS_MESSAGE = BIAS_MESSAGE return { "contents": [{ "role": "system", @@ -535,7 +534,7 @@ function LanguageInferenceEngine() { try { response = JSON.parse(response) } catch (e) { - return ["Error: Malformed response"]; + return ["Error: Malformed response - " + e.message]; } } From 10606532cb52434a0120941deedb8ca1341a62c6 Mon Sep 17 00:00:00 2001 From: Jihoon Yi <44565599+baramofme@users.noreply.github.com> Date: Sat, 10 May 2025 18:38:45 +0900 Subject: [PATCH 08/10] Update testloader.js Add missing closing brackets in test_implementsobject --- testloader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testloader.js b/testloader.js index 092457f..21bcbaa 100644 --- a/testloader.js +++ b/testloader.js @@ -1137,7 +1137,7 @@ var test_implements = { job.setHostName("example.org"); job.setResourceName(resourceName); job.saveTo("D:\\"); - }; + }); } }; From 2bff4df4be235913da72fe1928e834d5b7d05f4a Mon Sep 17 00:00:00 2001 From: Jihoon Yi <44565599+baramofme@users.noreply.github.com> Date: Sat, 10 May 2025 20:50:24 +0900 Subject: [PATCH 09/10] Update security.js fix wrong typo --- lib/security.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/security.js b/lib/security.js index 1e490eb..3ba833b 100644 --- a/lib/security.js +++ b/lib/security.js @@ -14,7 +14,7 @@ function __BOOL_TO_DWORD__(x) { } // Check 'Run as administrator' -function isElevated = function() { +var isElevated = function() { try { CreateObject("WScript.Shell").RegRead("HKEY_USERS\\s-1-5-19\\"); return true; From 90ea515f41a306bf882a76014191bcb3a079fb64 Mon Sep 17 00:00:00 2001 From: Jihoon Yi <44565599+baramofme@users.noreply.github.com> Date: Sat, 10 May 2025 20:51:17 +0900 Subject: [PATCH 10/10] Update winservice.js fix wrong typo --- lib/winservice.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/winservice.js b/lib/winservice.js index eea23bd..cff7960 100644 --- a/lib/winservice.js +++ b/lib/winservice.js @@ -13,7 +13,7 @@ var VirtualInputObject = function() { } catch (e) { console.error("VirtualInputObject.create() -> " + e.message); } - ); + }; this.moveMouse = function(x, y) { this.oAutoIt.MouseMove(x, y);