mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-06-07 05:39:03 +00:00
Merge pull request #252 from gnh1201/master
Update commit history to the dev branch
This commit is contained in:
commit
718dd77c1b
|
@ -62,7 +62,7 @@ WelsonJS is tailored for developers who need a reliable, lightweight JavaScript
|
||||||
## Specifications
|
## Specifications
|
||||||
* Built-in transpilers: [TypeScript](https://www.typescriptlang.org/), [Rescript](https://rescript-lang.org/), [CoffeeScript 2](https://coffeescript.org/), [LiveScript](https://livescript.net/)
|
* 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.**
|
* **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)
|
* 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)
|
* 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)
|
* Classical CSS Frameworks: [cascadeframework](https://github.com/jslegers/cascadeframework), [golden-layout](https://github.com/golden-layout/golden-layout)
|
||||||
|
|
54
app/assets/bat/clean_chrome_pup.bat
Normal file
54
app/assets/bat/clean_chrome_pup.bat
Normal file
|
@ -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
|
17
examples/honoai_gemini.ai.js
Normal file
17
examples/honoai_gemini.ai.js
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
var LIE = require("lib/language-inference-engine")
|
||||||
|
|
||||||
|
function main(args) {
|
||||||
|
|
||||||
|
var provider = "gemini"
|
||||||
|
var text = "hanoi tower example"
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.main = main;
|
|
@ -185,33 +185,39 @@ var ENGINE_PROFILES = {
|
||||||
}, []);
|
}, []);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"google": {
|
"gemini": {
|
||||||
"type": "llm",
|
"type": "llm",
|
||||||
"availableModels": [
|
"availableModels": [
|
||||||
|
"gemini-2.0-flash",
|
||||||
"gemini-1.5-flash"
|
"gemini-1.5-flash"
|
||||||
],
|
],
|
||||||
"headers": {
|
"headers": {
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
},
|
},
|
||||||
"url": "https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={apikey}",
|
"url": "https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={apikey}",
|
||||||
"warp": function(model, message, temperature) {
|
"wrap": function(model, message, temperature) {
|
||||||
return {
|
return {
|
||||||
"contents": [
|
"contents": [{
|
||||||
{
|
"role": "system",
|
||||||
"parts": [
|
"parts": [{
|
||||||
{
|
"text": BIAS_MESSAGE
|
||||||
"text": message
|
}]
|
||||||
}
|
}, {
|
||||||
]
|
"role": "user",
|
||||||
}
|
"parts": [{
|
||||||
]
|
"text": message
|
||||||
|
}]
|
||||||
|
}],
|
||||||
|
"generationConfig": {
|
||||||
|
"temperature": temperature
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
"callback": function(response) {
|
"callback": function(response) {
|
||||||
if ("error" in response) {
|
if ("error" in response) {
|
||||||
return ["Error: " + response.error.message];
|
return ["Error: " + response.error.message];
|
||||||
} else {
|
} else {
|
||||||
return response.candidates.reduce(function(a, x) {
|
return response["candidates"].reduce(function(a, x) {
|
||||||
x.content.parts.forEach(function(part) {
|
x.content.parts.forEach(function(part) {
|
||||||
if ("text" in part) {
|
if ("text" in part) {
|
||||||
a.push(part.text);
|
a.push(part.text);
|
||||||
|
@ -219,7 +225,6 @@ var ENGINE_PROFILES = {
|
||||||
a.push("Not supported type");
|
a.push("Not supported type");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return a;
|
return a;
|
||||||
}, []);
|
}, []);
|
||||||
}
|
}
|
||||||
|
@ -508,6 +513,11 @@ function LanguageInferenceEngine() {
|
||||||
var headers = this.engineProfile.headers;
|
var headers = this.engineProfile.headers;
|
||||||
var wrap = this.engineProfile.wrap;
|
var wrap = this.engineProfile.wrap;
|
||||||
var url = this.engineProfile.url;
|
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 callback = this.engineProfile.callback;
|
||||||
|
|
||||||
var response = HTTP.create("MSXML")
|
var response = HTTP.create("MSXML")
|
||||||
|
@ -520,6 +530,14 @@ function LanguageInferenceEngine() {
|
||||||
.send()
|
.send()
|
||||||
.responseBody;
|
.responseBody;
|
||||||
|
|
||||||
|
if(typeof response === 'string'){
|
||||||
|
try {
|
||||||
|
response = JSON.parse(response)
|
||||||
|
} catch (e) {
|
||||||
|
return ["Error: Malformed response - " + e.message];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return callback(response);
|
return callback(response);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ function __BOOL_TO_DWORD__(x) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check 'Run as administrator'
|
// Check 'Run as administrator'
|
||||||
function isElevated = function() {
|
var isElevated = function() {
|
||||||
try {
|
try {
|
||||||
CreateObject("WScript.Shell").RegRead("HKEY_USERS\\s-1-5-19\\");
|
CreateObject("WScript.Shell").RegRead("HKEY_USERS\\s-1-5-19\\");
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -13,7 +13,7 @@ var VirtualInputObject = function() {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("VirtualInputObject.create() -> " + e.message);
|
console.error("VirtualInputObject.create() -> " + e.message);
|
||||||
}
|
}
|
||||||
);
|
};
|
||||||
|
|
||||||
this.moveMouse = function(x, y) {
|
this.moveMouse = function(x, y) {
|
||||||
this.oAutoIt.MouseMove(x, y);
|
this.oAutoIt.MouseMove(x, y);
|
||||||
|
|
|
@ -1137,7 +1137,7 @@ var test_implements = {
|
||||||
job.setHostName("example.org");
|
job.setHostName("example.org");
|
||||||
job.setResourceName(resourceName);
|
job.setResourceName(resourceName);
|
||||||
job.saveTo("D:\\");
|
job.saveTo("D:\\");
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user