Clawdentity is a mixed TypeScript + Rust monorepo that provides cryptographic identity and trusted relay infrastructure for agent-to-agent communication. The deployable surface is in apps/ (registry, proxy, CLI packaging, OpenClaw skill), shared contracts/runtime libraries are in packages/, and Rust runtime + CLI implementation is in crates/. Design and delivery must assume operators may run Clawdentity in local or constrained/offline environments, with OpenClaw integration as a first-class workflow.
Run from repository root:
pnpm installpnpm buildpnpm test
- Keep all DID construction/parsing inside
packages/protocol/src/did.tsso the switch todid:cdistays centralized and tests update automatically. - Trust slices (AIT, CRL, registry ownership, proxy pairings, connectors) should call shared helpers (e.g.,
parseDid,validateAgentDid) instead of copying brittle string-prefix checks; this keeps role expectations tied to context when DID semantics depend on parsed entity and authority fields. - When new DID authorities appear (registry-owned vs self-hosted), track their identifiers in configuration and rely on parsed
authoritymetadata for routing/trust checks rather than scattering hardcoded strings.
- GitHub issues are the source of truth for sequencing, blockers, and rollout updates.
- Primary execution tracker: #74.
- Do not use local execution-order files as governance source.
Common quality checks:
pnpm lintpnpm -r typecheckpnpm check:file-size
Run from crates/:
cargo checkcargo clippy --all-targetscargo testcargo build
apps/registry- Cloudflare Worker HTTP API for humans, agents, invites, API keys, and revocation data.apps/proxy- Cloudflare Worker relay/proxy that verifies Clawdentity auth headers and enforces trust policy.apps/cli- TypeScript CLI compatibility package (clawdentity); Rust CLI is the canonical operator surface.apps/openclaw-skill- OpenClaw skill package and relay transform artifacts used by CLI install flow.
packages/protocol- Canonical protocol models and signing/verification wire-contract definitions.packages/common- Shared utility layer (errors, helpers, validation glue, shared types).packages/connector- TypeScript connector client/runtime primitives for relay connectivity.packages/sdk- Developer SDK for identity operations, verification, auth flows, and integration helpers.
crates/clawdentity-core- Core Rust library for identity, registry clients, connector/runtime, providers, pairing, and persistence.crates/clawdentity-cli- Rust CLI binary and command surface for current operator workflows.
crates/tests/local/mock-registry- Local mock registry used for integration and harness-style flows.crates/tests/local/mock-proxy- Local mock relay/proxy used for integration and connector testing.
- Build/package:
pnpm -F clawdentity build - Treat command docs here as compatibility guidance, not canonical runtime surface.
- Help:
cargo run -p clawdentity-cli -- --help - Common ops:
cargo run -p clawdentity-cli -- init,register,whoami,agent create <name>,agent auth revoke <name>,provider setup --for <platform> --agent-name <name>,provider doctor --for <platform>,connector start <agent>
Use docs/ as system of record:
docs/ARCHITECTURE.md- end-to-end architecture across apps, packages, crates, and trust flows.docs/MONOREPO.md- workspace structure, dependency/build ordering, and cross-ecosystem testing strategy.docs/DESIGN_DECISIONS.md- architectural choices and tradeoffs.docs/GOLDEN_PRINCIPLES.md- non-negotiable quality constraints.docs/HARNESS_ACTION_PLAN.md- staged execution and quality-enforcement plan.
- Follow
docs/GOLDEN_PRINCIPLES.mdfor code and documentation changes. - Keep modules small, testable, and dependency direction explicit.
- Favor actionable errors and stable machine-readable outputs.
- Run relevant TypeScript and Rust checks before commit (
pnpm buildandcargo checkare baseline gates). - Keep docs synchronized with implementation changes, especially when changing CLI flows or skill behavior.
- Keep user onboarding docs prompt-first (
/skill.mdcanonical); treat command-by-command and Rust toolchain flows as advanced fallback guidance only.
- Keep Rust release automation in
.github/workflows/publish-rust.ymlas the single canonical path for version bump + crates.io publish + tag creation + binary release. - Rust crate publish flow must derive the next version from crates metadata via
cargo info, avoid direct crates.io API endpoint calls, verify the newrust/vX.Y.Ztag does not yet exist, and keepclawdentity-core/clawdentity-cliversions aligned. - Rust crate publish order is strict: publish
clawdentity-corebeforeclawdentity-cli. - Rust binary builds must use the same
rust/vX.Y.Ztag created by the crate publish flow. - Rust binary releases must publish cross-platform assets for Windows x64, Linux x64/aarch64, and macOS x64/aarch64.
- Keep release asset names stable:
clawdentity-<version>-linux-x86_64.tar.gzclawdentity-<version>-linux-aarch64.tar.gzclawdentity-<version>-macos-x86_64.tar.gzclawdentity-<version>-macos-aarch64.tar.gzclawdentity-<version>-windows-x86_64.zipclawdentity-<version>-windows-aarch64.zipclawdentity-<version>-checksums.txt
- Binary naming contract for release artifacts:
- Unix binary is
clawdentity - Windows binary is
clawdentity.exe
- Unix binary is
irm/PowerShell is a download/install path only; do not treat it as a runtime binary format.- Every release run must publish SHA256 checksums for all archives.