AIKernel.Common 0.1.0

dotnet add package AIKernel.Common --version 0.1.0
                    
NuGet\Install-Package AIKernel.Common -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AIKernel.Common" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AIKernel.Common" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="AIKernel.Common" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AIKernel.Common --version 0.1.0
                    
#r "nuget: AIKernel.Common, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AIKernel.Common@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AIKernel.Common&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=AIKernel.Common&version=0.1.0
                    
Install as a Cake Tool

AIKernel.Common

日本語

English | 日本語


Overview / 概要

AIKernel.Common provides foundational utility components shared across the entire AIKernel ecosystem.
This library contains cross-cutting features such as JSON serialization helpers, file and path utilities, logging primitives, common exception types, and functional result primitives.

AIKernel.Common is designed as a lightweight, implementation-level support module used by:

  • AIKernel.Core
  • AIKernel.Tools
  • AIKernel.CLI
  • AIKernel.Foundation (optional)

It does not include domain logic or kernel abstractions.
Instead, it offers standardized behaviors and reusable helpers that ensure consistency across all AIKernel modules.


Features / 主な機能

Functional Results

  • Result<T> for fail-closed computation
  • Option<T> for pure optional values
  • Either<L,R> for pure left/right branching
  • ResultStep<TState,TValue> for deterministic step identity, semantic deltas, and replay logs
  • PipelineStep for deterministic finite loops, timeout-style loops, suspend, and resume points
  • LINQ query syntax support through Select, SelectMany, Where, Bind, Map, and Tap

PipelineStep keeps agent-style user-land control flow finite and observable. Each loop iteration, suspend point, and resume point is represented as a ResultStepReplayLogEntry; Map remains a pure projection and does not add a replay node. Use PipelineStepMetadataKeys when reading loop, suspend, and resume metadata from external capability modules. For ResultStep, passing where predicates also remain projections; rejected or throwing predicates append deterministic reject / fail-closed replay nodes.

JSON Utilities

  • Unified JsonSerializerOptions
  • Helper methods for serialization/deserialization
  • JSON file load/save utilities

File & Path Utilities

  • Safe file read/write
  • Path normalization
  • Directory helpers

Logging Primitives

  • Lightweight logging helpers
  • Common log formatting utilities

Common Exceptions

  • Shared exception types
  • Error handling helpers

Shared Helpers

  • Try helpers for exception-to-result conversion
  • Cross-module reusable utilities

Design Philosophy / 設計思想

AIKernel.Common follows the Interface-Led Architecture (ILA) principles:

  • No domain logic
  • No kernel abstractions
  • No dependency on AIKernel.NET (abstractions)
  • Pure implementation-level utilities
  • Stable, reusable, cross-cutting components

This ensures that all AIKernel modules behave consistently while keeping the architecture clean and layered.


Repository Structure / リポジトリ構成

AIKernel.Common/ 
├─ Results/
│ ├─ Result.cs
│ ├─ Option.cs
│ ├─ Either.cs
│ ├─ ResultStep.cs
│ ├─ PipelineStep.cs
│ └─ ErrorContext.cs
├─ Json/ 
│ ├─ JsonOptions.cs 
│ ├─ JsonUtil.cs 
│ └─ JsonFile.cs 
├─ IO/ 
│ ├─ FileUtil.cs 
│ └─ PathUtil.cs 
├─ Logging/ 
│ └─ LogUtil.cs 
├─ Exceptions/ 
│ └─ CommonException.cs 
└─ README.md

Usage Examples / 使用例

JSON Serialization

var json = JsonUtil.ToJson(obj);
var obj2 = JsonUtil.FromJson<MyType>(json);

JSON File I/O

await JsonFile.SaveAsync("data.json", obj);
var loaded = await JsonFile.LoadAsync<MyType>("data.json");

Path Utilities

var full = PathUtil.Normalize("~/data/output.txt");

Deterministic Pipeline Control

var suspended = PipelineStep.Suspend<string, int>(
    "awaiting-approval",
    "Needs user approval.");

var resumed =
    from approval in PipelineStep.Resume(
        suspended.ReplayLog,
        "approved",
        1,
        "User approved.")
    from looped in PipelineStep.Loop(
        ResultStep<string, int>.Success("agent", approval),
        maxIterations: 2,
        static (iteration, value) => ResultStep<string, int>
            .Success($"agent:{iteration}", value + 1))
    select looped;

License / ライセンス

Apache License 2.0

Contributing / コントリビュート

Contributions are welcome. Please follow the AIKernel ecosystem’s coding style and architectural guidelines.

AIKernel 全体のアーキテクチャガイドラインに従ってください。

Maintainer / メンテナー

AIKernel Project Maintained by Takuya.S

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AIKernel.Common:

Package Downloads
AIKernel.Core

EN: Core runtime engine for AIKernel.NET. Provides the foundational execution logic for VFS, ROM, Context construction, and inference execution in a deterministic Knowledge OS. JA: AIKernel.NET の Core ランタイムエンジンです。決定論的な Knowledge OS における VFS、ROM、Context 構築、推論実行の基礎ロジックを提供します。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 0 6/8/2026
0.0.5 48 6/6/2026

AIKernel.Core package family v0.1.0 - First executable runtime baseline aligned with official AIKernel.NET contract packages v0.1.0. Core provides Result/Option/Either, ResultStep/ReplayLog semantics, DSL and ROM runtime adapters, Kernel orchestration, Provider integration, Core-owned MemoryRegion/MemoryMapper runtime adapters, and Kernel provider-routing facade helpers. GPU and Native ABI implementations remain external Capability packages.