vapi-network 0.2.3 → 0.5.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 +764 -231
- package/dist/cli.js +33709 -3268
- package/dist/cli.js.map +3 -3
- package/dist/client.d.ts +61 -0
- package/dist/client.test.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +34262 -3496
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type AgentRouterUsage, type ChatRequest, type ChatResult, type Receipt, type RouterModel, type SecretStore, type VapiPaymentAccount } from "@vapi-network/core";
|
|
2
|
+
import { type RouterTopupTier } from "@vapi-network/core/router-client";
|
|
3
|
+
import { type CallToolInput, type CallToolResult, type InspectToolResult, type RunAgentDeps, type RunAgentResult } from "@vapi-network/mcp";
|
|
4
|
+
export type VapiClientOptions = {
|
|
5
|
+
/** Wallet name. Defaults to VAPI_WALLET, then the machine default. */
|
|
6
|
+
wallet?: string;
|
|
7
|
+
/** Local state directory. Defaults to VAPI_HOME or ~/.vapi. */
|
|
8
|
+
home?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Server use: sign with this account instead of the local keystore, for
|
|
11
|
+
* example a KMS or CDP server wallet represented as a viem account.
|
|
12
|
+
*/
|
|
13
|
+
account?: VapiPaymentAccount;
|
|
14
|
+
/** Used only without account, VAPI_KEYSTORE_PASSWORD, or a keychain entry. */
|
|
15
|
+
passphrase?: string;
|
|
16
|
+
fetch?: typeof fetch;
|
|
17
|
+
/** Test or embedded-runtime override for the OS secret store. */
|
|
18
|
+
secretStore?: SecretStore;
|
|
19
|
+
/** Test or embedded-runtime override for VAPI_HOME, VAPI_WALLET, and passphrase lookup. */
|
|
20
|
+
env?: NodeJS.ProcessEnv;
|
|
21
|
+
};
|
|
22
|
+
export type VapiClient = {
|
|
23
|
+
wallet: {
|
|
24
|
+
name: string;
|
|
25
|
+
address: `0x${string}`;
|
|
26
|
+
owner: `0x${string}` | null;
|
|
27
|
+
};
|
|
28
|
+
call: {
|
|
29
|
+
search(query: string, opts?: {
|
|
30
|
+
network?: string;
|
|
31
|
+
includeUnverified?: boolean;
|
|
32
|
+
}): Promise<unknown[]>;
|
|
33
|
+
inspect(ref: string): Promise<InspectToolResult>;
|
|
34
|
+
pay(input: CallToolInput): Promise<CallToolResult>;
|
|
35
|
+
};
|
|
36
|
+
router: {
|
|
37
|
+
models(): Promise<RouterModel[]>;
|
|
38
|
+
usage(): Promise<AgentRouterUsage>;
|
|
39
|
+
buy(usd: RouterTopupTier): Promise<{
|
|
40
|
+
receipt: Receipt;
|
|
41
|
+
balance: AgentRouterUsage["balance"];
|
|
42
|
+
}>;
|
|
43
|
+
chat(req: ChatRequest): Promise<ChatResult>;
|
|
44
|
+
/**
|
|
45
|
+
* Base URL and key for any OpenAI-compatible framework. The key stays in
|
|
46
|
+
* your process. Use this in your own code. Do not pass it into a model prompt.
|
|
47
|
+
*/
|
|
48
|
+
openai(): Promise<{
|
|
49
|
+
baseURL: string;
|
|
50
|
+
apiKey: string;
|
|
51
|
+
}>;
|
|
52
|
+
};
|
|
53
|
+
agent: {
|
|
54
|
+
run(profileName: string, task: string, opts?: {
|
|
55
|
+
approve?: RunAgentDeps["approve"];
|
|
56
|
+
onEvent?: RunAgentDeps["onEvent"];
|
|
57
|
+
}): Promise<RunAgentResult>;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
/** A wallet-bound SDK facade over vAPI Call, vAPI Router, and local agents. */
|
|
61
|
+
export declare function createVapiClient(options?: VapiClientOptions): Promise<VapiClient>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export * as cli from "@vapi-network/cli";
|
|
|
2
2
|
export * as core from "@vapi-network/core";
|
|
3
3
|
export * as mcp from "@vapi-network/mcp";
|
|
4
4
|
export * as sources from "@vapi-network/sources";
|
|
5
|
+
export { createVapiClient, type VapiClient, type VapiClientOptions } from "./client.js";
|
|
5
6
|
export { DEFAULT_DISCOVERY_URL, DEFAULT_MARKETPLACE_DISCOVERY_URL, DEFAULT_REGISTRY_FALLBACKS, DEFAULT_REGISTRY_URL, getDefaultConfig, } from "@vapi-network/core";
|
|
6
7
|
export { bazaarSource, localFileSource, vapiRegistrySource } from "@vapi-network/sources";
|