Skip to content
Draft
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
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ These instructions apply to the `peer-cli` repo.
- Prefer dry-run previews for write paths. Use the single `--yes` execution flag only when immediate broadcast is intended.
- Keep `peer mcp --profile read-only` as the default. The `cash` profile may prepare unsigned transactions but must never accept signer material, sign, or broadcast. Use `full` only for the complete operator surface.
- Keep `package.json`, `mcp.json`, `plugin.json`, `server.json`, and packaged skill versions aligned for a release.
- Stake and dispute-protection commands track the current `@zkp2p/sdk` names.
Protection is scoped by `(escrow, depositId, paymentMethod)`, and a zero risk
window means that payment method admits without stake.
- A prepared Peer Cash order can return several `accessPolicyPaymentMethods`.
The host must finalize the deposit, then submit one
`prepareAccessPolicy(depositId, paymentMethod)` transaction per returned
method. Access restriction is separate from stake-backed protection.
- Do not log or print private keys, API keys, tokens, cookies, or other credential values. Persistent runtime files stay owner-only.
- Keep tests hermetic unless a test is explicitly marked E2E.
- `agents.peer.xyz` source lives in `zkp2p-clients/clients/agents`; this repo owns the executable runtime and generated contracts it documents.
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# Changelog

## 0.4.0

- Updated to `@zkp2p/sdk@0.12.2-rc.3` and `@zkp2p/cash@0.4.11-rc.3` for the
current method-scoped dispute-protection and Peer Cash access-policy APIs.
- Replaced the retired chargeback-enabled read with
`stake dispute-protection-enabled`, including the required payment-method
hash, and updated matured-release calls to the current SDK names.
- Fixed `peer_cash_prepare_access_policy` to require and forward the exact
payment method returned by `accessPolicyPaymentMethods`.
- Updated the packaged skill, agent instructions, and generated catalogs for
the access-policy and Stake to Take cutovers.

## 0.3.0

- Added complete StakeVault and chargeback-protection CLI families, including
- Added complete StakeVault and dispute-protection CLI families, including
authoritative and indexed state, preview-first writes, and matured-intent
release operations.
- Added IntentGuardian discovery, policy, live extension quotes, payer-funding
Expand Down
3 changes: 3 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
- The command registry, `src/mcp/cash.ts`, and the error catalog are runtime sources of truth. `npm run build` regenerates the agent contracts.
- `peer mcp --profile read-only` is the default. `cash` exposes custody-separated Peer Cash tools; `full` exposes every tool.
- `--yes` is the only flag that forces prepared generic writes to broadcast.
- Dispute protection is payment-method scoped. Use the current SDK method names,
and pass the payment method hash to protection reads and Cash access-policy
follow-ups.
- Persistent config lives at `~/.peer/config.json`; checkout cache lives at `~/.peer/checkout-sessions.json`.
- Persistent runtime files must remain owner-only, and debug output must redact secrets.
- `--format table` only changes successful CLI rendering. Errors always emit JSON to stderr.
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ The package is `peer-protocol-cli`; do not install the unrelated unscoped
`peer-cli` package.

```bash
npm install --global peer-protocol-cli@0.3.0
npm install --global peer-protocol-cli@0.4.0
peer --help
```

Run without a global install:

```bash
npx -y peer-protocol-cli@0.3.0 quote --from USD --amount 100 --platform wise
npx -y peer-protocol-cli@0.4.0 quote --from USD --amount 100 --platform wise
```

