F FourIA GitHub ↗

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:

Purpose (v0.3.0)

Moltlazy provides two capabilities:

  1. 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 into openclaw.json as per-section $include directives (never a root $include, which would fail closed for Control UI saves). gateway.* and agents.* are written inline (onboard owns the gateway base; the gateway token is an env SecretRef). Replaces direct filesystem patching.

  2. SDK Module (sdk/) — Typed RPC client over the OpenClaw Admin HTTP RPC API. No filesystem writes — direct typed calls to a running gateway via POST /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 oxlint

Testing

608 tests across 33 test files.

bun test                    # all tests
bun test sdk/               # SDK tests only
bun test tests/config/      # Config Module tests only