@mnemopay/sdk 0.7.4 → 0.8.0

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 CHANGED
@@ -1,193 +1,266 @@
1
- # @mnemopay/sdk
2
-
3
- **Give any AI agent memory and a wallet in 5 lines.**
4
-
5
- MnemoPay unifies [Mnemosyne](https://github.com/mnemopay/mnemosyne-engine) (cognitive memory) and [AgentPay](https://github.com/mnemopay/agentpay-roa) (escrow economics) into a single SDK. The core innovation: **payment outcomes reinforce the memories that led to successful decisions**.
6
-
7
- ```typescript
8
- import { MnemoPay } from "@mnemopay/sdk";
9
-
10
- const agent = MnemoPay.quick("agent-001");
11
- await agent.remember("User prefers TypeScript");
12
- const memories = await agent.recall();
13
- const tx = await agent.charge(5.00, "Built analytics dashboard");
14
- await agent.settle(tx.id);
15
- ```
16
-
17
- ## Two Modes, One API
18
-
19
- | Mode | Constructor | Dependencies | Persistence | Use Case |
20
- |------|------------|-------------|-------------|----------|
21
- | **Prototype** | `MnemoPay.quick("id")` | None | In-memory | Development, testing, demos |
22
- | **Production** | `MnemoPay.create({...})` | Postgres + Redis | Durable | Deployed agents |
23
-
24
- Switch by changing one line. No code rewrites.
25
-
26
- ## Install
27
-
28
- ```bash
29
- npm install @mnemopay/sdk
30
- ```
31
-
32
- Optional peer dependencies (install only what you use):
33
-
34
- ```bash
35
- npm install openai # For OpenAI middleware
36
- npm install @anthropic-ai/sdk # For Anthropic middleware
37
- npm install @langchain/langgraph @langchain/core @langchain/openai # For LangGraph tools
38
- ```
39
-
40
- ## The Feedback Loop
41
-
42
- This is the core differentiator — payment outcomes reinforce memories:
43
-
44
- ```
45
- Agent recalls memories Makes decision Delivers value Charges user
46
-
47
- Payment settles
48
-
49
- Memories accessed in the last hour get +0.05 importance
50
-
51
- Agent makes better decisions next time
52
- ```
53
-
54
- Over time, memories that lead to successful transactions become dominant in recall, while memories associated with refunds decay faster.
55
-
56
- ## API Reference
57
-
58
- ### Memory Methods
59
-
60
- | Method | Description |
61
- |--------|-------------|
62
- | `agent.remember(content, opts?)` | Store a memory. Auto-scored by importance if not specified. |
63
- | `agent.recall(limit?)` | Recall top memories ranked by importance x recency x frequency. |
64
- | `agent.forget(id)` | Delete a memory. |
65
- | `agent.reinforce(id, boost?)` | Boost a memory's importance. |
66
- | `agent.consolidate()` | Prune stale memories below score threshold. |
67
-
68
- ### Payment Methods
69
-
70
- | Method | Description |
71
- |--------|-------------|
72
- | `agent.charge(amount, reason)` | Create an escrow transaction. Reputation-gated. |
73
- | `agent.settle(txId)` | Finalize escrow. Moves funds, boosts reputation, reinforces memories. |
74
- | `agent.refund(txId)` | Refund a transaction. Docks reputation by -0.05. |
75
- | `agent.balance()` | Get wallet balance and reputation score. |
76
-
77
- ### Observability
78
-
79
- | Method | Description |
80
- |--------|-------------|
81
- | `agent.profile()` | Full agent stats (reputation, wallet, memory count, tx count). |
82
- | `agent.logs(limit?)` | Immutable audit trail of all actions. |
83
- | `agent.history(limit?)` | Transaction history, most recent first. |
84
-
85
- ## Provider Middlewares
86
-
87
- ### OpenAI (invisible memory)
88
-
89
- ```typescript
90
- import OpenAI from "openai";
91
- import { MnemoPay } from "@mnemopay/sdk";
92
- import { MnemoPayMiddleware } from "@mnemopay/sdk/middleware/openai";
93
-
94
- const agent = MnemoPay.quick("assistant");
95
- const ai = MnemoPayMiddleware.wrap(new OpenAI(), agent);
96
-
97
- // Memory is now invisible auto-injected and auto-stored
98
- const res = await ai.chat.completions.create({
99
- model: "gpt-4o",
100
- messages: [{ role: "user", content: "What do you remember?" }],
101
- });
102
- ```
103
-
104
- ### Anthropic (invisible memory)
105
-
106
- ```typescript
107
- import Anthropic from "@anthropic-ai/sdk";
108
- import { MnemoPay } from "@mnemopay/sdk";
109
- import { AnthropicMiddleware } from "@mnemopay/sdk/middleware/anthropic";
110
-
111
- const agent = MnemoPay.quick("claude-agent");
112
- const ai = AnthropicMiddleware.wrap(new Anthropic(), agent);
113
- ```
114
-
115
- ## LangGraph Tools
116
-
117
- ```typescript
118
- import { createReactAgent } from "@langchain/langgraph/prebuilt";
119
- import { MnemoPay } from "@mnemopay/sdk";
120
- import { mnemoTools, agentPayTools } from "@mnemopay/sdk/langgraph";
121
-
122
- const agent = MnemoPay.quick("langgraph-agent");
123
- const graph = createReactAgent({
124
- llm,
125
- tools: [...mnemoTools(agent), ...agentPayTools(agent)],
126
- });
127
- ```
128
-
129
- 6 tools with full Zod schemas: `recall_memories`, `store_memory`, `reinforce_memory`, `charge_user`, `settle_payment`, `check_balance`.
130
-
131
- ## Agents Hiring Agents
132
-
133
- ```typescript
134
- const manager = MnemoPay.quick("manager");
135
- const coder = MnemoPay.quick("coder");
136
-
137
- await manager.remember("coder delivered fast but had 2 bugs last time");
138
- const memories = await manager.recall(); // Use memory to decide
139
-
140
- const job = await manager.charge(5.00, "Code sorting algorithm");
141
- await manager.settle(job.id);
142
- await manager.remember("coder delivered clean code this time");
143
- // Next round: manager makes better hiring decisions
144
- ```
145
-
146
- ## Production Mode
147
-
148
- ```bash
149
- docker compose up -d # Starts Mnemosyne + AgentPay + Postgres + Redis
150
- ```
151
-
152
- ```typescript
153
- const agent = MnemoPay.create({
154
- agentId: "prod-agent",
155
- mnemoUrl: "http://localhost:8100",
156
- agentpayUrl: "http://localhost:3100",
157
- debug: true,
158
- });
159
-
160
- // Same API — now backed by Hopfield networks, Bayesian trust, AIS fraud detection
161
- await agent.remember("Production memory");
162
- const tx = await agent.charge(10.00, "Premium service");
163
- await agent.settle(tx.id);
164
- ```
165
-
166
- ## Architecture
167
-
168
- ```
169
- Your code
170
-
171
- @mnemopay/sdk ←── Single import, 12 methods
172
- ↓ ↓
173
- Mnemosyne API AgentPay API ←── Separate services (unchanged)
174
- (12 models) (14 models)
175
- ↓ ↓
176
- Redis Streams Bridge ←── Payment outcomes reinforce memories
177
- ```
178
-
179
- The SDK is the developer-facing layer. The backends do the heavy lifting:
180
- - **Mnemosyne**: Hopfield associative recall, FSRS spaced repetition, Merkle integrity, Dream consolidation
181
- - **AgentPay**: Bayesian trust (Beta distributions), AIS fraud detection, behavioral economics, escrow
182
-
183
- ## Tests
184
-
185
- ```bash
186
- npm test # 67 tests covering memory, payments, feedback loop, security, concurrency
187
- ```
188
-
189
- ## License
190
-
191
- MIT
192
-
193
- Built by [J&B Enterprise LLC](https://github.com/mnemopay)
1
+ # MnemoPay
2
+
3
+ **Give your AI agents real superpowers.** Memory + Payments + Identity in one SDK.
4
+
5
+ Your agent remembers every interaction, handles real money, builds reputation, and trades with other agents all with a balanced double-entry ledger that never drifts by a penny.
6
+
7
+ ```bash
8
+ npm install @mnemopay/sdk
9
+ ```
10
+
11
+ ```ts
12
+ import MnemoPay from "@mnemopay/sdk";
13
+
14
+ const agent = MnemoPay.quick("my-agent");
15
+
16
+ await agent.remember("User prefers monthly billing");
17
+ const tx = await agent.charge(25, "Monthly API access");
18
+ await agent.settle(tx.id);
19
+ // Agent now has memory, money, and reputation. Ledger balanced.
20
+ ```
21
+
22
+ 330+ tests. Production-hardened. MIT licensed.
23
+
24
+ ---
25
+
26
+ ## Why MnemoPay
27
+
28
+ AI agents can think. They can't remember or pay. MnemoPay fixes both.
29
+
30
+ | Problem | Without MnemoPay | With MnemoPay |
31
+ |---|---|---|
32
+ | Memory | Every session starts cold | Agent remembers everything — decays naturally, strengthens on use |
33
+ | Payments | Manual API calls, no escrow | Charge → escrow → settle → refund. Real money, real rails |
34
+ | Identity | No agent verification | KYA (Know Your Agent) with capability tokens and permissions |
35
+ | Trust | No reputation system | Agent FICO score that grows with successful transactions |
36
+ | Accounting | Hope the numbers are right | Double-entry ledger. Every debit has a credit. Always balances to zero |
37
+ | Fraud | Build your own | Velocity checks, anomaly detection, geo-enhanced risk scoring |
38
+ | Multi-agent | Not possible | `net.transact("buyer", "seller", 25, "API access")` — both agents remember |
39
+
40
+ ---
41
+
42
+ ## Features
43
+
44
+ ### Memory (Neuroscience-backed)
45
+ - **Ebbinghaus forgetting curve** memories decay over time, just like the brain
46
+ - **Hebbian reinforcement** — successful transactions strengthen associated memories
47
+ - **Consolidation** — auto-prunes weak memories, keeps what matters
48
+ - **Semantic recall** — find memories by relevance, not just recency
49
+ - **100KB per memory** store rich context, not just strings
50
+
51
+ ### Payments (Bank-grade math)
52
+ - **Double-entry bookkeeping** — Luca Pacioli's 1494 system, 330+ tests proving it works
53
+ - **Escrow flow** — charge → hold → settle → refund (same as Stripe/Square)
54
+ - **Platform fee** 1.9% on settlement (configurable, volume-tiered: 1.9% 1.5% 1.0%)
55
+ - **3 payment rails** — Paystack (Africa), Stripe (global), Lightning (BTC)
56
+ - **Penny-precise** — stress-tested with 1,000 random transactions, fee + net = gross every time
57
+
58
+ ### Identity (KYA Compliance)
59
+ - **Agent identity** — cryptographic keypairs, owner verification
60
+ - **Capability tokens** scoped permissions (charge, settle, refund, remember)
61
+ - **Spend limits** — max per transaction, max total spend, counterparty whitelists
62
+ - **Kill switch** revoke all tokens instantly
63
+
64
+ ### Fraud Detection (Geo-enhanced)
65
+ - **Velocity checks** per-minute, per-hour, per-day limits
66
+ - **Anomaly detection** z-score + optional ML (Isolation Forest)
67
+ - **Geo-enhanced** — country tracking, rapid-hop detection, currency mismatch, timezone anomalies
68
+ - **Geo trust** — consistent location builds trust, dampens false positives
69
+ - **OFAC sanctions** — hard blocks for sanctioned countries (KP, IR, SY, CU, RU)
70
+ - **Behavioral fingerprinting** detects drift from agent's normal patterns
71
+
72
+ ### Multi-Agent Commerce
73
+ - **MnemoPayNetwork** register agents, execute deals, shared memory context
74
+ - **One method** `net.transact(buyer, seller, amount, reason)` handles everything
75
+ - **Both remember** buyer and seller each store the deal in their memory
76
+ - **Supply chains** — 10-step agent chains, 100-agent marketplaces, all tested
77
+
78
+ ---
79
+
80
+ ## Payment Rails
81
+
82
+ MnemoPay supports real money movement through pluggable payment rails:
83
+
84
+ ```ts
85
+ import { PaystackRail, StripeRail, LightningRail } from "@mnemopay/sdk";
86
+
87
+ // Africa (NGN, GHS, ZAR, KES)
88
+ const paystack = new PaystackRail(process.env.PAYSTACK_SECRET_KEY!);
89
+
90
+ // Global (USD, EUR, GBP — cards)
91
+ const stripe = new StripeRail(process.env.STRIPE_SECRET_KEY!);
92
+
93
+ // Crypto (BTC via Lightning Network)
94
+ const lightning = new LightningRail(LND_URL, MACAROON);
95
+
96
+ // Plug into any agent
97
+ const agent = MnemoPay.quick("my-agent", { paymentRail: paystack });
98
+ ```
99
+
100
+ ### Paystack Rail (Built for Africa)
101
+ - Initialize → checkout → verify flow
102
+ - Charge saved cards (authorization codes)
103
+ - Bank transfers / payouts
104
+ - Webhook HMAC-SHA512 verification
105
+ - Bank account resolution
106
+ - 23 Nigerian banks pre-mapped
107
+
108
+ ### Fee Structure
109
+
110
+ | Tier | Monthly Volume | Platform Fee |
111
+ |---|---|---|
112
+ | Standard | < $10,000 | 1.9% |
113
+ | Growth | $10,000 - $100,000 | 1.5% |
114
+ | Scale | $100,000+ | 1.0% |
115
+
116
+ Fees are automatically tiered based on cumulative settled volume per agent.
117
+
118
+ ---
119
+
120
+ ## MCP Server
121
+
122
+ MnemoPay runs as an MCP server, giving Claude and other AI assistants direct access:
123
+
124
+ ```bash
125
+ npx @mnemopay/sdk init
126
+ # or
127
+ claude mcp add mnemopay -s user -- npx -y @mnemopay/sdk
128
+ ```
129
+
130
+ Available tools: `charge`, `settle`, `refund`, `remember`, `recall`, `balance`, `history`, `profile`, `reputation`, `fraud_stats`, `dispute`, `reinforce`, `consolidate`, `forget`, `logs`.
131
+
132
+ ---
133
+
134
+ ## Middleware
135
+
136
+ Drop MnemoPay into your existing AI stack:
137
+
138
+ ```ts
139
+ // OpenAI
140
+ import { mnemoPayMiddleware } from "@mnemopay/sdk/middleware/openai";
141
+
142
+ // Anthropic
143
+ import { mnemoPayMiddleware } from "@mnemopay/sdk/middleware/anthropic";
144
+
145
+ // LangGraph
146
+ import { mnemoPayTools } from "@mnemopay/sdk/langgraph";
147
+ ```
148
+
149
+ ---
150
+
151
+ ## Multi-Agent Example
152
+
153
+ ```ts
154
+ import { MnemoPayNetwork } from "@mnemopay/sdk";
155
+
156
+ const net = new MnemoPayNetwork({ fraud: { platformFeeRate: 0.019 } });
157
+
158
+ // Register agents
159
+ net.register("buyer-bot", "owner-1", "dev@company.com");
160
+ net.register("seller-bot", "owner-2", "dev@company.com");
161
+
162
+ // Execute a deal — both agents remember, seller gets paid, ledger balances
163
+ const deal = await net.transact("buyer-bot", "seller-bot", 25, "API access for 1 month");
164
+
165
+ console.log(deal.netAmount); // 24.52 (after 1.9% fee)
166
+ console.log(deal.platformFee); // 0.48
167
+ console.log(deal.buyerMemoryId); // buyer remembers the purchase
168
+ console.log(deal.sellerMemoryId);// seller remembers the sale
169
+ ```
170
+
171
+ ---
172
+
173
+ ## Architecture
174
+
175
+ ```
176
+ ┌─────────────────────────────────────────────────┐
177
+ │ MnemoPay SDK │
178
+ ├──────────┬──────────┬───────────┬───────────────┤
179
+ │ Memory │ Payments Identity │ Fraud Guard │
180
+ │ │ │ │ │
181
+ remember charge │ KYA │ velocity │
182
+ │ recall │ settle │ tokens │ anomaly │
183
+ reinforce│ refund │ perms │ geo-enhanced │
184
+ │ forget │ dispute │ killswitch│ ML (optional) │
185
+ ├──────────┴──────────┴───────────┴───────────────┤
186
+ │ Double-Entry Ledger │
187
+ │ debit + credit = always zero │
188
+ ├─────────────────────────────────────────────────┤
189
+ │ Payment Rails │
190
+ │ Paystack │ Stripe │ Lightning │
191
+ └─────────────────────────────────────────────────┘
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Persistence
197
+
198
+ ```ts
199
+ // File-based (default)
200
+ const agent = MnemoPay.quick("my-agent", { persistDir: "./data" });
201
+
202
+ // SQLite (production)
203
+ import { SQLiteStorage } from "@mnemopay/sdk/storage";
204
+ const storage = new SQLiteStorage("./mnemopay.db");
205
+
206
+ // Everything persists: memories, transactions, identity, fraud state, geo profiles
207
+ ```
208
+
209
+ ---
210
+
211
+ ## API Reference
212
+
213
+ ### Core Methods
214
+
215
+ | Method | Description |
216
+ |---|---|
217
+ | `agent.remember(content, opts?)` | Store a memory with importance scoring |
218
+ | `agent.recall(limit?, query?)` | Retrieve memories by relevance |
219
+ | `agent.charge(amount, reason)` | Create an escrow hold |
220
+ | `agent.settle(txId, counterpartyId?)` | Release escrow, apply fee, complete payment |
221
+ | `agent.refund(txId)` | Reverse a completed or pending transaction |
222
+ | `agent.dispute(txId, reason)` | File a dispute against a settled transaction |
223
+ | `agent.balance()` | Get wallet balance and reputation |
224
+ | `agent.verifyLedger()` | Confirm double-entry ledger balances to zero |
225
+ | `agent.history(limit?)` | Get transaction history |
226
+ | `agent.consolidate()` | Prune stale memories |
227
+
228
+ ### Network Methods
229
+
230
+ | Method | Description |
231
+ |---|---|
232
+ | `net.register(agentId, ownerId, email)` | Register an agent on the network |
233
+ | `net.transact(buyer, seller, amount, reason)` | Full deal: charge → settle → memory → identity |
234
+ | `net.refundDeal(dealId)` | Reverse a deal, both agents remember the refund |
235
+ | `net.stats()` | Network-wide statistics |
236
+ | `net.dealsBetween(agentA, agentB)` | Get deal history between two agents |
237
+
238
+ ---
239
+
240
+ ## Testing
241
+
242
+ ```bash
243
+ npm test # Run all 330+ tests
244
+ npm run lint # Type check
245
+ ```
246
+
247
+ Test coverage:
248
+ - `core.test.ts` — 67 tests (memory, payments, lifecycle)
249
+ - `fraud.test.ts` — 43 tests (velocity, anomaly, fees, disputes)
250
+ - `geo-fraud.test.ts` — 20 tests (geo signals, trust, sanctions)
251
+ - `identity.test.ts` — 44 tests (KYA, tokens, permissions)
252
+ - `ledger.test.ts` — 21 tests (double-entry, reconciliation)
253
+ - `network.test.ts` — 22 tests (multi-agent, deals, supply chains)
254
+ - `paystack.test.ts` — 46 tests (rail, webhooks, transfers)
255
+ - `stress.test.ts` — 32 tests (1000-cycle precision, parallel ops)
256
+ - `recall.test.ts` — 35 tests (semantic search, decay, reinforcement)
257
+
258
+ ---
259
+
260
+ ## License
261
+
262
+ MIT
263
+
264
+ ---
265
+
266
+ Built by [Jerry Omiagbo](https://github.com/mnemopay)
package/dist/fraud.d.ts CHANGED
@@ -7,9 +7,17 @@
7
7
  */
8
8
  import { IsolationForest, TransactionGraph, BehaviorProfile } from "./fraud-ml.js";
9
9
  import type { CollusionSignal, BehaviorSnapshot } from "./fraud-ml.js";
10
+ export interface FeeTier {
11
+ /** Minimum cumulative settled volume (USD) to qualify */
12
+ minVolume: number;
13
+ /** Fee rate for this tier */
14
+ rate: number;
15
+ }
10
16
  export interface FraudConfig {
11
- /** Platform fee rate on settle (0.03 = 3%). Default 0.03 */
17
+ /** Platform fee rate on settle (0.019 = 1.9%). Default 0.019. Used when no tiers match. */
12
18
  platformFeeRate: number;
19
+ /** Volume-based fee tiers (sorted by minVolume ascending). Overrides platformFeeRate when agent qualifies. */
20
+ feeTiers: FeeTier[];
13
21
  /** Max charges per minute per agent. Default 5 */
14
22
  maxChargesPerMinute: number;
15
23
  /** Max charges per hour per agent. Default 30 */
@@ -38,6 +46,8 @@ export interface FraudConfig {
38
46
  blockedCountries: string[];
39
47
  /** Enable ML fraud detection (Isolation Forest, graph analysis, behavioral fingerprinting). Default false */
40
48
  ml: boolean;
49
+ /** Geo-enhanced fraud detection config */
50
+ geo: GeoFraudConfig;
41
51
  }
42
52
  export declare const DEFAULT_FRAUD_CONFIG: FraudConfig;
43
53
  export interface FraudSignal {
@@ -86,6 +96,40 @@ export interface RequestContext {
86
96
  country?: string;
87
97
  userAgent?: string;
88
98
  sessionId?: string;
99
+ /** UTC offset in hours (e.g., +1 for WAT, -5 for CDT) */
100
+ utcOffset?: number;
101
+ /** Currency code associated with this request's region */
102
+ currency?: string;
103
+ }
104
+ /** Per-agent geographic behavior profile */
105
+ export interface GeoProfile {
106
+ /** First country seen — established as "home" after 5+ transactions */
107
+ homeCountry?: string;
108
+ /** All countries seen, with transaction counts */
109
+ countryCounts: Record<string, number>;
110
+ /** Country of last transaction */
111
+ lastCountry?: string;
112
+ /** Timestamps of country changes (for rapid-hop detection) */
113
+ countryChanges: number[];
114
+ /** Total transactions tracked for this profile */
115
+ totalTxCount: number;
116
+ /** Geo trust score 0-1 (higher = more consistent location = less suspicious) */
117
+ trustScore: number;
118
+ }
119
+ /** Geo-specific fraud config. All thresholds designed to FLAG, not BLOCK. */
120
+ export interface GeoFraudConfig {
121
+ /** Enable geo-enhanced fraud signals. Default: true */
122
+ enabled: boolean;
123
+ /** Min transactions before establishing home country. Default: 5 */
124
+ homeCountryThreshold: number;
125
+ /** Country changes in 24h to trigger rapid-hop signal. Default: 3 */
126
+ rapidHopThreshold: number;
127
+ /** High-risk country corridors (pairs). Default: common AML corridors */
128
+ highRiskCorridors: [string, string][];
129
+ /** OFAC/sanctions blocked countries. These BLOCK, not just flag. */
130
+ sanctionedCountries: string[];
131
+ /** Currency-to-country region map for mismatch detection */
132
+ currencyRegions: Record<string, string[]>;
89
133
  }
90
134
  export declare class FraudGuard {
91
135
  readonly config: FraudConfig;
@@ -99,12 +143,16 @@ export declare class FraudGuard {
99
143
  private feeLedger;
100
144
  /** Total platform fees collected */
101
145
  private _platformFeesCollected;
146
+ /** Cumulative settled volume per agent (for tiered pricing) */
147
+ private agentSettledVolume;
102
148
  /** Known IPs per agent for consistency checks */
103
149
  private agentIps;
104
150
  /** Flagged agents (soft block — allowed but monitored) */
105
151
  private flaggedAgents;
106
152
  /** Hard-blocked agents */
107
153
  private blockedAgents;
154
+ /** Per-agent geo behavior profiles */
155
+ private geoProfiles;
108
156
  /** ML anomaly detection — only loaded when ml: true */
109
157
  readonly isolationForest: IsolationForest | null;
110
158
  /** Transaction graph — only loaded when ml: true */
@@ -130,8 +178,18 @@ export declare class FraudGuard {
130
178
  detectCollusion(): CollusionSignal[];
131
179
  /** Get an agent's behavioral baseline (requires ml: true) */
132
180
  getAgentBaseline(agentId: string): BehaviorSnapshot | undefined;
181
+ /**
182
+ * Get the effective fee rate for an agent based on cumulative settled volume.
183
+ * Higher volume = lower fees (loyalty reward for active agents).
184
+ */
185
+ getEffectiveFeeRate(agentId: string): number;
186
+ /**
187
+ * Get an agent's cumulative settled volume.
188
+ */
189
+ getAgentVolume(agentId: string): number;
133
190
  /**
134
191
  * Calculate and record platform fee for a settlement.
192
+ * Uses volume-based tiered pricing when configured.
135
193
  * Returns { grossAmount, feeAmount, netAmount }.
136
194
  */
137
195
  applyPlatformFee(txId: string, agentId: string, grossAmount: number): PlatformFeeRecord;
@@ -176,6 +234,22 @@ export declare class FraudGuard {
176
234
  openDisputes: number;
177
235
  platformFeesCollected: number;
178
236
  };
237
+ /**
238
+ * Assess geo-related risk signals for a transaction.
239
+ * Design: all signals are LOW weight (0.1-0.35) so they NEVER block alone.
240
+ * Only sanctioned countries use critical weight (0.9).
241
+ * Agents build geo trust over time, dampening signals further.
242
+ */
243
+ private assessGeo;
244
+ /**
245
+ * Update geo profile after a successful charge.
246
+ * Builds geo trust over time — consistent location = higher trust.
247
+ */
248
+ updateGeoProfile(agentId: string, ctx?: RequestContext): void;
249
+ /** Get or create a geo profile for an agent */
250
+ private getOrCreateGeoProfile;
251
+ /** Get an agent's geo profile (for diagnostics/display) */
252
+ getGeoProfile(agentId: string): GeoProfile | undefined;
179
253
  serialize(): string;
180
254
  static deserialize(json: string, config?: Partial<FraudConfig>): FraudGuard;
181
255
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fraud.d.ts","sourceRoot":"","sources":["../src/fraud.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,KAAK,EAAE,eAAe,EAAe,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAIpF,MAAM,WAAW,WAAW;IAC1B,4DAA4D;IAC5D,eAAe,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iDAAiD;IACjD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iDAAiD;IACjD,gBAAgB,EAAE,MAAM,CAAC;IACzB,mD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