Skip to main content

Module openclaw

Module openclaw 

Source
Expand description

The OpenClaw codec (openclaw.mjs): an OpenClaw state directory ⇄ the world. agents.* become profiles — the default agent IS the default profile, every other agent keeps its id — each rooted at its own agents/<id>/. Channels, bindings and hooks are install-wide and land on default; jobs, fires and obligations land on the profile their agent id or session key names. openclaw.json is JSON5 (comments and trailing commas survive the read; a re-emit is JSON, which OpenClaw’s parser loads); state/openclaw.sqlite is the pinned v2026.7.1-2 schema, its rows written back column for column when their record is unchanged.

Structs§

OpenclawLoaded
A loaded OpenClaw state directory.
OpenclawProfileIo
Per-profile bookkeeping.
OpenclawReport
What an OpenClaw decompile did.
OpenclawRootIo
Root bookkeeping for an OpenClaw state dir.
ParsedKey
What an OpenClaw session key mapped to, in the world’s binding form.

Constants§

CRON_JOB_COLUMNS
cron_jobs columns in order.
CRON_RUN_LOG_COLUMNS
cron_run_logs columns in order.
DELIVERY_QUEUE_COLUMNS
delivery_queue_entries columns in order.
NON_SECRET_KEYS
Credential-SHAPED names OpenClaw uses for things that are not secrets.
OPENCLAW_ACCOUNT_KEYS
Keys an inline account id may sit under.
OPENCLAW_CONFIG
The config file.
OPENCLAW_DDL
The pinned v2026.7.1-2 schema, transcribed column for column.
OPENCLAW_STATE_DB
The shared state store.
SCHEMA_META_COLUMNS
schema_meta columns in order.

Functions§

account_entries
channels.<name>.accounts as [accountId, entry], sorted by id.
agent_entries
The declared agents as [id, entry] in declaration order.
agents_form
list | entries | none.
credential_ref_name
The .env name for a credential: OPENCLAW_<scope>_<key>.
decode_fire
cron_run_logs row → Fire.
decode_job
cron_jobs row → Job (openclaw.mjs::decodeJob).
decode_obligation
delivery_queue_entries row → Obligation.
default_agent_id
The default agent: the entry flagged default: true, else the first declared, else main.
encode_fire_row
A fire as a cron_run_logs row, over the original when one exists.
encode_job_row
A job as a cron_jobs row, over the original row when one exists.
encode_obligation_row
An obligation as a delivery_queue_entries row, over the original when one exists.
from_openclaw
Compile an OpenClaw state directory into the world.
inline_secrets
Inverse of redact_secrets: {dotenv|env: NAME} refs and ${dotenv:NAME} placeholders become their values.
is_credential_key
OpenClaw’s own credential rule: the lower-cased key ENDS WITH a marker; only the name decides.
iso_millis
Unix ms → RFC 3339 with millis (sidecar::ms_to_rfc3339).
iso_seconds
Unix ms → RFC 3339 at SECOND precision (jobs.rs::iso_from_ms).
ms_from_iso
RFC 3339 (YYYY-MM-DDTHH:MM:SS[.fff][Z|±HH:MM]) → Unix ms; None for anything else.
parse_json5
Parse a JSON5 file’s text.
parse_openclaw_session_key
An OpenClaw gateway session key → the world’s surface key plus what the mapping had to translate (openclaw.mjs::parseOpenclawSessionKey). This is the WORLD’s form; the spine’s discovery nouns keep the key’s own shape through Binding::from_openclaw_key.
redact_secrets
Deep copy with every string under a credential-shaped key replaced by a {dotenv} ref, the value handed to the vault.
strip_json5
Reduce JSON5 to JSON: // and /* */ comments outside strings, trailing commas before } / ] (profiles.rs::strip_json5, which the Node codec transcribed; this is the same rule in the crate that owns the codec).
to_openclaw
Write an OpenClaw state directory from the world.