Commit Graph

20 Commits

Author SHA1 Message Date
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
0e21c8c2e3 Refactor file deployment logic in HandleTargetFilePath
Modularized the deployment of base files, optional data files, and entrypoint in HandleTargetFilePath. Improved error handling and validation for file paths and extensions. Replaced the previous CopyDirectoryRecursive implementation with a new version supporting required/optional directories and simplified file copying logic.
2026-01-19 10:03:34 +09:00
Namhyeon, Go
782d3a34a5 Update Catswords.Phantomizer.dll.gz binary
Replaced the Catswords.Phantomizer.dll.gz resource with a new version. This may include bug fixes, new features, or other improvements in the Phantomizer component.
2025-12-22 01:48:35 +09:00
Namhyeon, Go
226a33d874 Update Catswords.Phantomizer.dll.gz binary
Replaces the existing Catswords.Phantomizer.dll.gz in the launcher resources with a new version. This may include bug fixes, new features, or other improvements in the updated binary.
2025-12-22 01:28:58 +09:00
Namhyeon, Go
624bf7e7f5 Remove redundant 404 check in AssemblyLoader
Eliminated an unnecessary check for HttpStatusCode.NotFound in AssemblyLoader.cs, as EnsureSuccessStatusCode already throws for non-success responses. Updated Catswords.Phantomizer.dll.gz to reflect the latest changes.
2025-12-22 01:19:48 +09:00
Namhyeon, Go
b2df311db5 Refactor AssemblyLoader to use injected HttpClient
Updated AssemblyLoader to pass HttpClient explicitly to GetStreamFromUrl for improved flexibility and testability. Simplified GZip download logic to use the new method signature. Updated binary resource Catswords.Phantomizer.dll.gz.
2025-12-22 01:07:11 +09:00
Namhyeon, Go
7fd7206d80 Update Catswords.Phantomizer.dll.gz binary
Replaced the Catswords.Phantomizer.dll.gz resource with a new version. This may include bug fixes, new features, or other improvements in the Phantomizer component.
2025-12-22 00:48:42 +09:00
Namhyeon, Go
e50a966b89 Remove telemetry, add curl fallback and integrity hash
Removed all telemetry-related code and configuration from WelsonJS.Launcher, including source files, resource strings, and app.config keys. Enhanced AssemblyLoader to support fallback to curl.exe for downloads on legacy Windows, with integrity hash verification. Updated documentation and resource files to reflect the new curl fallback mechanism and added the required integrity hash for curl.exe.
2025-12-22 00:37:42 +09:00
Namhyeon, Go
fdabeab54f Change the project name to WelsonJS.Toolkit to WelsonJS.Augmented
Change the project name to WelsonJS.Toolkit to WelsonJS.Augmented
2025-12-14 18:54:32 +09:00