Moltlazy
OpenClaw config patcher (Config Module) and typed RPC client (SDK Module).
Admin HTTP RPC SDK and declarative configuration for OpenClaw container startup.
This module is owned by the Paso4 developers and is an external addition to the base Cloudflare Worker project.
Documentation
Full documentation is available in the docs/ directory:
- Overview — What is moltlazy and why it exists
- Quickstart — Get running in 5 minutes
- Concepts — Config Module and typed RPC client architecture
- SDK Domain Modules — config, agents, channels, devices, cron, models, gateway
- Startup Flow — How both systems work together at startup
- Feature Flags Reference — JSON feature flags format
- Migration Guide (v0.2 → v0.3) — Migrate from filesystem patching
Purpose (v0.3.0)
Moltlazy provides two capabilities:
-
Config Module (
src/config/+index.ts+cli.ts) — Generates immutable per-section include files (moltlazy-session.json,moltlazy-tools.json,moltlazy-logging.json) at container startup and injects them intoopenclaw.jsonas per-section$includedirectives (never a root$include, which would fail closed for Control UI saves).gateway.*andagents.*are written inline (onboard owns the gateway base; the gateway token is an env SecretRef). Replaces direct filesystem patching. -
SDK Module (
sdk/) — Typed RPC client over the OpenClaw Admin HTTP RPC API. No filesystem writes — direct typed calls to a running gateway viaPOST /api/v1/admin/rpc.
import { createClient } from 'moltlazy/sdk';
const client = createClient({
baseUrl: 'http://localhost:18789',
token: process.env.OPENCLAW_GATEWAY_TOKEN!,
});
const agents = await client.agents.list();
await client.config.set({ raw: JSON.stringify({ session: { dmScope: 'per-channel-peer' } }) });
await client.gateway.restart();Development
Requires Bun.
bun install # install deps
bun run build # compile TypeScript → dist/
bun test # run unit tests (vitest)
bun run typecheck # type-check without emitting
bun run lint # lint with oxlintTesting
608 tests across 33 test files.
bun test # all tests
bun test sdk/ # SDK tests only
bun test tests/config/ # Config Module tests only