@belticlabs/agent-risk-sdk 0.3.0 → 0.4.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/dist/{adapter-BEpzr2R3.d.ts → adapter-CLy44CD2.d.ts} +2 -2
- package/dist/ai/index.d.ts +2 -2
- package/dist/ai/index.js +3 -4
- package/dist/{chunk-46QN2KEZ.js → chunk-4BUUPU3O.js} +0 -9
- package/dist/chunk-WY5ZX4BD.js +177 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +17 -8
- package/dist/protocol/index.d.ts +2 -2
- package/dist/protocol/index.js +1 -5
- package/dist/{session-DsBWEP8d.d.ts → session-gK51QVAM.d.ts} +5 -6
- package/dist/{verdict-6vCyoAHE.d.ts → verdict-CDAsxktI.d.ts} +1 -17
- package/dist/x402/hono.d.ts +16 -5
- package/dist/x402/hono.js +14 -8
- package/dist/x402/index.d.ts +12 -22
- package/dist/x402/index.js +14 -57
- package/package.json +2 -30
- package/dist/chunk-7G5EHNVW.js +0 -17
- package/dist/chunk-FAQ442YH.js +0 -24
- package/dist/chunk-LM4NIYE5.js +0 -92
- package/dist/chunk-NJVO2WIV.js +0 -17
- package/dist/chunk-OKC6VMFH.js +0 -84
- package/dist/mcp/index.d.ts +0 -58
- package/dist/mcp/index.js +0 -135
- package/dist/middleware-9gI0ou2i.d.ts +0 -15
- package/dist/seller/anti-fraud-gateway.d.ts +0 -40
- package/dist/seller/anti-fraud-gateway.js +0 -38
- package/dist/x402/express.d.ts +0 -13
- package/dist/x402/express.js +0 -27
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
presentedFrom
|
|
3
|
-
} from "../chunk-7G5EHNVW.js";
|
|
4
|
-
import {
|
|
5
|
-
x402Summary
|
|
6
|
-
} from "../chunk-LM4NIYE5.js";
|
|
7
|
-
import "../chunk-FQDHFTVR.js";
|
|
8
|
-
|
|
9
|
-
// src/seller/anti-fraud-gateway.ts
|
|
10
|
-
var BelticAntiFraudGateway = class {
|
|
11
|
-
constructor(beltic) {
|
|
12
|
-
this.beltic = beltic;
|
|
13
|
-
}
|
|
14
|
-
async assess(ctx) {
|
|
15
|
-
const session = await this.beltic.sessions.ensure(ctx.sessionId ?? null);
|
|
16
|
-
const payment = x402Summary(
|
|
17
|
-
{
|
|
18
|
-
payTo: ctx.payTo ?? ctx.resource,
|
|
19
|
-
amount: ctx.amountAtomic,
|
|
20
|
-
network: ctx.network,
|
|
21
|
-
asset: ctx.asset
|
|
22
|
-
},
|
|
23
|
-
{ payer: ctx.wallet }
|
|
24
|
-
);
|
|
25
|
-
await session.emit(
|
|
26
|
-
"payment.presented",
|
|
27
|
-
presentedFrom(payment, {
|
|
28
|
-
resource: ctx.resource,
|
|
29
|
-
...ctx.paymentIdentifier ? { paymentIdentifier: ctx.paymentIdentifier } : {}
|
|
30
|
-
})
|
|
31
|
-
);
|
|
32
|
-
const out = await this.beltic.evaluate(session.id, payment);
|
|
33
|
-
return out?.verdict.blocks(this.beltic.onReview) ? { allow: false, reason: `${out.decision}:${out.reasonCodes.join(",")}` } : { allow: true };
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
export {
|
|
37
|
-
BelticAntiFraudGateway
|
|
38
|
-
};
|
package/dist/x402/express.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RoutesConfig, x402ResourceServer } from '@x402/core/server';
|
|
2
|
-
import { RequestHandler } from 'express';
|
|
3
|
-
import { B as Beltic } from '../session-DsBWEP8d.js';
|
|
4
|
-
import { G as GuardedMiddlewareOptions } from '../middleware-9gI0ou2i.js';
|
|
5
|
-
export { a as attachX402 } from '../adapter-BEpzr2R3.js';
|
|
6
|
-
import '../verdict-6vCyoAHE.js';
|
|
7
|
-
import 'zod';
|
|
8
|
-
|
|
9
|
-
/** Seller half for express: `@x402/express`'s payment middleware with the Beltic hooks attached. */
|
|
10
|
-
|
|
11
|
-
declare function belticPaymentMiddleware(beltic: Beltic, routes: RoutesConfig, server: x402ResourceServer, opts?: GuardedMiddlewareOptions): RequestHandler;
|
|
12
|
-
|
|
13
|
-
export { belticPaymentMiddleware };
|
package/dist/x402/express.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
guardedPaymentMiddleware
|
|
3
|
-
} from "../chunk-NJVO2WIV.js";
|
|
4
|
-
import {
|
|
5
|
-
attachX402
|
|
6
|
-
} from "../chunk-OKC6VMFH.js";
|
|
7
|
-
import "../chunk-FAQ442YH.js";
|
|
8
|
-
import "../chunk-X3W2Z5GC.js";
|
|
9
|
-
import "../chunk-46QN2KEZ.js";
|
|
10
|
-
import "../chunk-LM4NIYE5.js";
|
|
11
|
-
import "../chunk-FQDHFTVR.js";
|
|
12
|
-
|
|
13
|
-
// src/x402/express.ts
|
|
14
|
-
import { paymentMiddlewareFromHTTPServer } from "@x402/express";
|
|
15
|
-
function belticPaymentMiddleware(beltic, routes, server, opts) {
|
|
16
|
-
return guardedPaymentMiddleware(
|
|
17
|
-
paymentMiddlewareFromHTTPServer,
|
|
18
|
-
beltic,
|
|
19
|
-
routes,
|
|
20
|
-
server,
|
|
21
|
-
opts
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
attachX402,
|
|
26
|
-
belticPaymentMiddleware
|
|
27
|
-
};
|