Metadata-Version: 2.4
Name: aikernel-tools
Version: 0.1.2
Summary: Python wrapper for AIKernel.Tools v0.1.2 instrumentation contracts with bundled managed assemblies and pythonnet loading.
Author: Takuya Sogawa
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/AIKernel-NET/AIKernel.Tools
Project-URL: Repository, https://github.com/AIKernel-NET/AIKernel.Tools
Project-URL: Documentation, https://aikernel.net/reference/
Project-URL: Issues, https://github.com/AIKernel-NET/AIKernel.Tools/issues
Project-URL: Releases, https://github.com/AIKernel-NET/AIKernel.Tools/releases
Keywords: aikernel,tools,instrumentation,deterministic-debugging,capability,inspector,canonical-formatting,pythonnet
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: pythonnet>=3.0.3
Provides-Extra: test
Requires-Dist: pytest>=9.0; extra == "test"

# aikernel-tools

[日本語](README-ja.md)

Python wrapper for the public instrumentation surface of AIKernel.Tools.

The package bundles the AIKernel.Tools managed assemblies and loads them through
pythonnet. Python code receives a single API surface for replay facades,
inspection facades, canonical chat-history formatting, and public capability
contract descriptors without re-implementing the internal C# semantics.

The v0.1.2 package also exposes the generated managed API catalog through
`managed_api_catalog()`, `managed_api_summary()`, `managed_type_names()`, and
`find_managed_type(full_name)`.

See [Python Tools Wrapper](../docs/python/index.md) for package scope, managed
assembly bundle requirements, Linux CoreCLR loading, and validation guidance.

## Install

```bash
pip install aikernel-tools
```

## Usage

```python
from aikernel_tools import (
    CanonicalFormatter,
    ChatHistoryRecord,
    InfoCommand,
    MdExporter,
    NowCommand,
    RomExporter,
    RomStorageCapability,
)

capability = RomStorageCapability("tools.rom")
contract = capability.to_contract()

formatter = CanonicalFormatter()
rom = formatter.serialize([
    ChatHistoryRecord("user", "hello", "2026-06-09T00:00:00+00:00")
])

markdown = MdExporter.to_markdown([
    ChatHistoryRecord("assistant", "world", "2026-06-09T00:00:01+00:00")
])
history_rom = RomExporter.to_rom(
    [ChatHistoryRecord("assistant", "world", "2026-06-09T00:00:01+00:00")],
    namespace="python",
    name="history",
)
```

`ReplayEngine`, `Inspector`, and `CanonicalFormatter` can also delegate to an
explicit backend object that exposes the same method names. `MdExporter`,
`RomExporter`, `ChatHistoryScraper`, and the inspector command facades such as
`NowCommand` / `InfoCommand` mirror the public C# names so Python callers can
address the same contract surface. This keeps Python as a contract boundary
while the implementation stays in the configured tooling runtime.

The wheel bundles `AIKernel.Tools.Instrumentation.dll`,
`AIKernel.Tools.Capability.RomStorage.dll`, inspector assemblies, AIKernel.NET
contract assemblies, AIKernel.Core dependencies, and `ChatHistoryProvider.dll`.
