@belticlabs/agent-risk-sdk 0.1.1 → 0.2.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/{middleware-D-ejQIoE.d.ts → adapter-CF-cUYSA.d.ts} +4 -16
- package/dist/ai/index.d.ts +4 -4
- package/dist/ai/index.js +4 -3
- package/dist/chunk-GSH5APZW.js +39 -0
- package/dist/{chunk-U5Z5Z2BQ.js → chunk-LM4NIYE5.js} +26 -20
- package/dist/{chunk-W2OY7QXV.js → chunk-SO6HPRJT.js} +10 -23
- package/dist/chunk-U7HM37CB.js +17 -0
- package/dist/client-C-mV_3A0.d.ts +91 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.js +117 -16
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +11 -8
- package/dist/middleware-BwAYpBTl.d.ts +15 -0
- package/dist/seller/anti-fraud-gateway.d.ts +11 -2
- package/dist/seller/anti-fraud-gateway.js +13 -14
- package/dist/{session-B2mfurae.d.ts → session-5TClPLI4.d.ts} +57 -3
- package/dist/x402/express.d.ts +4 -4
- package/dist/x402/express.js +6 -5
- package/dist/x402/hono.d.ts +4 -4
- package/dist/x402/hono.js +6 -5
- package/dist/x402/index.d.ts +93 -18
- package/dist/x402/index.js +83 -32
- package/package.json +1 -1
- package/dist/chunk-5TWO73OD.js +0 -35
- package/dist/client-NxpD_384.d.ts +0 -64
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { a as PaymentSummary, B as EvaluateOutput } from './index-Bjs3BPPU.js';
|
|
2
|
-
import { O as OnReview } from './verdict-BAahb5po.js';
|
|
3
|
-
import { a as ApiClient, T as Transport, d as Sessions, A as AgentIdentity, b as ApiClientOptions, g as TransportOptions, R as RedactFn } from './session-B2mfurae.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Correlation without binding (Fraud SDK RFC › Protocol Adapter — x402:
|
|
7
|
-
* "binding travels on the call that initiates the purchase, not
|
|
8
|
-
* necessarily on the payment artifact"). The merchant binds a key it will
|
|
9
|
-
* see again (a checkout session id, a challenge nonce) to the buyer's
|
|
10
|
-
* session; the adapter resolves it when the settlement arrives (GAP-31).
|
|
11
|
-
*/
|
|
12
|
-
interface CorrelationStore {
|
|
13
|
-
bind(key: string, sessionId: string, ttlMs?: number): Promise<void>;
|
|
14
|
-
resolve(key: string): Promise<string | null>;
|
|
15
|
-
}
|
|
16
|
-
declare class MemoryCorrelationStore implements CorrelationStore {
|
|
17
|
-
private readonly defaultTtlMs;
|
|
18
|
-
private readonly entries;
|
|
19
|
-
constructor(defaultTtlMs?: number);
|
|
20
|
-
bind(key: string, sessionId: string, ttlMs?: number): Promise<void>;
|
|
21
|
-
resolve(key: string): Promise<string | null>;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* One SDK, two halves (Fraud SDK RFC › Summary). `Beltic` is the single
|
|
26
|
-
* client: sessions and evidence for both halves, `evaluate` for the seller
|
|
27
|
-
* half. Protocol integrations are plain functions behind subpath exports,
|
|
28
|
-
* each pulling exactly one optional peer:
|
|
29
|
-
*
|
|
30
|
-
* @belticlabs/agent-risk-sdk/ai → middleware(session), wrapTools(session, …)
|
|
31
|
-
* @belticlabs/agent-risk-sdk/x402 → belticFetch(session), attachX402(beltic, …)
|
|
32
|
-
* @belticlabs/agent-risk-sdk/hono → belticPaymentMiddleware(beltic, …) (and /express)
|
|
33
|
-
* @belticlabs/agent-risk-sdk/mcp → wrapClient(session, …), wrapServer(beltic, …)
|
|
34
|
-
*
|
|
35
|
-
* Neither half decides risk locally: verdicts are platform-side.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
declare const SDK_VERSION = "0.1.1";
|
|
39
|
-
interface BelticOptions extends Omit<ApiClientOptions, 'userAgent'> {
|
|
40
|
-
/** Buyer half. Without it, `sessions.start` is unavailable; the seller half works. */
|
|
41
|
-
identity?: AgentIdentity | undefined;
|
|
42
|
-
transport?: Partial<TransportOptions> | undefined;
|
|
43
|
-
/** What a synchronous seller hook does with REVIEW (GAP-52). */
|
|
44
|
-
onReview?: OnReview | undefined;
|
|
45
|
-
correlation?: CorrelationStore | undefined;
|
|
46
|
-
redact?: RedactFn | undefined;
|
|
47
|
-
now?: (() => Date) | undefined;
|
|
48
|
-
}
|
|
49
|
-
declare class Beltic {
|
|
50
|
-
readonly api: ApiClient;
|
|
51
|
-
readonly transport: Transport;
|
|
52
|
-
readonly sessions: Sessions;
|
|
53
|
-
readonly identity: AgentIdentity | undefined;
|
|
54
|
-
readonly correlation: CorrelationStore;
|
|
55
|
-
readonly onReview: OnReview;
|
|
56
|
-
constructor(opts: BelticOptions);
|
|
57
|
-
/** Read-your-writes: the platform must hold the evidence before it judges it (GAP-16). */
|
|
58
|
-
evaluate(sessionId: string, payment: PaymentSummary): Promise<EvaluateOutput>;
|
|
59
|
-
flush(): Promise<void>;
|
|
60
|
-
shutdown(): Promise<void>;
|
|
61
|
-
}
|
|
62
|
-
declare function createBeltic(opts: BelticOptions): Beltic;
|
|
63
|
-
|
|
64
|
-
export { Beltic as B, type CorrelationStore as C, MemoryCorrelationStore as M, SDK_VERSION as S, type BelticOptions as a, createBeltic as c };
|