AIKernel.Common
0.1.0
dotnet add package AIKernel.Common --version 0.1.0
NuGet\Install-Package AIKernel.Common -Version 0.1.0
<PackageReference Include="AIKernel.Common" Version="0.1.0" />
<PackageVersion Include="AIKernel.Common" Version="0.1.0" />
<PackageReference Include="AIKernel.Common" />
paket add AIKernel.Common --version 0.1.0
#r "nuget: AIKernel.Common, 0.1.0"
#:package AIKernel.Common@0.1.0
#addin nuget:?package=AIKernel.Common&version=0.1.0
#tool nuget:?package=AIKernel.Common&version=0.1.0
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 computationOption<T>for pure optional valuesEither<L,R>for pure left/right branchingResultStep<TState,TValue>for deterministic step identity, semantic deltas, and replay logsPipelineStepfor deterministic finite loops, timeout-style loops, suspend, and resume points- LINQ query syntax support through
Select,SelectMany,Where,Bind,Map, andTap
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 | Versions 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. |
-
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.
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.