@paysentry/protect 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -0
- package/package.json +7 -4
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# @paysentry/protect
|
|
2
|
+
|
|
3
|
+
Dispute resolution, provenance tracking, and recovery for AI agent payments. Know exactly what happened, prove it, and get your money back.
|
|
4
|
+
|
|
5
|
+
Part of [PaySentry](https://github.com/mkmkkkkk/paysentry).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @paysentry/protect @paysentry/core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { TransactionProvenance, DisputeManager, RecoveryEngine } from '@paysentry/protect';
|
|
17
|
+
|
|
18
|
+
const provenance = new TransactionProvenance();
|
|
19
|
+
const disputes = new DisputeManager({ provenance });
|
|
20
|
+
|
|
21
|
+
// Record provenance chain: intent -> policy -> execution -> settlement
|
|
22
|
+
provenance.recordIntent(tx, { originalPrompt: 'Buy market data' });
|
|
23
|
+
provenance.recordPolicyCheck(tx.id, 'pass', { policyId: 'production' });
|
|
24
|
+
provenance.recordExecution(tx.id, 'pass', { txHash: '0xabc...' });
|
|
25
|
+
provenance.recordSettlement(tx.id, 'fail', { error: 'Service returned 500' });
|
|
26
|
+
|
|
27
|
+
// File dispute with automatic evidence
|
|
28
|
+
const dispute = disputes.file({
|
|
29
|
+
transactionId: tx.id,
|
|
30
|
+
agentId: tx.agentId,
|
|
31
|
+
reason: 'Service failed to deliver after payment',
|
|
32
|
+
requestedAmount: tx.amount,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Resolve
|
|
36
|
+
disputes.resolve(dispute.id, {
|
|
37
|
+
status: 'resolved_refunded',
|
|
38
|
+
liability: 'service_provider',
|
|
39
|
+
resolvedAmount: tx.amount,
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
- **TransactionProvenance** — Immutable chain: intent -> policy -> approval -> execution -> settlement
|
|
46
|
+
- **DisputeManager** — File, track, and resolve disputes with auto-attached evidence
|
|
47
|
+
- **RecoveryEngine** — Automated recovery workflows for failed transactions
|
|
48
|
+
- **EU AI Act ready** — Full audit trails for autonomous financial decisions
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paysentry/protect",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Dispute resolution and recovery for AI agent payments",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,13 +16,16 @@
|
|
|
16
16
|
"clean": "tsc --build --clean"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@paysentry/core": "1.0.0"
|
|
19
|
+
"@paysentry/core": ">=1.0.0"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
|
-
"files": [
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
23
26
|
"repository": {
|
|
24
27
|
"type": "git",
|
|
25
|
-
"url": "https://github.com/
|
|
28
|
+
"url": "https://github.com/mkmkkkkk/paysentry",
|
|
26
29
|
"directory": "packages/protect"
|
|
27
30
|
}
|
|
28
31
|
}
|