Successful output is JSON by default. Errors always use the canonical JSON
Expand Down Expand Up @@ -73,7 +73,7 @@ The current tool counts are generated in `agents/runtime-manifest.json`.
"command": "npx",
"args": [
"-y",
"peer-protocol-cli@0.3.0",
"peer-protocol-cli@0.4.0",
"mcp",
"--profile",
"read-only"
Expand Down Expand Up @@ -116,6 +116,11 @@ custody boundary are unchanged:
8. `peer_cash_prepare_access_policy`, `peer_cash_prepare_withdraw`, and
`peer_cash_prepare_top_up` — prepare follow-up transactions.

For every method returned by `peer_cash_prepare` in
`accessPolicyPaymentMethods`, call `peer_cash_prepare_access_policy` after
finalization with both the finalized `depositId` and that exact
`paymentMethod`. Confirm every policy before presenting the order as ready.

Base USDC amounts are decimal strings in 6-decimal base units: 100 USDC is
`100000000`. Estimates are not locked quotes; the binding Chainlink rate
resolves when a buyer fills.
Expand Down Expand Up @@ -160,8 +165,8 @@ The CLI covers:
- deposit lifecycle, payment methods, currencies, oracle configuration, and
batch updates
- intents, pre-intent hooks, fulfillment, release, and cleanup
- StakeVault deposits, withdrawals, authorization, indexed freshness, and
matured chargeback releases
- StakeVault deposits, withdrawals, shared-stake authorization, method-scoped
dispute-protection reads, indexed freshness, and matured releases
- IntentGuardian policy, live extension quotes, payer funding, and
preview-first intent extension
- ProtocolViewer and indexer reads, including a raw GraphQL escape hatch
Expand Down
25 changes: 15 additions & 10 deletions agents/tool-catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -3796,7 +3796,7 @@
"stake",
"locked"
],
"description": "Read stake locked behind active chargeback windows.",
"description": "Read stake locked behind active dispute windows.",
"parameter_schema": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -3963,7 +3963,7 @@
"stake",
"admissions-paused"
],
"description": "Read whether chargebackable intent admissions are paused.",
"description": "Read whether dispute-protected intent admissions are paused.",
"parameter_schema": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -4005,12 +4005,12 @@
"read_only": true
},
{
"name": "peer stake chargeback-enabled",
"name": "peer stake dispute-protection-enabled",
"path": [
"stake",
"chargeback-enabled"
"dispute-protection-enabled"
],
"description": "Read whether a deposit has chargeback coverage enabled.",
"description": "Read whether one deposit payment method has dispute protection enabled.",
"parameter_schema": {
"type": "object",
"properties": {
Expand All @@ -4022,14 +4022,19 @@
"type": "string",
"description": "Numeric deposit ID."
},
"paymentMethodHash": {
"type": "string",
"description": "Payment method bytes32 hash."
},
"params": {
"type": "object",
"description": "Optional raw JSON params object merged underneath the typed CLI flags."
}
},
"required": [
"escrow",
"depositId"
"depositId",
"paymentMethodHash"
]
},
"auth_required": false,
Expand Down Expand Up @@ -4226,7 +4231,7 @@
"stake",
"release-matured"
],
"description": "Release one matured chargeback intent and unlock its stake cover.",
"description": "Release one matured protected intent and unlock its stake cover.",
"parameter_schema": {
"type": "object",
"properties": {
Expand All @@ -4236,7 +4241,7 @@
},
"policy": {
"type": "string",
"description": "Optional snapshotted chargeback policy address."
"description": "Optional snapshotted dispute-protection policy address."
},
"params": {
"type": "object",
Expand All @@ -4257,7 +4262,7 @@
"stake",
"release-matured-batch"
],
"description": "Release multiple matured chargeback intents in one transaction.",
"description": "Release multiple matured protected intents in one transaction.",
"parameter_schema": {
"type": "object",
"properties": {
Expand All @@ -4267,7 +4272,7 @@
},
"policy": {
"type": "string",
"description": "Optional snapshotted chargeback policy address."
"description": "Optional snapshotted dispute-protection policy address."
},
"params": {
"type": "object",
Expand Down
5 changes: 3 additions & 2 deletions llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ catalogs own enumerations; prose must not duplicate a command inventory.

## MCP

Run `npx -y https://github.com/zkp2p/peer-cli/releases/download/v0.2.0/peer-protocol-cli-0.2.0.tgz mcp --profile <profile>`.
Run `npx -y https://github.com/zkp2p/peer-cli/releases/download/v0.4.0/peer-protocol-cli-0.4.0.tgz mcp --profile <profile>`.

- read-only: generic and Peer Cash reads; no signing or broadcasting
- cash: complete peer_cash_* surface; prepares unsigned plans and never accepts
Expand All @@ -46,7 +46,8 @@ local stdio profiles.
3. peer_cash_prepare
4. host approval and ordered wallet submission
5. peer_cash_finalize after the confirmed createDeposit receipt
6. peer_cash_prepare_access_policy when required
6. for every accessPolicyPaymentMethods entry, call
peer_cash_prepare_access_policy with depositId and that paymentMethod
7. persist depositId and resume with peer_cash_order

Base USDC uses 6 decimals. Treat estimates as approximate. Retry read failures
Expand Down
Loading