Releases: peerclaw/peerclaw-agent
v0.7.2
Changes
- docs: add ZeroClaw plugin to multi-platform support section
- docs: add missing API methods (
NewSimple,Keypair,TrustStore,Router,SetNotificationHandler,Sessions) - docs: add missing Options fields (
ClaimToken,HealthCheck,PlatformAdapters,InboxRelays,ConnectionGate)
Go Module
go get github.com/peerclaw/peerclaw-agent@v0.7.2v0.7.1
v0.7.0
What's New
- Encrypted trust store — XChaCha20-Poly1305 encryption with HKDF-SHA256 key derivation, transparent migration from plaintext
- Forward secrecy session rekeying — ephemeral X25519 keypairs with automatic rekey on message count / TTL thresholds
Security Fixes
- Zero derived key material after
SetEncryptionKey(crypto hygiene) - Handle
json.Marshalerrors in rekey initiation/response and contact request - Disconnect on session key failure, validate nonce length, track goroutines
- Handle errors from
identity.Sign()andidentity.SignEnvelope()
CI
- Add 70% coverage threshold gate
v0.6.0 — Agent Auto-Recovery
What's New
Auto Re-Register on Heartbeat 404
When the server restarts and loses agent records, the SDK now automatically detects 404 from heartbeat and re-registers — zero manual intervention required.
Server Re-Register Notification
The SDK listens for re_register notifications broadcast by the server on startup, triggering immediate re-registration for all connected agents.
HealthCheck Callback
New HealthCheck option enables dynamic heartbeat status reporting. The callback runs before each heartbeat with a 5-second timeout, returning the actual agent health status (online, degraded, offline). Platform adapters implementing platform.HealthChecker are checked automatically.
Periodic Heartbeat Loop
Start() now automatically sends heartbeats on a configurable interval (default 3 minutes), keeping agents online without manual heartbeat management.
Structured Registry Errors
New RegistryError type and IsNotFound() helper enable programmatic error handling for registry API responses.
Commits
361c617feat: add auto re-register on heartbeat 404 and server re_register notificationcdc5db5feat: add HealthCheck callback for dynamic heartbeat statuse560747feat: add periodic heartbeat loop to keep agents online
v0.5.0
What's New
Version Upgrade Mechanism
Adds formal compatibility checking and upgrade notification between the agent SDK and platform adapters.
Protocol Version Gate (breaking)
Adapterinterface now requiresProtocolVersion() int— existing adapter implementations must add this method- SDK validates the adapter's protocol version at startup; incompatible adapters are rejected before
Connect() - Constants
MinSupportedProtocol/MaxSupportedProtocoldefine the supported range (currently both1)
Heartbeat Version Advisory
HeartbeatResponsenow includes an optionalVersionAdvisoryfield- After registration, the agent sends a background heartbeat; if the server reports a newer SDK, a warning is logged once
- Old agents ignore the new field (backward compatible)
Optional Versioned Interface
- Adapters may implement
PluginVersion()andSDKCompatRange()for soft plugin↔SDK compat checks - OpenClaw adapter implements this; others can adopt incrementally
- SDK logs a warning if it falls outside the adapter's declared range
Registration Metadata
ClaimRegister()now auto-injectssdk_version(was already done forRegister())- Both registration paths inject
platform_nameandplatform_protocolwhen a platform adapter is configured
Startup Log
- On successful adapter connect, a structured log line shows platform name, protocol version, SDK version, and plugin version (if available)
Breaking Changes
platform.Adapterinterface gainsProtocolVersion() int— all implementations must add this one-liner
Compatibility
| Scenario | Result |
|---|---|
| Old agent + new server | version_advisory in heartbeat → old agent ignores it |
| New agent + old server | version_advisory absent → decoded as nil |
| Old adapter + new SDK | Missing ProtocolVersion() → compile error (trivial fix) |
| Non-Go plugins (TS/Rust/Python) | Not affected — they use the bridge protocol |
v0.4.0
What's New
- Contact sync — Agent syncs server contacts to local TrustStore on startup (additive, non-fatal)
- Bidirectional contact push —
AddContact()/RemoveContact()propagate changes to server (best-effort) - Agent-to-agent contact requests —
SendContactRequest()via server REST API with P2P Envelope fallback; whitelist bypass for incoming requests - Signaling error handling — Agent processes
signaling_errormessages from server (e.g., "not in contacts" rejection), fails pending connections with clear error - RegistryClient auth — Ed25519 signature authentication for contacts and contact-request endpoints
Cleanup
- Removed unused
NostrSignaling+CompositeSignaling(875 lines) — tracked in CANDIDATE_FEATURES.md - Removed unused
DomainVerifier+RecoveryManager(148 lines) — tracked in CANDIDATE_FEATURES.md - Removed DHT reference from Discovery interface comment
Dependencies
- Bumped
peerclaw-coreto v0.6.0
v0.3.0
What's New
P2P File Transfer with E2E Encryption
Pure peer-to-peer large file transfer over WebRTC DataChannels — zero server dependency in the data path.
- Binary frame protocol —
[seq|length|flags|encrypted_chunk]with 64KB default chunk size - Mutual authentication — 3-step Ed25519 challenge-response handshake before any data flows
- Per-chunk encryption — XChaCha20-Poly1305 with AAD =
file_id|seqpreventing reorder attacks - Pipeline push + backpressure — Near line-speed transfer (1MB high-water, 256KB low-water)
- Resume support — Persisted last-confirmed sequence, reconnect picks up where it left off
- Nostr fallback — When WebRTC NAT traversal fails, chunks sent as encrypted Nostr events
- Mailbox wakeup — Immediate inbox sync on file offer instead of waiting for poll interval
New Public API
fileID, err := agent.SendFile(ctx, peerID, "/path/to/file")
transfers := agent.ListTransfers()
info, ok := agent.GetTransfer(fileID)
agent.CancelTransfer(fileID)New Options
FileTransferDir— Directory for received filesResumeStatePath— Path to persist resume state
Transport Enhancements
CreateDataChannel()andRegisterDataChannelHandler()on WebRTC transport- Backpressure control in
Send() TriggerSync()on mailbox transport for wakeup signals
Other Changes
- License changed from MIT to Apache 2.0
- peerclaw-core bumped to v0.5.0
v0.2.0: Security Audit + Encrypt-Then-Sign
Highlights
- Encrypt-then-sign (H-07): Messages are now encrypted before signing, enabling pre-authentication — receivers can verify sender identity without decrypting, preventing decryption-oracle attacks
- WebSocket migration (M-40): Migrated from
nhooyr.io/websockettogithub.com/coder/websocket - Comprehensive security audit (R2-R6): Fixed 30+ findings including mandatory signature verification, DTLS fingerprint pinning, trust/reputation hardening, dead code removal
Breaking Changes
- Encrypted message format changed (encrypt-then-sign). All communicating agents must upgrade simultaneously.
Changes
fix: mandatory signature verification and full-envelope signing (C-01, C-02)fix: Phase R2 security hardening (H-08, H-09, H-10, H-12)fix: Phase R3 security hardening (M-13)fix: Phase R4 security hardening across agent modulefix: Phase R5 security hardening across agent modulefix: Phase R6 security hardening — trust, reputation, DHTfix: DTLS fingerprint pinning and inbox channel race fixfix(security): H-07 encrypt-then-sign for pre-authenticationfix(deps): M-40 migrate nhooyr.io/websocket to coder/websocketchore: remove dead code (DHT, transport selector, sandbox)chore(deps): bump peerclaw-core to v0.4.0