@belticlabs/agent-risk-sdk 0.5.0 → 0.7.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/ai/index.d.ts +6 -16
- package/dist/ai/index.js +30 -41
- package/dist/{chunk-4BUUPU3O.js → chunk-FNU4CRJJ.js} +218 -229
- package/dist/{chunk-GM4KEEZB.js → chunk-HI656UWG.js} +34 -55
- package/dist/chunk-JGVVQUXQ.js +38 -0
- package/dist/chunk-M4I3FGZG.js +13 -0
- package/dist/{chunk-X3W2Z5GC.js → chunk-UXXSE643.js} +25 -23
- package/dist/client-Xn9M58OJ.d.ts +71 -0
- package/dist/{verdict-DMnbFuS5.d.ts → index-DAVKGJs5.d.ts} +129 -162
- package/dist/index.d.ts +3 -2
- package/dist/index.js +714 -190
- package/dist/protocol/index.d.ts +66 -22
- package/dist/protocol/index.js +19 -85
- package/dist/session-DAN29XoB.d.ts +380 -0
- package/dist/x402/hono.d.ts +5 -17
- package/dist/x402/hono.js +8 -14
- package/dist/x402/index.d.ts +11 -43
- package/dist/x402/index.js +42 -53
- package/package.json +1 -1
- package/dist/adapter-DEdhsNt-.d.ts +0 -22
- package/dist/chunk-JSE6JQJC.js +0 -530
- package/dist/session-D9E-efc0.d.ts +0 -462
|
@@ -13,7 +13,6 @@ import { z } from 'zod';
|
|
|
13
13
|
* GAP-08 names the internal kinds it carries.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
declare const WIRE_SOURCES: readonly ["AGENT_TRACE", "INTERNAL_NETWORK"];
|
|
17
16
|
declare const ALL_SOURCES: readonly ["AGENT_TRACE", "INTERNAL_NETWORK", "PLATFORM"];
|
|
18
17
|
declare const EvidenceSourceSchema: z.ZodEnum<{
|
|
19
18
|
AGENT_TRACE: "AGENT_TRACE";
|
|
@@ -36,22 +35,50 @@ declare function compareBySourceSeq(a: {
|
|
|
36
35
|
source: EvidenceSourceAll;
|
|
37
36
|
seq: number;
|
|
38
37
|
}): number;
|
|
39
|
-
/**
|
|
40
|
-
declare function
|
|
38
|
+
/** One chain's key wherever heads are reported: `sessionId:source`. */
|
|
39
|
+
declare function chainKey(sessionId: string, source: EvidenceSourceAll): string;
|
|
40
|
+
/**
|
|
41
|
+
* The order a conversation is read in: when it happened, when the platform
|
|
42
|
+
* saw it, then by chain and seq — the one order that interleaves the
|
|
43
|
+
* chains of every session of a conversation (GAP-84).
|
|
44
|
+
*/
|
|
45
|
+
declare function compareByArrival(a: {
|
|
46
|
+
ts: string;
|
|
47
|
+
receivedAt: string;
|
|
41
48
|
sessionId: string;
|
|
42
49
|
source: EvidenceSourceAll;
|
|
50
|
+
seq: number;
|
|
43
51
|
}, b: {
|
|
52
|
+
ts: string;
|
|
53
|
+
receivedAt: string;
|
|
44
54
|
sessionId: string;
|
|
45
55
|
source: EvidenceSourceAll;
|
|
56
|
+
seq: number;
|
|
46
57
|
}): number;
|
|
58
|
+
/** The root of a conversation before its members; a store then orders the members its own way. */
|
|
59
|
+
declare function compareRootFirst(conversationId: string): (a: {
|
|
60
|
+
id: string;
|
|
61
|
+
}, b: {
|
|
62
|
+
id: string;
|
|
63
|
+
}) => number;
|
|
47
64
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
65
|
+
* Whether a row is inside the heads a decision pinned (replay): its chain
|
|
66
|
+
* is among them and its seq is at or below that head. A chain the decision
|
|
67
|
+
* never saw is outside.
|
|
51
68
|
*/
|
|
52
|
-
declare
|
|
53
|
-
|
|
54
|
-
|
|
69
|
+
declare function withinHeads(heads: Readonly<Record<string, number>>): (e: {
|
|
70
|
+
sessionId: string;
|
|
71
|
+
source: EvidenceSourceAll;
|
|
72
|
+
seq: number;
|
|
73
|
+
}) => boolean;
|
|
74
|
+
/** Commitments across sessions: by sessionId, then source. */
|
|
75
|
+
declare function compareBySessionSource(a: {
|
|
76
|
+
sessionId: string;
|
|
77
|
+
source: EvidenceSourceAll;
|
|
78
|
+
}, b: {
|
|
79
|
+
sessionId: string;
|
|
80
|
+
source: EvidenceSourceAll;
|
|
81
|
+
}): number;
|
|
55
82
|
declare const WireEvidenceKindSchema: z.ZodEnum<{
|
|
56
83
|
"session.open": "session.open";
|
|
57
84
|
"session.close": "session.close";
|
|
@@ -93,8 +120,15 @@ type Hex64 = z.infer<typeof Hex64Schema>;
|
|
|
93
120
|
/** `ed25519:` + base64url (no padding) of a 64-byte signature (GAP-03). */
|
|
94
121
|
declare const SigSchema: z.ZodString;
|
|
95
122
|
type Sig = z.infer<typeof SigSchema>;
|
|
96
|
-
|
|
97
|
-
|
|
123
|
+
/**
|
|
124
|
+
* The public session id: what every event, ack, evaluate and binding
|
|
125
|
+
* names, and the only form the wire accepts. Minted by the platform
|
|
126
|
+
* (`sess_` + 22 base62 chars, 128 bits); the uuid primary key never
|
|
127
|
+
* leaves persistence (GAP-86).
|
|
128
|
+
*/
|
|
129
|
+
declare const SESSION_ID_PREFIX = "sess_";
|
|
130
|
+
declare const SESSION_ID_CHARS = 22;
|
|
131
|
+
declare const SessionIdSchema: z.ZodString;
|
|
98
132
|
declare const TimestampSchema: z.ZodISODateTime;
|
|
99
133
|
/** JSON value that survives RFC 8785 canonicalization unchanged. */
|
|
100
134
|
declare const JsonValueSchema: z.ZodType<JsonValue>;
|
|
@@ -105,7 +139,7 @@ type JsonObject = {
|
|
|
105
139
|
[key: string]: JsonValue;
|
|
106
140
|
};
|
|
107
141
|
declare const EvidenceEventSchema: z.ZodObject<{
|
|
108
|
-
sessionId: z.
|
|
142
|
+
sessionId: z.ZodString;
|
|
109
143
|
source: z.ZodEnum<{
|
|
110
144
|
AGENT_TRACE: "AGENT_TRACE";
|
|
111
145
|
INTERNAL_NETWORK: "INTERNAL_NETWORK";
|
|
@@ -154,14 +188,7 @@ interface ChainHead {
|
|
|
154
188
|
seq: number;
|
|
155
189
|
digest: Hex64;
|
|
156
190
|
}
|
|
157
|
-
declare function isWireKind(kind: string): kind is WireEvidenceKind;
|
|
158
|
-
declare function isPlatformKind(kind: string): kind is PlatformEvidenceKind;
|
|
159
191
|
|
|
160
|
-
declare const AmountSchema: z.ZodObject<{
|
|
161
|
-
value: z.ZodString;
|
|
162
|
-
currency: z.ZodString;
|
|
163
|
-
}, z.core.$strict>;
|
|
164
|
-
type Amount = z.infer<typeof AmountSchema>;
|
|
165
192
|
declare const DeclaredIntentSchema: z.ZodObject<{
|
|
166
193
|
mandate: z.ZodString;
|
|
167
194
|
maxAmount: z.ZodOptional<z.ZodObject<{
|
|
@@ -190,94 +217,41 @@ declare const CreateSessionInputSchema: z.ZodObject<{
|
|
|
190
217
|
merchantAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
191
218
|
validUntil: z.ZodISODateTime;
|
|
192
219
|
}, z.core.$strict>>;
|
|
220
|
+
resume: z.ZodOptional<z.ZodString>;
|
|
193
221
|
}, z.core.$strict>;
|
|
194
222
|
type CreateSessionInput = z.infer<typeof CreateSessionInputSchema>;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
223
|
+
/** The conversation's last prompt as a base for deltas: the call it was recorded on, one digest per message (GAP-89). */
|
|
224
|
+
interface PromptBase {
|
|
225
|
+
prior: string;
|
|
226
|
+
digests: Hex64[];
|
|
227
|
+
}
|
|
228
|
+
interface CreateSessionOutput {
|
|
229
|
+
/** This session's public id — the `sessionId` of its events and of the x402 binding (GAP-86). */
|
|
230
|
+
sessionId: string;
|
|
231
|
+
/** The conversation this session belongs to: the root's public id, stable across resumes (GAP-84). */
|
|
232
|
+
conversationId: string;
|
|
233
|
+
expiresAt: string;
|
|
234
|
+
/** On a resume: the base the next `llm_call.start` may ship a delta against (GAP-89). */
|
|
235
|
+
prompt?: PromptBase;
|
|
236
|
+
}
|
|
200
237
|
declare const MAX_BATCH_EVENTS = 500;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
source: z.ZodEnum<{
|
|
204
|
-
AGENT_TRACE: "AGENT_TRACE";
|
|
205
|
-
INTERNAL_NETWORK: "INTERNAL_NETWORK";
|
|
206
|
-
}>;
|
|
207
|
-
seq: z.ZodNumber;
|
|
208
|
-
ts: z.ZodISODateTime;
|
|
209
|
-
kind: z.ZodEnum<{
|
|
210
|
-
"session.open": "session.open";
|
|
211
|
-
"session.close": "session.close";
|
|
212
|
-
"intent.declared": "intent.declared";
|
|
213
|
-
"llm_call.start": "llm_call.start";
|
|
214
|
-
"llm_call.end": "llm_call.end";
|
|
215
|
-
"tool_call.start": "tool_call.start";
|
|
216
|
-
"tool_call.end": "tool_call.end";
|
|
217
|
-
"payment.requested": "payment.requested";
|
|
218
|
-
"payment.presented": "payment.presented";
|
|
219
|
-
"gateway.decision": "gateway.decision";
|
|
220
|
-
"transport.gap": "transport.gap";
|
|
221
|
-
}>;
|
|
222
|
-
payload: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
223
|
-
prevHash: z.ZodString;
|
|
224
|
-
sig: z.ZodOptional<z.ZodString>;
|
|
225
|
-
}, z.core.$strict>>;
|
|
226
|
-
type EvidenceBatchInput = z.infer<typeof EvidenceBatchInputSchema>;
|
|
227
|
-
declare const EventResultStatusSchema: z.ZodEnum<{
|
|
228
|
-
ok: "ok";
|
|
229
|
-
duplicate: "duplicate";
|
|
230
|
-
fork: "fork";
|
|
231
|
-
rejected: "rejected";
|
|
232
|
-
}>;
|
|
233
|
-
type EventResultStatus = z.infer<typeof EventResultStatusSchema>;
|
|
238
|
+
/** The batch as the route takes it; each event is judged on its own by the Collector, with its own result (GAP-17). */
|
|
239
|
+
declare const EvidenceBatchInputSchema: z.ZodArray<z.ZodUnknown>;
|
|
234
240
|
/** Per-event outcome of a batch (GAP-17). `seq` is null when the event could not be parsed. */
|
|
235
|
-
|
|
236
|
-
index:
|
|
237
|
-
sessionId:
|
|
238
|
-
source:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
code: z.ZodOptional<z.ZodString>;
|
|
250
|
-
eventDigest: z.ZodOptional<z.ZodString>;
|
|
251
|
-
}, z.core.$strict>;
|
|
252
|
-
type EventResult = z.infer<typeof EventResultSchema>;
|
|
253
|
-
declare const ChainHeadSchema: z.ZodObject<{
|
|
254
|
-
seq: z.ZodNumber;
|
|
255
|
-
digest: z.ZodString;
|
|
256
|
-
}, z.core.$strict>;
|
|
257
|
-
declare const EvidenceAckSchema: z.ZodObject<{
|
|
258
|
-
results: z.ZodArray<z.ZodObject<{
|
|
259
|
-
index: z.ZodNumber;
|
|
260
|
-
sessionId: z.ZodNullable<z.ZodUUID>;
|
|
261
|
-
source: z.ZodNullable<z.ZodEnum<{
|
|
262
|
-
AGENT_TRACE: "AGENT_TRACE";
|
|
263
|
-
INTERNAL_NETWORK: "INTERNAL_NETWORK";
|
|
264
|
-
}>>;
|
|
265
|
-
seq: z.ZodNullable<z.ZodNumber>;
|
|
266
|
-
status: z.ZodEnum<{
|
|
267
|
-
ok: "ok";
|
|
268
|
-
duplicate: "duplicate";
|
|
269
|
-
fork: "fork";
|
|
270
|
-
rejected: "rejected";
|
|
271
|
-
}>;
|
|
272
|
-
code: z.ZodOptional<z.ZodString>;
|
|
273
|
-
eventDigest: z.ZodOptional<z.ZodString>;
|
|
274
|
-
}, z.core.$strict>>;
|
|
275
|
-
heads: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
276
|
-
seq: z.ZodNumber;
|
|
277
|
-
digest: z.ZodString;
|
|
278
|
-
}, z.core.$strict>>;
|
|
279
|
-
}, z.core.$strict>;
|
|
280
|
-
type EvidenceAck = z.infer<typeof EvidenceAckSchema>;
|
|
241
|
+
interface EventResult {
|
|
242
|
+
index: number;
|
|
243
|
+
sessionId: string | null;
|
|
244
|
+
source: EvidenceSource | null;
|
|
245
|
+
seq: number | null;
|
|
246
|
+
status: 'ok' | 'duplicate' | 'fork' | 'rejected';
|
|
247
|
+
code?: string;
|
|
248
|
+
eventDigest?: Hex64;
|
|
249
|
+
}
|
|
250
|
+
interface EvidenceAck {
|
|
251
|
+
results: EventResult[];
|
|
252
|
+
/** Head of every chain touched by the batch, after the batch. Keyed `sessionId:source`. */
|
|
253
|
+
heads: Record<string, ChainHead>;
|
|
254
|
+
}
|
|
281
255
|
declare const PaymentSummarySchema: z.ZodObject<{
|
|
282
256
|
protocol: z.ZodString;
|
|
283
257
|
payee: z.ZodString;
|
|
@@ -289,7 +263,7 @@ declare const PaymentSummarySchema: z.ZodObject<{
|
|
|
289
263
|
}, z.core.$strict>;
|
|
290
264
|
type PaymentSummary = z.infer<typeof PaymentSummarySchema>;
|
|
291
265
|
declare const EvaluateInputSchema: z.ZodObject<{
|
|
292
|
-
sessionId: z.
|
|
266
|
+
sessionId: z.ZodString;
|
|
293
267
|
payment: z.ZodObject<{
|
|
294
268
|
protocol: z.ZodString;
|
|
295
269
|
payee: z.ZodString;
|
|
@@ -299,25 +273,17 @@ declare const EvaluateInputSchema: z.ZodObject<{
|
|
|
299
273
|
}, z.core.$strict>;
|
|
300
274
|
payer: z.ZodOptional<z.ZodString>;
|
|
301
275
|
}, z.core.$strict>;
|
|
276
|
+
callId: z.ZodOptional<z.ZodString>;
|
|
302
277
|
}, z.core.$strict>;
|
|
303
278
|
type EvaluateInput = z.infer<typeof EvaluateInputSchema>;
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
DENY: "DENY";
|
|
313
|
-
REVIEW: "REVIEW";
|
|
314
|
-
ALLOW: "ALLOW";
|
|
315
|
-
}>;
|
|
316
|
-
reasonCodes: z.ZodArray<z.ZodString>;
|
|
317
|
-
sessionId: z.ZodUUID;
|
|
318
|
-
decisionId: z.ZodUUID;
|
|
319
|
-
}, z.core.$strict>;
|
|
320
|
-
type EvaluateOutput = z.infer<typeof EvaluateOutputSchema>;
|
|
279
|
+
type Decision = 'ALLOW' | 'DENY' | 'REVIEW';
|
|
280
|
+
interface EvaluateOutput {
|
|
281
|
+
decision: Decision;
|
|
282
|
+
reasonCodes: string[];
|
|
283
|
+
sessionId: string;
|
|
284
|
+
/** Additive (GAP-21). */
|
|
285
|
+
decisionId: string;
|
|
286
|
+
}
|
|
321
287
|
/** Non-RFC admin surface (GAP-53). */
|
|
322
288
|
declare const CreatePolicyInputSchema: z.ZodObject<{
|
|
323
289
|
rules: z.ZodObject<{
|
|
@@ -343,20 +309,13 @@ declare const CreatePolicyInputSchema: z.ZodObject<{
|
|
|
343
309
|
}>>;
|
|
344
310
|
code: z.ZodString;
|
|
345
311
|
}, z.core.$strict>>;
|
|
346
|
-
scoreThresholds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
347
312
|
}, z.core.$strict>;
|
|
348
313
|
}, z.core.$strict>;
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
ACTIVE: "ACTIVE";
|
|
355
|
-
SUPERSEDED: "SUPERSEDED";
|
|
356
|
-
DRAFT: "DRAFT";
|
|
357
|
-
}>;
|
|
358
|
-
}, z.core.$strict>;
|
|
359
|
-
type CreatePolicyOutput = z.infer<typeof CreatePolicyOutputSchema>;
|
|
314
|
+
interface CreatePolicyOutput {
|
|
315
|
+
policyId: string;
|
|
316
|
+
version: number;
|
|
317
|
+
status: 'ACTIVE' | 'SUPERSEDED' | 'DRAFT';
|
|
318
|
+
}
|
|
360
319
|
/** Error envelope (GAP-20). */
|
|
361
320
|
declare const ApiErrorSchema: z.ZodObject<{
|
|
362
321
|
error: z.ZodObject<{
|
|
@@ -377,7 +336,6 @@ declare const SessionOpenPayloadSchema: z.ZodObject<{
|
|
|
377
336
|
}, z.core.$loose>;
|
|
378
337
|
attestations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
|
|
379
338
|
}, z.core.$loose>;
|
|
380
|
-
declare const SESSION_CLOSE_REASONS: readonly ["completed", "settled", "aborted", "expired"];
|
|
381
339
|
declare const SessionClosePayloadSchema: z.ZodObject<{
|
|
382
340
|
reason: z.ZodEnum<{
|
|
383
341
|
completed: "completed";
|
|
@@ -396,11 +354,38 @@ declare const IntentDeclaredPayloadSchema: z.ZodObject<{
|
|
|
396
354
|
merchantAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
397
355
|
validUntil: z.ZodISODateTime;
|
|
398
356
|
}, z.core.$loose>;
|
|
357
|
+
/**
|
|
358
|
+
* A prompt as the difference from an earlier call's (GAP-89): `prior` is
|
|
359
|
+
* the `callId` of the `llm_call.start` whose *unfolded* prompt this one
|
|
360
|
+
* extends, `shared` how many of its leading messages are equal (JCS +
|
|
361
|
+
* SHA-256 per message), `messages` the rest.
|
|
362
|
+
*/
|
|
363
|
+
declare const PromptDeltaSchema: z.ZodObject<{
|
|
364
|
+
prior: z.ZodString;
|
|
365
|
+
shared: z.ZodNumber;
|
|
366
|
+
messages: z.ZodArray<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
367
|
+
}, z.core.$strict>;
|
|
368
|
+
/** The provider-level call options (GAP-57); the prompt whole, or as a delta, never both. */
|
|
369
|
+
declare const LlmCallParamsSchema: z.ZodObject<{
|
|
370
|
+
prompt: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
371
|
+
promptDelta: z.ZodOptional<z.ZodObject<{
|
|
372
|
+
prior: z.ZodString;
|
|
373
|
+
shared: z.ZodNumber;
|
|
374
|
+
messages: z.ZodArray<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
375
|
+
}, z.core.$strict>>;
|
|
376
|
+
}, z.core.$loose>;
|
|
399
377
|
declare const LlmCallStartPayloadSchema: z.ZodObject<{
|
|
400
378
|
callId: z.ZodString;
|
|
401
379
|
provider: z.ZodString;
|
|
402
380
|
modelId: z.ZodString;
|
|
403
|
-
params: z.
|
|
381
|
+
params: z.ZodObject<{
|
|
382
|
+
prompt: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
383
|
+
promptDelta: z.ZodOptional<z.ZodObject<{
|
|
384
|
+
prior: z.ZodString;
|
|
385
|
+
shared: z.ZodNumber;
|
|
386
|
+
messages: z.ZodArray<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
387
|
+
}, z.core.$strict>>;
|
|
388
|
+
}, z.core.$loose>;
|
|
404
389
|
}, z.core.$loose>;
|
|
405
390
|
declare const LlmCallEndPayloadSchema: z.ZodObject<{
|
|
406
391
|
callId: z.ZodString;
|
|
@@ -432,7 +417,6 @@ declare const ToolCallEndPayloadSchema: z.ZodObject<{
|
|
|
432
417
|
}, z.core.$loose>>;
|
|
433
418
|
durationMs: z.ZodNumber;
|
|
434
419
|
}, z.core.$loose>;
|
|
435
|
-
declare const PAYMENT_ARTIFACTS: readonly ["http-402", "mrtr-input-required", "payment-signature", "checkout-url"];
|
|
436
420
|
/**
|
|
437
421
|
* A payment moment, normalized across protocols so the engine can compare
|
|
438
422
|
* the two sides of the same purchase (`EVIDENCE_MISMATCH`, GAP-50). `raw` is
|
|
@@ -470,9 +454,14 @@ declare const GatewayDecisionPayloadSchema: z.ZodObject<{
|
|
|
470
454
|
reasonCodes: z.ZodArray<z.ZodString>;
|
|
471
455
|
record: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
472
456
|
}, z.core.$loose>;
|
|
473
|
-
/**
|
|
457
|
+
/**
|
|
458
|
+
* Emitted by the SDK after it dropped events pre-sequencing (GAP-38): for
|
|
459
|
+
* lack of room in its buffer, or — `oversized` of them — because the
|
|
460
|
+
* platform would refuse them as too large (GAP-87).
|
|
461
|
+
*/
|
|
474
462
|
declare const TransportGapPayloadSchema: z.ZodObject<{
|
|
475
463
|
dropped: z.ZodNumber;
|
|
464
|
+
oversized: z.ZodOptional<z.ZodNumber>;
|
|
476
465
|
firstTs: z.ZodString;
|
|
477
466
|
lastTs: z.ZodString;
|
|
478
467
|
}, z.core.$loose>;
|
|
@@ -482,7 +471,6 @@ declare const PlatformObservationPayloadSchema: z.ZodObject<{
|
|
|
482
471
|
params: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
|
|
483
472
|
response: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
|
|
484
473
|
}, z.core.$strict>;
|
|
485
|
-
declare const ANOMALY_TYPES: readonly ["fork", "seq_gap", "prev_hash_mismatch", "bad_sig", "clock_skew", "source_conflict"];
|
|
486
474
|
declare const PlatformAnomalyPayloadSchema: z.ZodObject<{
|
|
487
475
|
type: z.ZodEnum<{
|
|
488
476
|
fork: "fork";
|
|
@@ -503,6 +491,8 @@ declare const PlatformAnomalyPayloadSchema: z.ZodObject<{
|
|
|
503
491
|
type SessionOpenPayload = z.infer<typeof SessionOpenPayloadSchema>;
|
|
504
492
|
type SessionClosePayload = z.infer<typeof SessionClosePayloadSchema>;
|
|
505
493
|
type IntentDeclaredPayload = z.infer<typeof IntentDeclaredPayloadSchema>;
|
|
494
|
+
type PromptDelta = z.infer<typeof PromptDeltaSchema>;
|
|
495
|
+
type LlmCallParams = z.infer<typeof LlmCallParamsSchema>;
|
|
506
496
|
type LlmCallStartPayload = z.infer<typeof LlmCallStartPayloadSchema>;
|
|
507
497
|
type LlmCallEndPayload = z.infer<typeof LlmCallEndPayloadSchema>;
|
|
508
498
|
type ToolCallStartPayload = z.infer<typeof ToolCallStartPayloadSchema>;
|
|
@@ -529,27 +519,4 @@ interface PayloadByKind {
|
|
|
529
519
|
'platform.anomaly': PlatformAnomalyPayload;
|
|
530
520
|
}
|
|
531
521
|
|
|
532
|
-
|
|
533
|
-
* The verdict as a value (Fraud Engine RFC › API: ALLOW | DENY | REVIEW).
|
|
534
|
-
* Layers combine by severity (GAP-45); a synchronous seller hook turns
|
|
535
|
-
* REVIEW into a stop or a pass according to its `onReview` (GAP-52). Both
|
|
536
|
-
* halves of the SDK and the engine share this one rule.
|
|
537
|
-
*/
|
|
538
|
-
|
|
539
|
-
type OnReview = 'abort' | 'allow';
|
|
540
|
-
declare class Verdict {
|
|
541
|
-
readonly value: Decision;
|
|
542
|
-
private constructor();
|
|
543
|
-
static readonly ALLOW: Verdict;
|
|
544
|
-
static readonly REVIEW: Verdict;
|
|
545
|
-
static readonly DENY: Verdict;
|
|
546
|
-
static of(value: Decision): Verdict;
|
|
547
|
-
/** The more severe of the two. */
|
|
548
|
-
atLeast(other: Verdict | Decision): Verdict;
|
|
549
|
-
/** Whether a synchronous gate must stop the call (GAP-52). */
|
|
550
|
-
blocks(onReview: OnReview): boolean;
|
|
551
|
-
/** What the gate effectively did: DENY when it blocked, else the verdict itself. */
|
|
552
|
-
effective(onReview: OnReview): Decision;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
export { LlmCallEndPayloadSchema as $, ALL_SOURCES as A, type EvidenceAck as B, type ChainHead as C, type Decision as D, type EvidenceSourceAll as E, EvidenceAckSchema as F, type EvidenceBatchInput as G, EvidenceBatchInputSchema as H, type EvidenceEnvelope as I, type JsonValue as J, type EvidenceEvent as K, EvidenceEventSchema as L, type EvidenceKind as M, EvidenceKindSchema as N, type EvidenceSource as O, type PaymentMomentPayload as P, EvidenceSourceAllSchema as Q, EvidenceSourceSchema as R, type GatewayDecisionPayload as S, GatewayDecisionPayloadSchema as T, type Hex64 as U, Hex64Schema as V, type IntentDeclaredPayload as W, IntentDeclaredPayloadSchema as X, type JsonObject as Y, JsonValueSchema as Z, type LlmCallEndPayload as _, ANOMALY_TYPES as a, type LlmCallStartPayload as a0, LlmCallStartPayloadSchema as a1, MAX_BATCH_EVENTS as a2, type OnReview as a3, PAYMENT_ARTIFACTS as a4, PLATFORM_KINDS as a5, type PayloadByKind as a6, PaymentMomentPayloadSchema as a7, type PaymentSummary as a8, PaymentSummarySchema as a9, type WireEvidenceKind as aA, WireEvidenceKindSchema as aB, compareBySessionSource as aC, compareBySourceSeq as aD, isPlatformKind as aE, isWireKind as aF, payloadSchemaFor as aG, type PlatformAnomalyPayload as aa, PlatformAnomalyPayloadSchema as ab, type PlatformEvidenceKind as ac, PlatformEvidenceKindSchema as ad, type PlatformObservationPayload as ae, PlatformObservationPayloadSchema as af, SESSION_CLOSE_REASONS as ag, SOURCE_ORDER as ah, SeqSchema as ai, type SessionClosePayload as aj, SessionClosePayloadSchema as ak, SessionIdSchema as al, type SessionOpenPayload as am, SessionOpenPayloadSchema as an, type Sig as ao, SigSchema as ap, TimestampSchema as aq, type ToolCallEndPayload as ar, ToolCallEndPayloadSchema as as, type ToolCallStartPayload as at, ToolCallStartPayloadSchema as au, type TransportGapPayload as av, TransportGapPayloadSchema as aw, Verdict as ax, WIRE_KINDS as ay, WIRE_SOURCES as az, type Amount as b, AmountSchema as c, type ApiError as d, ApiErrorSchema as e, ChainHeadSchema as f, type CreatePolicyInput as g, CreatePolicyInputSchema as h, type CreatePolicyOutput as i, CreatePolicyOutputSchema as j, type CreateSessionInput as k, CreateSessionInputSchema as l, type CreateSessionOutput as m, CreateSessionOutputSchema as n, DecisionSchema as o, type DeclaredIntent as p, DeclaredIntentSchema as q, type DigestedEnvelope as r, type EvaluateInput as s, EvaluateInputSchema as t, type EvaluateOutput as u, EvaluateOutputSchema as v, type EventResult as w, EventResultSchema as x, type EventResultStatus as y, EventResultStatusSchema as z };
|
|
522
|
+
export { type Sig as $, ALL_SOURCES as A, type LlmCallParams as B, type ChainHead as C, type Decision as D, type EvidenceSourceAll as E, type LlmCallStartPayload as F, type GatewayDecisionPayload as G, type Hex64 as H, type IntentDeclaredPayload as I, type JsonValue as J, type PaymentMomentPayload as K, type LlmCallEndPayload as L, MAX_BATCH_EVENTS as M, type PaymentSummary as N, PaymentSummarySchema as O, type PayloadByKind as P, type PlatformAnomalyPayload as Q, type PlatformEvidenceKind as R, type PlatformObservationPayload as S, type PromptBase as T, type PromptDelta as U, SESSION_ID_CHARS as V, SESSION_ID_PREFIX as W, SOURCE_ORDER as X, type SessionClosePayload as Y, SessionIdSchema as Z, type SessionOpenPayload as _, type ApiError as a, TimestampSchema as a0, type ToolCallEndPayload as a1, type ToolCallStartPayload as a2, type TransportGapPayload as a3, type WireEvidenceKind as a4, chainKey as a5, compareByArrival as a6, compareBySessionSource as a7, compareBySourceSeq as a8, compareRootFirst as a9, payloadSchemaFor as aa, withinHeads as ab, ApiErrorSchema as b, CreatePolicyInputSchema as c, type CreatePolicyOutput as d, type CreateSessionInput as e, CreateSessionInputSchema as f, type CreateSessionOutput as g, type DeclaredIntent as h, DeclaredIntentSchema as i, type DigestedEnvelope as j, type EvaluateInput as k, EvaluateInputSchema as l, type EvaluateOutput as m, type EventResult as n, type EvidenceAck as o, EvidenceBatchInputSchema as p, type EvidenceEnvelope as q, type EvidenceEvent as r, EvidenceEventSchema as s, type EvidenceKind as t, type EvidenceSource as u, EvidenceSourceAllSchema as v, EvidenceSourceSchema as w, Hex64Schema as x, type JsonObject as y, JsonValueSchema as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { B as Beltic, a as BelticOptions, S as SDK_VERSION } from './client-Xn9M58OJ.js';
|
|
2
|
+
export { B as BelticApiError, C as ChainRejectedError, D as DecideOptions, a as Decision, H as HumanDecisionInput, S as Session, b as SessionOptions } from './session-DAN29XoB.js';
|
|
3
|
+
import './index-DAVKGJs5.js';
|
|
3
4
|
import 'zod';
|
|
4
5
|
|
|
5
6
|
/**
|