npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dcp-ai/openclaw

v2.0.0

Published

DCP integration plugin for OpenClaw — digital citizenship, intent declaration, and audit trail for AI agents

Downloads

132

Readme

@dcp-ai/openclaw — DCP Integration for OpenClaw

OpenClaw plugin that adds Digital Citizenship Protocol (DCP) governance to AI agents. Every action the agent takes is declared, risk-scored, and recorded in a cryptographically chained audit trail bound to a human owner.

Supported DCP Specifications

DCP-01 through DCP-09.

Features

  • Identity (DCP-01) — Ed25519 keypair generation, Responsible Principal Record, Agent Passport
  • Intent Declaration (DCP-02) — Risk scoring and policy gating before sensitive actions
  • Audit Trail (DCP-03) — Hash-chained, immutable action log with evidence references
  • Lifecycle (DCP-05) — Commission, vitality reporting, decommission agents
  • Succession (DCP-06) — Digital testament with successor preferences and memory classification
  • Delegation (DCP-09) — Create delegation mandates for human→agent authority transfer
  • Bundle Verification — Full schema + signature + hash verification of Signed Bundles
  • Bundle Signing — Build and sign a complete CitizenshipBundle at session end
  • SKILL.md — Companion skill that teaches the agent how to use DCP tools

Installation

# In your OpenClaw plugins directory
npm install @dcp-ai/openclaw

Add to your OpenClaw config:

plugins:
  - "@dcp-ai/openclaw"

Tools Registered

| Tool | Description | DCP Spec | |------|-------------|----------| | dcp_identity_setup | Generate keypair + RPR + AgentPassport | DCP-01 | | dcp_declare_intent | Declare intent, get policy decision (approve/escalate/block) | DCP-02 | | dcp_verify_bundle | Verify a Signed Bundle (schema + signature + hashes) | VERIFICATION | | dcp_log_action | Record action as AuditEntry with hash-chaining | DCP-03 | | dcp_get_audit_trail | Retrieve session audit trail | DCP-03 | | dcp_commission_agent | Commission an agent (lifecycle → commissioned) | DCP-05 | | dcp_report_vitality | Report vitality metrics, get computed score | DCP-05 | | dcp_decommission_agent | Decommission an agent (graceful/immediate/emergency) | DCP-05 | | dcp_create_testament | Create digital testament with successor preferences | DCP-06 | | dcp_create_mandate | Create human→agent delegation mandate | DCP-09 | | dcp_sign_bundle | Build + sign CitizenshipBundle from session state | BUNDLE |

Usage Flow

┌─────────────────────────────────────────────────────┐
│                  Session Start                       │
│  dcp_identity_setup(owner, jurisdiction, caps)       │
└──────────────────────┬──────────────────────────────┘
                       │
          ┌────────────▼─────────────┐
          │   For each sensitive      │
          │   action:                 │
          │                           │
          │  1. dcp_declare_intent()  │
          │     → approve/escalate/   │
          │       block               │
          │                           │
          │  2. [perform action]      │
          │                           │
          │  3. dcp_log_action()      │
          └────────────┬─────────────┘
                       │ (repeat)
          ┌────────────▼─────────────┐
          │     Session End           │
          │  dcp_sign_bundle()        │
          │  → SignedBundle           │
          └───────────────────────────┘

Architecture

integrations/openclaw/
├── package.json               # Dependencies: @dcp-ai/sdk, @sinclair/typebox
├── tsconfig.json
├── SKILL.md                   # Companion skill with agent instructions
├── README.md                  # This file
└── src/
    ├── index.ts               # Plugin entry — registerTool() calls
    ├── tools/
    │   ├── identity.ts        # dcp_identity_setup
    │   ├── intent.ts          # dcp_declare_intent
    │   ├── verify.ts          # dcp_verify_bundle
    │   ├── audit.ts           # dcp_log_action + dcp_get_audit_trail
    │   ├── lifecycle.ts       # dcp_commission_agent + dcp_report_vitality + dcp_decommission_agent
    │   ├── succession.ts      # dcp_create_testament
    │   └── delegation.ts      # dcp_create_mandate
    └── state/
        └── agent-state.ts     # Per-session DCP state management

Concept Mapping: OpenClaw → DCP

| OpenClaw Concept | DCP Equivalent | |---|---| | Owner (human) | ResponsiblePrincipalRecord | | Agent session | AgentPassport (capabilities mapped from allowed tools) | | Tool call | Intent (action_type derived from tool name) | | Tool allowlist/denylist | PolicyDecision | | DM pairing | HumanConfirmation | | Agent actions | AuditEntry with hash-chaining |

OpenClaw Tool → DCP Action Type Mapping

| OpenClaw Tool | DCP action_type | DCP channel | |---|---|---| | browser.* | browse | web | | exec, bash | execute_code | runtime | | web.fetch, web.search | api_call | api | | write, edit, apply_patch | write_file | filesystem | | sessions_send | api_call | api | | cron, webhook | api_call | api |

Risk Scoring

The intent declaration tool computes a risk score based on:

  • Action type — payments and code execution score higher than browsing
  • Estimated impact — low / medium / high
  • Data classes — PII, credentials, financial data increase the score

Policy decisions:

  • approve (risk < 0.5) — proceed normally
  • escalate (0.5 ≤ risk < 0.8) — ask human for confirmation
  • block (risk ≥ 0.8) — action denied, requires explicit override

Programmatic Usage

The tools can also be used directly without the OpenClaw plugin system:

import {
  executeIdentitySetup,
  executeDeclareIntent,
  executeLogAction,
  executeGetAuditTrail,
} from '@dcp-ai/openclaw';

// Set up identity
const identity = await executeIdentitySetup({
  session_id: 'my-session',
  owner_name: 'Alice',
  jurisdiction: 'US',
});

// Declare intent
const intent = await executeDeclareIntent({
  session_id: 'my-session',
  action_type: 'api_call',
  target_channel: 'api',
  estimated_impact: 'low',
});

// Log action
await executeLogAction({
  session_id: 'my-session',
  intent_id: intent.intent_id,
  outcome: 'API call succeeded',
  evidence_tool: 'web.fetch',
});

// Get audit trail
const trail = await executeGetAuditTrail({ session_id: 'my-session' });
console.log(trail.entries);

Dependencies

  • @dcp-ai/sdk — DCP TypeScript SDK (types, crypto, builder, signer, verifier)
  • @sinclair/typebox — JSON Schema type builder (used by OpenClaw for tool parameters)

License

Apache-2.0