* feat(protocol): add session companion schemas * feat(gateway): add session companion service * feat(gateway): expose session companion rpc * fix(gateway): harden companion runtime limits * test(gateway): fix companion type assertions * test(gateway): align companion test target * feat(ui): replace observer HUD and side chat with session rail * docs: session rail companion for control ui * test(ui): align session rail client mock * fix(ui): drop stale chat search import * fix: satisfy session companion lint contracts * refactor(gateway): isolate companion state contract * fix(ui): keep session rail reachable while idle * fix(agents): clamp derived openai prompt cache keys at boundary * fix(ai): clamp chatgpt responses session_id affinity header * fix(ci): align session companion branch gates * fix(ui): require run id for sessionless terminal chat events * fix(agents): scope internal run events to transcript * chore: revert changelog edit (release generation owns changelog)
@openclaw/ai
Reusable model API contracts, provider adapters, and streaming primitives from OpenClaw. The package supports isolated runtime instances; importing it does not register providers globally.
import { createLlmRuntime } from "@openclaw/ai";
import { registerBuiltInApiProviders } from "@openclaw/ai/providers";
const runtime = createLlmRuntime();
registerBuiltInApiProviders(runtime.registry);
Provider-neutral contracts, validation, diagnostics, and event streams are
available from the package root and focused subpaths such as
@openclaw/ai/event-stream, @openclaw/ai/transports, and
@openclaw/ai/validation. No second OpenClaw runtime package is required.
Provider ids, credentials, model catalogs, retries, and failover remain
application concerns. OpenClaw supplies those policies around this package.
Host policy (request fetch guarding, secret redaction, strict-tool defaults,
provider plugin hooks, and diagnostics logging) can be injected with
configureAiTransportHost; the defaults are inert.
The explicit @openclaw/ai/internal/anthropic, openai, retry-after,
runtime, and shared subpaths exist for the OpenClaw application itself.
They carry no semver guarantee and can change or disappear in any release; do
not depend on them outside OpenClaw.