@muonroi/agent-harness-opentui
v0.1.0
Published
OpenTUI adapter for the muonroi agent harness. Provides `<Semantic>`, `<SemanticProvider>`, the OpenTUI reconciler hook, and the `installOpenTUIHarness` entry point.
Readme
@muonroi/agent-harness-opentui
OpenTUI adapter for the muonroi agent harness. Provides <Semantic>, <SemanticProvider>, the OpenTUI reconciler hook, and the installOpenTUIHarness entry point.
Install
bun add @muonroi/agent-harness-opentui @muonroi/agent-harness-corePeer dependencies: @opentui/core, @opentui/react, react@>=18.
Minimal example
import { Semantic, SemanticProvider, installOpenTUIHarness } from "@muonroi/agent-harness-opentui";
import { createSemanticRegistry, createSidechannelTransport } from "@muonroi/agent-harness-core";
const registry = createSemanticRegistry();
const transport = createSidechannelTransport(); // fd 3/4 or named pipe
const uninstall = installOpenTUIHarness({ registry, transport, fps: 60 });
// In your OpenTUI app root:
<SemanticProvider registry={registry}>
<Semantic id="composer" role="textbox" name="Prompt">
<textbox />
</Semantic>
</SemanticProvider>Public API
| Export | Purpose |
|---|---|
| <Semantic id role …> | Wrap user-visible elements; zero layout cost when registry is absent |
| <SemanticProvider registry> | Provide a registry to all descendant <Semantic> nodes |
| installOpenTUIHarness({ registry, transport, fps?, onFrame? }) | One-call wire-up; returns uninstall handle |
| createReconcilerHook | Lower-level: OpenTUI addPostProcessFn hook |
| startAgentMode | --agent-mode runtime init |
References
Migration
The legacy in-repo shim at src/agent-harness/* is deprecated for external use.
See the [Unreleased] / BREAKING / harness block in CHANGELOG.md
for the full migration notes.
// Before (deprecated)
import { Semantic, startAgentMode } from "muonroi-cli/src/agent-harness";
// After
import { Semantic, startAgentMode } from "@muonroi/agent-harness-opentui";License
Internal — Muonroi.
