Commit Graph

2838 Commits

Author SHA1 Message Date
b78f0c9af9
Update install.ps1
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2026-04-18 14:37:42 +09:00
ab96f1462b
Add WelsonJS One-Click Installer script #404
Add WelsonJS One-Click Installer script #404
2026-04-18 14:32:21 +09:00
Namhyeon, Go
0bf4fe1d59 Style: normalize function formatting in core-js
Adjust whitespace, indentation and add missing semicolon in the returned function inside NullProtoObjectViaSc64bit. This is a purely stylistic change (spacing around `function` and consistent indentation) and does not alter runtime behavior.
2026-04-18 12:26:34 +09:00
Namhyeon, Go
12f6088ba0 Handle ScriptControl failures gracefully
Replace the explicit error throw when ScriptControl-based object creation fails with a safe fallback factory that returns an empty object. This prevents runtime errors in 64-bit environments and during subsequent enumBugKeys cleanup by returning a benign constructor instead of throwing.
2026-04-18 12:20:49 +09:00
272651f376 Add fix_excel_format example script
Add examples/fix_excel_format.js which uses the WelsonJS msoffice Office.Excel API to read rows from data/fulllist.xlsx (worksheet 2), extract company, reservation time, resource, port and bandwidth, and log each row. For each entry it generates a per-company card Excel file by opening card_format.xlsx, populating template cells (with sensible defaults for missing resource/port/bandwidth), saving as data/{company}_card.xlsx, and exporting main.
2026-04-17 16:18:49 +09:00
bd8e2bad77 Add example Claude desktop config
Add data/claude_desktop_config.example.json providing an example desktop configuration for the Claude app. It defines an "mcpServers" entry ("local-tools") that invokes Windows cscript to run app.js with mcploader args, and a "preferences" block with toggles for cowork/ccd scheduled tasks, cowork web search enabled, and sidebarMode set to "chat".
2026-04-14 11:55:15 +09:00
Namhyeon, Go
6a3ac803b1 Remove embedded McpToolsList.json
Delete the <EmbeddedResource Include="McpToolsList.json" /> entry from WelsonJS.Augmented/WelsonJS.Launcher/WelsonJS.Launcher.csproj so the JSON file is no longer embedded into the assembly as a resource.
2026-04-12 22:58:47 +09:00
Namhyeon, Go
2120a8f8b4 Add ES3 evaluator and isError flag
Introduce an isError flag and propagate it through RPC responses, including initialize and action listings. Add a new action "evaluate_js_es3" with an input schema that accepts a script string and a handler that evaluates the script (returns the evaluation result as text or "Error" on exception). Also set isError for unknown methods so the RPC indicates failures consistently.
2026-04-12 22:54:24 +09:00
Namhyeon, Go
97802fd074 Remove McpToolsList and stub JsonRpc2 tools
Replace the previous in-file handling of JSON-RPC tools methods with a NotImplementedException and remove the ResolveToolsCall helper. Also delete the large McpToolsList.json resource that previously provided the tools manifest. This stubs out the tools/list and tools/call behavior so the tooling manifest and handler can be reworked or moved elsewhere in a follow-up change.
2026-04-12 22:50:11 +09:00
Namhyeon, Go
03d078bde8 Allow no-reply notifications; also write messages to stderr
Treat a callback returning false as a signal to suppress a JSON-RPC reply (jsonrpc2.extract). Add a special-case in mcploader to return false for "notifications/initialized" so no response is sent. In stdio-server, skip sending falsy messages, keep object serialization, and write outgoing messages to both StdOut and StdErr (useful for logging/debugging). Small cleanup in catch formatting.
2026-04-12 21:11:22 +09:00
Namhyeon, Go
c22ca660ec Add MCP JSON-RPC handlers and stdio fixes
Implement MCP JSON-RPC handling and related I/O fixes: mcploader now handles initialize, tools/list and tools/call (implements add_both_numbers) and returns JSON-RPC responses; stdio-server.send serializes object messages before writing; console logging on WScript now writes muted messages to StdErr; bump jsonrpc2 version to 0.1.7 and reformat extract(). These changes enable proper MCP capability negotiation, tool discovery and invocation over stdio.
2026-04-12 20:39:50 +09:00
Namhyeon, Go
43d945055f Prefix existsSync checks with script directory
Change existsSync to resolve filenames relative to the current script directory by prepending require._getCurrentScriptDirectory() + "\\" to the provided filename before calling Scripting.FileSystemObject.FileExists. This ensures relative paths are correctly resolved when checking file existence (prevents false negatives when filenames are relative to the script).
2026-04-12 19:44:04 +09:00
Namhyeon, Go
55f6f1c438 Evaluate console._muted at load time
Convert console._muted from a function to a boolean by invoking an IIFE during module initialization. This reads the WScript 'quiet' flag once and stores the result, and updates _echoCallback to reference the boolean (remove the function call). This simplifies usage and avoids repeated runtime checks.
2026-04-12 19:18:46 +09:00
Namhyeon, Go
4c48fdbb4d Add stdio server, mcploader and JSON-RPC extract
Introduce a StdioServer module and mcploader entry script, and extend jsonrpc2 with an extract() helper. stdio-server.js provides an EventTarget-based wrapper for reading/writing via WScript stdio. mcploader.js uses the server and JsonRpc2.extract to parse incoming JSON-RPC messages and respond. Also change DEFAULT_JSONRPC2_URL to http://localhost:5555, export the new extract function, and bump jsonrpc2 version to 0.1.6.
2026-04-12 19:11:30 +09:00
Namhyeon, Go
e0e713d975 Add muted mode and restructure console echo
Introduce a _muted() helper to check for a WScript "quiet" argument and avoid output when muted. Replace the old _echoDefault with a unified _echoCallback(params, type) that writes messages via WScript and respects the muted flag. Refactor _echo to build a params object (including params.message and scope), prepend the optional type, invoke _echoCallback, and push the composed message to _messages. Adjust callback invocation logic (remove the previous null check and inline handling).
2026-04-12 18:10:06 +09:00
252da80548
Simplify argument retrieval from WScript
Refactor argument handling for WScript in app.js.
2026-04-12 16:51:10 +09:00
Namhyeon, Go
c7f1d6675b Switch WSH output and update core-js
Replace WScript.Echo with WScript.StdOut.WriteLine for WSH console output and reword provider comments to reflect requesting scripts (including LLM/AI services). Update core-js usage to app/assets/js/core-js-3.49.0.wsh and adjust related require paths (including squel), and remove the old core-js-3.26.1 minified file. Other minor changes include updates to bootstrap.bat and lib/http.js.
2026-04-11 12:42:07 +09:00
fe21be0e54 Add core-js 3.49.0 bundle
Add new webpacked core-js bundle (app/assets/js/core-js-3.49.0.wsh.js) containing core-js v3.49.0 polyfills and runtime helpers. The file includes the webpack bootstrap and numerous core-js modules to provide compatibility for older environments (license and source referenced in header).
2026-04-11 12:36:03 +09:00
2599470bb6 Add stdin flag to console and update copyright
app.js: Add a _useStdin flag (via WScript.Arguments.Named.Exists("stdin")) and skip default echoing when stdin is in use; switch WScript.Echo to WScript.StdOut.WriteLine for proper stdout output. Remove separator comment lines before initializeConsole. bootstrap.js: Bump copyright year to 2026 and remove an obsolete/commented CORS-to-ADO registry tweak. These changes improve console output behavior for piped input and clean up bootstrap metadata and comments.
2026-04-09 16:30:17 +09:00
Namhyeon, Go
f1456e304c Add tools call handling and translate docs
Pass the serializer and request id to ResolveToolsCall and implement a basic dispatcher that extracts params.method. Add a handler stub for "run_jsrt_script" (extracts the script argument; implementation TODO) and log unknown tool methods. Also update McpToolsList.json scriptContract notes from Korean to English to improve readability/localization.
2026-03-16 21:37:16 +09:00
Namhyeon, Go
3eea89f5a3 Fix JSON-RPC dispatcher callback params
Reordered the parameters for the JSON-RPC dispatch callback to ensure the serializer and request id are passed in the correct positions. Updated the Func signature in JsonRpc2Dispatcher.cs to include the int id parameter before the CancellationToken, and adjusted the invocation/lambda in JsonRpc2.cs to match (method, ser, id, ct), preventing parameter mismatches when handling requests.
2026-03-16 21:17:51 +09:00
d7f58a9b0c Propagate request id and add tools call handler
Forward the JSON-RPC request id through the dispatcher and handler so methods can access the id. JsonRpc2Dispatcher now passes the id to dispatchMethodAsync, and the JsonRpc2 endpoint lambda accepts the id parameter. Implemented a call for "tools/call" that extracts the tool name via ser.ExtractFrom(id, "params", "name") and invokes a new ResolveToolsCall(string) stub (TODO: implement actual tool logic). This prepares the codepath for tooling invocation based on request params.
2026-03-07 14:44:14 +09:00
4101c03659 Validate keyword and normalize limit in search
Add input validation to search(): require keyword be a non-empty string and throw a TypeError if not. Normalize limit to a finite integer between 1 and 100 (default 10) using Math.floor and Math.min/Math.max to prevent invalid or out-of-range values.
2026-02-11 16:46:37 +09:00
aaac19406b Use HTTP SERP API client for search
Replace the old JsonRpc2 relay-based product search with a direct HTTP client call to a SERP API endpoint. The search function signature changed from search(s) to search(keyword, limit) and now sends a GET to the workers.dev /api/v1/products/search endpoint with keyword and limit parameters, returning the HTTP responseBody. Also updated VERSIONINFO and removed the previous security notice and remote script relay logic. Note: callers must update usages due to the signature and return-value change.
2026-02-11 16:36:48 +09:00
ef11f06661 Add SPDX header and fix error message
Add SPDX license header and project copyright/URL to JsNative.cs for proper licensing metadata. Update JsonRpc2Dispatcher.cs to improve the exception text to "Unsupported JSON-RPC version: ..." (capitalization and hyphen) for a clearer error message when the jsonrpc version is invalid.
2026-02-10 11:03:58 +09:00
546fe93f23
Merge pull request #394 from gnh1201/codex/create-new-mcptoolslist.json
Limit run_jsrt_script timeoutMs to 90 minutes
2026-02-10 10:12:40 +09:00
Namhyeon, Go
6101054f2b Limit run_jsrt_script timeoutMs to 90 minutes 2026-02-10 10:10:45 +09:00
3e5d120824 Update whois resource strings and comments
Replace hardcoded WHOIS resource values: change WhoisClientAddress from 141.101.82.1 to 49.8.14.101, and replace punycode domains with the human-readable whois.kr for WhoisReferrerUrl and WhoisServerUrl. Updated Resources.resx and synchronized the generated XML documentation comments in Resources.Designer.cs to reflect the new values.
2026-02-10 09:47:02 +09:00
Namhyeon, Go
92f434ec07 Invalidate map and geolocate only when visible
Move the setTimeout and its contents inside the visible check so map.invalidateSize() and navigator.geolocation.getCurrentPosition(...) are only invoked when the map container is shown. This avoids unnecessary map invalidation and geolocation requests when the view is hidden; try/catch and the 0ms defer are preserved.
2026-02-09 23:28:34 +09:00
Namhyeon, Go
2804a4a4df Add location marker to MapView
Introduce useLocationMarker hook to manage a Leaflet marker (create, update and bind a popup). MapView now uses the hook and, when visible, requests navigator.geolocation to place/center a marker at the user's current position with a popup showing coordinates. Also includes a small indentation/whitespace cleanup.
2026-02-09 23:24:25 +09:00
Namhyeon, Go
387e86e5a1 Update WHOIS URLs and client IP in app.config
Modify WelsonJS.Augmented/WelsonJS.Launcher/app.config to replace the previous punycode WHOIS endpoints with the canonical whois.kr URLs (WhoisServerUrl and WhoisReferrerUrl) and change WhoisClientAddress from 141.101.82.1 to 49.8.14.101. No other configuration values were modified.
2026-02-09 22:59:43 +09:00
ec85cc88e4 Rename AzureAiService keys to AzureCognitive
Rename AzureAiService resource keys and app settings to AzureCognitive across the launcher. Updated Properties/Resources.Designer.cs to use AzureCognitive* properties, changed Resources.resx keys and the service prefix value, and updated app.config appSettings keys accordingly. Also adjusted editor.html to use the new setting names and user-facing "Azure Cognitive" wording and updated how the chat completions URL is constructed to use the AzureCognitive* settings.
2026-02-09 14:49:11 +09:00
ef6ff90e39 Add Leaflet map view and map toggle
Integrate a Leaflet-based MapView into the editor UI: load Leaflet CSS/JS resources, add a MapView React component (initializes map, OpenStreetMap tiles, cleanup on unmount, and calls invalidateSize when shown), and wire a new Map button into the ribbon to toggle map visibility. Add show/hide handling for the Editor component (toggle display via a visible prop) and manage map/editor layout by rendering them side-by-side and toggling display. Rename Azure AI references to Azure Cognitive (handler and button id/label) and update related prop names. Minor resource list and styling updates for layout and dependencies.
2026-02-09 13:02:53 +09:00
91e18bbb0e Use HTTP forwarder for stdio-jsonrpc2
Replace the old StdioServer-based stdio JSON-RPC flow with an in-process HTTP forwarder. Program.cs now reads raw stdin, posts payloads to the configured ResourceServerPrefix + "jsonrpc2" using HttpClient (configurable timeout), writes HTTP response bytes back to stdout, and includes improved logging and SafePreviewUtf8 for safe payload previews. StdioServer.cs and its project entry were removed, and Resources.resx HttpClientTimeout was increased to 300 (Designer version updated). This centralizes stdio handling and HTTP forwarding with better error handling and diagnostics.
2026-02-06 15:10:04 +09:00
33148ec826 Add SPDX license header to JsonRpc2Dispatcher
Insert file header comments in JsonRpc2Dispatcher.cs to declare licensing and attribution: SPDX-License-Identifier: GPL-3.0-or-later, copyright notice for Catswords OSS and WelsonJS Contributors, and project URL. This clarifies file license and provenance.
2026-02-06 14:32:45 +09:00
c16603af42 Rename global store to __WJS__ and adjust serialization
Rename the global store identifier from __WJ_STORE to __WJS__ throughout JsSerializer.cs (store access in load/unload/set/get and EnsureStore initialization). Also change value retrieval to only JSON.stringify objects and use String(v) for primitives to avoid wrapping non-objects in JSON. Preserve the Object.create(null) store initialization to prevent prototype pollution.
2026-02-06 14:31:57 +09:00
362367f473 Remove unused usings from Program.cs
Clean up Program.cs by removing unused using directives (System.Net.Http, System.Runtime.Remoting.Contexts, System.Threading.Tasks and the static VisualStyleElement.Tab import). This reduces clutter and compiler warnings and keeps imports focused on required namespaces.
2026-02-05 17:47:56 +09:00
6b3d83fbcd Add JSON-RPC2 stdio & HTTP endpoint support
Introduce JSON-RPC 2.0 handling and a minimal stdio framing server. Adds ApiEndpoints/JsonRpc2 and JsonRpc2Dispatcher to parse and dispatch JSON-RPC requests, and StdioServer to handle Content-Length framed stdio messages. Adds McpToolsList.json (tools list resource) and wires JsonRpc2 into ResourceServer.

