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§
- Openclaw
Loaded - A loaded OpenClaw state directory.
- Openclaw
Profile Io - Per-profile bookkeeping.
- Openclaw
Report - What an OpenClaw decompile did.
- Openclaw
Root Io - Root bookkeeping for an OpenClaw state dir.
- Parsed
Key - What an OpenClaw session key mapped to, in the world’s binding form.
Constants§
- CRON_
JOB_ COLUMNS cron_jobscolumns in order.- CRON_
RUN_ LOG_ COLUMNS cron_run_logscolumns in order.- DELIVERY_
QUEUE_ COLUMNS delivery_queue_entriescolumns 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_metacolumns in order.
Functions§
- account_
entries channels.<name>.accountsas[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
.envname for a credential:OPENCLAW_<scope>_<key>. - decode_
fire cron_run_logsrow → Fire.- decode_
job cron_jobsrow → Job (openclaw.mjs::decodeJob).- decode_
obligation delivery_queue_entriesrow → Obligation.- default_
agent_ id - The default agent: the entry flagged
default: true, else the first declared, elsemain. - encode_
fire_ row - A fire as a
cron_run_logsrow, over the original when one exists. - encode_
job_ row - A job as a
cron_jobsrow, over the original row when one exists. - encode_
obligation_ row - An obligation as a
delivery_queue_entriesrow, 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;Nonefor 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 throughBinding::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.