@absol-labs/agent 0.1.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/LICENSE +21 -0
- package/README.md +196 -0
- package/dist/discovery/registry.d.ts +68 -0
- package/dist/discovery/registry.d.ts.map +1 -0
- package/dist/discovery/registry.js +148 -0
- package/dist/discovery/registry.js.map +1 -0
- package/dist/frameworks/agentkit.d.ts +158 -0
- package/dist/frameworks/agentkit.d.ts.map +1 -0
- package/dist/frameworks/agentkit.js +339 -0
- package/dist/frameworks/agentkit.js.map +1 -0
- package/dist/frameworks/crewai.d.ts +19 -0
- package/dist/frameworks/crewai.d.ts.map +1 -0
- package/dist/frameworks/crewai.js +73 -0
- package/dist/frameworks/crewai.js.map +1 -0
- package/dist/frameworks/eliza.d.ts +393 -0
- package/dist/frameworks/eliza.d.ts.map +1 -0
- package/dist/frameworks/eliza.js +542 -0
- package/dist/frameworks/eliza.js.map +1 -0
- package/dist/frameworks/langchain.d.ts +31 -0
- package/dist/frameworks/langchain.d.ts.map +1 -0
- package/dist/frameworks/langchain.js +206 -0
- package/dist/frameworks/langchain.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/mandates/env.d.ts +51 -0
- package/dist/mandates/env.d.ts.map +1 -0
- package/dist/mandates/env.js +148 -0
- package/dist/mandates/env.js.map +1 -0
- package/dist/mandates/mandate.d.ts +214 -0
- package/dist/mandates/mandate.d.ts.map +1 -0
- package/dist/mandates/mandate.js +172 -0
- package/dist/mandates/mandate.js.map +1 -0
- package/dist/mcp/http-server.d.ts +2 -0
- package/dist/mcp/http-server.d.ts.map +1 -0
- package/dist/mcp/http-server.js +32 -0
- package/dist/mcp/http-server.js.map +1 -0
- package/dist/mcp/http.d.ts +114 -0
- package/dist/mcp/http.d.ts.map +1 -0
- package/dist/mcp/http.js +428 -0
- package/dist/mcp/http.js.map +1 -0
- package/dist/mcp/server.d.ts +119 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +679 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/stdio.d.ts +2 -0
- package/dist/mcp/stdio.d.ts.map +1 -0
- package/dist/mcp/stdio.js +6 -0
- package/dist/mcp/stdio.js.map +1 -0
- package/dist/sdk/client.d.ts +78 -0
- package/dist/sdk/client.d.ts.map +1 -0
- package/dist/sdk/client.js +99 -0
- package/dist/sdk/client.js.map +1 -0
- package/dist/wallet/provider.d.ts +51 -0
- package/dist/wallet/provider.d.ts.map +1 -0
- package/dist/wallet/provider.js +107 -0
- package/dist/wallet/provider.js.map +1 -0
- package/dist/x402/facilitator.d.ts +315 -0
- package/dist/x402/facilitator.d.ts.map +1 -0
- package/dist/x402/facilitator.js +194 -0
- package/dist/x402/facilitator.js.map +1 -0
- package/dist/zktls/reclaim.d.ts +137 -0
- package/dist/zktls/reclaim.d.ts.map +1 -0
- package/dist/zktls/reclaim.js +245 -0
- package/dist/zktls/reclaim.js.map +1 -0
- package/package.json +86 -0
- package/src/discovery/registry.ts +255 -0
- package/src/frameworks/agentkit.ts +537 -0
- package/src/frameworks/crewai.ts +102 -0
- package/src/frameworks/eliza.ts +776 -0
- package/src/frameworks/langchain.ts +325 -0
- package/src/index.ts +179 -0
- package/src/mandates/env.ts +222 -0
- package/src/mandates/mandate.ts +280 -0
- package/src/mcp/http-server.ts +38 -0
- package/src/mcp/http.ts +620 -0
- package/src/mcp/server.ts +1006 -0
- package/src/mcp/stdio.ts +8 -0
- package/src/sdk/client.ts +222 -0
- package/src/wallet/provider.ts +197 -0
- package/src/x402/facilitator.ts +336 -0
- package/src/zktls/reclaim.ts +424 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { DynamicStructuredTool } from "@langchain/core/tools";
|
|
2
|
+
import { isAddress, isHex } from "viem";
|
|
3
|
+
import { z } from "zod/v3";
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
discoverServices as defaultDiscoverServices,
|
|
7
|
+
type DiscoverServicesOptions,
|
|
8
|
+
type ServiceListing,
|
|
9
|
+
} from "../discovery/registry.js";
|
|
10
|
+
import { checkMandate, type SignedSpendMandate } from "../mandates/mandate.js";
|
|
11
|
+
import {
|
|
12
|
+
type MandateAuthorizedStreamActionInput,
|
|
13
|
+
type ReclaimAuthorizedStreamInput,
|
|
14
|
+
type ReclaimVerifiedStreamResult,
|
|
15
|
+
type StreamProofTransactionResult,
|
|
16
|
+
type StreamStatusView,
|
|
17
|
+
type VerifiedStreamAgentOpener,
|
|
18
|
+
} from "../sdk/client.js";
|
|
19
|
+
|
|
20
|
+
const addressSchema = z
|
|
21
|
+
.string()
|
|
22
|
+
.refine((value) => isAddress(value), "must be an EVM address");
|
|
23
|
+
const bytes32Schema = z
|
|
24
|
+
.string()
|
|
25
|
+
.refine(
|
|
26
|
+
(value) => isHex(value, { strict: true }) && value.length === 66,
|
|
27
|
+
"must be bytes32 hex",
|
|
28
|
+
);
|
|
29
|
+
const decimalStringSchema = z.preprocess(
|
|
30
|
+
(value) =>
|
|
31
|
+
typeof value === "bigint" || typeof value === "number"
|
|
32
|
+
? value.toString()
|
|
33
|
+
: value,
|
|
34
|
+
z.string().regex(/^(0|[1-9]\d*)$/, "must be a base-10 integer string"),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const spendMandateInputSchema = z.object({
|
|
38
|
+
maxPerStreamUsdc: decimalStringSchema,
|
|
39
|
+
maxTotalUsdc: decimalStringSchema,
|
|
40
|
+
maxRatePerSecondUsdc: decimalStringSchema,
|
|
41
|
+
maxDurationSeconds: z.number().int().positive(),
|
|
42
|
+
allowedOperators: z.array(addressSchema).optional(),
|
|
43
|
+
expiresAt: z.number().int().positive(),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const signedSpendMandateInputSchema = z.object({
|
|
47
|
+
mandateId: bytes32Schema,
|
|
48
|
+
owner: addressSchema,
|
|
49
|
+
chainId: z.number().int().positive(),
|
|
50
|
+
issuedAt: z.number().int().nonnegative(),
|
|
51
|
+
mandate: spendMandateInputSchema,
|
|
52
|
+
signature: z
|
|
53
|
+
.string()
|
|
54
|
+
.refine(
|
|
55
|
+
(value) => isHex(value, { strict: true }) && value.length === 132,
|
|
56
|
+
"must be a 65-byte signature",
|
|
57
|
+
),
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const hireToolSchema = z.object({
|
|
61
|
+
operator: addressSchema,
|
|
62
|
+
serviceRef: bytes32Schema,
|
|
63
|
+
budgetUsdc: decimalStringSchema,
|
|
64
|
+
ratePerSecondUsdc: decimalStringSchema,
|
|
65
|
+
maxDurationSeconds: z.number().int().positive(),
|
|
66
|
+
signedMandate: signedSpendMandateInputSchema,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const streamStatusToolSchema = z.object({
|
|
70
|
+
streamId: bytes32Schema,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const reclaimToolSchema = z.object({
|
|
74
|
+
streamId: bytes32Schema,
|
|
75
|
+
closeFirst: z.boolean().optional(),
|
|
76
|
+
signedMandate: signedSpendMandateInputSchema,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const closeToolSchema = z.object({
|
|
80
|
+
streamId: bytes32Schema,
|
|
81
|
+
signedMandate: signedSpendMandateInputSchema,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const discoverToolSchema = z.object({
|
|
85
|
+
category: z.string().min(1).optional(),
|
|
86
|
+
limit: z.number().int().positive().optional(),
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export interface LangChainMandateStateResolver {
|
|
90
|
+
getSpentSoFarUsdc(owner: `0x${string}`): Promise<bigint>;
|
|
91
|
+
getRevokedMandateIds(owner: `0x${string}`): Promise<readonly `0x${string}`[]>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface LangChainVerifiedStreamClient extends Pick<
|
|
95
|
+
VerifiedStreamAgentOpener,
|
|
96
|
+
"openVerifiedStream"
|
|
97
|
+
> {
|
|
98
|
+
getStreamStatus(streamId: `0x${string}`): Promise<StreamStatusView>;
|
|
99
|
+
reclaimStream(
|
|
100
|
+
input: ReclaimAuthorizedStreamInput,
|
|
101
|
+
): Promise<ReclaimVerifiedStreamResult>;
|
|
102
|
+
closeStream(
|
|
103
|
+
input: MandateAuthorizedStreamActionInput,
|
|
104
|
+
): Promise<StreamProofTransactionResult>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface LangChainVerifiedStreamToolsOptions {
|
|
108
|
+
readonly agentClient: LangChainVerifiedStreamClient;
|
|
109
|
+
readonly mandateStateResolver?: Partial<LangChainMandateStateResolver>;
|
|
110
|
+
readonly now?: () => number;
|
|
111
|
+
/**
|
|
112
|
+
* Discovery driver for the `discover_services` tool. Defaults to the live
|
|
113
|
+
* registry-backed `discoverServices`; tests inject a double.
|
|
114
|
+
*/
|
|
115
|
+
readonly discoverServices?: (
|
|
116
|
+
opts?: DiscoverServicesOptions,
|
|
117
|
+
) => Promise<ServiceListing[]>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface LangChainVerifiedStreamTools {
|
|
121
|
+
readonly discover: DynamicStructuredTool<any, any, any, any, any, string>;
|
|
122
|
+
readonly hire: DynamicStructuredTool<any, any, any, any, any, string>;
|
|
123
|
+
readonly status: DynamicStructuredTool<any, any, any, any, any, string>;
|
|
124
|
+
readonly reclaim: DynamicStructuredTool<any, any, any, any, any, string>;
|
|
125
|
+
readonly close: DynamicStructuredTool<any, any, any, any, any, string>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const DEFAULT_MANDATE_STATE_RESOLVER: LangChainMandateStateResolver = {
|
|
129
|
+
getSpentSoFarUsdc: async () => 0n,
|
|
130
|
+
getRevokedMandateIds: async () => [],
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export function createLangChainVerifiedStreamTools(
|
|
134
|
+
options: LangChainVerifiedStreamToolsOptions,
|
|
135
|
+
): LangChainVerifiedStreamTools {
|
|
136
|
+
const resolver = {
|
|
137
|
+
...DEFAULT_MANDATE_STATE_RESOLVER,
|
|
138
|
+
...options.mandateStateResolver,
|
|
139
|
+
} satisfies LangChainMandateStateResolver;
|
|
140
|
+
const now = options.now ?? (() => Math.floor(Date.now() / 1000));
|
|
141
|
+
const discoverImpl = options.discoverServices ?? defaultDiscoverServices;
|
|
142
|
+
|
|
143
|
+
const discover: DynamicStructuredTool<any, any, any, any, any, string> =
|
|
144
|
+
new DynamicStructuredTool({
|
|
145
|
+
name: "discover_services",
|
|
146
|
+
description:
|
|
147
|
+
"Discover verified third-party services on the Metrik marketplace. Returns operator + serviceRef + endpoint for listings whose operator signature is verified — the entry point before hire_verified_service.",
|
|
148
|
+
schema: discoverToolSchema as any,
|
|
149
|
+
func: async (input: z.infer<typeof discoverToolSchema>) => {
|
|
150
|
+
const listings = await discoverImpl({
|
|
151
|
+
...(input.category === undefined ? {} : { category: input.category }),
|
|
152
|
+
...(input.limit === undefined ? {} : { limit: input.limit }),
|
|
153
|
+
});
|
|
154
|
+
return { services: listings };
|
|
155
|
+
},
|
|
156
|
+
}) as DynamicStructuredTool<any, any, any, any, any, string>;
|
|
157
|
+
|
|
158
|
+
const hire: DynamicStructuredTool<any, any, any, any, any, string> =
|
|
159
|
+
new DynamicStructuredTool({
|
|
160
|
+
name: "hire_verified_service",
|
|
161
|
+
description:
|
|
162
|
+
"Open a verified payment stream with a signed mandate and hard budget limits.",
|
|
163
|
+
schema: hireToolSchema as any,
|
|
164
|
+
func: async (input: z.infer<typeof hireToolSchema>) => {
|
|
165
|
+
const signedMandate = parseSignedMandateInput(input.signedMandate);
|
|
166
|
+
const nowSeconds = now();
|
|
167
|
+
const spentSoFarUsdc = await resolver.getSpentSoFarUsdc(
|
|
168
|
+
signedMandate.owner as `0x${string}`,
|
|
169
|
+
);
|
|
170
|
+
const revokedMandateIds = await resolver.getRevokedMandateIds(
|
|
171
|
+
signedMandate.owner as `0x${string}`,
|
|
172
|
+
);
|
|
173
|
+
const decision = await checkMandate(
|
|
174
|
+
signedMandate,
|
|
175
|
+
{
|
|
176
|
+
operator: input.operator as `0x${string}`,
|
|
177
|
+
budgetUsdc: BigInt(input.budgetUsdc),
|
|
178
|
+
ratePerSecondUsdc: BigInt(input.ratePerSecondUsdc),
|
|
179
|
+
maxDurationSeconds: input.maxDurationSeconds,
|
|
180
|
+
},
|
|
181
|
+
spentSoFarUsdc,
|
|
182
|
+
{
|
|
183
|
+
nowSeconds,
|
|
184
|
+
revokedMandateIds,
|
|
185
|
+
},
|
|
186
|
+
);
|
|
187
|
+
if (!decision.allowed) {
|
|
188
|
+
throw new Error(`mandate denied: ${decision.reason ?? "unknown"}`);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const result = await options.agentClient.openVerifiedStream({
|
|
192
|
+
operator: input.operator as `0x${string}`,
|
|
193
|
+
serviceRef: input.serviceRef as `0x${string}`,
|
|
194
|
+
budgetUsdc: BigInt(input.budgetUsdc),
|
|
195
|
+
ratePerSecondUsdc: BigInt(input.ratePerSecondUsdc),
|
|
196
|
+
maxDurationSeconds: input.maxDurationSeconds,
|
|
197
|
+
signedMandate,
|
|
198
|
+
spentSoFarUsdc,
|
|
199
|
+
nowSeconds,
|
|
200
|
+
revokedMandateIds,
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
return {
|
|
204
|
+
streamId: result.streamId,
|
|
205
|
+
txHash: result.txHash,
|
|
206
|
+
approveTxHash: result.approveTxHash,
|
|
207
|
+
handle: result.handle,
|
|
208
|
+
};
|
|
209
|
+
},
|
|
210
|
+
}) as DynamicStructuredTool<any, any, any, any, any, string>;
|
|
211
|
+
|
|
212
|
+
const status: DynamicStructuredTool<any, any, any, any, any, string> =
|
|
213
|
+
new DynamicStructuredTool({
|
|
214
|
+
name: "check_stream_status",
|
|
215
|
+
description:
|
|
216
|
+
"Read the current stream status and whether the agent should stop work.",
|
|
217
|
+
schema: streamStatusToolSchema as any,
|
|
218
|
+
func: async ({ streamId }: z.infer<typeof streamStatusToolSchema>) => {
|
|
219
|
+
const result = await options.agentClient.getStreamStatus(
|
|
220
|
+
streamId as `0x${string}`,
|
|
221
|
+
);
|
|
222
|
+
return serializeStreamStatus(result, streamId as `0x${string}`);
|
|
223
|
+
},
|
|
224
|
+
}) as DynamicStructuredTool<any, any, any, any, any, string>;
|
|
225
|
+
|
|
226
|
+
const reclaim: DynamicStructuredTool<any, any, any, any, any, string> =
|
|
227
|
+
new DynamicStructuredTool({
|
|
228
|
+
name: "reclaim_unspent",
|
|
229
|
+
description:
|
|
230
|
+
"Close and/or reclaim an existing stream under the same signed mandate controls.",
|
|
231
|
+
schema: reclaimToolSchema as any,
|
|
232
|
+
func: async (input: z.infer<typeof reclaimToolSchema>) => {
|
|
233
|
+
const signedMandate = parseSignedMandateInput(input.signedMandate);
|
|
234
|
+
const nowSeconds = now();
|
|
235
|
+
const spentSoFarUsdc = await resolver.getSpentSoFarUsdc(
|
|
236
|
+
signedMandate.owner as `0x${string}`,
|
|
237
|
+
);
|
|
238
|
+
const revokedMandateIds = await resolver.getRevokedMandateIds(
|
|
239
|
+
signedMandate.owner as `0x${string}`,
|
|
240
|
+
);
|
|
241
|
+
const result = await options.agentClient.reclaimStream({
|
|
242
|
+
streamId: input.streamId as `0x${string}`,
|
|
243
|
+
signedMandate,
|
|
244
|
+
spentSoFarUsdc,
|
|
245
|
+
nowSeconds,
|
|
246
|
+
revokedMandateIds,
|
|
247
|
+
...(input.closeFirst === undefined
|
|
248
|
+
? {}
|
|
249
|
+
: { closeFirst: input.closeFirst }),
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
return {
|
|
253
|
+
closeTxHash: result.closeResult?.txHash ?? null,
|
|
254
|
+
reclaimTxHash: result.reclaimResult.txHash,
|
|
255
|
+
};
|
|
256
|
+
},
|
|
257
|
+
}) as DynamicStructuredTool<any, any, any, any, any, string>;
|
|
258
|
+
|
|
259
|
+
const close: DynamicStructuredTool<any, any, any, any, any, string> =
|
|
260
|
+
new DynamicStructuredTool({
|
|
261
|
+
name: "close_stream",
|
|
262
|
+
description:
|
|
263
|
+
"Close an existing stream, finalizing accrual and halting further payment, under the same signed mandate controls.",
|
|
264
|
+
schema: closeToolSchema as any,
|
|
265
|
+
func: async (input: z.infer<typeof closeToolSchema>) => {
|
|
266
|
+
const signedMandate = parseSignedMandateInput(input.signedMandate);
|
|
267
|
+
const nowSeconds = now();
|
|
268
|
+
const spentSoFarUsdc = await resolver.getSpentSoFarUsdc(
|
|
269
|
+
signedMandate.owner as `0x${string}`,
|
|
270
|
+
);
|
|
271
|
+
const revokedMandateIds = await resolver.getRevokedMandateIds(
|
|
272
|
+
signedMandate.owner as `0x${string}`,
|
|
273
|
+
);
|
|
274
|
+
const result = await options.agentClient.closeStream({
|
|
275
|
+
streamId: input.streamId as `0x${string}`,
|
|
276
|
+
signedMandate,
|
|
277
|
+
spentSoFarUsdc,
|
|
278
|
+
nowSeconds,
|
|
279
|
+
revokedMandateIds,
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
return { closeTxHash: result.txHash };
|
|
283
|
+
},
|
|
284
|
+
}) as DynamicStructuredTool<any, any, any, any, any, string>;
|
|
285
|
+
|
|
286
|
+
return { discover, hire, status, reclaim, close };
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function parseSignedMandateInput(
|
|
290
|
+
value: z.input<typeof signedSpendMandateInputSchema>,
|
|
291
|
+
): SignedSpendMandate {
|
|
292
|
+
const parsed = signedSpendMandateInputSchema.parse(value);
|
|
293
|
+
return {
|
|
294
|
+
...parsed,
|
|
295
|
+
mandateId: parsed.mandateId as `0x${string}`,
|
|
296
|
+
owner: parsed.owner as `0x${string}`,
|
|
297
|
+
signature: parsed.signature as `0x${string}`,
|
|
298
|
+
mandate: {
|
|
299
|
+
...parsed.mandate,
|
|
300
|
+
maxPerStreamUsdc: BigInt(parsed.mandate.maxPerStreamUsdc),
|
|
301
|
+
maxTotalUsdc: BigInt(parsed.mandate.maxTotalUsdc),
|
|
302
|
+
maxRatePerSecondUsdc: BigInt(parsed.mandate.maxRatePerSecondUsdc),
|
|
303
|
+
},
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function serializeStreamStatus(
|
|
308
|
+
result: StreamStatusView,
|
|
309
|
+
streamId: `0x${string}`,
|
|
310
|
+
) {
|
|
311
|
+
return {
|
|
312
|
+
streamId,
|
|
313
|
+
shouldStop: result.stream.status !== "active",
|
|
314
|
+
stream: {
|
|
315
|
+
...result.stream,
|
|
316
|
+
deposit: result.stream.deposit.toString(),
|
|
317
|
+
ratePerSecond: result.stream.ratePerSecond.toString(),
|
|
318
|
+
accrued: result.stream.accrued.toString(),
|
|
319
|
+
claimed: result.stream.claimed.toString(),
|
|
320
|
+
lastSequence: result.stream.lastSequence.toString(),
|
|
321
|
+
},
|
|
322
|
+
claimable: result.claimable.toString(),
|
|
323
|
+
reclaimable: result.reclaimable.toString(),
|
|
324
|
+
};
|
|
325
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
export {
|
|
2
|
+
createSpendMandateTypedData,
|
|
3
|
+
spendMandateSchema,
|
|
4
|
+
signedSpendMandateSchema,
|
|
5
|
+
checkMandate,
|
|
6
|
+
checkMandatePolicy,
|
|
7
|
+
verifySignedMandate,
|
|
8
|
+
verifyMandateOwnerSignature,
|
|
9
|
+
spendMandateDomain,
|
|
10
|
+
spendMandateTypedData,
|
|
11
|
+
type SpendMandate,
|
|
12
|
+
type SignedSpendMandate,
|
|
13
|
+
type HireRequest,
|
|
14
|
+
type MandateDecision,
|
|
15
|
+
type MandateVerificationContext,
|
|
16
|
+
} from "./mandates/mandate.js";
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
DEFAULT_SERVER_MANDATE_TTL_SECONDS,
|
|
20
|
+
ServerMandateConfigError,
|
|
21
|
+
parseServerMandateCapsEnv,
|
|
22
|
+
signServerMandate,
|
|
23
|
+
type ServerMandateCaps,
|
|
24
|
+
type SignServerMandateOptions,
|
|
25
|
+
} from "./mandates/env.js";
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
VerifiedStreamX402Facilitator,
|
|
29
|
+
DeliveryProofUnavailableError,
|
|
30
|
+
X402PayloadError,
|
|
31
|
+
SettlementTargetMismatchError,
|
|
32
|
+
X402_SCHEME,
|
|
33
|
+
encodeX402PayloadHeader,
|
|
34
|
+
parseX402ChallengeJson,
|
|
35
|
+
parseX402PayloadHeader,
|
|
36
|
+
verifiedStreamRequirementsSchema,
|
|
37
|
+
x402StreamChallengeSchema,
|
|
38
|
+
x402OpenPayloadSchema,
|
|
39
|
+
type X402ConsumedHttpsResponseProofInput,
|
|
40
|
+
type X402Facilitator,
|
|
41
|
+
type X402OpenPayload,
|
|
42
|
+
type X402StreamChallenge,
|
|
43
|
+
type VerifiedStreamFacilitatorOptions,
|
|
44
|
+
type VerifiedStreamRequirements,
|
|
45
|
+
} from "./x402/facilitator.js";
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
DEFAULT_METRIK_REGISTRY_URL,
|
|
49
|
+
discoverServices,
|
|
50
|
+
type DiscoverServicesOptions,
|
|
51
|
+
type ServiceListing,
|
|
52
|
+
} from "./discovery/registry.js";
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
METRIK_MCP_TOOLS,
|
|
56
|
+
STREAMPROOF_MCP_TOOLS,
|
|
57
|
+
FileStreamRegistry,
|
|
58
|
+
InMemoryStreamRegistry,
|
|
59
|
+
createVerifiedStreamMcpServer,
|
|
60
|
+
createVerifiedStreamMcpServerFromEnv,
|
|
61
|
+
createVerifiedStreamMcpServerOptionsFromEnv,
|
|
62
|
+
parseMetrikAgentEnv,
|
|
63
|
+
startVerifiedStreamMcpServerStdio,
|
|
64
|
+
type McpToolSpec,
|
|
65
|
+
type ParsedMetrikAgentEnv,
|
|
66
|
+
type StoredStreamRecord,
|
|
67
|
+
type StreamRegistry,
|
|
68
|
+
type VerifiedStreamMcpClient,
|
|
69
|
+
type VerifiedStreamMcpServerOptions,
|
|
70
|
+
type VerifiedStreamMcpServerRuntime,
|
|
71
|
+
} from "./mcp/server.js";
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
StaticTenantResolver,
|
|
75
|
+
createHostedMcpHttpServer,
|
|
76
|
+
createHostedMcpTenants,
|
|
77
|
+
parseHostedMcpServerConfig,
|
|
78
|
+
startHostedMcpHttpServerFromEnv,
|
|
79
|
+
type HostedMcpHttpServer,
|
|
80
|
+
type HostedMcpHttpServerOptions,
|
|
81
|
+
type HostedMcpServerConfig,
|
|
82
|
+
type HostedMcpTenant,
|
|
83
|
+
type HostedMcpTenantConfig,
|
|
84
|
+
type TenantResolver,
|
|
85
|
+
} from "./mcp/http.js";
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
MandateDeniedError,
|
|
89
|
+
VerifiedStreamAgentClient,
|
|
90
|
+
type AgentSdkClient,
|
|
91
|
+
type AgentSdkClientFactory,
|
|
92
|
+
type MandateAuthorizedStreamActionInput,
|
|
93
|
+
type OpenVerifiedStreamInput,
|
|
94
|
+
type ReclaimAuthorizedStreamInput,
|
|
95
|
+
type ReclaimVerifiedStreamOptions,
|
|
96
|
+
type ReclaimVerifiedStreamResult,
|
|
97
|
+
type StreamStatusView,
|
|
98
|
+
type VerifiedStreamAgentOpener,
|
|
99
|
+
} from "./sdk/client.js";
|
|
100
|
+
|
|
101
|
+
export {
|
|
102
|
+
AgentWalletConfigError,
|
|
103
|
+
createWalletBackedAgentClient,
|
|
104
|
+
parseAgentWalletEnv,
|
|
105
|
+
resolveAgentWallet,
|
|
106
|
+
type AgentWalletInput,
|
|
107
|
+
type CdpClientLike,
|
|
108
|
+
type CdpWalletConfig,
|
|
109
|
+
type ResolvedAgentWallet,
|
|
110
|
+
type WalletBackedAgentClient,
|
|
111
|
+
} from "./wallet/provider.js";
|
|
112
|
+
|
|
113
|
+
export {
|
|
114
|
+
ReclaimConsumerProofService,
|
|
115
|
+
ResponseProofUnavailableError,
|
|
116
|
+
ResponseProofVerificationError,
|
|
117
|
+
createReclaimConsumerProofServiceFromEnv,
|
|
118
|
+
parseReclaimProofEnv,
|
|
119
|
+
type ConsumerDeliveryProofService,
|
|
120
|
+
type DeliveryProofBinding,
|
|
121
|
+
type HttpsResponseMatch,
|
|
122
|
+
type HttpsResponseRedaction,
|
|
123
|
+
type ParsedReclaimProofEnv,
|
|
124
|
+
type ProveConsumedHttpsResponseInput,
|
|
125
|
+
type ReclaimClientLike,
|
|
126
|
+
type ReclaimProof,
|
|
127
|
+
type ReclaimProofServiceConfig,
|
|
128
|
+
type VerifiedConsumedHttpsResponseProof,
|
|
129
|
+
type VerifyProofFn,
|
|
130
|
+
} from "./zktls/reclaim.js";
|
|
131
|
+
|
|
132
|
+
export {
|
|
133
|
+
createLangChainVerifiedStreamTools,
|
|
134
|
+
type LangChainMandateStateResolver,
|
|
135
|
+
type LangChainVerifiedStreamClient,
|
|
136
|
+
type LangChainVerifiedStreamTools,
|
|
137
|
+
type LangChainVerifiedStreamToolsOptions,
|
|
138
|
+
} from "./frameworks/langchain.js";
|
|
139
|
+
|
|
140
|
+
export {
|
|
141
|
+
METRIK_ELIZA_ACTION_NAMES,
|
|
142
|
+
METRIK_ELIZA_SETTLEMENT_CHAIN_ID,
|
|
143
|
+
createMetrikElizaPlugin,
|
|
144
|
+
createMetrikElizaContent,
|
|
145
|
+
metrikElizaPlugin,
|
|
146
|
+
// Deprecated aliases retained for backward compatibility.
|
|
147
|
+
createElizaVerifiedStreamContent,
|
|
148
|
+
createElizaVerifiedStreamPlugin,
|
|
149
|
+
type MetrikElizaActionInputs,
|
|
150
|
+
type MetrikElizaActionName,
|
|
151
|
+
type MetrikElizaClient,
|
|
152
|
+
type MetrikElizaMandateStateResolver,
|
|
153
|
+
type MetrikElizaPluginOptions,
|
|
154
|
+
} from "./frameworks/eliza.js";
|
|
155
|
+
|
|
156
|
+
export {
|
|
157
|
+
CREWAI_VERIFIED_STREAM_TOOL_NAMES,
|
|
158
|
+
createCrewAiVerifiedStreamMcpConfig,
|
|
159
|
+
renderCrewAiVerifiedStreamPythonExample,
|
|
160
|
+
type CrewAiVerifiedStreamMcpConfig,
|
|
161
|
+
type CrewAiVerifiedStreamMcpConfigOptions,
|
|
162
|
+
} from "./frameworks/crewai.js";
|
|
163
|
+
|
|
164
|
+
export {
|
|
165
|
+
METRIK_BASE_SEPOLIA_CHAIN_ID,
|
|
166
|
+
MetrikActionProvider,
|
|
167
|
+
MetrikActionProviderConfigError,
|
|
168
|
+
metrikActionProvider,
|
|
169
|
+
createMetrikAgentKit,
|
|
170
|
+
discoverServicesSchema,
|
|
171
|
+
hireVerifiedServiceSchema,
|
|
172
|
+
checkStreamStatusSchema,
|
|
173
|
+
reclaimUnspentSchema,
|
|
174
|
+
closeStreamSchema,
|
|
175
|
+
type CreateMetrikAgentKitOptions,
|
|
176
|
+
type MetrikActionProviderConfig,
|
|
177
|
+
type MetrikAgentKitClient,
|
|
178
|
+
type MetrikMandateStateResolver,
|
|
179
|
+
} from "./frameworks/agentkit.js";
|