@belticlabs/agent-risk-sdk 0.1.0 → 0.1.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/dist/ai/index.d.ts +3 -3
- package/dist/ai/index.js +1 -1
- package/dist/{chunk-GCKCAKHA.js → chunk-46QN2KEZ.js} +199 -33
- package/dist/{chunk-YVMJ5CZX.js → chunk-W2OY7QXV.js} +1 -1
- package/dist/{client-CVx9LgJC.d.ts → client-NxpD_384.d.ts} +4 -3
- package/dist/index-Bjs3BPPU.d.ts +547 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +2 -2
- package/dist/mcp/index.d.ts +5 -4
- package/dist/mcp/index.js +1 -1
- package/dist/{middleware-_DSwvNIx.d.ts → middleware-D-ejQIoE.d.ts} +3 -3
- package/dist/protocol/index.d.ts +158 -0
- package/dist/protocol/index.js +152 -0
- package/dist/seller/anti-fraud-gateway.d.ts +5 -4
- package/dist/seller/anti-fraud-gateway.js +1 -1
- package/dist/{session-BMNB1N1g.d.ts → session-B2mfurae.d.ts} +14 -2
- package/dist/verdict-BAahb5po.d.ts +26 -0
- package/dist/x402/express.d.ts +7 -6
- package/dist/x402/express.js +2 -2
- package/dist/x402/hono.d.ts +7 -6
- package/dist/x402/hono.js +2 -2
- package/dist/x402/index.d.ts +6 -5
- package/dist/x402/index.js +2 -2
- package/package.json +5 -1
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { b as JsonValue, E as EvidenceSourceAll } from '../index-Bjs3BPPU.js';
|
|
2
|
+
export { A as ALL_SOURCES, c as ANOMALY_TYPES, d as Amount, e as AmountSchema, f as AnchorEntry, g as AnchorEntrySchema, h as AnchorsOutput, i as AnchorsOutputSchema, j as ApiError, k as ApiErrorSchema, C as ChainHead, l as ChainHeadSchema, m as CreatePolicyInput, n as CreatePolicyInputSchema, o as CreatePolicyOutput, p as CreatePolicyOutputSchema, q as CreateSessionInput, r as CreateSessionInputSchema, s as CreateSessionOutput, t as CreateSessionOutputSchema, D as Decision, u as DecisionSchema, v as DeclaredIntent, w as DeclaredIntentSchema, x as DigestedEnvelope, y as EvaluateInput, z as EvaluateInputSchema, B as EvaluateOutput, F as EvaluateOutputSchema, G as EventResult, H as EventResultSchema, I as EventResultStatus, K as EventResultStatusSchema, L as EvidenceAck, M as EvidenceAckSchema, N as EvidenceBatchInput, O as EvidenceBatchInputSchema, Q as EvidenceEnvelope, R as EvidenceEvent, S as EvidenceEventSchema, T as EvidenceKind, U as EvidenceKindSchema, V as EvidenceSource, W as EvidenceSourceAllSchema, X as EvidenceSourceSchema, Y as GatewayDecisionPayload, Z as GatewayDecisionPayloadSchema, _ as Hex64, $ as Hex64Schema, a0 as IntentDeclaredPayload, a1 as IntentDeclaredPayloadSchema, J as JsonObject, a2 as JsonValueSchema, a3 as LlmCallEndPayload, a4 as LlmCallEndPayloadSchema, a5 as LlmCallStartPayload, a6 as LlmCallStartPayloadSchema, a7 as MAX_BATCH_EVENTS, a8 as PAYMENT_ARTIFACTS, a9 as PLATFORM_KINDS, aa as PayloadByKind, P as PaymentMomentPayload, ab as PaymentMomentPayloadSchema, a as PaymentSummary, ac as PaymentSummarySchema, ad as PlatformAnomalyPayload, ae as PlatformAnomalyPayloadSchema, af as PlatformEvidenceKind, ag as PlatformEvidenceKindSchema, ah as PlatformObservationPayload, ai as PlatformObservationPayloadSchema, aj as SESSION_CLOSE_REASONS, ak as SOURCE_ORDER, al as SeqSchema, am as SessionClosePayload, an as SessionClosePayloadSchema, ao as SessionIdSchema, ap as SessionOpenPayload, aq as SessionOpenPayloadSchema, ar as Sig, as as SigSchema, at as TimestampSchema, au as ToolCallEndPayload, av as ToolCallEndPayloadSchema, aw as ToolCallStartPayload, ax as ToolCallStartPayloadSchema, ay as TransportGapPayload, az as TransportGapPayloadSchema, aA as WIRE_KINDS, aB as WIRE_SOURCES, aC as WireEvidenceKind, aD as WireEvidenceKindSchema, aE as compareBySessionSource, aF as compareBySourceSeq, aG as isPlatformKind, aH as isWireKind, aI as payloadSchemaFor } from '../index-Bjs3BPPU.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export { O as OnReview, V as Verdict } from '../verdict-BAahb5po.js';
|
|
5
|
+
|
|
6
|
+
declare const PRIMITIVES: readonly ["THRESHOLD", "MEMBERSHIP", "MATCH", "PRESENCE", "FRESHNESS"];
|
|
7
|
+
declare const PrimitiveSchema: z.ZodEnum<{
|
|
8
|
+
THRESHOLD: "THRESHOLD";
|
|
9
|
+
MEMBERSHIP: "MEMBERSHIP";
|
|
10
|
+
MATCH: "MATCH";
|
|
11
|
+
PRESENCE: "PRESENCE";
|
|
12
|
+
FRESHNESS: "FRESHNESS";
|
|
13
|
+
}>;
|
|
14
|
+
type Primitive = z.infer<typeof PrimitiveSchema>;
|
|
15
|
+
declare const RuleVerdictSchema: z.ZodEnum<{
|
|
16
|
+
DENY: "DENY";
|
|
17
|
+
REVIEW: "REVIEW";
|
|
18
|
+
}>;
|
|
19
|
+
type RuleVerdict = z.infer<typeof RuleVerdictSchema>;
|
|
20
|
+
/**
|
|
21
|
+
* Params are JSON; a string value of the form `@<selector>` is resolved
|
|
22
|
+
* against the session view before the primitive runs (GAP-24).
|
|
23
|
+
*/
|
|
24
|
+
declare const RuleSchema: z.ZodObject<{
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
primitive: z.ZodEnum<{
|
|
27
|
+
THRESHOLD: "THRESHOLD";
|
|
28
|
+
MEMBERSHIP: "MEMBERSHIP";
|
|
29
|
+
MATCH: "MATCH";
|
|
30
|
+
PRESENCE: "PRESENCE";
|
|
31
|
+
FRESHNESS: "FRESHNESS";
|
|
32
|
+
}>;
|
|
33
|
+
selector: z.ZodString;
|
|
34
|
+
params: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
35
|
+
onFail: z.ZodEnum<{
|
|
36
|
+
DENY: "DENY";
|
|
37
|
+
REVIEW: "REVIEW";
|
|
38
|
+
}>;
|
|
39
|
+
onMissing: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
DENY: "DENY";
|
|
41
|
+
REVIEW: "REVIEW";
|
|
42
|
+
skip: "skip";
|
|
43
|
+
}>>;
|
|
44
|
+
code: z.ZodString;
|
|
45
|
+
}, z.core.$strict>;
|
|
46
|
+
type Rule = z.infer<typeof RuleSchema>;
|
|
47
|
+
declare const PolicyRulesSchema: z.ZodObject<{
|
|
48
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
49
|
+
id: z.ZodString;
|
|
50
|
+
primitive: z.ZodEnum<{
|
|
51
|
+
THRESHOLD: "THRESHOLD";
|
|
52
|
+
MEMBERSHIP: "MEMBERSHIP";
|
|
53
|
+
MATCH: "MATCH";
|
|
54
|
+
PRESENCE: "PRESENCE";
|
|
55
|
+
FRESHNESS: "FRESHNESS";
|
|
56
|
+
}>;
|
|
57
|
+
selector: z.ZodString;
|
|
58
|
+
params: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
59
|
+
onFail: z.ZodEnum<{
|
|
60
|
+
DENY: "DENY";
|
|
61
|
+
REVIEW: "REVIEW";
|
|
62
|
+
}>;
|
|
63
|
+
onMissing: z.ZodOptional<z.ZodEnum<{
|
|
64
|
+
DENY: "DENY";
|
|
65
|
+
REVIEW: "REVIEW";
|
|
66
|
+
skip: "skip";
|
|
67
|
+
}>>;
|
|
68
|
+
code: z.ZodString;
|
|
69
|
+
}, z.core.$strict>>;
|
|
70
|
+
scoreThresholds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
71
|
+
}, z.core.$strict>;
|
|
72
|
+
type PolicyRules = z.infer<typeof PolicyRulesSchema>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Reason codes are the only thing that crosses the verdict boundary besides
|
|
76
|
+
* the verdict itself (Fraud Engine RFC › API: "the seller receives a verdict
|
|
77
|
+
* and reasons — never the record"). Three families, kept separate so the
|
|
78
|
+
* type system knows which layer may emit which.
|
|
79
|
+
*/
|
|
80
|
+
/** Static platform policy — may DENY alone (Fraud Engine RFC › Fraud indicators). */
|
|
81
|
+
declare const INDICATOR_CODES: readonly ["CHAIN_BROKEN", "EVIDENCE_MISMATCH", "CREDENTIAL_REVOKED", "SESSION_INVALID", "PRINCIPAL_FLAGGED"];
|
|
82
|
+
type IndicatorCode = (typeof INDICATOR_CODES)[number];
|
|
83
|
+
/**
|
|
84
|
+
* Annotations describe the floor the decision was made on. They never change
|
|
85
|
+
* a verdict by themselves — `NO_AGENT_TRACE` is "thinner evidence", priced by
|
|
86
|
+
* the owner's rules, not a denial (GAP-43).
|
|
87
|
+
*/
|
|
88
|
+
declare const ANNOTATION_CODES: readonly ["NO_AGENT_TRACE", "NO_POLICY"];
|
|
89
|
+
type AnnotationCode = (typeof ANNOTATION_CODES)[number];
|
|
90
|
+
/** Why the Collector refused or downgraded an event (per-event ack, GAP-17). */
|
|
91
|
+
declare const COLLECTOR_CODES: readonly ["SCHEMA_INVALID", "SESSION_UNKNOWN", "SESSION_CLOSED", "SESSION_EXPIRED", "SOURCE_FORBIDDEN", "KIND_FORBIDDEN", "SEQ_GAP", "PREV_HASH_MISMATCH", "SIG_MISSING", "SIG_INVALID", "PAYLOAD_INVALID", "EVENT_TOO_LARGE"];
|
|
92
|
+
type CollectorCode = (typeof COLLECTOR_CODES)[number];
|
|
93
|
+
/** Codes the platform default policy uses; owners may define their own (GAP-44). */
|
|
94
|
+
declare const DEFAULT_RULE_CODES: readonly ["CAP_EXCEEDED", "PAYEE_NOT_ALLOWED", "NO_INTENT", "INTENT_EXPIRED"];
|
|
95
|
+
type DefaultRuleCode = (typeof DEFAULT_RULE_CODES)[number];
|
|
96
|
+
type ReasonCode = IndicatorCode | AnnotationCode | DefaultRuleCode | (string & {});
|
|
97
|
+
declare const REASON_CODE_PATTERN: RegExp;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Selector language (GAP-24; answers Fraud Engine RFC › Open Questions ›
|
|
101
|
+
* "Selector language"). One grammar addresses everything a rule or a
|
|
102
|
+
* detector may read from the session's materialized view:
|
|
103
|
+
*
|
|
104
|
+
* selector := root path?
|
|
105
|
+
* root := 'payment' | 'intent' | 'session'
|
|
106
|
+
* | 'signal[name=' NAME ']'
|
|
107
|
+
* | 'evidence[kind=' KIND (',source=' SOURCE)? ']' ('[*]')?
|
|
108
|
+
* | 'evidence[*]'
|
|
109
|
+
* path := ('.' IDENT | '[' INT ']')*
|
|
110
|
+
*
|
|
111
|
+
* payment.* the payment under evaluation (EvaluateInput)
|
|
112
|
+
* intent.* the session's declared intent
|
|
113
|
+
* session.<field> id · status · agentDid · hasAgentTrace · expiresAt · sourceBorn
|
|
114
|
+
* signal[name=N] latest value of signal N (a detector's namespace, dotted)
|
|
115
|
+
* evidence[kind=K] latest payload of kind K (any source unless source= given)
|
|
116
|
+
* evidence[kind=K][*] every payload of kind K, in (source, seq) order
|
|
117
|
+
* evidence[*] every envelope (chain checks)
|
|
118
|
+
*
|
|
119
|
+
* Inside rule params, a string `@<selector>` is a reference resolved the
|
|
120
|
+
* same way. The grammar is deliberately not JSONPath: it names four roots
|
|
121
|
+
* and nothing else, so a policy cannot address what the RFC says the
|
|
122
|
+
* engine must not expose.
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
type PathSegment = {
|
|
126
|
+
key: string;
|
|
127
|
+
} | {
|
|
128
|
+
index: number;
|
|
129
|
+
};
|
|
130
|
+
type Selector = {
|
|
131
|
+
root: 'payment' | 'intent' | 'session';
|
|
132
|
+
path: PathSegment[];
|
|
133
|
+
} | {
|
|
134
|
+
root: 'signal';
|
|
135
|
+
name: string;
|
|
136
|
+
path: PathSegment[];
|
|
137
|
+
} | {
|
|
138
|
+
root: 'evidence';
|
|
139
|
+
kind: string | '*';
|
|
140
|
+
source?: EvidenceSourceAll;
|
|
141
|
+
all: boolean;
|
|
142
|
+
path: PathSegment[];
|
|
143
|
+
};
|
|
144
|
+
declare class SelectorSyntaxError extends Error {
|
|
145
|
+
readonly input: string;
|
|
146
|
+
readonly at: number;
|
|
147
|
+
readonly code = "SELECTOR_SYNTAX";
|
|
148
|
+
constructor(input: string, at: number, detail: string);
|
|
149
|
+
}
|
|
150
|
+
declare function parseSelector(input: string): Selector;
|
|
151
|
+
declare function formatSelector(sel: Selector): string;
|
|
152
|
+
declare function isSelectorRef(value: unknown): value is `@${string}`;
|
|
153
|
+
declare function parseSelectorRef(ref: string): Selector;
|
|
154
|
+
/** Walk a `path` over a value; `undefined` when any step is missing. */
|
|
155
|
+
declare function walkPath(value: unknown, path: readonly PathSegment[]): unknown;
|
|
156
|
+
declare const SelectorStringSchema: z.ZodString;
|
|
157
|
+
|
|
158
|
+
export { ANNOTATION_CODES, type AnnotationCode, COLLECTOR_CODES, type CollectorCode, DEFAULT_RULE_CODES, type DefaultRuleCode, EvidenceSourceAll, INDICATOR_CODES, type IndicatorCode, JsonValue, PRIMITIVES, type PathSegment, type PolicyRules, PolicyRulesSchema, type Primitive, PrimitiveSchema, REASON_CODE_PATTERN, type ReasonCode, type Rule, RuleSchema, type RuleVerdict, RuleVerdictSchema, type Selector, SelectorStringSchema, SelectorSyntaxError, formatSelector, isSelectorRef, parseSelector, parseSelectorRef, walkPath };
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ALL_SOURCES,
|
|
3
|
+
ANNOTATION_CODES,
|
|
4
|
+
ANOMALY_TYPES,
|
|
5
|
+
AmountSchema,
|
|
6
|
+
AnchorEntrySchema,
|
|
7
|
+
AnchorsOutputSchema,
|
|
8
|
+
ApiErrorSchema,
|
|
9
|
+
COLLECTOR_CODES,
|
|
10
|
+
ChainHeadSchema,
|
|
11
|
+
CreatePolicyInputSchema,
|
|
12
|
+
CreatePolicyOutputSchema,
|
|
13
|
+
CreateSessionInputSchema,
|
|
14
|
+
CreateSessionOutputSchema,
|
|
15
|
+
DEFAULT_RULE_CODES,
|
|
16
|
+
DecisionSchema,
|
|
17
|
+
DeclaredIntentSchema,
|
|
18
|
+
EvaluateInputSchema,
|
|
19
|
+
EvaluateOutputSchema,
|
|
20
|
+
EventResultSchema,
|
|
21
|
+
EventResultStatusSchema,
|
|
22
|
+
EvidenceAckSchema,
|
|
23
|
+
EvidenceBatchInputSchema,
|
|
24
|
+
EvidenceEventSchema,
|
|
25
|
+
EvidenceKindSchema,
|
|
26
|
+
EvidenceSourceAllSchema,
|
|
27
|
+
EvidenceSourceSchema,
|
|
28
|
+
GatewayDecisionPayloadSchema,
|
|
29
|
+
Hex64Schema,
|
|
30
|
+
INDICATOR_CODES,
|
|
31
|
+
IntentDeclaredPayloadSchema,
|
|
32
|
+
JsonValueSchema,
|
|
33
|
+
LlmCallEndPayloadSchema,
|
|
34
|
+
LlmCallStartPayloadSchema,
|
|
35
|
+
MAX_BATCH_EVENTS,
|
|
36
|
+
PAYMENT_ARTIFACTS,
|
|
37
|
+
PLATFORM_KINDS,
|
|
38
|
+
PRIMITIVES,
|
|
39
|
+
PaymentMomentPayloadSchema,
|
|
40
|
+
PaymentSummarySchema,
|
|
41
|
+
PlatformAnomalyPayloadSchema,
|
|
42
|
+
PlatformEvidenceKindSchema,
|
|
43
|
+
PlatformObservationPayloadSchema,
|
|
44
|
+
PolicyRulesSchema,
|
|
45
|
+
PrimitiveSchema,
|
|
46
|
+
REASON_CODE_PATTERN,
|
|
47
|
+
RuleSchema,
|
|
48
|
+
RuleVerdictSchema,
|
|
49
|
+
SESSION_CLOSE_REASONS,
|
|
50
|
+
SOURCE_ORDER,
|
|
51
|
+
SelectorStringSchema,
|
|
52
|
+
SelectorSyntaxError,
|
|
53
|
+
SeqSchema,
|
|
54
|
+
SessionClosePayloadSchema,
|
|
55
|
+
SessionIdSchema,
|
|
56
|
+
SessionOpenPayloadSchema,
|
|
57
|
+
SigSchema,
|
|
58
|
+
TimestampSchema,
|
|
59
|
+
ToolCallEndPayloadSchema,
|
|
60
|
+
ToolCallStartPayloadSchema,
|
|
61
|
+
TransportGapPayloadSchema,
|
|
62
|
+
Verdict,
|
|
63
|
+
WIRE_KINDS,
|
|
64
|
+
WIRE_SOURCES,
|
|
65
|
+
WireEvidenceKindSchema,
|
|
66
|
+
compareBySessionSource,
|
|
67
|
+
compareBySourceSeq,
|
|
68
|
+
formatSelector,
|
|
69
|
+
isPlatformKind,
|
|
70
|
+
isSelectorRef,
|
|
71
|
+
isWireKind,
|
|
72
|
+
parseSelector,
|
|
73
|
+
parseSelectorRef,
|
|
74
|
+
payloadSchemaFor,
|
|
75
|
+
walkPath
|
|
76
|
+
} from "../chunk-46QN2KEZ.js";
|
|
77
|
+
export {
|
|
78
|
+
ALL_SOURCES,
|
|
79
|
+
ANNOTATION_CODES,
|
|
80
|
+
ANOMALY_TYPES,
|
|
81
|
+
AmountSchema,
|
|
82
|
+
AnchorEntrySchema,
|
|
83
|
+
AnchorsOutputSchema,
|
|
84
|
+
ApiErrorSchema,
|
|
85
|
+
COLLECTOR_CODES,
|
|
86
|
+
ChainHeadSchema,
|
|
87
|
+
CreatePolicyInputSchema,
|
|
88
|
+
CreatePolicyOutputSchema,
|
|
89
|
+
CreateSessionInputSchema,
|
|
90
|
+
CreateSessionOutputSchema,
|
|
91
|
+
DEFAULT_RULE_CODES,
|
|
92
|
+
DecisionSchema,
|
|
93
|
+
DeclaredIntentSchema,
|
|
94
|
+
EvaluateInputSchema,
|
|
95
|
+
EvaluateOutputSchema,
|
|
96
|
+
EventResultSchema,
|
|
97
|
+
EventResultStatusSchema,
|
|
98
|
+
EvidenceAckSchema,
|
|
99
|
+
EvidenceBatchInputSchema,
|
|
100
|
+
EvidenceEventSchema,
|
|
101
|
+
EvidenceKindSchema,
|
|
102
|
+
EvidenceSourceAllSchema,
|
|
103
|
+
EvidenceSourceSchema,
|
|
104
|
+
GatewayDecisionPayloadSchema,
|
|
105
|
+
Hex64Schema,
|
|
106
|
+
INDICATOR_CODES,
|
|
107
|
+
IntentDeclaredPayloadSchema,
|
|
108
|
+
JsonValueSchema,
|
|
109
|
+
LlmCallEndPayloadSchema,
|
|
110
|
+
LlmCallStartPayloadSchema,
|
|
111
|
+
MAX_BATCH_EVENTS,
|
|
112
|
+
PAYMENT_ARTIFACTS,
|
|
113
|
+
PLATFORM_KINDS,
|
|
114
|
+
PRIMITIVES,
|
|
115
|
+
PaymentMomentPayloadSchema,
|
|
116
|
+
PaymentSummarySchema,
|
|
117
|
+
PlatformAnomalyPayloadSchema,
|
|
118
|
+
PlatformEvidenceKindSchema,
|
|
119
|
+
PlatformObservationPayloadSchema,
|
|
120
|
+
PolicyRulesSchema,
|
|
121
|
+
PrimitiveSchema,
|
|
122
|
+
REASON_CODE_PATTERN,
|
|
123
|
+
RuleSchema,
|
|
124
|
+
RuleVerdictSchema,
|
|
125
|
+
SESSION_CLOSE_REASONS,
|
|
126
|
+
SOURCE_ORDER,
|
|
127
|
+
SelectorStringSchema,
|
|
128
|
+
SelectorSyntaxError,
|
|
129
|
+
SeqSchema,
|
|
130
|
+
SessionClosePayloadSchema,
|
|
131
|
+
SessionIdSchema,
|
|
132
|
+
SessionOpenPayloadSchema,
|
|
133
|
+
SigSchema,
|
|
134
|
+
TimestampSchema,
|
|
135
|
+
ToolCallEndPayloadSchema,
|
|
136
|
+
ToolCallStartPayloadSchema,
|
|
137
|
+
TransportGapPayloadSchema,
|
|
138
|
+
Verdict,
|
|
139
|
+
WIRE_KINDS,
|
|
140
|
+
WIRE_SOURCES,
|
|
141
|
+
WireEvidenceKindSchema,
|
|
142
|
+
compareBySessionSource,
|
|
143
|
+
compareBySourceSeq,
|
|
144
|
+
formatSelector,
|
|
145
|
+
isPlatformKind,
|
|
146
|
+
isSelectorRef,
|
|
147
|
+
isWireKind,
|
|
148
|
+
parseSelector,
|
|
149
|
+
parseSelectorRef,
|
|
150
|
+
payloadSchemaFor,
|
|
151
|
+
walkPath
|
|
152
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { B as Beltic } from '../client-
|
|
2
|
-
import '
|
|
3
|
-
import '
|
|
4
|
-
import '
|
|
1
|
+
import { B as Beltic } from '../client-NxpD_384.js';
|
|
2
|
+
import '../index-Bjs3BPPU.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import '../verdict-BAahb5po.js';
|
|
5
|
+
import '../session-B2mfurae.js';
|
|
5
6
|
|
|
6
7
|
interface PaymentRiskContext {
|
|
7
8
|
wallet: string;
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { L as EvidenceAck, G as EventResult, R as EvidenceEvent, V as EvidenceSource, aC as WireEvidenceKind, J as JsonObject, C as ChainHead, aa as PayloadByKind, am as SessionClosePayload, v as DeclaredIntent } from './index-Bjs3BPPU.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The edge signs event digests (Fraud SDK RFC › Modules › Identity Module);
|
|
5
|
+
* the platform signs its own PLATFORM chain and epoch anchors. Both are the
|
|
6
|
+
* same operation over different keys, so one interface.
|
|
7
|
+
*/
|
|
8
|
+
interface Signer {
|
|
9
|
+
/** Raw 32-byte Ed25519 public key. */
|
|
10
|
+
readonly publicKey: Uint8Array;
|
|
11
|
+
/** Stable identifier for logs and key rotation; `did:key` for agents. */
|
|
12
|
+
readonly keyId: string;
|
|
13
|
+
sign(message: Uint8Array): Promise<Uint8Array>;
|
|
14
|
+
}
|
|
3
15
|
|
|
4
16
|
interface ApiClientOptions {
|
|
5
17
|
baseUrl: string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { D as Decision } from './index-Bjs3BPPU.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The verdict as a value (Fraud Engine RFC › API: ALLOW | DENY | REVIEW).
|
|
5
|
+
* Layers combine by severity (GAP-45); a synchronous seller hook turns
|
|
6
|
+
* REVIEW into a stop or a pass according to its `onReview` (GAP-52). Both
|
|
7
|
+
* halves of the SDK and the engine share this one rule.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
type OnReview = 'abort' | 'allow';
|
|
11
|
+
declare class Verdict {
|
|
12
|
+
readonly value: Decision;
|
|
13
|
+
private constructor();
|
|
14
|
+
static readonly ALLOW: Verdict;
|
|
15
|
+
static readonly REVIEW: Verdict;
|
|
16
|
+
static readonly DENY: Verdict;
|
|
17
|
+
static of(value: Decision): Verdict;
|
|
18
|
+
/** The more severe of the two. */
|
|
19
|
+
atLeast(other: Verdict | Decision): Verdict;
|
|
20
|
+
/** Whether a synchronous gate must stop the call (GAP-52). */
|
|
21
|
+
blocks(onReview: OnReview): boolean;
|
|
22
|
+
/** What the gate effectively did: DENY when it blocked, else the verdict itself. */
|
|
23
|
+
effective(onReview: OnReview): Decision;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { type OnReview as O, Verdict as V };
|
package/dist/x402/express.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { RoutesConfig, x402ResourceServer } from '@x402/core/server';
|
|
2
2
|
import { RequestHandler } from 'express';
|
|
3
|
-
import { B as Beltic } from '../client-
|
|
4
|
-
import { G as GuardedMiddlewareOptions } from '../middleware-
|
|
5
|
-
export { a as attachX402 } from '../middleware-
|
|
6
|
-
import '
|
|
7
|
-
import '
|
|
8
|
-
import '
|
|
3
|
+
import { B as Beltic } from '../client-NxpD_384.js';
|
|
4
|
+
import { G as GuardedMiddlewareOptions } from '../middleware-D-ejQIoE.js';
|
|
5
|
+
export { a as attachX402 } from '../middleware-D-ejQIoE.js';
|
|
6
|
+
import '../index-Bjs3BPPU.js';
|
|
7
|
+
import 'zod';
|
|
8
|
+
import '../verdict-BAahb5po.js';
|
|
9
|
+
import '../session-B2mfurae.js';
|
|
9
10
|
|
|
10
11
|
/** Seller half for express: `@x402/express`'s payment middleware with the Beltic hooks attached. */
|
|
11
12
|
|
package/dist/x402/express.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attachX402,
|
|
3
3
|
guardedPaymentMiddleware
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-W2OY7QXV.js";
|
|
5
5
|
import "../chunk-VM7MK43J.js";
|
|
6
6
|
import "../chunk-SFGM7KOG.js";
|
|
7
7
|
import "../chunk-U5Z5Z2BQ.js";
|
|
8
8
|
import "../chunk-7G5EHNVW.js";
|
|
9
9
|
import "../chunk-FQDHFTVR.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-46QN2KEZ.js";
|
|
11
11
|
|
|
12
12
|
// src/x402/express.ts
|
|
13
13
|
import { paymentMiddlewareFromHTTPServer } from "@x402/express";
|
package/dist/x402/hono.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { RoutesConfig, x402ResourceServer } from '@x402/core/server';
|
|
2
2
|
import { MiddlewareHandler } from 'hono';
|
|
3
|
-
import { B as Beltic } from '../client-
|
|
4
|
-
import { G as GuardedMiddlewareOptions } from '../middleware-
|
|
5
|
-
export { a as attachX402 } from '../middleware-
|
|
6
|
-
import '
|
|
7
|
-
import '
|
|
8
|
-
import '
|
|
3
|
+
import { B as Beltic } from '../client-NxpD_384.js';
|
|
4
|
+
import { G as GuardedMiddlewareOptions } from '../middleware-D-ejQIoE.js';
|
|
5
|
+
export { a as attachX402 } from '../middleware-D-ejQIoE.js';
|
|
6
|
+
import '../index-Bjs3BPPU.js';
|
|
7
|
+
import 'zod';
|
|
8
|
+
import '../verdict-BAahb5po.js';
|
|
9
|
+
import '../session-B2mfurae.js';
|
|
9
10
|
|
|
10
11
|
/** Seller half for hono: `@x402/hono`'s payment middleware with the Beltic hooks attached. */
|
|
11
12
|
|
package/dist/x402/hono.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attachX402,
|
|
3
3
|
guardedPaymentMiddleware
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-W2OY7QXV.js";
|
|
5
5
|
import "../chunk-VM7MK43J.js";
|
|
6
6
|
import "../chunk-SFGM7KOG.js";
|
|
7
7
|
import "../chunk-U5Z5Z2BQ.js";
|
|
8
8
|
import "../chunk-7G5EHNVW.js";
|
|
9
9
|
import "../chunk-FQDHFTVR.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-46QN2KEZ.js";
|
|
11
11
|
|
|
12
12
|
// src/x402/hono.ts
|
|
13
13
|
import { paymentMiddlewareFromHTTPServer } from "@x402/hono";
|
package/dist/x402/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export { A as AttachOptions, b as AttachedX402, C as CorrelationContext, G as GuardedMiddlewareOptions, a as attachX402, g as guardedPaymentMiddleware } from '../middleware-
|
|
2
|
-
import { S as Session } from '../session-
|
|
3
|
-
import { PaymentMomentPayload, JsonObject } from '
|
|
1
|
+
export { A as AttachOptions, b as AttachedX402, C as CorrelationContext, G as GuardedMiddlewareOptions, a as attachX402, g as guardedPaymentMiddleware } from '../middleware-D-ejQIoE.js';
|
|
2
|
+
import { S as Session } from '../session-B2mfurae.js';
|
|
3
|
+
import { P as PaymentMomentPayload, J as JsonObject } from '../index-Bjs3BPPU.js';
|
|
4
4
|
import { PaymentPayload, PaymentRequired, PaymentRequirements } from '@x402/core/types';
|
|
5
5
|
import '@x402/core/server';
|
|
6
|
-
import '../client-
|
|
7
|
-
import '
|
|
6
|
+
import '../client-NxpD_384.js';
|
|
7
|
+
import '../verdict-BAahb5po.js';
|
|
8
|
+
import 'zod';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Session binding on the x402 rail (Fraud SDK RFC › Protocol Adapter — x402:
|
package/dist/x402/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attachX402,
|
|
3
3
|
guardedPaymentMiddleware
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-W2OY7QXV.js";
|
|
5
5
|
import {
|
|
6
6
|
SESSION_EXTENSION,
|
|
7
7
|
SESSION_HEADER,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "../chunk-U5Z5Z2BQ.js";
|
|
16
16
|
import "../chunk-7G5EHNVW.js";
|
|
17
17
|
import "../chunk-FQDHFTVR.js";
|
|
18
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-46QN2KEZ.js";
|
|
19
19
|
|
|
20
20
|
// src/x402/fetch.ts
|
|
21
21
|
import {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@belticlabs/agent-risk-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "The Beltic Agent Risk SDK — one client, two halves: instrument the buyer agent (AI SDK, x402 fetch, MCP client) and guard the seller boundary (x402, MCP server, evaluate).",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"default": "./dist/index.js"
|
|
18
18
|
},
|
|
19
|
+
"./protocol": {
|
|
20
|
+
"types": "./dist/protocol/index.d.ts",
|
|
21
|
+
"default": "./dist/protocol/index.js"
|
|
22
|
+
},
|
|
19
23
|
"./ai": {
|
|
20
24
|
"types": "./dist/ai/index.d.ts",
|
|
21
25
|
"default": "./dist/ai/index.js"
|