@belticlabs/agent-risk-sdk 0.5.0 → 0.6.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-AjCgj-KM.d.ts +6 -0
- package/dist/ai/index.d.ts +6 -16
- package/dist/ai/index.js +21 -29
- package/dist/{chunk-X3W2Z5GC.js → chunk-77D74TWX.js} +0 -1
- package/dist/{chunk-GM4KEEZB.js → chunk-IUWC6HT5.js} +23 -42
- package/dist/chunk-M4I3FGZG.js +13 -0
- package/dist/chunk-ZMPKY7AX.js +39 -0
- package/dist/client-CgCjOrRP.d.ts +65 -0
- package/dist/{verdict-DMnbFuS5.d.ts → index-IfY4XCvJ.d.ts} +1 -24
- package/dist/index.d.ts +3 -2
- package/dist/index.js +524 -186
- package/dist/protocol/index.d.ts +26 -3
- package/dist/protocol/index.js +487 -74
- package/dist/session-Dcof4UIn.d.ts +308 -0
- package/dist/x402/hono.d.ts +6 -17
- package/dist/x402/hono.js +7 -13
- package/dist/x402/index.d.ts +25 -42
- package/dist/x402/index.js +11 -31
- package/package.json +1 -1
- package/dist/adapter-DEdhsNt-.d.ts +0 -22
- package/dist/chunk-4BUUPU3O.js +0 -558
- package/dist/chunk-JSE6JQJC.js +0 -530
- package/dist/session-D9E-efc0.d.ts +0 -462
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { x402ResourceServer, x402HTTPResourceServer } from '@x402/core/server';
|
|
2
|
+
import { B as Beltic } from './client-CgCjOrRP.js';
|
|
3
|
+
|
|
4
|
+
declare function attachX402(beltic: Beltic, server: x402ResourceServer, http?: x402HTTPResourceServer): void;
|
|
5
|
+
|
|
6
|
+
export { attachX402 as a };
|
package/dist/ai/index.d.ts
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { LanguageModelMiddleware, ToolSet } from 'ai';
|
|
2
|
+
import { S as Session } from '../session-Dcof4UIn.js';
|
|
3
|
+
import '../index-IfY4XCvJ.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
presented?: PaymentMomentPayload;
|
|
9
|
-
}
|
|
10
|
-
interface WrapToolOptions<I = unknown, O = unknown> {
|
|
11
|
-
name?: string;
|
|
12
|
-
/** When the tool performs a purchase, map its input/output to the payment moments it produced. */
|
|
13
|
-
payment?: (input: I, output: O) => PaymentMoments | null;
|
|
14
|
-
}
|
|
15
|
-
declare function middleware(source: SessionSource): LanguageModelMiddleware;
|
|
16
|
-
declare function wrapTool<T extends Tool>(source: SessionSource, tool: T, opts?: WrapToolOptions): T;
|
|
17
|
-
declare function wrapTools<T extends ToolSet>(source: SessionSource, tools: T, opts?: Record<string, WrapToolOptions>): T;
|
|
6
|
+
declare function middleware(session: Session): LanguageModelMiddleware;
|
|
7
|
+
declare function wrapTools<T extends ToolSet>(session: Session, tools: T): T;
|
|
18
8
|
|
|
19
|
-
export {
|
|
9
|
+
export { middleware, wrapTools };
|
package/dist/ai/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Sessions,
|
|
3
2
|
recordCall
|
|
4
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-ZMPKY7AX.js";
|
|
5
4
|
import {
|
|
6
5
|
toJson,
|
|
7
6
|
toJsonObject
|
|
8
7
|
} from "../chunk-FQDHFTVR.js";
|
|
9
8
|
import {
|
|
10
9
|
uuidv7
|
|
11
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-77D74TWX.js";
|
|
12
11
|
|
|
13
12
|
// src/ai/index.ts
|
|
14
13
|
var PARAM_KEYS = [
|
|
@@ -23,13 +22,13 @@ var PARAM_KEYS = [
|
|
|
23
22
|
"responseFormat",
|
|
24
23
|
"stopSequences"
|
|
25
24
|
];
|
|
26
|
-
function middleware(
|
|
25
|
+
function middleware(session) {
|
|
27
26
|
return {
|
|
28
27
|
wrapGenerate: async ({ doGenerate, params, model }) => {
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
28
|
+
const stream = await session.stream();
|
|
29
|
+
if (!stream) return doGenerate();
|
|
31
30
|
return recordCall(
|
|
32
|
-
|
|
31
|
+
stream,
|
|
33
32
|
"llm_call",
|
|
34
33
|
uuidv7(),
|
|
35
34
|
{ provider: model.provider, modelId: model.modelId, params: pick(params) },
|
|
@@ -43,11 +42,11 @@ function middleware(source) {
|
|
|
43
42
|
},
|
|
44
43
|
// A stream ends when it drains, not when doStream resolves — so its end is emitted at flush.
|
|
45
44
|
wrapStream: async ({ doStream, params, model }) => {
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
45
|
+
const evidence = await session.stream();
|
|
46
|
+
if (!evidence) return doStream();
|
|
48
47
|
const callId = uuidv7();
|
|
49
48
|
const started = Date.now();
|
|
50
|
-
await
|
|
49
|
+
await evidence.emit("llm_call.start", {
|
|
51
50
|
callId,
|
|
52
51
|
provider: model.provider,
|
|
53
52
|
modelId: model.modelId,
|
|
@@ -65,7 +64,7 @@ function middleware(source) {
|
|
|
65
64
|
controller.enqueue(part);
|
|
66
65
|
},
|
|
67
66
|
flush: async () => {
|
|
68
|
-
await
|
|
67
|
+
await evidence.emit("llm_call.end", {
|
|
69
68
|
callId,
|
|
70
69
|
content: toJson(parts),
|
|
71
70
|
...finish.finishReason ? { finishReason: finish.finishReason } : {},
|
|
@@ -78,15 +77,20 @@ function middleware(source) {
|
|
|
78
77
|
}
|
|
79
78
|
};
|
|
80
79
|
}
|
|
81
|
-
function
|
|
80
|
+
function wrapTools(session, tools) {
|
|
81
|
+
const out = {};
|
|
82
|
+
for (const [name, tool] of Object.entries(tools))
|
|
83
|
+
out[name] = wrapTool(session, name, tool);
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
function wrapTool(session, toolName, tool) {
|
|
82
87
|
if (!tool.execute) return tool;
|
|
83
88
|
const original = tool.execute;
|
|
84
|
-
const toolName = opts.name ?? tool.name ?? "tool";
|
|
85
89
|
const execute = async (input, options) => {
|
|
86
|
-
const
|
|
87
|
-
if (!
|
|
90
|
+
const stream = await session.stream();
|
|
91
|
+
if (!stream) return original(input, options);
|
|
88
92
|
return recordCall(
|
|
89
|
-
|
|
93
|
+
stream,
|
|
90
94
|
"tool_call",
|
|
91
95
|
options.toolCallId,
|
|
92
96
|
{ toolName, input: toJson(input), transport: "local" },
|
|
@@ -94,22 +98,11 @@ function wrapTool(source, tool, opts = {}) {
|
|
|
94
98
|
const output = await original(input, options);
|
|
95
99
|
return output && typeof output === "object" && Symbol.asyncIterator in output ? collect(output) : output;
|
|
96
100
|
},
|
|
97
|
-
|
|
98
|
-
const moments = opts.payment?.(input, output) ?? null;
|
|
99
|
-
if (moments?.requested) await session.emit("payment.requested", moments.requested);
|
|
100
|
-
if (moments?.presented) await session.emit("payment.presented", moments.presented);
|
|
101
|
-
return { output: toJson(output) };
|
|
102
|
-
}
|
|
101
|
+
(output) => ({ output: toJson(output) })
|
|
103
102
|
);
|
|
104
103
|
};
|
|
105
104
|
return { ...tool, execute };
|
|
106
105
|
}
|
|
107
|
-
function wrapTools(source, tools, opts = {}) {
|
|
108
|
-
const out = {};
|
|
109
|
-
for (const [name, tool] of Object.entries(tools))
|
|
110
|
-
out[name] = wrapTool(source, tool, { name, ...opts[name] });
|
|
111
|
-
return out;
|
|
112
|
-
}
|
|
113
106
|
function pick(params) {
|
|
114
107
|
const out = {};
|
|
115
108
|
for (const k of PARAM_KEYS) {
|
|
@@ -125,6 +118,5 @@ async function collect(it) {
|
|
|
125
118
|
}
|
|
126
119
|
export {
|
|
127
120
|
middleware,
|
|
128
|
-
wrapTool,
|
|
129
121
|
wrapTools
|
|
130
122
|
};
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
summaryOf
|
|
3
|
+
} from "./chunk-M4I3FGZG.js";
|
|
1
4
|
import {
|
|
2
5
|
toJsonObject
|
|
3
6
|
} from "./chunk-FQDHFTVR.js";
|
|
4
7
|
import {
|
|
5
8
|
payloadDigest
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-77D74TWX.js";
|
|
7
10
|
|
|
8
11
|
// src/x402/binding.ts
|
|
9
12
|
var SESSION_EXTENSION = "beltic.sessionId";
|
|
10
13
|
var SESSION_HEADER = "Beltic-Session-Id";
|
|
11
|
-
var DECISION_EXTENSION = "beltic.decisionId";
|
|
12
14
|
function sessionIdOf(extensions) {
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
function decisionIdOf(extensions) {
|
|
16
|
-
return stringAt(extensions, DECISION_EXTENSION);
|
|
17
|
-
}
|
|
18
|
-
function stringAt(extensions, key) {
|
|
19
|
-
const v = extensions?.[key];
|
|
15
|
+
const v = extensions?.[SESSION_EXTENSION];
|
|
20
16
|
return typeof v === "string" && v.length > 0 ? v : null;
|
|
21
17
|
}
|
|
22
18
|
|
|
@@ -95,15 +91,15 @@ function priceValue(price) {
|
|
|
95
91
|
}
|
|
96
92
|
|
|
97
93
|
// src/x402/adapter.ts
|
|
98
|
-
function attachX402(beltic, server, http
|
|
94
|
+
function attachX402(beltic, server, http) {
|
|
99
95
|
const inFlight = /* @__PURE__ */ new Map();
|
|
100
96
|
http?.onProtectedRequest(async (ctx, route) => {
|
|
101
97
|
if (ctx.paymentHeader) return;
|
|
102
98
|
const bound = ctx.adapter.getHeader(SESSION_HEADER) ?? ctx.adapter.getHeader(SESSION_HEADER.toLowerCase());
|
|
103
99
|
if (!bound) return;
|
|
104
|
-
const
|
|
100
|
+
const stream = await beltic.streams.ensure(bound);
|
|
105
101
|
const accepts = Array.isArray(route.accepts) ? route.accepts[0] : route.accepts;
|
|
106
|
-
await
|
|
102
|
+
await stream.emit(
|
|
107
103
|
"payment.requested",
|
|
108
104
|
x402Moments.route(accepts, {
|
|
109
105
|
path: ctx.path,
|
|
@@ -115,49 +111,34 @@ function attachX402(beltic, server, http, opts = {}) {
|
|
|
115
111
|
server.onBeforeVerify(async (ctx) => {
|
|
116
112
|
const payload = ctx.paymentPayload;
|
|
117
113
|
const requirements = ctx.requirements;
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
120
|
-
await
|
|
114
|
+
const stream = await beltic.streams.ensure(sessionIdOf(payload.extensions));
|
|
115
|
+
if (stream.born === "seller")
|
|
116
|
+
await stream.emit("payment.requested", x402Moments.requirements(requirements));
|
|
121
117
|
const presented = x402Moments.payload(payload);
|
|
122
|
-
await
|
|
123
|
-
inFlight.set(payloadDigest(payload),
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
buyerDecisionId: decisionIdOf(payload.extensions)
|
|
132
|
-
});
|
|
133
|
-
if (out.verdict.blocks(beltic.onReview)) {
|
|
134
|
-
return {
|
|
135
|
-
abort: true,
|
|
136
|
-
reason: `BELTIC_${out.verdict.value}`,
|
|
137
|
-
message: out.reasonCodes.join(",")
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
return;
|
|
118
|
+
await stream.emit("payment.presented", presented);
|
|
119
|
+
inFlight.set(payloadDigest(payload), stream);
|
|
120
|
+
const decision = await beltic.evaluate(stream.id, summaryOf(presented));
|
|
121
|
+
if (decision.absent || decision.allowed) return;
|
|
122
|
+
return {
|
|
123
|
+
abort: true,
|
|
124
|
+
reason: `BELTIC_${decision.value}`,
|
|
125
|
+
message: decision.reasonCodes.join(",")
|
|
126
|
+
};
|
|
141
127
|
});
|
|
142
128
|
server.onAfterSettle(async (ctx) => {
|
|
143
129
|
const key = payloadDigest(ctx.paymentPayload);
|
|
144
|
-
const
|
|
145
|
-
if (!
|
|
130
|
+
const stream = inFlight.get(key);
|
|
131
|
+
if (!stream) return;
|
|
146
132
|
inFlight.delete(key);
|
|
147
|
-
if (ctx.result.success) await
|
|
133
|
+
if (ctx.result.success) await stream.close("settled", { transaction: ctx.result.transaction });
|
|
148
134
|
});
|
|
149
|
-
return { inFlight };
|
|
150
135
|
}
|
|
151
136
|
|
|
152
137
|
export {
|
|
153
138
|
SESSION_EXTENSION,
|
|
154
139
|
SESSION_HEADER,
|
|
155
|
-
DECISION_EXTENSION,
|
|
156
|
-
sessionIdOf,
|
|
157
|
-
decisionIdOf,
|
|
158
140
|
x402Currency,
|
|
159
141
|
x402Summary,
|
|
160
|
-
payerOf,
|
|
161
142
|
x402Moments,
|
|
162
143
|
attachX402
|
|
163
144
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/core/payment-moment.ts
|
|
2
|
+
function summaryOf(m) {
|
|
3
|
+
return {
|
|
4
|
+
protocol: m.protocol,
|
|
5
|
+
payee: m.payee,
|
|
6
|
+
amount: { value: m.amount.value, currency: m.amount.currency },
|
|
7
|
+
...m.payer ? { payer: m.payer } : {}
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
summaryOf
|
|
13
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// src/core/record.ts
|
|
2
|
+
function errorOf(err) {
|
|
3
|
+
const e = err;
|
|
4
|
+
return { name: String(e?.name ?? "Error"), message: String(e?.message ?? err) };
|
|
5
|
+
}
|
|
6
|
+
function openCall(stream, kind, callId, start) {
|
|
7
|
+
const started = Date.now();
|
|
8
|
+
const opened = stream.emit(`${kind}.start`, { callId, ...start });
|
|
9
|
+
const close = async (outcome) => {
|
|
10
|
+
await opened;
|
|
11
|
+
return stream.emit(
|
|
12
|
+
`${kind}.end`,
|
|
13
|
+
{ callId, ...outcome, durationMs: Date.now() - started }
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
callId,
|
|
18
|
+
opened,
|
|
19
|
+
end: (outcome = {}) => close(outcome),
|
|
20
|
+
fail: (error, outcome = {}) => close({ error: errorOf(error), ...outcome })
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
async function recordCall(stream, kind, callId, start, run, end = () => ({})) {
|
|
24
|
+
const span = openCall(stream, kind, callId, start);
|
|
25
|
+
await span.opened;
|
|
26
|
+
try {
|
|
27
|
+
const result = await run();
|
|
28
|
+
await span.end(await end(result));
|
|
29
|
+
return result;
|
|
30
|
+
} catch (err) {
|
|
31
|
+
await span.fail(err);
|
|
32
|
+
throw err;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
openCall,
|
|
38
|
+
recordCall
|
|
39
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { a7 as PaymentSummary } from './index-IfY4XCvJ.js';
|
|
2
|
+
import { b as SessionOptions, S as Session, a as Decision } from './session-Dcof4UIn.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* One SDK, two halves (Fraud SDK RFC › Summary). `Beltic` is the single
|
|
6
|
+
* client: `session` for the buyer half, `evaluate` for whichever half is
|
|
7
|
+
* about to let a payment through. Protocol integrations are plain
|
|
8
|
+
* functions behind subpath exports, each pulling exactly one optional peer:
|
|
9
|
+
*
|
|
10
|
+
* @belticlabs/agent-risk-sdk/ai → middleware(session), wrapTools(session, …)
|
|
11
|
+
* @belticlabs/agent-risk-sdk/x402 → belticFetch(session), x402Summary(…), attachX402(beltic, …)
|
|
12
|
+
* @belticlabs/agent-risk-sdk/hono → belticPaymentMiddleware(beltic, …)
|
|
13
|
+
*
|
|
14
|
+
* Neither half decides risk locally: verdicts are platform-side.
|
|
15
|
+
*
|
|
16
|
+
* A client is configured or it is not constructed — `Beltic.fromEnv()`
|
|
17
|
+
* reads `BELTIC_*`, and there is no disabled client (GAP-78). Evidence is
|
|
18
|
+
* a side channel of the work it observes, so a platform outage never
|
|
19
|
+
* throws into that work (GAP-70): the transport waits it out, `session`
|
|
20
|
+
* runs without a stream, `evaluate` answers `Decision.absent()` — never an
|
|
21
|
+
* invented verdict. What the platform *rejects* (a 4xx, a forked chain)
|
|
22
|
+
* is the client's fault and throws.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
declare const SDK_VERSION = "0.6.0";
|
|
26
|
+
interface BelticOptions {
|
|
27
|
+
apiKey: string;
|
|
28
|
+
baseUrl: string;
|
|
29
|
+
/** The agent's 32-byte Ed25519 seed as 64 hex — the buyer half. Without it, `session` is unavailable; the seller half works. */
|
|
30
|
+
agentSeed?: string | undefined;
|
|
31
|
+
}
|
|
32
|
+
declare class Beltic {
|
|
33
|
+
private readonly api;
|
|
34
|
+
private readonly transport;
|
|
35
|
+
private readonly sessions;
|
|
36
|
+
/**
|
|
37
|
+
* The client the environment describes: `BELTIC_API_KEY` and
|
|
38
|
+
* `BELTIC_BASE_URL`, both required, and `BELTIC_AGENT_SEED` (64 hex) for
|
|
39
|
+
* the buyer half. A missing required variable is a configuration error,
|
|
40
|
+
* thrown (GAP-78).
|
|
41
|
+
*/
|
|
42
|
+
static fromEnv(env?: Record<string, string | undefined>): Beltic;
|
|
43
|
+
constructor(opts: BelticOptions);
|
|
44
|
+
/**
|
|
45
|
+
* The session for a key of the host's own (its session, run or
|
|
46
|
+
* conversation id) — one object per key until it closes; the options
|
|
47
|
+
* count on the first call only. See `Session`.
|
|
48
|
+
*/
|
|
49
|
+
session(key: string, opts?: SessionOptions): Session;
|
|
50
|
+
/**
|
|
51
|
+
* The platform's verdict on a payment — the seller's before it verifies,
|
|
52
|
+
* the buyer's before it presents (Fraud SDK RFC › Evaluation Client).
|
|
53
|
+
* Read-your-writes: the buffered evidence is flushed first so the
|
|
54
|
+
* platform judges what the caller already saw (GAP-16). Absent when the
|
|
55
|
+
* platform could not be reached (GAP-70).
|
|
56
|
+
*/
|
|
57
|
+
evaluate(sessionId: string, payment: PaymentSummary): Promise<Decision>;
|
|
58
|
+
/** Send everything buffered now and wait for that attempt. */
|
|
59
|
+
flush(): Promise<void>;
|
|
60
|
+
shutdown(): Promise<void>;
|
|
61
|
+
/** `process.env` where there is a `process` (Node); `{}` on workerd, where the shell passes its `env`. */
|
|
62
|
+
private static processEnv;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { Beltic as B, SDK_VERSION as S, type BelticOptions as a };
|
|
@@ -529,27 +529,4 @@ interface PayloadByKind {
|
|
|
529
529
|
'platform.anomaly': PlatformAnomalyPayload;
|
|
530
530
|
}
|
|
531
531
|
|
|
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 };
|
|
532
|
+
export { type LlmCallStartPayload 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, EvidenceSourceAllSchema as P, EvidenceSourceSchema as Q, type GatewayDecisionPayload as R, GatewayDecisionPayloadSchema as S, type Hex64 as T, Hex64Schema as U, type IntentDeclaredPayload as V, IntentDeclaredPayloadSchema as W, type JsonObject as X, JsonValueSchema as Y, type LlmCallEndPayload as Z, LlmCallEndPayloadSchema as _, ANOMALY_TYPES as a, LlmCallStartPayloadSchema as a0, MAX_BATCH_EVENTS as a1, PAYMENT_ARTIFACTS as a2, PLATFORM_KINDS as a3, type PayloadByKind as a4, type PaymentMomentPayload as a5, PaymentMomentPayloadSchema as a6, type PaymentSummary as a7, PaymentSummarySchema as a8, type PlatformAnomalyPayload as a9, compareBySessionSource as aA, compareBySourceSeq as aB, isPlatformKind as aC, isWireKind as aD, payloadSchemaFor as aE, PlatformAnomalyPayloadSchema as aa, type PlatformEvidenceKind as ab, PlatformEvidenceKindSchema as ac, type PlatformObservationPayload as ad, PlatformObservationPayloadSchema as ae, SESSION_CLOSE_REASONS as af, SOURCE_ORDER as ag, SeqSchema as ah, type SessionClosePayload as ai, SessionClosePayloadSchema as aj, SessionIdSchema as ak, type SessionOpenPayload as al, SessionOpenPayloadSchema as am, type Sig as an, SigSchema as ao, TimestampSchema as ap, type ToolCallEndPayload as aq, ToolCallEndPayloadSchema as ar, type ToolCallStartPayload as as, ToolCallStartPayloadSchema as at, type TransportGapPayload as au, TransportGapPayloadSchema as av, WIRE_KINDS as aw, WIRE_SOURCES as ax, type WireEvidenceKind as ay, WireEvidenceKindSchema 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 };
|
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-CgCjOrRP.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-Dcof4UIn.js';
|
|
3
|
+
import './index-IfY4XCvJ.js';
|
|
3
4
|
import 'zod';
|
|
4
5
|
|
|
5
6
|
/**
|