Program.cs: add --stdio-jsonrpc2 mode to run the stdio server, and integrate dispatcher usage (with timeout and TODO placeholders for tools/call). ResourceServer: register JsonRpc2 endpoint, change fallback handling to 404 via ServeResource(), and make several resource helper methods static/public for reuse. Update csproj to include new source files and embed the McpToolsList.json resource.

Contains basic implementation and scaffolding; tool-call handling is left as TODO.
2026-02-05 17:44:39 +09:00
Namhyeon, Go
7b2a2d49d0 Move API endpoints to ApiEndpoints namespace
Refactored all API endpoint classes from the ResourceTools namespace to the ApiEndpoints namespace for improved clarity and organization. Updated all references in ResourceServer to use the new namespace.
2026-01-31 23:26:36 +09:00
Namhyeon, Go
c98fcfea10 Add null checks for path in API endpoint handlers
Added null checks for the 'path' parameter in CanHandle methods across all API endpoint classes to prevent potential NullReferenceExceptions. Also made the _apis list in ResourceServer readonly and updated a comment for clarity.
2026-01-31 23:21:53 +09:00
Namhyeon, Go
741ade67c3 Refactor CanHandle to accept HttpListenerContext
Updated the IApiEndpoint interface and all implementing endpoints to change the CanHandle method signature to accept both HttpListenerContext and path. This enables more advanced routing decisions based on the full HTTP request context. ResourceServer and all endpoint usages have been updated accordingly.
2026-01-31 23:17:33 +09:00
Namhyeon, Go
bbfc6f2a6d Refactor IApiEndpoint and update ResourceServer usage
Expanded the IApiEndpoint interface to support advanced routing with a new CanHandle overload and improved documentation. Renamed internal variables in ResourceServer from _tools to _apis to better reflect their purpose and updated all related logic accordingly.
2026-01-31 23:08:47 +09:00
55c33d1750 Fix logger initialization in ResourceServer constructor
Corrects the logger assignment in ResourceServer to use the provided logger parameter instead of the uninitialized field. Also adds a commented-out log4net configuration line in AssemblyInfo.cs.
2026-01-28 17:56:58 +09:00
5d8684144b Use environment-specific logging in Program.cs
Added conditional compilation to initialize the logger with 'dev' in DEBUG builds and 'prod' otherwise. This ensures appropriate logging configuration based on the build environment.
2026-01-26 14:54:37 +09:00
96986d1417 Migrate logging to log4net and refactor API endpoints
Replaces the custom ICompatibleLogger and TraceLogger with log4net for logging, introducing LoggingBootstrap for environment-aware log4net initialization. Refactors all resource tools to use IApiEndpoint and moves them to the ApiEndpoints namespace. Updates project references, configuration, and adds a log4net.config for consistent logging setup.
2026-01-26 14:51:12 +09:00
f63a46e5b1 Add TraceError and function export utility
Introduces a TraceError class for enhanced stack tracing and logging, and adds a __export__ utility to wrap functions with error handling and naming. Also adds a console.trace method and updates bootstrap.js to use the new main function structure.
2026-01-23 16:00:12 +09:00
8d27e1fd02 Add fallback to UseObject error handling
The UseObject function now accepts an optional fallback callback, which is invoked if the main callback throws an error. This improves error handling and allows custom recovery logic.
2026-01-21 17:51:26 +09:00
3fbcd71bc5 Fix type checks and update version in pipe-ipc.js
Corrects type checking for callback and position parameters in app.js and pipe-ipc.js, ensuring proper function behavior. Also updates the version string in pipe-ipc.js to 0.1.26.
2026-01-21 17:44:17 +09:00
0c79192a63 Add custom dispose to UseObject and update pipe-ipc
Enhanced UseObject to accept a custom dispose function, improving resource management flexibility. Updated pipe-ipc.js to utilize this feature, preventing unintended disposal in repositionObject and ensuring correct stream handling. Bumped module version to 0.1.25.
2026-01-21 17:35:38 +09:00
d54a348368 Fix pageEventId usage in request body
Use pageEventId.get() instead of pageEventId when setting the request body, as pageEventId is an accessor object and requires the getter.
2026-01-21 16:23:32 +09:00