AIKernel.Common
0.1.2
dotnet add package AIKernel.Common --version 0.1.2
NuGet\Install-Package AIKernel.Common -Version 0.1.2
<PackageReference Include="AIKernel.Common" Version="0.1.2" />
<PackageVersion Include="AIKernel.Common" Version="0.1.2" />
<PackageReference Include="AIKernel.Common" />
paket add AIKernel.Common --version 0.1.2
#r "nuget: AIKernel.Common, 0.1.2"
#:package AIKernel.Common@0.1.2
#addin nuget:?package=AIKernel.Common&version=0.1.2
#tool nuget:?package=AIKernel.Common&version=0.1.2
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 全体のアーキテクチャガイドラインに従ってください。
Common owns the monadic primitives used by the rest of the ecosystem, so changes here must preserve LINQ composition, fail-closed semantics, deterministic identity metadata, and bilingual public documentation comments.
Common は ecosystem 全体で利用される monadic primitive を所有します。そのため、 ここでの変更は LINQ composition、fail-closed semantics、deterministic identity metadata、public API の bilingual documentation comment を維持してください。
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 (15)
Showing the top 5 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 構築、推論実行の基礎ロジックを提供します。 |
|
|
AIKernel.Providers.MicrosoftAI
EN: Microsoft.Extensions.AI based provider implementation for AIKernel.NET. Enables OpenAI-compatible model execution while preserving AIKernel's capability-based provider model. JA: Microsoft.Extensions.AI を利用した AIKernel.NET 向け Provider 実装です。AIKernel の Capability ベース Provider モデルを維持しながら、OpenAI 互換モデル実行を可能にします。 |
|
|
AIKernel.Control.Core
Control-plane runtime entry package for AIKernel.Control. Provides Bonsai provider contracts, model config/tokenizer/model-state wrappers, provider capabilities, and the public governance execution boundary built on AIKernel.NET contracts. |
|
|
AIKernel.Providers.ChatOpenAI
EN: Official AIKernel.NET extension provider for OpenAI-compatible ChatCompletion, Embedding, and Moderation endpoints. JA: OpenAI 互換 ChatCompletion、Embedding、Moderation endpoint 向けの AIKernel.NET 公式拡張 Provider です。 |
|
|
AIKernel.Wasm.Runtime
EN: AIKernel WASM runtime service package for browser/WebAssembly process, memory, stdin, file system, event, audio, screenshot, save-state, and time providers. JA: browser / WebAssembly の process、memory、stdin、file system、event、audio、screenshot、save-state、time Provider を提供する AIKernel WASM runtime service package です。 |
GitHub repositories
This package is not used by any popular GitHub repositories.
AIKernel.Core package family v0.1.2 - Release build aligned with official AIKernel.NET contract packages v0.1.2, synchronized Python wrapper package aikernel-net v0.1.2, and local development package outputs using 0.1.2-dev{build-number}.