CAPPZ SDK. Build trusted agents.

Install, bootstrap, bind skills, run sync cycles, and subscribe to events. Trusted primitives with A2A quantum tunneling and HD-wallet provenance.

The reference SDK for publishing skills, BPMN flows, and notarized content under your own HD root — with A2A quantum tunneling state sync, royalty TXs, and Claude/MCP surfacing out of the box.

cappz.ai is the technical implementation of the Constitution of Trusted Agents (COTA). Every SDK primitive carries COTA provenance — identity, moral inheritance, zero-trust execution, no-harm bonds.

Notarized & lifecycle-managed

Sync by default

Constitution of Trusted Agents

The 12 sections.

1. Install & Bootstrap

The CAPPZ SDK is a sovereign module resolved by the CAPPZ Package Manager (CPM). Skills, BPMN flows, and schemas hydrate from wallet-resident storage — no npm registry required for runtime skill resolution.

// 1. Bind your wallet import { CappzAgent } from '@cappz/sdk'; const agent = await CappzAgent.bind({ walletAddress: 'rYourXRPLAddress...', hdRoot: "m/44'/144'/0'/your-domain", }); // 2. Discover skills on chain (AX-68 — generic HD-walk) const skills = await agent.fetchSkillsOnChain(); // 3. Invoke a notarized BPMN skill const result = await agent.invoke('your-skill', { input }); // → Emits ContentIngested + ConstituentsAggregated (twin-TX) // → Royalty event TXs flow to wallet scopes

2. Constitution of Trusted Agents (COTA)

cappz.ai is the technical implementation of COTA — the Constitution of Trusted Agents. Every SDK primitive maps to a COTA article: identity (Article I), moral provenance (Article II), zero-trust execution (Article III), no-harm bonds (Article IV), decentralized governance (Article V), radical transparency (Article VI).

Read the full charter at /cota. Every notarization, every event TX, every clone copy carries COTA provenance.

3. A2A Quantum Tunneling State Sync

Sibling agent clones reconcile their append-only block sequences peer-to-peer (AX-78). No hub. No server. No conflict — only append-only entanglement. This is on by default for every agent bound through the SDK.

import { runSyncCycle, syncCacheWalletCopies } from '@cappz/sdk/sync'; // Full A2A discovery + pull cycle const { peersFound, blocksApplied } = await runSyncCycle(walletAddress); // Federated cache wallet sync (AX-78) await syncCacheWalletCopies(walletAddress, cacheWalletHdRoot); // Each apply emits a high-QoS Event TX: // A2ACacheSyncApplied + FederatedCacheSyncApplied

The result: every clone converges on the same notarized graph state without a coordinator, replacing hub-and-spoke with viral blockchain sync.

4. Storage Stack (cappz-middleware)

All state flows through cappz-middleware. Raw browser storage APIs are prohibited (AX-63 — single storage stack).

cappz-middleware (IDB engine base) ├── offlineCache (TTL KV) │ └── chainletStorage (high-level KV) ├── cappz-chainlet (block sync) ├── cappz-a2a (agent-to-agent — quantum tunneling) ├── cappz-sync-async (correlated envelopes) ├── cappz-mdm-cache (address-driven TX cache) └── cappz-model-adapter (AI inference) Event Bus: middlewareNotify(store, key, type) Subscription: CreateEventSubscription(hdPath, callback, eventType?)

5. HD Address Identity (AX-59)

Address-identity convergence: every entity's HD path IS its identity. All paths centralized inBibleCodexPaths.ts (AP-17 remediation — no hardcoded path strings).

m/44'/144'/0'/bible-codex/ ← BIBLE_CODEX_ROOT ├── ethiopian/{lang}/{book}/{ch}'/{v}' ├── kjv/{lang}/{book}/{ch}'/{v}' ├── peshitta/{lang}/{book}/{ch}'/{v}' ├── wlc/{lang}/{book}/{ch}'/{v}' └── nestle-1904/{lang}/{book}/{ch}'/{v}'

6. COOL & COPE Primitives

COOL (Cognitive Ontological Oriented Learning) — every dependency resolved through the on-chain ontology. No vocabulary drift, ever.

COPE (Cognitive Object Permanence Experiences) — eliminates constant re-inferencing. Learnings retained for consistent, reliable, and repeatable outcomes.

// COPE node anchor (see public/soul.md) m/44'/144'/100'/principles/cope/v1 // PrinciplesChainlet — hash-verified governance import { PrinciplesChainlet } from '@cappz/sdk/governance'; const verified = await PrinciplesChainlet.verify(skillId);

7. Generic Discovery — FetchSkillsOnChain (AX-68)

Generic HD-walk discovery utility. Replaces all domain-specific discovery functions.

import { FetchSkillsOnChain } from '@cappz/sdk/skills'; const configs = await FetchSkillsOnChain(YOUR_HD_ROOT); // → Discovers all bound skills under root // → Caches in chainletStorage (7-day TTL — AX-69) // → Reactive invalidation via CreateEventSubscription (AX-70)

8. CreateEventSubscription (AX-70)

Decentralized event subscription via cappz-middleware pub/sub. Zero third-party dependency leakage.

import { CreateEventSubscription } from '@cappz/sdk/sync'; const unsubscribe = CreateEventSubscription( 'cappz:codex/config/', // HD path prefix (key, value, mutationType) => RefreshCache(),// callback ['SkillBindingCreated', 'ContentAmended'], // event filter ); unsubscribe();

9. Royalty Flywheel

Every skill binding, every clone copy, every invocation emits a royalty event TX. Configs are inherited from wallet/skill scopes (AP-19 remediation — no per-TX royalty config).

// Mission gift split: 70 / 20 / 10 // 70% → skill author wallet // 20% → substrate treasury // 10% → COTA charter wallet // // 777 CAPPZ copy fee on every clone — distributed via flywheel.

10. Design Axioms

Wallet Sovereignty — local agent clones are self-governing

Sovereign Bootloader — skills loaded from wallet-resident storage

BPMN-First — all skill execution governed by a root BPMN process

HD Path Source-of-Truth — no hardcoded path strings

Single Storage Stack — all state through cappz-middleware

Generic On-Chain Discovery — FetchSkillsOnChain(hdRoot)

Config Cache — 7-day TTL on non-volatile datasets

Event-Driven Invalidation — CreateEventSubscription

Federated A2A Sync — quantum tunneling between sibling clones

DAG-Native Ingest — partition-scoped multi-parent nodes

Modal-Free Naming — no would/could/should/can/may identifiers

11. Anti-Patterns to Avoid

Resolution: Resolve from event TX existence

Resolution: Centralized constants/builders

Resolution: Wallet/skill scope inheritance

Resolution: Use action verbs (detectX, requestX)

12. Build Log & Upchain Synthesis

The SkillBuildLog records structural changes per clone. Entries sync upchain via A2A to parent templates — local learnings propagate to all siblings without breaking sovereignty.

Publish skills under your own HD root.

Royalty TXs to your wallets. Claude/MCP surfacing out of the box. A2A quantum tunneling between every clone.