Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.18.0
22.22.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ PEAC produces portable, verifiable evidence that can feed AI safety reviews, inc

## Quick start

**Requirements:** Node >= 20
**Requirements:** Node >= 22

```bash
pnpm add @peac/protocol
Expand Down
2 changes: 1 addition & 1 deletion docs/README_LONG.md
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ Test vectors: `tests/vectors/` and `docs/specs/TEST_VECTORS.md`.

**Prerequisites:**

- Node.js 20+
- Node.js 22+
- pnpm >= 8

**Setup:**
Expand Down
94 changes: 27 additions & 67 deletions examples/openclaw-capture/README.md
Original file line number Diff line number Diff line change
@@ -1,93 +1,53 @@
# OpenClaw Interaction Evidence
# OpenClaw Activity Records

Capture OpenClaw tool calls as signed PEAC interaction evidence receipts.

## Install

```bash
pnpm add @peac/adapter-openclaw @peac/capture-core
```
Capture OpenClaw tool calls as offline-verifiable activity records with durable file-based storage and real signing.

## Run

```bash
pnpm demo
# From monorepo root
pnpm -C examples/openclaw-capture demo
```

## What it does

1. Creates a capture session with in-memory storage
2. Captures three simulated OpenClaw tool call events (web_search, file_read, code_execute)
3. Verifies tamper-evident chain integrity (each entry links to the previous via digest)
4. Emits signed receipts via the background service
5. Prints receipt summaries with interaction IDs and JWS tokens
1. Generates a signing key (to a temp directory)
2. Activates the evidence export plugin with durable file-based storage
3. Captures 3 simulated tool call events (web_search, file_read, code_execute)
4. Exports an evidence bundle (manifest.json + signed receipts)
5. Verifies the bundle offline

## Requirements

- Node.js 20+
- Node.js 22+
- pnpm 8+

## Caveats

- The demo signer produces a structurally valid but **not cryptographically signed** JWS.
For real signing, use an Ed25519 key via `@peac/crypto` or a standard JOSE library.
- In-memory stores are inlined in the demo. In production, use a durable store
(filesystem, database, etc).

## Using this outside the PEAC monorepo

This example uses `workspace:*` dependencies for monorepo development.
To run it standalone:

```bash
mkdir openclaw-demo && cd openclaw-demo
npm init -y
pnpm add @peac/adapter-openclaw@0.10.9 @peac/capture-core@0.10.9
pnpm add -D @types/node tsx typescript
```

Then copy `demo.ts` and `tsconfig.json` into the directory and run `npx tsx demo.ts`.
- Run from the monorepo root (uses `workspace:*` dependencies)

## Expected output

```
OpenClaw Interaction Evidence Demo

1. Creating capture session...
Session ready.
1. Generating signing key...
kid: <key-id>

2. Capturing tool calls...
Captured: web_search -> digest a1b2c3d4...
Captured: file_read -> digest f7e8d9c0...
Captured: code_execute -> digest 1234abcd...
2. Activating plugin...
Plugin active.

3. Verifying chain integrity...
Chain OK: 3 entries, all linked
3. Capturing tool calls...
web_search: captured
file_read: captured
code_execute: captured

4. Emitting signed receipts...
Emitted 3 receipts
4. Flushing receipts...
Receipts signed and written.

5. Receipt summary:
- r_<digest>
interaction_id: openclaw/cnVuX2RlbW8/Y2FsbF8wMDE
jws: eyJhbGciOiJFZERTQSJ9...
5. Exporting evidence bundle...
Exported 3 receipts.

Done. All tool calls captured as verifiable interaction evidence.
```

## Two-stage pipeline
6. Verifying bundle...

verification successful -- 3 receipts in evidence bundle
```
Tool Call Spool Receipts
(sync hook) --> (append-only) --> (signed JWS)
< 10ms events.jsonl *.peac.json
```

- **Capture stage**: Maps OpenClaw events to CapturedAction, hashes payloads inline
- **Emit stage**: Drains spool, converts to InteractionEvidence, signs with Ed25519

## Next steps
## License

- See [docs/integrations/openclaw.md](../../docs/integrations/openclaw.md) for full configuration
- See [docs/specs/INTERACTION-EVIDENCE.md](../../docs/specs/INTERACTION-EVIDENCE.md) for the schema spec
- See [examples/quickstart/](../quickstart/) for basic receipt issuance and verification
Apache-2.0
Loading
Loading