pynydus.agents.zeroclaw.hatcher

ZeroClaw hatcher connector. Spec §11.6.

Produces a valid ZeroClaw project directory from an Egg:

  • persona.md <- persona memory (minus identity records)

  • identity.md <- persona memory originating from IDENTITY.md / identity.json

  • agents.md <- flow memory

  • user.md <- context memory (minus tools records)

  • tools.md <- context memory originating from TOOLS.md

  • knowledge.md <- undated state memory

  • memory/YYYY-MM-DD.md <- dated state memory (one file per day)

  • tools/ <- skill records as Python tool files

  • config.toml <- credential placeholders + round-tripped manifest fields

  • .zeroclaw/ <- marker directory for project detection

  • mcp.json <- MCP servers (Claude Desktop mcpServers format)

All 4 MemoryLabel values have explicit file mappings. Records are fanned back to separate files using source_store metadata, matching the structure the spawner reads on ingest.

Module Contents

Classes

ZeroClawHatcher

Produce a valid ZeroClaw project directory from an Egg.

Functions

_is_identity_source

True if this persona record originated from IDENTITY.md or identity.json.

_is_tools_source

True if this context record originated from TOOLS.md.

_toml_escape

_build_config_toml

Build a TOML config string from credentials and neutral manifest fields.

API

pynydus.agents.zeroclaw.hatcher._is_identity_source(rec: pynydus.api.schemas.MemoryRecord) bool

True if this persona record originated from IDENTITY.md or identity.json.

pynydus.agents.zeroclaw.hatcher._is_tools_source(rec: pynydus.api.schemas.MemoryRecord) bool

True if this context record originated from TOOLS.md.

pynydus.agents.zeroclaw.hatcher._toml_escape(value: str) str
pynydus.agents.zeroclaw.hatcher._build_config_toml(credentials: list[tuple[str, str]], *, agent_name: str | None = None, agent_description: str | None = None, llm_model: str | None = None, agent_version: str | None = None) str

Build a TOML config string from credentials and neutral manifest fields.

Args: credentials: List of (name, placeholder) pairs for each credential. agent_name: Optional agent display name from manifest. agent_description: Optional description from manifest. llm_model: Optional model id from manifest. agent_version: Optional version string (e.g. from spawn metadata).

Returns: TOML-formatted string, or empty string if nothing to write.

class pynydus.agents.zeroclaw.hatcher.ZeroClawHatcher

Bases: pynydus.api.protocols.Hatcher

Produce a valid ZeroClaw project directory from an Egg.

render(egg: pynydus.api.schemas.Egg, output_dir: pathlib.Path) pynydus.api.raw_types.RenderResult

Render Egg records into ZeroClaw project files.

Placeholders ({{SECRET_NNN}}, {{PII_NNN}}) are preserved. the pipeline substitutes real values after this step.

Args: egg: The Egg to render. output_dir: Target directory (unused, pipeline performs disk I/O).

Returns: File dict and any warnings produced during rendering.

hatch(egg: pynydus.api.schemas.Egg, output_dir: pathlib.Path) pynydus.api.schemas.HatchResult

Generate ZeroClaw project files from an Egg.

.. deprecated:: Use :meth:render instead. The pipeline now handles disk I/O.

Args: egg: The Egg to hatch. output_dir: Directory where output files are written.

Returns: Result with list of created files and any warnings.