@vapi-network/mcp 0.2.1 → 0.2.3
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 +21 -2
- package/dist/index.js +78 -6
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,6 +29,7 @@ vapi pay <listing-ref> --max 0.02
|
|
|
29
29
|
vapi balance
|
|
30
30
|
vapi accounts # balances plus network-specific deposit guidance
|
|
31
31
|
vapi receipts # one line per paid call: quote, settlement, latency
|
|
32
|
+
vapi export-key # print the private key for this wallet, on stdout only
|
|
32
33
|
```
|
|
33
34
|
|
|
34
35
|
`vapi search` tags each listing with its group — `[vapi]`, `[added]`,
|
|
@@ -117,6 +118,21 @@ faucet URL or instructions to that network's `config.json` entry:
|
|
|
117
118
|
Account lookup dispatches by CAIP namespace: the EVM and Solana adapters use their corresponding
|
|
118
119
|
local address and guarded RPC balance calls without coupling one wallet family to the other.
|
|
119
120
|
|
|
121
|
+
## Exporting the key
|
|
122
|
+
|
|
123
|
+
The wallet is yours, so the key can leave on demand:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
vapi export-key # EVM key (eip155:8453) as 0x-prefixed hex
|
|
127
|
+
vapi export-key --network solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d
|
|
128
|
+
vapi export-key --json # { "network", "address", "privateKey" }
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The command asks for the keystore passphrase, prints a one-line warning on
|
|
132
|
+
stderr, and writes the key alone on stdout so it can be piped into a password
|
|
133
|
+
manager. Anyone holding that key can spend the wallet: never paste it into a
|
|
134
|
+
website or a chat. Nothing else in vAPI ever logs it.
|
|
135
|
+
|
|
120
136
|
## Reporting a bug
|
|
121
137
|
|
|
122
138
|
```bash
|
|
@@ -179,8 +195,11 @@ provenance:
|
|
|
179
195
|
`https://api.vapinetwork.ai/api/call/discovery` for discovery and
|
|
180
196
|
`https://api.vapinetwork.ai/api/call/services` for service details. If the
|
|
181
197
|
primary returns HTTP 404 or cannot be resolved, the client logs one notice
|
|
182
|
-
and tries the
|
|
183
|
-
the
|
|
198
|
+
and tries the fallbacks in `registryFallbacks`, using the same canonical
|
|
199
|
+
paths; the default distribution no longer ships a distinct fallback host,
|
|
200
|
+
because the `console.vapinetwork.ai` and `console-staging.vapinetwork.ai`
|
|
201
|
+
hosts are retired. A `config.json` that still names them is repaired in
|
|
202
|
+
memory on load and rewritten on disk by `vapi init`. The registry's historical `/api/marketplace/discovery`
|
|
184
203
|
and `/api/network/services` paths still answer for one release and reply with
|
|
185
204
|
`Deprecation: true` plus a `Link` header naming the successor; a base URL
|
|
186
205
|
supplied on either of them is normalized to the canonical pair.
|
package/dist/index.js
CHANGED
|
@@ -43085,8 +43085,8 @@ var DEFAULT_DISCOVERY_URL = `${DEFAULT_REGISTRY_URL}/api/call/services`;
|
|
|
43085
43085
|
var DEFAULT_MARKETPLACE_DISCOVERY_URL = `${DEFAULT_REGISTRY_URL}/api/call/discovery`;
|
|
43086
43086
|
var DEFAULT_REGISTRY_FALLBACKS = [
|
|
43087
43087
|
{
|
|
43088
|
-
discoveryUrl:
|
|
43089
|
-
marketplaceDiscoveryUrl:
|
|
43088
|
+
discoveryUrl: DEFAULT_DISCOVERY_URL,
|
|
43089
|
+
marketplaceDiscoveryUrl: DEFAULT_MARKETPLACE_DISCOVERY_URL
|
|
43090
43090
|
}
|
|
43091
43091
|
];
|
|
43092
43092
|
var DEFAULT_SPEND_CAPS = {
|
|
@@ -43191,6 +43191,70 @@ async function migrateLegacyVapiHome(options = {}) {
|
|
|
43191
43191
|
}
|
|
43192
43192
|
return copied;
|
|
43193
43193
|
}
|
|
43194
|
+
var LEGACY_REGISTRY_HOSTS = /* @__PURE__ */ new Map([
|
|
43195
|
+
["console.vapinetwork.ai", "api.vapinetwork.ai"],
|
|
43196
|
+
["console-staging.vapinetwork.ai", "api-staging.vapinetwork.ai"]
|
|
43197
|
+
]);
|
|
43198
|
+
var LEGACY_REGISTRY_PATHS = /* @__PURE__ */ new Map([
|
|
43199
|
+
["/api/network/services", "/api/call/services"],
|
|
43200
|
+
["/api/marketplace/discovery", "/api/call/discovery"]
|
|
43201
|
+
]);
|
|
43202
|
+
var REGISTRY_DOMAIN = "vapinetwork.ai";
|
|
43203
|
+
function rewriteLegacyRegistryUrl(value) {
|
|
43204
|
+
let url2;
|
|
43205
|
+
try {
|
|
43206
|
+
url2 = new URL(value);
|
|
43207
|
+
} catch {
|
|
43208
|
+
return value;
|
|
43209
|
+
}
|
|
43210
|
+
let rewritten = false;
|
|
43211
|
+
const host = LEGACY_REGISTRY_HOSTS.get(url2.hostname.toLowerCase());
|
|
43212
|
+
if (host) {
|
|
43213
|
+
url2.hostname = host;
|
|
43214
|
+
rewritten = true;
|
|
43215
|
+
}
|
|
43216
|
+
const hostname3 = url2.hostname.toLowerCase();
|
|
43217
|
+
if (hostname3 === REGISTRY_DOMAIN || hostname3.endsWith(`.${REGISTRY_DOMAIN}`)) {
|
|
43218
|
+
const path = LEGACY_REGISTRY_PATHS.get(url2.pathname.replace(/\/+$/, ""));
|
|
43219
|
+
if (path) {
|
|
43220
|
+
url2.pathname = path;
|
|
43221
|
+
rewritten = true;
|
|
43222
|
+
}
|
|
43223
|
+
}
|
|
43224
|
+
return rewritten ? url2.href : value;
|
|
43225
|
+
}
|
|
43226
|
+
function rewriteLegacyRegistryUrls(config2) {
|
|
43227
|
+
const changes = [];
|
|
43228
|
+
const rewrite = (field, from15) => {
|
|
43229
|
+
const to = rewriteLegacyRegistryUrl(from15);
|
|
43230
|
+
if (to !== from15) changes.push({ field, from: from15, to });
|
|
43231
|
+
return to;
|
|
43232
|
+
};
|
|
43233
|
+
const next = {
|
|
43234
|
+
...config2,
|
|
43235
|
+
discoveryUrl: rewrite("discoveryUrl", config2.discoveryUrl),
|
|
43236
|
+
marketplaceDiscoveryUrl: rewrite("marketplaceDiscoveryUrl", config2.marketplaceDiscoveryUrl),
|
|
43237
|
+
...config2.registryFallbacks ? {
|
|
43238
|
+
registryFallbacks: config2.registryFallbacks.map((fallback, index2) => ({
|
|
43239
|
+
discoveryUrl: rewrite(
|
|
43240
|
+
`registryFallbacks[${index2}].discoveryUrl`,
|
|
43241
|
+
fallback.discoveryUrl
|
|
43242
|
+
),
|
|
43243
|
+
marketplaceDiscoveryUrl: rewrite(
|
|
43244
|
+
`registryFallbacks[${index2}].marketplaceDiscoveryUrl`,
|
|
43245
|
+
fallback.marketplaceDiscoveryUrl
|
|
43246
|
+
)
|
|
43247
|
+
}))
|
|
43248
|
+
} : {}
|
|
43249
|
+
};
|
|
43250
|
+
return changes.length === 0 ? { config: config2, changes } : { config: next, changes };
|
|
43251
|
+
}
|
|
43252
|
+
function formatLegacyRegistryRewrites(changes) {
|
|
43253
|
+
return [
|
|
43254
|
+
"Rewrote retired vAPI registry URLs in the local config:",
|
|
43255
|
+
...changes.map((change) => ` ${change.field}: ${change.from} -> ${change.to}`)
|
|
43256
|
+
].join("\n");
|
|
43257
|
+
}
|
|
43194
43258
|
function getDefaultConfig(source = process.env, options = {}) {
|
|
43195
43259
|
const registry2 = registryEndpoints(source.VAPI_REGISTRY_URL?.trim() || DEFAULT_REGISTRY_URL);
|
|
43196
43260
|
const requested = new Set(options.networks ?? ["base"]);
|
|
@@ -43229,7 +43293,7 @@ function getDefaultConfig(source = process.env, options = {}) {
|
|
|
43229
43293
|
spendCaps: { ...DEFAULT_SPEND_CAPS }
|
|
43230
43294
|
};
|
|
43231
43295
|
}
|
|
43232
|
-
async function loadConfig(path = getVapiPaths().config, source = process.env) {
|
|
43296
|
+
async function loadConfig(path = getVapiPaths().config, source = process.env, options = {}) {
|
|
43233
43297
|
if (!process.env.VAPI_HOME?.trim() && path === getVapiPaths(join(homedir(), ".vapi")).config) {
|
|
43234
43298
|
await migrateLegacyVapiHome({ targetDirectory: join(homedir(), ".vapi") });
|
|
43235
43299
|
}
|
|
@@ -43240,8 +43304,16 @@ async function loadConfig(path = getVapiPaths().config, source = process.env) {
|
|
|
43240
43304
|
if (isMissingFile(error61)) return getDefaultConfig(source);
|
|
43241
43305
|
throw error61;
|
|
43242
43306
|
}
|
|
43243
|
-
const
|
|
43244
|
-
|
|
43307
|
+
const parsed = configSchema.parse(JSON.parse(raw));
|
|
43308
|
+
parsed.registryFallbacks ??= DEFAULT_REGISTRY_FALLBACKS.map((fallback) => ({ ...fallback }));
|
|
43309
|
+
const migrated = rewriteLegacyRegistryUrls(parsed);
|
|
43310
|
+
const config2 = migrated.config;
|
|
43311
|
+
if (migrated.changes.length > 0 && options.notice) {
|
|
43312
|
+
options.notice(
|
|
43313
|
+
`${formatLegacyRegistryRewrites(migrated.changes)}
|
|
43314
|
+
Run vapi init to write the new URLs to ${path}.`
|
|
43315
|
+
);
|
|
43316
|
+
}
|
|
43245
43317
|
const baseRpcUrl = source.BASE_RPC_URL?.trim();
|
|
43246
43318
|
const arcRpcUrl = source.ARC_TESTNET_RPC_URL?.trim();
|
|
43247
43319
|
const solanaRpcUrl = source.SOLANA_RPC_URL?.trim();
|
|
@@ -43822,7 +43894,7 @@ function serviceHost(resourceUrl) {
|
|
|
43822
43894
|
import { mkdir as mkdir5, writeFile as writeFile3 } from "node:fs/promises";
|
|
43823
43895
|
import { arch, platform, release } from "node:os";
|
|
43824
43896
|
import { join as join2 } from "node:path";
|
|
43825
|
-
var VAPI_CLIENT_VERSION = "0.2.
|
|
43897
|
+
var VAPI_CLIENT_VERSION = "0.2.3";
|
|
43826
43898
|
async function createSupportReport(options) {
|
|
43827
43899
|
const message = options.message.trim();
|
|
43828
43900
|
if (!message) throw new Error("Support report message must not be empty.");
|