How nexxbiz/jlio works
Purpose and Entry Points
JLio is a .NET library ecosystem for declarative JSON transformation: JSON-formatted scripts are parsed into executable commands and applied to Newtonsoft JToken data. Primary embedding API is JLioConvert.Parse and engine construction in JLio.CLient/JLioConvert.cs and JLio.CLient/JLioEngineBuilder.cs. A separate MCP host exposes JLio capabilities via JLio.MCP/Program.cs.
Engine Assembly and Script Lifecycle
JLioEngine builds the execution environment from registered command/function providers and configurable parse behavior. JLioVersionedEngine supports versioned engine configurations, providing an isolation/compatibility boundary for different registered capability sets.
• JLio.CLient/JLioEngine.cs
• JLio.CLient/JLioVersionedEngine.cs
• JLio.CLient/JLioEngineConfigurations.cs
Flow: script JSON or fluent JLioScript → parse/convert registrations into command instances → execute sequentially against a mutable JSON token → return execution result and logging data.
Core Parsing, Dispatch, and Execution
Core contracts define the extension boundary: commands implement ICommand; functions implement IFunction; providers register and resolve both. CommandConverter and FunctionConverter translate script notation into runtime objects. ExecutionContext carries current/root token state, while ConditionEvaluator evaluates conditional behavior.
• JLio.Core/CommandConverter.cs
• JLio.Core/FunctionsProvider.cs
• JLio.Core/Models/ExecutionContext.cs
Unknown command handling is explicit through JLio.Core/NotFoundCommand.cs; execution results and logging are modeled in JLio.Core/Models/JLioExecutionResult.cs and JLio.Core/Models/ExecutionLogger.cs.
JSON Addressing and Mutation Commands
JSONPath selection is a central boundary between declarative script paths and token mutation. Path parsing, selection, and fetch abstraction reside in core extensions; command implementations then add, set, put, remove, copy, or move selected properties/array entries. Function-capable values are evaluated before applicable mutations.
• JLio.Core/Extensions/JsonPathMethods.cs
• JLio.Commands/Logic/PropertyChangeCommand.cs
• JLio.Commands/Logic/CopyMove.cs
Control-oriented and advanced transformations include conditional branches, decision tables, comparison, and merge:
• JLio.Commands/IfElse.cs
• JLio.Commands/DecisionTable.cs
• JLio.Commands/Advanced/Merge.cs
Function and Extension-Pack Model
Functions evaluate literals, nested expressions, and JSONPath-referenced values during command execution. Base functions cover fetch/indirection/script-relative paths; optional packs add domain capabilities and are registered as packs rather than hardwired into core.
• JLio.Functions/Fetch.cs
• JLio.Extensions.Math/RegisterMathPack.cs
• JLio.Extensions.Text/RegisterTextPack.cs
Additional packs provide date/time functions, JSON-schema ordering/filtering, and ETL transformations such as flatten, resolve, restore, and CSV serialization.
• JLio.Extensions.TimeDate/RegisterTimeDatePack.cs
• JLio.Extensions.JSchema/RegisterJSchemaPack.cs
• JLio.Extensions.ETL/RegisterETLPack.cs
Validation and MCP Integration
Pre-execution validation is a separate subsystem: script validation applies command specifications and JSONPath validation, yielding structured issues rather than coupling validation to execution.
• JLio.Validation/JLioScriptValidator.cs
• JLio.Validation/Commands/ICommandSpec.cs
• JLio.Validation/Paths/BasicJsonPathValidator.cs
The MCP executable wraps engine creation and exposes tool groups for search, reference material, script proposal, and JLio operations. No external datastore or web application is represented; material runtime infrastructure is .NET/NuGet, GitHub Actions CI/release workflows, and an MCP-compatible host.
• JLio.MCP/JLioEngineFactory.cs
• JLio.MCP/JLioTools.cs
• .github/workflows/ci.yml
Main entry points: JLioEngine.cs JLioEngine · JLioEngineBuilder.cs Engine Builder · PropertyChangeCommand.cs Mutation Commands · ExecutionContext.cs Execution Context
Components 19
Client API
- JLioConvert
JLio.CLient/JLioConvert.cs - Engine Builder · Registers command and function capabilities.
JLio.CLient/JLioEngineBuilder.cs - JLioEngine · Parses scripts and runs command sequences.
JLio.CLient/JLioEngine.cs - Versioned Engine · Isolates registered capability sets by version.
JLio.CLient/JLioVersionedEngine.cs - Engine Configurations
JLio.CLient/JLioEngineConfigurations.cs
Core Runtime
- Command & Function Conversion · Converts script notation into runtime objects.
JLio.Core/CommandConverter.cs - Function Provider · Resolves registered functions and commands.
JLio.Core/FunctionsProvider.cs - Execution Context · Carries current and root token state.
JLio.Core/Models/ExecutionContext.cs - Execution Result & Log · Returns transformed data and execution logging.
JLio.Core/Models/JLioExecutionResult.cs - JSONPath Selection · Parses and selects mutation targets.
JLio.Core/Extensions/JsonPathMethods.cs
Commands & Functions
- Mutation Commands · Add, set, put, remove, copy, and move selected JSON values.
JLio.Commands/Logic/PropertyChangeCommand.cs - Control Transformations · Conditional, decision-table, comparison, and merge behavior.
JLio.Commands/IfElse.cs - Base Functions · Evaluates literals, expressions, and path-referenced values.
JLio.Functions/Fetch.cs - Optional Extension Packs · Math, text, date/time, schema, and ETL functions.
JLio.Extensions.ETL/RegisterETLPack.cs
Validation & MCP
- Script Validator · Produces structured command and JSONPath issues.
JLio.Validation/JLioScriptValidator.cs - MCP Host · Exposes JLio operations and script tooling as MCP tools.
JLio.MCP/Program.cs - MCP Engine Factory
JLio.MCP/JLioEngineFactory.cs
Other components
- Script JSON / JLioScript · Declarative transformation program.
- Newtonsoft JToken · Mutable source and result document.
Connections 22
- Script JSON / JLioScript → JLioConvert: parse
- JLioConvert → Engine Builder: constructs
- Engine Builder → Engine Configurations: applies
- Engine Builder → Function Provider: registers
- Engine Builder → JLioEngine: builds
- Engine Configurations → Versioned Engine: versions
- Versioned Engine → JLioEngine: selects
- JLioEngine → Command & Function Conversion: parses via
- Command & Function Conversion → Function Provider: resolves runtime types
- JLioEngine → Execution Context: executes with
- Newtonsoft JToken → Execution Context: supplies mutable state
- Execution Context → Mutation Commands: runs
- Mutation Commands → JSONPath Selection: selects targets
- Mutation Commands → Base Functions: evaluates values
- Control Transformations → Base Functions: evaluates conditions
- Optional Extension Packs → Function Provider: register with
- JLioEngine → Execution Result & Log: returns
- Script JSON / JLioScript → Script Validator: validates before execution
- Script Validator → JSONPath Selection: checks paths
- MCP Host → MCP Engine Factory: starts
- MCP Engine Factory → Engine Builder: creates engine
- MCP Host → JLioEngine: invokes JLio operations