@vapi-network/mcp 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/README.md +49 -5
- package/dist/actions/call.d.ts +453 -0
- package/dist/actions/context.d.ts +44 -0
- package/dist/actions/define.d.ts +16 -0
- package/dist/actions/policy.d.ts +17 -0
- package/dist/actions/register.d.ts +342 -0
- package/dist/agent/deps.d.ts +2 -1
- package/dist/agent/run.d.ts +36 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +5365 -1781
- package/dist/index.js.map +3 -3
- package/dist/server.d.ts +13 -5
- package/dist/tools/accounts.d.ts +148 -0
- package/dist/tools/auth.d.ts +2 -0
- package/dist/tools/call.d.ts +3 -1
- package/dist/tools/siblings.d.ts +70 -0
- package/dist/tools/status.d.ts +116 -0
- package/dist/wallet-session.d.ts +21 -25
- package/package.json +1 -1
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { type AgentProfile } from "@vapi-network/core";
|
|
2
|
+
import type { ActionContext } from "./context.js";
|
|
3
|
+
import type { Action } from "./define.js";
|
|
4
|
+
export declare class ActionDeclinedError extends Error {
|
|
5
|
+
readonly reason: string;
|
|
6
|
+
readonly name = "ActionDeclinedError";
|
|
7
|
+
constructor(reason: string);
|
|
8
|
+
}
|
|
9
|
+
export declare function runAction<I, O>(action: Action<I, O>, rawInput: unknown, ctx: ActionContext): Promise<O>;
|
|
10
|
+
export declare const actions: readonly [Action<{
|
|
11
|
+
query?: string | undefined;
|
|
12
|
+
kinds?: ("api" | "service_offer" | "open_request")[] | undefined;
|
|
13
|
+
network?: string | undefined;
|
|
14
|
+
limit?: number | undefined;
|
|
15
|
+
cursor?: string | undefined;
|
|
16
|
+
includeUnverified?: boolean | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
[x: string]: unknown;
|
|
19
|
+
protocol: "vapi.marketplace.discovery/1";
|
|
20
|
+
items: ({
|
|
21
|
+
[x: string]: unknown;
|
|
22
|
+
kind: "api";
|
|
23
|
+
provenance: "self_listed" | "partner";
|
|
24
|
+
execution: {
|
|
25
|
+
[x: string]: unknown;
|
|
26
|
+
mode: "direct" | "gateway";
|
|
27
|
+
};
|
|
28
|
+
action: {
|
|
29
|
+
[x: string]: unknown;
|
|
30
|
+
type: "invoke_api";
|
|
31
|
+
href: string;
|
|
32
|
+
};
|
|
33
|
+
verification: "none" | "requested" | "verified";
|
|
34
|
+
ref: string;
|
|
35
|
+
card: {
|
|
36
|
+
[x: string]: unknown;
|
|
37
|
+
title: string;
|
|
38
|
+
summary: string;
|
|
39
|
+
badges: {
|
|
40
|
+
[x: string]: unknown;
|
|
41
|
+
code: "partner" | "live_x402" | "payout_wallet_confirmed" | "vapi_verified" | "external_catalog" | "approved_vendor";
|
|
42
|
+
label: string;
|
|
43
|
+
}[];
|
|
44
|
+
facts: {
|
|
45
|
+
[x: string]: unknown;
|
|
46
|
+
label: string;
|
|
47
|
+
value: string;
|
|
48
|
+
}[];
|
|
49
|
+
byline?: string | undefined;
|
|
50
|
+
bylineHref?: string | undefined;
|
|
51
|
+
};
|
|
52
|
+
group?: "partner" | "vapi" | "added" | "external" | undefined;
|
|
53
|
+
fee?: {
|
|
54
|
+
[x: string]: unknown;
|
|
55
|
+
bps: number;
|
|
56
|
+
label: string;
|
|
57
|
+
} | undefined;
|
|
58
|
+
liveness?: {
|
|
59
|
+
[x: string]: unknown;
|
|
60
|
+
uptime7d: number;
|
|
61
|
+
latencyP50Ms: number | null;
|
|
62
|
+
latencyP95Ms: number | null;
|
|
63
|
+
checks7d: number;
|
|
64
|
+
} | undefined;
|
|
65
|
+
conformance?: {
|
|
66
|
+
[x: string]: unknown;
|
|
67
|
+
declaredVersion: 1 | 2 | null;
|
|
68
|
+
versionConformant: boolean;
|
|
69
|
+
offerTransport: "body" | "header" | "both";
|
|
70
|
+
issues: string[];
|
|
71
|
+
} | undefined;
|
|
72
|
+
identity?: {
|
|
73
|
+
[x: string]: unknown;
|
|
74
|
+
erc8004Id: string;
|
|
75
|
+
reputation?: {
|
|
76
|
+
[x: string]: unknown;
|
|
77
|
+
score: number;
|
|
78
|
+
count: number;
|
|
79
|
+
} | undefined;
|
|
80
|
+
} | undefined;
|
|
81
|
+
} | {
|
|
82
|
+
[x: string]: unknown;
|
|
83
|
+
kind: "api";
|
|
84
|
+
provenance: "indexed";
|
|
85
|
+
execution: {
|
|
86
|
+
[x: string]: unknown;
|
|
87
|
+
mode: "direct";
|
|
88
|
+
url: string;
|
|
89
|
+
method: "HEAD" | "POST" | "GET" | "PUT" | "PATCH" | "DELETE" | null;
|
|
90
|
+
network: string;
|
|
91
|
+
};
|
|
92
|
+
action: {
|
|
93
|
+
[x: string]: unknown;
|
|
94
|
+
type: "invoke_api";
|
|
95
|
+
href: string;
|
|
96
|
+
};
|
|
97
|
+
verification: "none" | "requested" | "verified";
|
|
98
|
+
ref: string;
|
|
99
|
+
card: {
|
|
100
|
+
[x: string]: unknown;
|
|
101
|
+
title: string;
|
|
102
|
+
summary: string;
|
|
103
|
+
badges: {
|
|
104
|
+
[x: string]: unknown;
|
|
105
|
+
code: "partner" | "live_x402" | "payout_wallet_confirmed" | "vapi_verified" | "external_catalog" | "approved_vendor";
|
|
106
|
+
label: string;
|
|
107
|
+
}[];
|
|
108
|
+
facts: {
|
|
109
|
+
[x: string]: unknown;
|
|
110
|
+
label: string;
|
|
111
|
+
value: string;
|
|
112
|
+
}[];
|
|
113
|
+
byline?: string | undefined;
|
|
114
|
+
bylineHref?: string | undefined;
|
|
115
|
+
};
|
|
116
|
+
group?: "partner" | "vapi" | "added" | "external" | undefined;
|
|
117
|
+
fee?: {
|
|
118
|
+
[x: string]: unknown;
|
|
119
|
+
bps: number;
|
|
120
|
+
label: string;
|
|
121
|
+
} | undefined;
|
|
122
|
+
liveness?: {
|
|
123
|
+
[x: string]: unknown;
|
|
124
|
+
uptime7d: number;
|
|
125
|
+
latencyP50Ms: number | null;
|
|
126
|
+
latencyP95Ms: number | null;
|
|
127
|
+
checks7d: number;
|
|
128
|
+
} | undefined;
|
|
129
|
+
conformance?: {
|
|
130
|
+
[x: string]: unknown;
|
|
131
|
+
declaredVersion: 1 | 2 | null;
|
|
132
|
+
versionConformant: boolean;
|
|
133
|
+
offerTransport: "body" | "header" | "both";
|
|
134
|
+
issues: string[];
|
|
135
|
+
} | undefined;
|
|
136
|
+
identity?: {
|
|
137
|
+
[x: string]: unknown;
|
|
138
|
+
erc8004Id: string;
|
|
139
|
+
reputation?: {
|
|
140
|
+
[x: string]: unknown;
|
|
141
|
+
score: number;
|
|
142
|
+
count: number;
|
|
143
|
+
} | undefined;
|
|
144
|
+
} | undefined;
|
|
145
|
+
} | {
|
|
146
|
+
[x: string]: unknown;
|
|
147
|
+
kind: "service_offer";
|
|
148
|
+
action: {
|
|
149
|
+
[x: string]: unknown;
|
|
150
|
+
type: "start_engagement";
|
|
151
|
+
href: string;
|
|
152
|
+
};
|
|
153
|
+
verification: "none" | "requested" | "verified";
|
|
154
|
+
ref: string;
|
|
155
|
+
card: {
|
|
156
|
+
[x: string]: unknown;
|
|
157
|
+
title: string;
|
|
158
|
+
summary: string;
|
|
159
|
+
badges: {
|
|
160
|
+
[x: string]: unknown;
|
|
161
|
+
code: "partner" | "live_x402" | "payout_wallet_confirmed" | "vapi_verified" | "external_catalog" | "approved_vendor";
|
|
162
|
+
label: string;
|
|
163
|
+
}[];
|
|
164
|
+
facts: {
|
|
165
|
+
[x: string]: unknown;
|
|
166
|
+
label: string;
|
|
167
|
+
value: string;
|
|
168
|
+
}[];
|
|
169
|
+
byline?: string | undefined;
|
|
170
|
+
bylineHref?: string | undefined;
|
|
171
|
+
};
|
|
172
|
+
group?: "partner" | "vapi" | "added" | "external" | undefined;
|
|
173
|
+
fee?: {
|
|
174
|
+
[x: string]: unknown;
|
|
175
|
+
bps: number;
|
|
176
|
+
label: string;
|
|
177
|
+
} | undefined;
|
|
178
|
+
liveness?: {
|
|
179
|
+
[x: string]: unknown;
|
|
180
|
+
uptime7d: number;
|
|
181
|
+
latencyP50Ms: number | null;
|
|
182
|
+
latencyP95Ms: number | null;
|
|
183
|
+
checks7d: number;
|
|
184
|
+
} | undefined;
|
|
185
|
+
conformance?: {
|
|
186
|
+
[x: string]: unknown;
|
|
187
|
+
declaredVersion: 1 | 2 | null;
|
|
188
|
+
versionConformant: boolean;
|
|
189
|
+
offerTransport: "body" | "header" | "both";
|
|
190
|
+
issues: string[];
|
|
191
|
+
} | undefined;
|
|
192
|
+
identity?: {
|
|
193
|
+
[x: string]: unknown;
|
|
194
|
+
erc8004Id: string;
|
|
195
|
+
reputation?: {
|
|
196
|
+
[x: string]: unknown;
|
|
197
|
+
score: number;
|
|
198
|
+
count: number;
|
|
199
|
+
} | undefined;
|
|
200
|
+
} | undefined;
|
|
201
|
+
} | {
|
|
202
|
+
[x: string]: unknown;
|
|
203
|
+
kind: "open_request";
|
|
204
|
+
action: {
|
|
205
|
+
[x: string]: unknown;
|
|
206
|
+
type: "propose_to_request";
|
|
207
|
+
href: string;
|
|
208
|
+
};
|
|
209
|
+
verification: "none" | "requested" | "verified";
|
|
210
|
+
ref: string;
|
|
211
|
+
card: {
|
|
212
|
+
[x: string]: unknown;
|
|
213
|
+
title: string;
|
|
214
|
+
summary: string;
|
|
215
|
+
badges: {
|
|
216
|
+
[x: string]: unknown;
|
|
217
|
+
code: "partner" | "live_x402" | "payout_wallet_confirmed" | "vapi_verified" | "external_catalog" | "approved_vendor";
|
|
218
|
+
label: string;
|
|
219
|
+
}[];
|
|
220
|
+
facts: {
|
|
221
|
+
[x: string]: unknown;
|
|
222
|
+
label: string;
|
|
223
|
+
value: string;
|
|
224
|
+
}[];
|
|
225
|
+
byline?: string | undefined;
|
|
226
|
+
bylineHref?: string | undefined;
|
|
227
|
+
};
|
|
228
|
+
group?: "partner" | "vapi" | "added" | "external" | undefined;
|
|
229
|
+
fee?: {
|
|
230
|
+
[x: string]: unknown;
|
|
231
|
+
bps: number;
|
|
232
|
+
label: string;
|
|
233
|
+
} | undefined;
|
|
234
|
+
liveness?: {
|
|
235
|
+
[x: string]: unknown;
|
|
236
|
+
uptime7d: number;
|
|
237
|
+
latencyP50Ms: number | null;
|
|
238
|
+
latencyP95Ms: number | null;
|
|
239
|
+
checks7d: number;
|
|
240
|
+
} | undefined;
|
|
241
|
+
conformance?: {
|
|
242
|
+
[x: string]: unknown;
|
|
243
|
+
declaredVersion: 1 | 2 | null;
|
|
244
|
+
versionConformant: boolean;
|
|
245
|
+
offerTransport: "body" | "header" | "both";
|
|
246
|
+
issues: string[];
|
|
247
|
+
} | undefined;
|
|
248
|
+
identity?: {
|
|
249
|
+
[x: string]: unknown;
|
|
250
|
+
erc8004Id: string;
|
|
251
|
+
reputation?: {
|
|
252
|
+
[x: string]: unknown;
|
|
253
|
+
score: number;
|
|
254
|
+
count: number;
|
|
255
|
+
} | undefined;
|
|
256
|
+
} | undefined;
|
|
257
|
+
})[];
|
|
258
|
+
nextCursor: string | null;
|
|
259
|
+
unavailableKinds: ("api" | "service_offer" | "open_request")[];
|
|
260
|
+
rankingVersion: "marketplace-ranking-v1";
|
|
261
|
+
}>, Action<{
|
|
262
|
+
id: string;
|
|
263
|
+
endpoint?: string | undefined;
|
|
264
|
+
}, {
|
|
265
|
+
name: string;
|
|
266
|
+
method: string | null;
|
|
267
|
+
url: string;
|
|
268
|
+
price: string;
|
|
269
|
+
description: string;
|
|
270
|
+
verification: "none" | "requested" | "verified";
|
|
271
|
+
payment: {
|
|
272
|
+
scheme: "exact";
|
|
273
|
+
network: string;
|
|
274
|
+
asset: string;
|
|
275
|
+
payTo: string;
|
|
276
|
+
checkedAt: string;
|
|
277
|
+
} | null;
|
|
278
|
+
operationId?: string | undefined;
|
|
279
|
+
requestContentType?: string | undefined;
|
|
280
|
+
requestSchema?: unknown;
|
|
281
|
+
responseContentType?: string | undefined;
|
|
282
|
+
network?: string | undefined;
|
|
283
|
+
group?: "partner" | "vapi" | "added" | "external" | undefined;
|
|
284
|
+
fee?: {
|
|
285
|
+
[x: string]: unknown;
|
|
286
|
+
bps: number;
|
|
287
|
+
label: string;
|
|
288
|
+
} | undefined;
|
|
289
|
+
liveness?: {
|
|
290
|
+
[x: string]: unknown;
|
|
291
|
+
uptime7d: number;
|
|
292
|
+
latencyP50Ms: number | null;
|
|
293
|
+
latencyP95Ms: number | null;
|
|
294
|
+
checks7d: number;
|
|
295
|
+
} | undefined;
|
|
296
|
+
conformance?: {
|
|
297
|
+
[x: string]: unknown;
|
|
298
|
+
declaredVersion: 1 | 2 | null;
|
|
299
|
+
versionConformant: boolean;
|
|
300
|
+
offerTransport: "body" | "header" | "both";
|
|
301
|
+
issues: string[];
|
|
302
|
+
} | undefined;
|
|
303
|
+
identity?: {
|
|
304
|
+
[x: string]: unknown;
|
|
305
|
+
erc8004Id: string;
|
|
306
|
+
reputation?: {
|
|
307
|
+
[x: string]: unknown;
|
|
308
|
+
score: number;
|
|
309
|
+
count: number;
|
|
310
|
+
} | undefined;
|
|
311
|
+
} | undefined;
|
|
312
|
+
}>, Action<{
|
|
313
|
+
id?: string | undefined;
|
|
314
|
+
url?: string | undefined;
|
|
315
|
+
method?: string | undefined;
|
|
316
|
+
endpoint?: string | undefined;
|
|
317
|
+
body?: unknown;
|
|
318
|
+
contentType?: string | undefined;
|
|
319
|
+
network?: string | undefined;
|
|
320
|
+
expectedPayTo?: string | undefined;
|
|
321
|
+
maxPriceUsd?: string | number | undefined;
|
|
322
|
+
wallet?: string | undefined;
|
|
323
|
+
}, {
|
|
324
|
+
wallet: string;
|
|
325
|
+
} & import("../server.js").CallToolResult>];
|
|
326
|
+
export declare const agentToolNames: AgentProfile["tools"];
|
|
327
|
+
export declare const registeredAgentProfileSchema: import("zod").ZodObject<{
|
|
328
|
+
tools: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodEnum<{
|
|
329
|
+
[x: string]: string;
|
|
330
|
+
}>>>;
|
|
331
|
+
version: import("zod").ZodLiteral<1>;
|
|
332
|
+
name: import("zod").ZodString;
|
|
333
|
+
wallet: import("zod").ZodString;
|
|
334
|
+
model: import("zod").ZodString;
|
|
335
|
+
instructions: import("zod").ZodString;
|
|
336
|
+
verifiedOnly: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
337
|
+
approveAboveUsd: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
338
|
+
maxSteps: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
339
|
+
paused: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
340
|
+
createdAt: import("zod").ZodString;
|
|
341
|
+
}, import("zod/v4/core").$strip>;
|
|
342
|
+
export declare function findAction(name: string): (typeof actions)[number] | undefined;
|
package/dist/agent/deps.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AgentProfile, type ChatRequest, type ChatResult, type SpendCaps, type VapiConfig, type VapiPaymentAccount, type WalletName } from "@vapi-network/core";
|
|
1
|
+
import { type AgentProfile, type CeilingSweepHook, type ChatRequest, type ChatResult, type SpendCaps, type VapiConfig, type VapiPaymentAccount, type WalletName } from "@vapi-network/core";
|
|
2
2
|
import type { AgentEvent, RunAgentDeps } from "./run.js";
|
|
3
3
|
export declare function createAgentRunDeps(input: {
|
|
4
4
|
profile: AgentProfile;
|
|
@@ -14,4 +14,5 @@ export declare function createAgentRunDeps(input: {
|
|
|
14
14
|
fetchImpl?: typeof fetch;
|
|
15
15
|
ledgerPath?: string;
|
|
16
16
|
receiptsPath?: string;
|
|
17
|
+
ceilingSweep?: CeilingSweepHook | false;
|
|
17
18
|
}): RunAgentDeps;
|
package/dist/agent/run.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AgentProfile, type ChatRequest, type ChatResult, type VapiConfig } from "@vapi-network/core";
|
|
2
|
+
import { type ActionRunState } from "../actions/context.js";
|
|
2
3
|
import type { InspectToolResult } from "../tools/inspect.js";
|
|
3
4
|
export type AgentEvent = {
|
|
4
5
|
type: "step";
|
|
@@ -60,6 +61,7 @@ export type RunAgentDeps = {
|
|
|
60
61
|
onEvent?: (event: AgentEvent) => void;
|
|
61
62
|
tty?: boolean;
|
|
62
63
|
now?: () => Date;
|
|
64
|
+
forRun?: (run: ActionRunState) => RunAgentDeps;
|
|
63
65
|
};
|
|
64
66
|
export type RunAgentResult = {
|
|
65
67
|
answer: string | null;
|
|
@@ -69,4 +71,38 @@ export type RunAgentResult = {
|
|
|
69
71
|
paidUsd: number;
|
|
70
72
|
steps: number;
|
|
71
73
|
};
|
|
74
|
+
export declare function loopToolsForProfile(profile: {
|
|
75
|
+
tools: readonly string[];
|
|
76
|
+
}): ({
|
|
77
|
+
readonly type: "function";
|
|
78
|
+
readonly function: {
|
|
79
|
+
readonly name: "finish";
|
|
80
|
+
readonly description: "Finish the run with the final answer.";
|
|
81
|
+
readonly strict: true;
|
|
82
|
+
readonly parameters: {
|
|
83
|
+
readonly type: "object";
|
|
84
|
+
readonly properties: {
|
|
85
|
+
readonly answer: {
|
|
86
|
+
readonly type: "string";
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
readonly required: readonly ["answer"];
|
|
90
|
+
readonly additionalProperties: false;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
} | {
|
|
94
|
+
profileName: string;
|
|
95
|
+
type: "function";
|
|
96
|
+
function: {
|
|
97
|
+
name: string;
|
|
98
|
+
description: string;
|
|
99
|
+
strict: true;
|
|
100
|
+
parameters: {
|
|
101
|
+
type: "object";
|
|
102
|
+
properties: Record<string, unknown>;
|
|
103
|
+
required: string[];
|
|
104
|
+
additionalProperties: false;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
})[];
|
|
72
108
|
export declare function runAgent(task: string, deps: RunAgentDeps): Promise<RunAgentResult>;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,4 +6,9 @@ export { WalletSession, type SessionWallet, type SessionWalletInfo, type WalletS
|
|
|
6
6
|
export { buildSIWxProof, parseSIWxResponse } from "./siwx.js";
|
|
7
7
|
export { UNTRUSTED_NOTICE, decidePayment, wrapUntrusted, type PayDecision, } from "./agent/guards.js";
|
|
8
8
|
export { createAgentRunDeps } from "./agent/deps.js";
|
|
9
|
-
export { runAgent, type AgentEvent, type RunAgentDeps, type RunAgentResult } from "./agent/run.js";
|
|
9
|
+
export { loopToolsForProfile, runAgent, type AgentEvent, type RunAgentDeps, type RunAgentResult, } from "./agent/run.js";
|
|
10
|
+
export { callInspect, callInspectInputSchema, callPay, callPayInputSchema, callSearch, callSearchInputSchema, callToolResultSchema, createCallPort, inspectToolResultSchema, MAX_CACHED_MARKETPLACE_REFS, walletArgument, type CreateCallPortOptions, type PaymentResolution, } from "./actions/call.js";
|
|
11
|
+
export { createRunState, inspectionCacheKey, type ActionContext, type ActionRunState, type ActionSurface, type CallPort, } from "./actions/context.js";
|
|
12
|
+
export { defineAction, toLoopName, type Action, type ActionGrant, type ActionMoney, } from "./actions/define.js";
|
|
13
|
+
export { checkAction, exactUsdcPrice, type PolicyDecision } from "./actions/policy.js";
|
|
14
|
+
export { ActionDeclinedError, actions, agentToolNames, findAction, registeredAgentProfileSchema, runAction, } from "./actions/register.js";
|