vapi-network 0.3.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 +108 -529
- package/dist/cli.js +19267 -3900
- package/dist/cli.js.map +3 -3
- package/dist/client.d.ts +58 -0
- package/dist/client.test.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +20240 -4443
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
/** Account name. Defaults to VAPI_WALLET, then the vault default. Pass a viem/VapiPaymentAccount object instead to sign with an injected server account. */
|
|
6
|
+
account?: string | VapiPaymentAccount;
|
|
7
|
+
/** @deprecated Use `account`. Removed in 0.7. */
|
|
8
|
+
wallet?: string;
|
|
9
|
+
/** Local state directory. Defaults to VAPI_HOME or ~/.vapi. */
|
|
10
|
+
home?: string;
|
|
11
|
+
/** Used only without account, VAPI_KEYSTORE_PASSWORD, or a keychain entry. */
|
|
12
|
+
passphrase?: string;
|
|
13
|
+
fetch?: typeof fetch;
|
|
14
|
+
/** Test or embedded-runtime override for the OS secret store. */
|
|
15
|
+
secretStore?: SecretStore;
|
|
16
|
+
/** Test or embedded-runtime override for VAPI_HOME, VAPI_WALLET, and passphrase lookup. */
|
|
17
|
+
env?: NodeJS.ProcessEnv;
|
|
18
|
+
};
|
|
19
|
+
export type VapiClient = {
|
|
20
|
+
wallet: {
|
|
21
|
+
name: string;
|
|
22
|
+
address: `0x${string}`;
|
|
23
|
+
owner: `0x${string}` | null;
|
|
24
|
+
};
|
|
25
|
+
call: {
|
|
26
|
+
search(query: string, opts?: {
|
|
27
|
+
network?: string;
|
|
28
|
+
includeUnverified?: boolean;
|
|
29
|
+
}): Promise<unknown[]>;
|
|
30
|
+
inspect(ref: string): Promise<InspectToolResult>;
|
|
31
|
+
pay(input: CallToolInput): Promise<CallToolResult>;
|
|
32
|
+
};
|
|
33
|
+
router: {
|
|
34
|
+
models(): Promise<RouterModel[]>;
|
|
35
|
+
usage(): Promise<AgentRouterUsage>;
|
|
36
|
+
buy(usd: RouterTopupTier): Promise<{
|
|
37
|
+
receipt: Receipt;
|
|
38
|
+
balance: AgentRouterUsage["balance"];
|
|
39
|
+
}>;
|
|
40
|
+
chat(req: ChatRequest): Promise<ChatResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Base URL and key for any OpenAI-compatible framework. The key stays in
|
|
43
|
+
* your process. Use this in your own code. Do not pass it into a model prompt.
|
|
44
|
+
*/
|
|
45
|
+
openai(): Promise<{
|
|
46
|
+
baseURL: string;
|
|
47
|
+
apiKey: string;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
agent: {
|
|
51
|
+
run(profileName: string, task: string, opts?: {
|
|
52
|
+
approve?: RunAgentDeps["approve"];
|
|
53
|
+
onEvent?: RunAgentDeps["onEvent"];
|
|
54
|
+
}): Promise<RunAgentResult>;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
/** A wallet-bound SDK facade over vAPI Call, vAPI Router, and local agents. */
|
|
58
|
+
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";
|