-
Notifications
You must be signed in to change notification settings - Fork 0
Implement MuGlyph M1 foundation plus M2–M4 subsystems #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build-and-test: | ||
| name: build & test (${{ matrix.os }}) | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest] | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up .NET 10 SDK | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: '10.0.x' | ||
|
|
||
| - name: Restore | ||
| run: dotnet restore MuGlyph.slnx | ||
|
|
||
| - name: Build | ||
| run: dotnet build MuGlyph.slnx -c Release --no-restore | ||
|
|
||
| # TUnit runs on Microsoft.Testing.Platform; execute each test project directly | ||
| # (the classic `dotnet test`/VSTest path is not used by MTP on .NET 10). | ||
| - name: Test — Core | ||
| shell: bash | ||
| run: dotnet run -c Release --no-build --project tests/MuClient.Core.Tests/MuClient.Core.Tests.csproj | ||
|
|
||
| - name: Test — Graphics | ||
| shell: bash | ||
| run: dotnet run -c Release --no-build --project tests/MuClient.Graphics.Tests/MuClient.Graphics.Tests.csproj | ||
|
|
||
| - name: Test — Scripting | ||
| shell: bash | ||
| run: dotnet run -c Release --no-build --project tests/MuClient.Scripting.Tests/MuClient.Scripting.Tests.csproj | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <Project> | ||
|
|
||
| <!-- Shared settings for every project in the MuGlyph solution. --> | ||
| <PropertyGroup> | ||
| <TargetFramework>net10.0</TargetFramework> | ||
| <LangVersion>latest</LangVersion> | ||
| <Nullable>enable</Nullable> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <TreatWarningsAsErrors>false</TreatWarningsAsErrors> | ||
| <GenerateDocumentationFile>false</GenerateDocumentationFile> | ||
| <InvariantGlobalization>true</InvariantGlobalization> | ||
| <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
| <Authors>Harry Cordewener</Authors> | ||
| <Product>MuGlyph</Product> | ||
| <Copyright>Copyright (c) 2026 Harry Cordewener</Copyright> | ||
| <PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
| <RepositoryUrl>https://github.com/HarryCordewener/MuGlyph</RepositoryUrl> | ||
| </PropertyGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <Project> | ||
|
|
||
| <!-- Central package version management for the whole solution. --> | ||
| <PropertyGroup> | ||
| <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <!-- TUI toolkit (v2 is prerelease; API differs completely from v1). --> | ||
| <PackageVersion Include="Terminal.Gui" Version="2.4.18-develop.6" /> | ||
|
|
||
| <!-- Telnet negotiation: TELOPT/NAWS/MTTS/EOR/CHARSET/MSSP/GMCP/MSDP/MCCP/MXP negotiation. --> | ||
| <PackageVersion Include="TelnetNegotiationCore" Version="2.5.3" /> | ||
|
|
||
| <!-- Sandboxed Lua scripting (pure-managed, no native deps). --> | ||
| <PackageVersion Include="MoonSharp" Version="2.0.0" /> | ||
|
|
||
| <!-- Logging abstractions (TelnetNegotiationCore takes an ILogger). --> | ||
| <PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.2" /> | ||
|
|
||
| <!-- Test stack: TUnit (source-generated, runs on Microsoft.Testing.Platform). --> | ||
| <PackageVersion Include="TUnit" Version="1.61.38" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <Solution> | ||
| <Folder Name="/src/"> | ||
| <Project Path="src/MuClient.Core/MuClient.Core.csproj" /> | ||
| <Project Path="src/MuClient.Graphics/MuClient.Graphics.csproj" /> | ||
| <Project Path="src/MuClient.Scripting/MuClient.Scripting.csproj" /> | ||
| <Project Path="src/MuClient.Tui/MuClient.Tui.csproj" /> | ||
| </Folder> | ||
| <Folder Name="/tests/"> | ||
| <Project Path="tests/MuClient.Core.Tests/MuClient.Core.Tests.csproj" /> | ||
| <Project Path="tests/MuClient.Graphics.Tests/MuClient.Graphics.Tests.csproj" /> | ||
| <Project Path="tests/MuClient.Scripting.Tests/MuClient.Scripting.Tests.csproj" /> | ||
| </Folder> | ||
| </Solution> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| -- Example MuGlyph Lua script. | ||
| -- Loaded per-world; the sandbox exposes: world, output, trigger, alias, timer, gmcp, log. | ||
| -- (No io/os.execute/require — scripting is sandboxed.) | ||
|
|
||
| output.print("Loaded example.lua for world: " .. world.name) | ||
|
|
||
| -- Trigger: callback receives the whole match followed by each capture group. | ||
| trigger.add("(%w+) waves at you", function(whole, who) | ||
| world.send("wave " .. who) | ||
| output.print("Waved back at " .. who) | ||
| end) | ||
|
|
||
| -- Alias: string form with $1..$9 capture references. | ||
| alias.add("^gt (.+)", "grouptell $1") | ||
|
|
||
| -- Alias: function form (same call shape as triggers). | ||
| alias.add("^hp$", function() | ||
| world.send("score") | ||
| end) | ||
|
|
||
| -- Timer: recurring; returns a handle with :cancel(). | ||
| local keepalive = timer.every(60000, function() | ||
| world.send("") -- blank line keeps some servers from idling us out | ||
| end) | ||
|
|
||
| -- Timer: one-shot. | ||
| timer.after(2000, function() | ||
| output.print("Two seconds since load.") | ||
| end) | ||
|
|
||
| -- GMCP: a handler registered for "Char" also fires for "Char.Vitals", etc. | ||
| gmcp.on("Char.Vitals", function(json) | ||
| output.print("Vitals update: " .. json) | ||
| end) | ||
|
|
||
| log.info("example.lua ready") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| using System.Text.Json.Serialization; | ||
| using System.Text.RegularExpressions; | ||
|
|
||
| namespace MuClient.Core.Automation; | ||
|
|
||
| /// <summary> | ||
| /// A command alias: when user input matches <see cref="Pattern"/>, it is expanded into one | ||
| /// or more commands via <see cref="Substitution"/> (with <c>$1</c>..<c>$9</c> / <c>${name}</c> | ||
| /// capture references). Newlines in the substitution produce multiple commands. | ||
| /// </summary> | ||
| public sealed class Alias | ||
| { | ||
| private Regex? _compiled; | ||
|
|
||
| public string Name { get; init; } = string.Empty; | ||
|
|
||
| public required string Pattern { get; init; } | ||
|
|
||
| public bool Enabled { get; set; } = true; | ||
|
|
||
| public bool CaseSensitive { get; init; } | ||
|
|
||
| /// <summary>The expansion template. May contain multiple newline-separated commands.</summary> | ||
| public string Substitution { get; init; } = string.Empty; | ||
|
|
||
| /// <summary>Optional named script callback invoked instead of / in addition to expansion.</summary> | ||
| public string? ScriptCallback { get; init; } | ||
|
|
||
| [JsonIgnore] | ||
| public Regex Regex => _compiled ??= new Regex( | ||
| Pattern, | ||
| RegexOptions.Compiled | (CaseSensitive ? RegexOptions.None : RegexOptions.IgnoreCase), | ||
| AutomationDefaults.RegexMatchTimeout); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.