commit f39c9d2bd5bfddb23fb0575c3daea48b23d24c9f
Author: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com>
Date: Mon Mar 30 21:29:45 2026 -0500
chore: initial commit
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..c265c6f
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,390 @@
+root = true
+
+# All files
+[*]
+indent_style = space
+indent_size = 2
+
+# Xml files
+[*.xml]
+indent_size = 2
+
+# Xml project files
+[*.{csproj,fsproj,vbproj,proj,slnx}]
+indent_size = 2
+
+# Xml config files
+[*.{props,targets,config,nuspec}]
+indent_size = 2
+
+[*.json]
+indent_size = 2
+
+# C# files
+[*.cs]
+
+#### Core EditorConfig Options ####
+
+# Indentation and spacing
+indent_size = 2
+tab_width = 2
+
+# New line preferences
+insert_final_newline = false
+
+#### .NET Coding Conventions ####
+[*.{cs,vb}]
+
+# Organize usings
+dotnet_separate_import_directive_groups = true
+dotnet_sort_system_directives_first = true
+file_header_template = unset
+
+# this. and Me. preferences
+dotnet_style_qualification_for_event = false:silent
+dotnet_style_qualification_for_field = false:silent
+dotnet_style_qualification_for_method = false:silent
+dotnet_style_qualification_for_property = false:silent
+
+# Language keywords vs BCL types preferences
+dotnet_style_predefined_type_for_locals_parameters_members = true:silent
+dotnet_style_predefined_type_for_member_access = true:silent
+
+# Parentheses preferences
+dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
+dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
+dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
+dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
+
+# Modifier preferences
+dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
+
+# Expression-level preferences
+dotnet_style_coalesce_expression = true:suggestion
+dotnet_style_collection_initializer = true:suggestion
+dotnet_style_explicit_tuple_names = true:suggestion
+dotnet_style_namespace_match_folder = true:suggestion
+dotnet_style_null_propagation = true:suggestion
+dotnet_style_object_initializer = true:suggestion
+dotnet_style_operator_placement_when_wrapping = beginning_of_line
+dotnet_style_prefer_auto_properties = true:suggestion
+dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
+dotnet_style_prefer_compound_assignment = true:suggestion
+dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
+dotnet_style_prefer_conditional_expression_over_return = false:silent
+dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed:suggestion
+dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
+dotnet_style_prefer_inferred_tuple_names = true:suggestion
+dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
+dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
+dotnet_style_prefer_simplified_interpolation = true:suggestion
+
+# Field preferences
+dotnet_style_readonly_field = true:warning
+
+# Parameter preferences
+dotnet_code_quality_unused_parameters = all:suggestion
+
+# Suppression preferences
+dotnet_remove_unnecessary_suppression_exclusions = none
+
+#### C# Coding Conventions ####
+[*.cs]
+
+# var preferences
+csharp_style_var_elsewhere = true:suggestion
+csharp_style_var_for_built_in_types = true:suggestion
+csharp_style_var_when_type_is_apparent = true:suggestion
+
+# Expression-bodied members
+csharp_style_expression_bodied_accessors = true:silent
+csharp_style_expression_bodied_constructors = false:silent
+csharp_style_expression_bodied_indexers = true:silent
+csharp_style_expression_bodied_lambdas = true:suggestion
+csharp_style_expression_bodied_local_functions = false:silent
+csharp_style_expression_bodied_methods = false:silent
+csharp_style_expression_bodied_operators = false:silent
+csharp_style_expression_bodied_properties = true:silent
+
+# Pattern matching preferences
+csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
+csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
+csharp_style_prefer_extended_property_pattern = true:suggestion
+csharp_style_prefer_not_pattern = true:suggestion
+csharp_style_prefer_pattern_matching = true:silent
+csharp_style_prefer_switch_expression = true:suggestion
+
+# Null-checking preferences
+csharp_style_conditional_delegate_call = true:suggestion
+
+# Modifier preferences
+csharp_prefer_static_anonymous_function = true:suggestion
+csharp_prefer_static_local_function = true:warning
+csharp_preferred_modifier_order = public,private,protected,internal,file,const,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:suggestion
+csharp_style_prefer_readonly_struct = true:suggestion
+csharp_style_prefer_readonly_struct_member = true:suggestion
+
+# Code-block preferences
+csharp_prefer_braces = true:silent
+csharp_prefer_simple_using_statement = true:suggestion
+csharp_style_namespace_declarations = file_scoped:suggestion
+csharp_style_prefer_method_group_conversion = true:silent
+csharp_style_prefer_primary_constructors = true:suggestion
+csharp_style_prefer_top_level_statements = true:silent
+
+# Expression-level preferences
+csharp_prefer_simple_default_expression = true:suggestion
+csharp_style_deconstructed_variable_declaration = true:suggestion
+csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
+csharp_style_inlined_variable_declaration = true:suggestion
+csharp_style_prefer_index_operator = true:suggestion
+csharp_style_prefer_local_over_anonymous_function = true:suggestion
+csharp_style_prefer_null_check_over_type_check = true:suggestion
+csharp_style_prefer_range_operator = true:suggestion
+csharp_style_prefer_tuple_swap = true:suggestion
+csharp_style_prefer_utf8_string_literals = true:suggestion
+csharp_style_throw_expression = true:suggestion
+csharp_style_unused_value_assignment_preference = discard_variable:suggestion
+csharp_style_unused_value_expression_statement_preference = discard_variable:silent
+
+# 'using' directive preferences
+csharp_using_directive_placement = outside_namespace:silent
+
+#### C# Formatting Rules ####
+
+# New line preferences
+csharp_new_line_before_catch = true
+csharp_new_line_before_else = true
+csharp_new_line_before_finally = true
+csharp_new_line_before_members_in_anonymous_types = true
+csharp_new_line_before_members_in_object_initializers = true
+csharp_new_line_before_open_brace = all
+csharp_new_line_between_query_expression_clauses = true
+
+# Indentation preferences
+csharp_indent_block_contents = true
+csharp_indent_braces = false
+csharp_indent_case_contents = true
+csharp_indent_case_contents_when_block = true
+csharp_indent_labels = one_less_than_current
+csharp_indent_switch_labels = true
+
+# Space preferences
+csharp_space_after_cast = false
+csharp_space_after_colon_in_inheritance_clause = true
+csharp_space_after_comma = true
+csharp_space_after_dot = false
+csharp_space_after_keywords_in_control_flow_statements = true
+csharp_space_after_semicolon_in_for_statement = true
+csharp_space_around_binary_operators = before_and_after
+csharp_space_around_declaration_statements = false
+csharp_space_before_colon_in_inheritance_clause = true
+csharp_space_before_comma = false
+csharp_space_before_dot = false
+csharp_space_before_open_square_brackets = false
+csharp_space_before_semicolon_in_for_statement = false
+csharp_space_between_empty_square_brackets = false
+csharp_space_between_method_call_empty_parameter_list_parentheses = false
+csharp_space_between_method_call_name_and_opening_parenthesis = false
+csharp_space_between_method_call_parameter_list_parentheses = false
+csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
+csharp_space_between_method_declaration_name_and_open_parenthesis = false
+csharp_space_between_method_declaration_parameter_list_parentheses = false
+csharp_space_between_parentheses = false
+csharp_space_between_square_brackets = false
+
+# Wrapping preferences
+csharp_preserve_single_line_blocks = true
+csharp_preserve_single_line_statements = true
+
+#### Naming styles ####
+[*.{cs,vb}]
+
+# Naming rules
+
+dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.severity = suggestion
+dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.symbols = types_and_namespaces
+dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.style = pascalcase
+
+dotnet_naming_rule.interfaces_should_be_ipascalcase.severity = suggestion
+dotnet_naming_rule.interfaces_should_be_ipascalcase.symbols = interfaces
+dotnet_naming_rule.interfaces_should_be_ipascalcase.style = ipascalcase
+
+dotnet_naming_rule.type_parameters_should_be_tpascalcase.severity = suggestion
+dotnet_naming_rule.type_parameters_should_be_tpascalcase.symbols = type_parameters
+dotnet_naming_rule.type_parameters_should_be_tpascalcase.style = tpascalcase
+
+dotnet_naming_rule.methods_should_be_pascalcase.severity = suggestion
+dotnet_naming_rule.methods_should_be_pascalcase.symbols = methods
+dotnet_naming_rule.methods_should_be_pascalcase.style = pascalcase
+
+dotnet_naming_rule.properties_should_be_pascalcase.severity = suggestion
+dotnet_naming_rule.properties_should_be_pascalcase.symbols = properties
+dotnet_naming_rule.properties_should_be_pascalcase.style = pascalcase
+
+dotnet_naming_rule.events_should_be_pascalcase.severity = suggestion
+dotnet_naming_rule.events_should_be_pascalcase.symbols = events
+dotnet_naming_rule.events_should_be_pascalcase.style = pascalcase
+
+dotnet_naming_rule.local_variables_should_be_camelcase.severity = suggestion
+dotnet_naming_rule.local_variables_should_be_camelcase.symbols = local_variables
+dotnet_naming_rule.local_variables_should_be_camelcase.style = camelcase
+
+dotnet_naming_rule.local_constants_should_be_camelcase.severity = suggestion
+dotnet_naming_rule.local_constants_should_be_camelcase.symbols = local_constants
+dotnet_naming_rule.local_constants_should_be_camelcase.style = camelcase
+
+dotnet_naming_rule.parameters_should_be_camelcase.severity = suggestion
+dotnet_naming_rule.parameters_should_be_camelcase.symbols = parameters
+dotnet_naming_rule.parameters_should_be_camelcase.style = camelcase
+
+dotnet_naming_rule.public_fields_should_be_pascalcase.severity = suggestion
+dotnet_naming_rule.public_fields_should_be_pascalcase.symbols = public_fields
+dotnet_naming_rule.public_fields_should_be_pascalcase.style = pascalcase
+
+dotnet_naming_rule.private_fields_should_be__camelcase.severity = suggestion
+dotnet_naming_rule.private_fields_should_be__camelcase.symbols = private_fields
+dotnet_naming_rule.private_fields_should_be__camelcase.style = _camelcase
+
+dotnet_naming_rule.private_static_fields_should_be_s_camelcase.severity = suggestion
+dotnet_naming_rule.private_static_fields_should_be_s_camelcase.symbols = private_static_fields
+dotnet_naming_rule.private_static_fields_should_be_s_camelcase.style = s_camelcase
+
+dotnet_naming_rule.public_constant_fields_should_be_pascalcase.severity = suggestion
+dotnet_naming_rule.public_constant_fields_should_be_pascalcase.symbols = public_constant_fields
+dotnet_naming_rule.public_constant_fields_should_be_pascalcase.style = pascalcase
+
+dotnet_naming_rule.private_constant_fields_should_be_pascalcase.severity = suggestion
+dotnet_naming_rule.private_constant_fields_should_be_pascalcase.symbols = private_constant_fields
+dotnet_naming_rule.private_constant_fields_should_be_pascalcase.style = pascalcase
+
+dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.severity = suggestion
+dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.symbols = public_static_readonly_fields
+dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.style = pascalcase
+
+dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.severity = suggestion
+dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.symbols = private_static_readonly_fields
+dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.style = pascalcase
+
+dotnet_naming_rule.enums_should_be_pascalcase.severity = suggestion
+dotnet_naming_rule.enums_should_be_pascalcase.symbols = enums
+dotnet_naming_rule.enums_should_be_pascalcase.style = pascalcase
+
+dotnet_naming_rule.local_functions_should_be_pascalcase.severity = suggestion
+dotnet_naming_rule.local_functions_should_be_pascalcase.symbols = local_functions
+dotnet_naming_rule.local_functions_should_be_pascalcase.style = pascalcase
+
+dotnet_naming_rule.non_field_members_should_be_pascalcase.severity = suggestion
+dotnet_naming_rule.non_field_members_should_be_pascalcase.symbols = non_field_members
+dotnet_naming_rule.non_field_members_should_be_pascalcase.style = pascalcase
+
+# Symbol specifications
+
+dotnet_naming_symbols.interfaces.applicable_kinds = interface
+dotnet_naming_symbols.interfaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
+dotnet_naming_symbols.interfaces.required_modifiers =
+
+dotnet_naming_symbols.enums.applicable_kinds = enum
+dotnet_naming_symbols.enums.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
+dotnet_naming_symbols.enums.required_modifiers =
+
+dotnet_naming_symbols.events.applicable_kinds = event
+dotnet_naming_symbols.events.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
+dotnet_naming_symbols.events.required_modifiers =
+
+dotnet_naming_symbols.methods.applicable_kinds = method
+dotnet_naming_symbols.methods.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
+dotnet_naming_symbols.methods.required_modifiers =
+
+dotnet_naming_symbols.properties.applicable_kinds = property
+dotnet_naming_symbols.properties.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
+dotnet_naming_symbols.properties.required_modifiers =
+
+dotnet_naming_symbols.public_fields.applicable_kinds = field
+dotnet_naming_symbols.public_fields.applicable_accessibilities = public, internal
+dotnet_naming_symbols.public_fields.required_modifiers =
+
+dotnet_naming_symbols.private_fields.applicable_kinds = field
+dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
+dotnet_naming_symbols.private_fields.required_modifiers =
+
+dotnet_naming_symbols.private_static_fields.applicable_kinds = field
+dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
+dotnet_naming_symbols.private_static_fields.required_modifiers = static
+
+dotnet_naming_symbols.types_and_namespaces.applicable_kinds = namespace, class, struct, interface, enum
+dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
+dotnet_naming_symbols.types_and_namespaces.required_modifiers =
+
+dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
+dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
+dotnet_naming_symbols.non_field_members.required_modifiers =
+
+dotnet_naming_symbols.type_parameters.applicable_kinds = namespace
+dotnet_naming_symbols.type_parameters.applicable_accessibilities = *
+dotnet_naming_symbols.type_parameters.required_modifiers =
+
+dotnet_naming_symbols.private_constant_fields.applicable_kinds = field
+dotnet_naming_symbols.private_constant_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
+dotnet_naming_symbols.private_constant_fields.required_modifiers = const
+
+dotnet_naming_symbols.local_variables.applicable_kinds = local
+dotnet_naming_symbols.local_variables.applicable_accessibilities = local
+dotnet_naming_symbols.local_variables.required_modifiers =
+
+dotnet_naming_symbols.local_constants.applicable_kinds = local
+dotnet_naming_symbols.local_constants.applicable_accessibilities = local
+dotnet_naming_symbols.local_constants.required_modifiers = const
+
+dotnet_naming_symbols.parameters.applicable_kinds = parameter
+dotnet_naming_symbols.parameters.applicable_accessibilities = *
+dotnet_naming_symbols.parameters.required_modifiers =
+
+dotnet_naming_symbols.public_constant_fields.applicable_kinds = field
+dotnet_naming_symbols.public_constant_fields.applicable_accessibilities = public, internal
+dotnet_naming_symbols.public_constant_fields.required_modifiers = const
+
+dotnet_naming_symbols.public_static_readonly_fields.applicable_kinds = field
+dotnet_naming_symbols.public_static_readonly_fields.applicable_accessibilities = public, internal
+dotnet_naming_symbols.public_static_readonly_fields.required_modifiers = readonly, static
+
+dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field
+dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
+dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = readonly, static
+
+dotnet_naming_symbols.local_functions.applicable_kinds = local_function
+dotnet_naming_symbols.local_functions.applicable_accessibilities = *
+dotnet_naming_symbols.local_functions.required_modifiers =
+
+# Naming styles
+
+dotnet_naming_style.pascalcase.required_prefix =
+dotnet_naming_style.pascalcase.required_suffix =
+dotnet_naming_style.pascalcase.word_separator =
+dotnet_naming_style.pascalcase.capitalization = pascal_case
+
+dotnet_naming_style.ipascalcase.required_prefix = I
+dotnet_naming_style.ipascalcase.required_suffix =
+dotnet_naming_style.ipascalcase.word_separator =
+dotnet_naming_style.ipascalcase.capitalization = pascal_case
+
+dotnet_naming_style.tpascalcase.required_prefix = T
+dotnet_naming_style.tpascalcase.required_suffix =
+dotnet_naming_style.tpascalcase.word_separator =
+dotnet_naming_style.tpascalcase.capitalization = pascal_case
+
+dotnet_naming_style._camelcase.required_prefix = _
+dotnet_naming_style._camelcase.required_suffix =
+dotnet_naming_style._camelcase.word_separator =
+dotnet_naming_style._camelcase.capitalization = camel_case
+
+dotnet_naming_style.camelcase.required_prefix =
+dotnet_naming_style.camelcase.required_suffix =
+dotnet_naming_style.camelcase.word_separator =
+dotnet_naming_style.camelcase.capitalization = camel_case
+
+dotnet_naming_style.s_camelcase.required_prefix = s_
+dotnet_naming_style.s_camelcase.required_suffix =
+dotnet_naming_style.s_camelcase.word_separator =
+dotnet_naming_style.s_camelcase.capitalization = camel_case
+
diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml
new file mode 100644
index 0000000..a6b2c1a
--- /dev/null
+++ b/.gitea/workflows/ci.yml
@@ -0,0 +1,23 @@
+name: CI
+on:
+ pull_request:
+ branches: [main]
+jobs:
+ ci:
+ name: Build, Format, and Test
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: 10.0.x
+ - name: Restore dependencies
+ run: dotnet restore
+ - name: Build
+ run: dotnet build --no-restore
+ - name: Check formatting
+ run: dotnet format --verify-no-changes
+ - name: Run tests
+ run: dotnet test --no-build --verbosity normal
diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml
new file mode 100644
index 0000000..7089907
--- /dev/null
+++ b/.gitea/workflows/release.yml
@@ -0,0 +1,56 @@
+name: Release
+on:
+ push:
+ branches: [main]
+jobs:
+ release:
+ name: Version, Build, and Release
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Make scripts executable
+ run: chmod +x scripts/*.sh
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: 10.0.x
+ - name: Determine version
+ id: version
+ run: ./scripts/determine-version.sh main
+ - name: Update version in csproj
+ if: steps.version.outputs.VERSION
+ run: ./scripts/update-version.sh "${{ steps.version.outputs.VERSION }}"
+ - name: Create commit
+ if: steps.version.outputs.VERSION
+ run: |
+ git config user.name "gitea-actions[bot]"
+ git config user.email "gitea-actions[bot]@users.noreply.gitea.io"
+ git add -A
+ git commit -m "Bump version to ${{ steps.version.outputs.VERSION }}" || echo "No changes to commit"
+ - name: Create tag
+ if: steps.version.outputs.VERSION
+ run: |
+ git tag "v${{ steps.version.outputs.VERSION }}"
+ - name: Push changes and tags
+ if: steps.version.outputs.VERSION
+ run: |
+ git push origin main
+ git push origin v${{ steps.version.outputs.VERSION }}
+ - name: Restore dependencies
+ if: steps.version.outputs.VERSION
+ run: dotnet restore
+ - name: Build
+ if: steps.version.outputs.VERSION
+ run: dotnet build --configuration Release --no-restore
+ - name: Run tests
+ if: steps.version.outputs.VERSION
+ run: dotnet test --configuration Release --no-build --verbosity normal
+ - name: Pack
+ if: steps.version.outputs.VERSION
+ run: dotnet pack --configuration Release --no-build --output ./artifacts
+ - name: Push to NuGet
+ if: steps.version.outputs.VERSION
+ run: dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 0000000..1ade24a
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,12 @@
+
+
+ enable
+ enable
+ latest
+ latest
+ All
+ true
+ true
+ true
+
+
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..307cc61
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,19 @@
+# Copyright (c) 2026 Stevan Freeborn
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..7dc7ba1
--- /dev/null
+++ b/README.md
@@ -0,0 +1,62 @@
+# StevanFreeborn.Options
+
+[](https://www.nuget.org/packages/StevanFreeborn.Options)
+[](https://www.nuget.org/packages/StevanFreeborn.Options)
+[](https://opensource.org/licenses/MIT)
+
+A minimalistic, AOT-compatible Option type library for functional programming in .NET.
+
+## Features
+
+- **Functional Programming**: Chain operations with Map, Bind, and Match
+- **AOT Compatible**: Works with Native AOT and trimming
+- **Nullable Reference Types**: Full support for nullable reference types
+- **No External Dependencies**: Lightweight with zero dependencies
+- **Pattern Matching Support**: Deconstruction support for modern C# pattern matching
+- **Comprehensive XML Documentation**: Full IntelliSense support
+
+## Installation
+
+Install via NuGet:
+
+```bash
+dotnet add package StevanFreeborn.Options
+```
+
+## Quick Start
+
+```csharp
+using StevanFreeborn.Options;
+
+// Create an option with a value
+Option some = Option.Some("Hello");
+
+// Create an empty option
+Option none = Option.None();
+
+// Implicit conversion from value
+Option implicitSome = "World";
+
+// Use functional operations
+string result = some
+ .Map(s => s.ToUpper())
+ .Match(
+ onSome: s => $"Value: {s}",
+ onNone: () => "No value"
+ );
+
+// Pattern matching
+if (some is (true, var value))
+{
+ Console.WriteLine(value);
+}
+```
+
+## Requirements
+
+- .NET Standard 2.1
+- .NET 10.0+
+
+## License
+
+MIT License - see [LICENSE.md](LICENSE.md) for details.
diff --git a/StevanFreeborn.Options.slnx b/StevanFreeborn.Options.slnx
new file mode 100644
index 0000000..3d8e9a0
--- /dev/null
+++ b/StevanFreeborn.Options.slnx
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/global.json b/global.json
new file mode 100644
index 0000000..ebc8585
--- /dev/null
+++ b/global.json
@@ -0,0 +1,9 @@
+{
+ "sdk": {
+ "version": "10.0.201",
+ "rollForward": "latestPatch"
+ },
+ "test": {
+ "runner": "Microsoft.Testing.Platform"
+ }
+}
\ No newline at end of file
diff --git a/scripts/determine-version.sh b/scripts/determine-version.sh
new file mode 100644
index 0000000..3aeba36
--- /dev/null
+++ b/scripts/determine-version.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+branch="${1:-main}"
+
+tag=$(git describe --tags --abbrev=0 2>/dev/null)
+base="${tag:-$branch}"
+
+commits=$(git log "$base..HEAD" --format="%s")
+major=0
+minor=0
+patch=0
+
+while IFS= read -r message; do
+ if [[ -n "$message" ]] && [[ "$message" =~ " BREAKING CHANGE|!:" ]]; then
+ major=1
+ elif [[ -n "$message" ]] && [[ "$message" =~ feat(\(.*\))?: ]]; then
+ minor=1
+ elif [[ -n "$message" ]] && [[ "$message" =~ fix(\(.*\))?: ]]; then
+ patch=1
+ fi
+done <<< "$commits"
+
+if [[ "$major" -eq 1 ]]; then
+ minor=0
+ patch=0
+elif [[ "$minor" -eq 1 ]]; then
+ patch=0
+elif [[ "$patch" -eq 0 ]] && [[ -n "$commits" ]]; then
+ patch=1
+fi
+
+currentVersion="0.0.0"
+hasExistingTag=false
+
+if [[ -n "$tag" ]]; then
+ hasExistingTag=true
+ currentVersion="${tag#v}"
+fi
+
+IFS='.' read -r majorCurrent minorCurrent patchCurrent <<< "$currentVersion"
+
+majorNew=$((majorCurrent + major))
+
+if [[ "$major" -eq 1 ]]; then
+ minorNew=0
+else
+ minorNew=$((minorCurrent + minor))
+fi
+
+if [[ "$major" -eq 1 ]] || [[ "$minor" -eq 1 ]]; then
+ patchNew=0
+else
+ patchNew=$((patchCurrent + patch))
+fi
+
+if [[ "$majorNew" -eq "$majorCurrent" ]] && [[ "$minorNew" -eq "$minorCurrent" ]] && [[ "$patchNew" -eq "$patchCurrent" ]]; then
+ if [[ "$hasExistingTag" == "false" ]]; then
+ version="0.0.0"
+ [[ -n "$GITHUB_OUTPUT" ]] && echo "VERSION=$version" >> "$GITHUB_OUTPUT" || echo "VERSION=$version"
+ echo "First release: publishing version 0.0.0"
+ else
+ exit 0
+ fi
+else
+ version="$majorNew.$minorNew.$patchNew"
+ [[ -n "$GITHUB_OUTPUT" ]] && echo "VERSION=$version" >> "$GITHUB_OUTPUT" || echo "VERSION=$version"
+fi
\ No newline at end of file
diff --git a/scripts/update-version.sh b/scripts/update-version.sh
new file mode 100644
index 0000000..a71067e
--- /dev/null
+++ b/scripts/update-version.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+version="${1:-}"
+csprojPath="${2:-src/StevanFreeborn.Results/StevanFreeborn.Results.csproj}"
+
+if [[ -z "$version" ]]; then
+ echo "Error: Version is required"
+ exit 1
+fi
+
+content=$(cat "$csprojPath")
+
+if [[ "$content" =~ \.*?\ ]]; then
+ content=$(echo "$content" | sed "s|.*|$version|")
+elif [[ "$content" =~ \ ]]; then
+ content=$(echo "$content" | sed "s||\\n $version|")
+fi
+
+echo "$content" > "$csprojPath"
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
new file mode 100644
index 0000000..6d18a9d
--- /dev/null
+++ b/src/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props
new file mode 100644
index 0000000..f2da18a
--- /dev/null
+++ b/src/Directory.Packages.props
@@ -0,0 +1,13 @@
+
+
+ true
+
+
+
+
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+
\ No newline at end of file
diff --git a/src/StevanFreeborn.Options/Option.cs b/src/StevanFreeborn.Options/Option.cs
new file mode 100644
index 0000000..d51e0c8
--- /dev/null
+++ b/src/StevanFreeborn.Options/Option.cs
@@ -0,0 +1,279 @@
+namespace StevanFreeborn.Options;
+
+///
+/// Provides factory methods for creating .
+///
+#pragma warning disable CA1716 // Identifiers should not match keywords
+public static class Option
+#pragma warning restore CA1716 // Identifiers should not match keywords
+{
+ ///
+ /// Creates an option with the specified value.
+ ///
+ /// The type of the value.
+ /// The value.
+ /// An with the specified value.
+ public static Option Some(T value)
+ {
+#if NET6_0_OR_GREATER
+ ArgumentNullException.ThrowIfNull(value);
+#else
+ if (value is null)
+ {
+ throw new ArgumentNullException(nameof(value));
+ }
+#endif
+ return new Option(true, value);
+ }
+
+ ///
+ /// Creates an empty option.
+ ///
+ /// The type of the value.
+ /// An empty .
+ public static Option None() => new(false, default!);
+
+ ///
+ /// Creates an option from the specified value, returning None if the value is null.
+ ///
+ /// The type of the value.
+ /// The value.
+ /// An with the value if not null, otherwise None.
+ public static Option From(T? value) => value is null ? None() : Some(value);
+
+ ///
+ /// Converts a value to an .
+ ///
+ /// The type of the value.
+ /// The value.
+ /// An .
+ public static Option FromT(T? value) => From(value);
+}
+
+///
+/// Represents an optional value that may or may not be present.
+///
+/// The type of the value.
+#pragma warning disable CA1716 // Identifiers should not match keywords
+public sealed class Option
+#pragma warning restore CA1716 // Identifiers should not match keywords
+{
+ private readonly T _value;
+
+ ///
+ /// Gets a value indicating whether the option has a value.
+ ///
+ public bool IsSome { get; }
+
+ ///
+ /// Gets a value indicating whether the option is empty.
+ ///
+ public bool IsNone => !IsSome;
+
+ ///
+ /// Gets the value of the option.
+ ///
+ /// Thrown when accessing Value on a None option.
+ public T Value => IsSome
+ ? _value
+ : throw new InvalidOperationException("Cannot access Value on a None option.");
+
+ internal Option(bool isSome, T value)
+ {
+ IsSome = isSome;
+ _value = value;
+ }
+
+ ///
+ /// Implicitly converts a value to an .
+ ///
+ /// The value to convert.
+#pragma warning disable CA2225 // Operator overloads have named alternates
+ public static implicit operator Option(T? value) => Option.From(value);
+#pragma warning restore CA2225 // Operator overloads have named alternates
+
+ ///
+ /// Deconstructs the option into its components.
+ ///
+ /// Indicates whether the option has a value.
+ /// The value of the option.
+ public void Deconstruct(out bool isSome, out T value)
+ {
+ isSome = IsSome;
+ value = _value;
+ }
+
+ ///
+ /// Maps the value to a new type if the option has a value.
+ ///
+ /// The new type.
+ /// The function to map the value.
+ /// A new with the mapped value if Some, otherwise None.
+ /// Thrown when mapper is null.
+ public Option Map(Func mapper)
+ {
+#if NET6_0_OR_GREATER
+ ArgumentNullException.ThrowIfNull(mapper);
+#else
+ if (mapper is null)
+ {
+ throw new ArgumentNullException(nameof(mapper));
+ }
+#endif
+
+ return IsSome ? Option.From(mapper(_value)) : Option.None();
+ }
+
+ ///
+ /// Binds to a new option if the current option has a value.
+ ///
+ /// The new option type.
+ /// The function to bind to on Some.
+ /// The result of the binder function if Some, otherwise None.
+ /// Thrown when binder is null.
+ public Option Bind(Func> binder)
+ {
+#if NET6_0_OR_GREATER
+ ArgumentNullException.ThrowIfNull(binder);
+#else
+ if (binder is null)
+ {
+ throw new ArgumentNullException(nameof(binder));
+ }
+#endif
+
+ return IsSome ? binder(_value) : Option.None();
+ }
+
+ ///
+ /// Matches the option and returns a value based on whether it has a value.
+ ///
+ /// The type of the result.
+ /// The function to execute on Some.
+ /// The function to execute on None.
+ /// The result of the appropriate function.
+ /// Thrown when onSome or onNone is null.
+ public TResult Match(Func onSome, Func onNone)
+ {
+#if NET6_0_OR_GREATER
+ ArgumentNullException.ThrowIfNull(onSome);
+ ArgumentNullException.ThrowIfNull(onNone);
+#else
+ if (onSome is null)
+ {
+ throw new ArgumentNullException(nameof(onSome));
+ }
+
+ if (onNone is null)
+ {
+ throw new ArgumentNullException(nameof(onNone));
+ }
+#endif
+
+ return IsSome ? onSome(_value) : onNone();
+ }
+
+ ///
+ /// Matches the option and executes the appropriate action.
+ ///
+ /// The action to execute on Some.
+ /// The action to execute on None.
+ /// Thrown when onSome or onNone is null.
+ public void Match(Action onSome, Action onNone)
+ {
+#if NET6_0_OR_GREATER
+ ArgumentNullException.ThrowIfNull(onSome);
+ ArgumentNullException.ThrowIfNull(onNone);
+#else
+ if (onSome is null)
+ {
+ throw new ArgumentNullException(nameof(onSome));
+ }
+
+ if (onNone is null)
+ {
+ throw new ArgumentNullException(nameof(onNone));
+ }
+#endif
+
+ if (IsSome)
+ {
+ onSome(_value);
+ }
+ else
+ {
+ onNone();
+ }
+ }
+
+ ///
+ /// Filters the option based on the specified predicate.
+ ///
+ /// The predicate to filter with.
+ /// The current option if Some and the predicate is met, otherwise None.
+ /// Thrown when predicate is null.
+ public Option Where(Func predicate)
+ {
+#if NET6_0_OR_GREATER
+ ArgumentNullException.ThrowIfNull(predicate);
+#else
+ if (predicate is null)
+ {
+ throw new ArgumentNullException(nameof(predicate));
+ }
+#endif
+
+ if (IsNone)
+ {
+ return this;
+ }
+
+ return predicate(_value) ? this : Option.None();
+ }
+
+ ///
+ /// Gets the value of the option if Some, otherwise the specified default value.
+ ///
+ /// The default value.
+ /// The value if Some, otherwise the default value.
+ public T GetValueOrDefault(T defaultValue) => IsSome ? _value : defaultValue;
+
+ ///
+ /// Gets the value of the option if Some, otherwise the result of the specified factory function.
+ ///
+ /// The factory function to provide the default value.
+ /// The value if Some, otherwise the result of the factory function.
+ /// Thrown when factory is null.
+ public T GetValueOrDefault(Func factory)
+ {
+#if NET6_0_OR_GREATER
+ ArgumentNullException.ThrowIfNull(factory);
+#else
+ if (factory is null)
+ {
+ throw new ArgumentNullException(nameof(factory));
+ }
+#endif
+
+ return IsSome ? _value : factory();
+ }
+
+ ///
+ /// Returns the current option if Some, otherwise the result of the specified factory function.
+ ///
+ /// The factory function to provide the fallback option.
+ /// The current option if Some, otherwise the result of the factory function.
+ /// Thrown when factory is null.
+ public Option OrElse(Func