@soulid/adapter-openclaw
v0.1.0
Published
SOUL ID runtime adapter for OpenClaw — read/write Soul Documents from SOUL.md, IDENTITY.md, MEMORY.md
Maintainers
Readme
@soulid/adapter-openclaw
SOUL ID runtime adapter for OpenClaw — reads an OpenClaw workspace and produces a portable Soul Document.
Install
npm install @soulid/adapter-openclawFile mapping (SOUL ID v0.3 spec)
| OpenClaw file | → Soul Document field |
|---|---|
| IDENTITY.md | soul_id, name, archetype |
| SOUL.md | purpose, values |
| AGENTS.md + SOUL.md | capabilities (inferred from keywords) |
| MEMORY.md | lineage.source, memory.index_file |
| (always) | runtime_hints (openclaw preset) |
Usage
import { fromWorkspace, toWorkspace } from '@soulid/adapter-openclaw'
// Read workspace → Soul Document
const doc = fromWorkspace({
workspacePath: '/path/to/workspace',
namespace: 'soulid',
overrides: {
soul_id: 'soulid:rasputina:v1:001',
values: ['honesty', 'resourcefulness', 'privacy'],
}
})
console.log(doc.soul_id) // soulid:rasputina:v1:001
console.log(doc.name) // from IDENTITY.md
console.log(doc.purpose) // from SOUL.md
console.log(doc.capabilities) // inferred from file keywords
// Write soul_id back to IDENTITY.md
toWorkspace(doc, { workspacePath: '/path/to/workspace' })API
fromWorkspace(opts?)
Parses an OpenClaw workspace into a partial SoulDocument.
fromWorkspace({
workspacePath?: string, // defaults to process.cwd()
namespace?: string, // soul_id namespace, default 'soulid'
overrides?: Partial<SoulDocument> // fields to override/add
}): Partial<SoulDocument>toWorkspace(doc, opts?)
Writes name, archetype, soul_id, purpose back into IDENTITY.md.
toWorkspace(doc: Partial<SoulDocument>, opts?: { workspacePath?: string }): voidreadWorkspace(opts?)
Returns the raw markdown strings from the workspace files.
readWorkspace({ workspacePath?: string }): {
soulMd?: string
identityMd?: string
memoryMd?: string
agentsMd?: string
}Spec
This adapter implements the RFC-SOULID-0003 Runtime Adapter interface.
Required adapter fields declared:
runtime: "openclaw"soul_file: "SOUL.md"identity_file: "IDENTITY.md"memory_index: "MEMORY.md"memory_strategy: "pointer-index"capabilities_source: "plugins.entries"lifecycle_hooks: { on_session_start, on_session_end }
License
MIT — soulid.io
