@vapi-network/mcp 0.1.1 → 0.2.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 CHANGED
@@ -1,188 +1,336 @@
1
- # Agent Cash (`@vapi-network/mcp`)
1
+ # vAPI Network
2
2
 
3
- Agent Cash gives Claude, Cursor, and other MCP clients a small local wallet that
4
- can discover and pay x402 APIs directly.
3
+ **One wallet, every x402 API.** vAPI Network is an open-source, non-custodial
4
+ TypeScript toolkit for discovering and paying x402 services from a CLI, MCP
5
+ client, or your own code. Call works today. Tasks and Compute are next.
5
6
 
6
- For the Call launch, this buyer-local client is the npm-distributed payment path
7
- for native and external Bazaar listings. The browser-wallet flow is also
8
- available where a provider permits a direct browser request. Legacy wrapped
9
- rows remain hidden and non-callable while the optional Wrap gateway is disabled.
10
- The hosted Go MCP remains free (`echo` and `search`).
7
+ Your key stays encrypted on your machine. vAPI Network applies spend policy
8
+ before signing, sends payment directly to the service, and writes receipts to a
9
+ local append-only ledger. It does not hold funds, proxy payments, or send
10
+ telemetry off the machine by default.
11
11
 
12
- The private key is generated locally and stored only in the Agent Cash home
13
- (default `~/.vapi/agent-cash`, overridden by `VAPI_AGENT_CASH_HOME`), encrypted
14
- with scrypt (`N=2^15`) and AES-256-GCM. Your MCP client signs each exact
15
- EIP-3009 payment locally. vAPI supplies public discovery metadata; it never
16
- receives the private key and cannot spend the wallet balance. Fund this like
17
- pocket money, not a treasury.
12
+ ## 60-second quickstart
18
13
 
19
- Direct x402 calls need no vAPI account or API key: the agent pays the selected
20
- API directly from the buyer-controlled wallet.
14
+ Install once, then every command is `vapi …`:
21
15
 
22
- ## Install and run
16
+ ```bash
17
+ npm i -g vapi-network
18
+ vapi init # encrypted wallet + config under ~/.vapi (or $VAPI_HOME), prints the address
19
+ ```
23
20
 
24
- Create the encrypted local wallet:
21
+ Fund that address with `vapi fund` (card or Apple Pay via Coinbase Onramp) or by
22
+ sending USDC on Base to it. Then:
25
23
 
26
- ```sh
27
- npx -y @vapi-network/mcp init
24
+ ```bash
25
+ vapi fund # hosted onramp link, or direct-transfer instructions
26
+ vapi search "weather" # every catalog, merged, with provenance
27
+ vapi inspect <listing-ref> # request contract and the live 402 quote, before paying
28
+ vapi pay <listing-ref> --max 0.02
29
+ vapi balance
30
+ vapi accounts # balances plus network-specific deposit guidance
31
+ vapi receipts # one line per paid call: quote, settlement, latency
28
32
  ```
29
33
 
30
- Running `npx -y @vapi-network/mcp` with no command starts the MCP stdio server.
34
+ `vapi search` tags each listing with its group — `[vapi]`, `[added]`,
35
+ `[partner]`, or `[external]` — and prints the network fee already inside the
36
+ price: vAPI and added APIs carry a 5% network fee inside the quoted price, while
37
+ partner and external listings carry none. `vapi inspect` and `--json` return the
38
+ same `group` and `fee` fields.
39
+
40
+ No install? Prefix any command with `npx vapi-network`, for example `npx vapi-network init`.
41
+ (`npx vapi` cannot work: the bare `vapi` name on npm belongs to an unrelated package.)
31
42
 
32
- Fund the printed address with a small amount of canonical Base-mainnet USDC
33
- (`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`). Agent Cash does not need ETH to
34
- authorize ordinary x402 calls; send a little Base ETH only if you want it to
35
- sweep USDC back to another wallet later.
43
+ ### Use it from an agent (MCP)
36
44
 
37
- Configure an MCP client to launch the package through npm:
45
+ Add this to Claude Desktop, Claude Code, or Cursor. The passphrase unlocks the local keystore; it never leaves the machine.
38
46
 
39
47
  ```json
40
48
  {
41
49
  "mcpServers": {
42
- "agent-cash": {
50
+ "vapi": {
43
51
  "command": "npx",
44
- "args": ["-y", "@vapi-network/mcp", "serve"],
45
- "env": {
46
- "VAPI_KEYSTORE_PASSWORD": "replace-with-your-keystore-passphrase"
47
- }
52
+ "args": ["-y", "vapi-network", "mcp"],
53
+ "env": { "VAPI_KEYSTORE_PASSWORD": "your-passphrase" }
48
54
  }
49
55
  }
50
56
  }
51
57
  ```
52
58
 
53
- `VAPI_AGENT_CASH_HOME` optionally moves the wallet directory from
54
- `~/.vapi/agent-cash`. Desktop MCP hosts normally need
55
- `VAPI_KEYSTORE_PASSWORD` in the process environment because they cannot answer
56
- an interactive passphrase prompt. Protect that configuration with the same
57
- care as the pocket-money wallet.
59
+ Tools: `call.search`, `call.inspect`, `call.pay`, `wallet.address`, `wallet.balance`,
60
+ `wallet.accounts`, `wallet.fund`, `receipts.list`, `receipts.stats`, `support.report`. Spend caps
61
+ default to $0.10 per call and $1.00 per day; the wallet checks both before it signs a payment.
58
62
 
59
- For a workspace-only development run, build from the repository root and keep
60
- the test wallet isolated under the gitignored `.context` directory:
63
+ ## Sign-in with X
61
64
 
62
- ```sh
63
- pnpm --filter @vapi-network/mcp build
64
- VAPI_AGENT_CASH_HOME="$PWD/.context/agent-cash" \
65
- pnpm --filter @vapi-network/mcp exec node dist/cli.js init
65
+ x402 v2 services can require Sign-In-With-X (SIWX) before returning a price. When `call.pay` or
66
+ `vapi pay` receives that challenge, vAPI checks that both the challenge domain and URI match the
67
+ final resource origin, signs the canonical EIP-4361 message locally with EVM `personal_sign`, and
68
+ retries once with `SIGN-IN-WITH-X`. The proof is never sent to a redirect or a different host.
69
+
70
+ If the retry returns a normal 402 quote, the usual spend-policy and payment flow continues. If the
71
+ resource is free after sign-in, the result has `outcome: "signed_in"` and the local receipt records
72
+ `amountAtomic: "0"`.
73
+
74
+ ## Fund the wallet
75
+
76
+ ```bash
77
+ vapi fund # ask the registry for a hosted onramp session
78
+ vapi fund --amount 25 # prefill a US dollar amount
79
+ vapi fund --json # stable machine-readable shape
66
80
  ```
67
81
 
68
- For the first staging test, send a small amount of Base USDC to the printed
69
- address. Also send a little Base ETH only if you intend to test sweep-back.
82
+ `vapi fund` POSTs `{ address, network: "base", asset: "USDC", fiatAmount }` to
83
+ `<registry>/api/wallet/onramp-session` through the same guarded network client as
84
+ every other command, prints the returned URL, and opens it in your default
85
+ browser when you are on a terminal. The onramp is **Coinbase's**: Coinbase takes
86
+ the card or Apple Pay payment and sends USDC straight to your local address.
87
+ **vAPI never holds your funds**, never proxies the payment, and never sees your
88
+ card details or your private key.
89
+
90
+ When the registry replies `503 onramp_unavailable` — or cannot be reached at all
91
+ — the command stays useful instead of failing: it prints your address and
70
92
 
71
- Then point the MCP client at the built CLI. Replace both absolute paths with
72
- this checkout's paths:
93
+ ```text
94
+ Send USDC on Base (eip155:8453) to this address; add a little ETH for gas if you plan to sweep.
95
+ ```
96
+
97
+ Either way it finishes by printing the current balance. MCP clients can use the
98
+ `wallet.fund` tool, which returns the same `{ url }` or the same fallback text.
99
+
100
+ ## Accounts and deposits
101
+
102
+ `vapi accounts` lists one deposit account for every configured network, including its CAIP-2 ID,
103
+ network name, address, atomic and formatted USDC balance, gas-token balance, and deposit guidance.
104
+ Use `--json` for the stable `{ "accounts": [...] }` shape. `vapi init` prints the same account list
105
+ after creating the encrypted keystore and configuration. MCP clients can use `wallet.accounts`.
106
+
107
+ Base uses the wallet's EVM address and tells you to send USDC on Base. For Arc testnet, add the
108
+ faucet URL or instructions to that network's `config.json` entry:
73
109
 
74
110
  ```json
75
111
  {
76
- "mcpServers": {
77
- "agent-cash": {
78
- "command": "node",
79
- "args": ["/absolute/path/to/vapi-app/packages/vapi-mcp/dist/cli.js", "serve"],
80
- "env": {
81
- "VAPI_AGENT_CASH_HOME": "/absolute/path/to/vapi-app/.context/agent-cash",
82
- "VAPI_KEYSTORE_PASSWORD": "replace-with-your-keystore-passphrase"
83
- }
84
- }
85
- }
112
+ "depositUrl": "https://your-arc-faucet.example",
113
+ "depositInstructions": "Use the configured Arc testnet faucet, then send USDC to this address."
86
114
  }
87
115
  ```
88
116
 
89
- Base uses its public RPC by default. Leave `ARC_TESTNET_RPC_URL` unset for the
90
- Base-only staging slice.
117
+ Account lookup dispatches by CAIP namespace: the EVM and Solana adapters use their corresponding
118
+ local address and guarded RPC balance calls without coupling one wallet family to the other.
91
119
 
92
- Restart the MCP client. The agent can now:
120
+ ## Reporting a bug
93
121
 
94
- - `search {query?, kinds?, network?, limit?, cursor?}` across the public
95
- marketplace. API results are callable; other results carry their canonical
96
- vAPI web action.
97
- - `call {id|url, method?, body?, maxPriceUsd?, network?}` and pay an x402
98
- `exact` challenge directly over HTTPS. An `id` must be an API ref returned by
99
- `search` in the current Agent Cash process; an explicit published `url` may be
100
- called directly. Set `network` to require a specific configured CAIP-2
101
- network before Agent Cash signs.
102
- - `wallet {}` to inspect the address and USDC balance on each network.
122
+ ```bash
123
+ vapi report "the provider returned 402 twice"
124
+ vapi report "the provider returned 402 twice" --include-addresses
125
+ vapi report "the provider returned 402 twice" --send
126
+ ```
103
127
 
104
- `tools/list` exposes exactly these three tools: `search`, `call`, and `wallet`.
128
+ The command first writes `$VAPI_HOME/reports/<timestamp>.json`, then prints that path and a prefilled
129
+ GitHub issue URL. Reports contain the message, client version, OS/Node information, and only the
130
+ newest five receipt IDs. Wallet and payee addresses are included only with `--include-addresses`;
131
+ amounts are never included. No report is uploaded unless `--send` is explicit. With `--send`, vAPI
132
+ uses the guarded network client to POST the same JSON to the configured registry and prints the HTTP
133
+ response code, including non-success responses such as 404. MCP clients can use `support.report`
134
+ with the corresponding `includeAddresses` and `send` booleans.
105
135
 
106
- ## Spend caps
136
+ ## Networks
107
137
 
108
- The Agent Cash home's `config.json` contains atomic-USDC caps (USDC has 6 decimals):
138
+ | Network | x402 identifier | USDC | Gas / RPC notes |
139
+ | -------------- | ----------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------ |
140
+ | Base mainnet | `eip155:8453` | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` | ETH; defaults to `https://mainnet.base.org` |
141
+ | Arc testnet | `eip155:5042002` | `0x3600000000000000000000000000000000000000` | USDC is also the gas token; set `ARC_TESTNET_RPC_URL` |
142
+ | Solana mainnet | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d` | `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v` | SOL; defaults to `https://api.mainnet-beta.solana.com` |
109
143
 
110
- ```json
111
- {
112
- "spendCaps": {
113
- "perCallAtomic": "100000",
114
- "perDayAtomic": "1000000"
115
- }
116
- }
144
+ The x402 reference packages shorten the Solana CAIP-2 reference to
145
+ `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`; vAPI accepts that identifier as an
146
+ alias while persisting the full genesis hash above. Arc mainnet is not enabled:
147
+ **not yet — placeholder only.** Arc and the x402 packages do not publish a
148
+ mainnet RPC plus canonical USDC, so the client deliberately carries only a
149
+ non-routable code placeholder instead of guessing a production configuration.
150
+
151
+ Create both local accounts during initialization:
152
+
153
+ ```bash
154
+ vapi init --networks base,solana
117
155
  ```
118
156
 
119
- Those defaults are $0.10 per call and $1.00 per UTC day. Agent Cash checks both caps and reserves the quote in its atomic local daily ledger **before signing**. `maxPriceUsd` can set a still-lower ceiling for one tool call. The ledger is `spend-ledger.json` in the same Agent Cash home and rolls over when the UTC date changes.
157
+ Or add an Ed25519 account to an existing encrypted keystore:
120
158
 
121
- The `call` tool requires HTTPS and blocks private, loopback, and link-local destinations by default. It validates every redirect before carrying a method or body forward. For local development only, setting `"allowPrivateNetwork": true` in `~/.vapi/agent-cash/config.json` permits an unpaid HTTP `localhost`, `*.localhost`, or loopback request; it does not permit HTTP calls to remote hosts, and Agent Cash still refuses to send a signed payment over HTTP.
159
+ ```bash
160
+ vapi accounts --enable solana
161
+ ```
122
162
 
123
- `discoveryUrl` remains the Calls compatibility endpoint used to resolve a
124
- searched native vAPI ref into its payable endpoint. `marketplaceDiscoveryUrl`
125
- is the unified search route. Override them independently with
126
- `VAPI_DISCOVERY_URL` and `VAPI_MARKETPLACE_DISCOVERY_URL`. Agent Cash rejects an
127
- uncached or evicted `id` because its source and marketplace kind are no longer
128
- known; run `search` again or use the result's explicit published URL. It never
129
- attempts to call a service offer or open request; those actions continue in the
130
- web marketplace.
163
+ Fund the printed Solana address with SPL USDC. Exact x402 payments use the
164
+ facilitator advertised in the challenge as fee payer, so they do not consume the
165
+ local SOL balance. `vapi sweep <solana-address> --network
166
+ solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d` is a separate transaction
167
+ and requires a small amount of SOL locally for fees and, when necessary,
168
+ creation of the destination token account. The default public Solana RPC is
169
+ rate-limited and has no availability guarantee; set `SOLANA_RPC_URL` to a
170
+ trusted dedicated endpoint for regular use.
171
+
172
+ ## Discovery sources
173
+
174
+ Discovery is a plugin interface. The client can merge listings from multiple
175
+ sources, de-duplicate them by resource URL, and retain each listing's
176
+ provenance:
177
+
178
+ - **vAPI Registry** is enabled by the default distribution, using
179
+ `https://api.vapinetwork.ai/api/call/discovery` for discovery and
180
+ `https://api.vapinetwork.ai/api/call/services` for service details. If the
181
+ primary returns HTTP 404 or cannot be resolved, the client logs one notice
182
+ and tries the configured fallback at `https://console.vapinetwork.ai`, using
183
+ the same canonical paths. The registry's historical `/api/marketplace/discovery`
184
+ and `/api/network/services` paths still answer for one release and reply with
185
+ `Deprecation: true` plus a `Link` header naming the successor; a base URL
186
+ supplied on either of them is normalized to the canonical pair.
187
+ - **Coinbase Bazaar** reads the public x402 v2
188
+ `/discovery/resources` catalog exposed by a facilitator.
189
+ - **Local file** reads a JSON array of listings for private or development
190
+ catalogs.
191
+ - **x402scan** is a deliberate stub for now. The source research documents its
192
+ discovery convention, but not a stable public read API that this client can
193
+ safely target.
194
+
195
+ Use `@vapi-network/sources` to compose only the catalogs you trust. Network
196
+ access is guarded against local and private destinations before a request is
197
+ made.
198
+
199
+ Set `VAPI_REGISTRY_URL` to replace the registry base; the client derives
200
+ `/api/call/discovery` and `/api/call/services` beneath it. The existing
201
+ `VAPI_MARKETPLACE_DISCOVERY_URL` and `VAPI_DISCOVERY_URL` variables can still
202
+ override either full endpoint separately. Registry fallbacks are stored in
203
+ `config.json` under `registryFallbacks`.
204
+
205
+ ## Packages
206
+
207
+ | Package | Purpose |
208
+ | ----------------------- | ------------------------------------------------------------------------ |
209
+ | `@vapi-network/core` | x402 protocol, wallet, spend policy, discovery merge, and receipts |
210
+ | `@vapi-network/sources` | vAPI Registry, Coinbase Bazaar, local-file, and x402scan source adapters |
211
+ | `@vapi-network/mcp` | stdio MCP server with namespaced payment tools |
212
+ | `@vapi-network/cli` | `init`, discovery, payment, wallet, receipt, and MCP commands |
213
+ | `vapi-network` | zero-dependency distribution with the `vapi` binary and defaults |
214
+
215
+ Every npm tarball is bundled and has zero runtime dependencies. The scoped
216
+ packages are useful for embedding; most users should start with
217
+ `vapi-network`.
218
+
219
+ ## SDK
220
+
221
+ The core and source packages can be used without the CLI or MCP layer. See the
222
+ runnable [SDK example](./examples/pay-with-sdk.ts) for discovery, policy
223
+ validation, local signing, and direct x402 payment construction.
224
+
225
+ Run it after initialization with `pnpm example:pay -- weather`.
226
+
227
+ ## Local state and migration
228
+
229
+ By default, local state lives in `~/.vapi/`:
230
+
231
+ ```text
232
+ config.json
233
+ keystore.json
234
+ receipts.jsonl
235
+ spend-ledger.json
236
+ reports/
237
+ ```
131
238
 
132
- ## Paid-call receipts
239
+ Set `VAPI_HOME` to use a different directory. On first use of the default home,
240
+ the client copies an existing `~/.vapi/agent-cash/` configuration into
241
+ `~/.vapi/` when it can do so without overwriting files, prints a migration
242
+ notice, and leaves the old directory untouched.
133
243
 
134
- The `call` result keeps both payment receipt surfaces under `payment`:
244
+ ## Metrics
135
245
 
136
- - `settlement` is the decoded x402 `Payment-Response` (or compatible `X-Payment-Response`) header.
137
- - `proof` is normally `null` for launch-approved native endpoints. Agent Cash
138
- preserves an `X-VAPI-Payment-Proof` value if a future reviewed Wrap endpoint
139
- returns one.
246
+ vAPI measures call and discovery health locally. Call receipts can include the
247
+ listing name and provider host, policy decision, retry count, client version,
248
+ outcome, total latency, and discovery, quote, signing, request, and settlement
249
+ phase timings. Policy declines are recorded with the quoted amount but without
250
+ a payer or transaction, so blocked spend remains visible without creating a
251
+ payment authorization. Search events record the query, sources tried,
252
+ per-source latency and result count, merged result count, and timestamp.
140
253
 
141
- A proof value alone is not verification. A future Wrap consumer must pin and
142
- verify its signer and fields and enforce replay protection.
254
+ Call receipts are appended to `$VAPI_HOME/receipts.jsonl`; search events are
255
+ appended to `$VAPI_HOME/searches.jsonl`. Nothing in either ledger is uploaded,
256
+ and vAPI sends no telemetry off the machine by default. The vAPI website can
257
+ show public on-chain usage for a wallet address directly from the chain; that
258
+ view does not require uploading these local files.
143
259
 
144
- ## Balances and sweep-back
260
+ Use `vapi stats --range 24h|7d|30d` for a human-readable summary or add `--json`
261
+ for the stable `{ range, generatedAt, totals, outcomes, latency, topServices,
262
+ search }` shape. `receipts.stats` exposes the same shape through MCP. Export raw
263
+ receipts for spreadsheets and dashboards with:
145
264
 
146
265
  ```sh
147
- VAPI_AGENT_CASH_HOME="$PWD/.context/agent-cash" pnpm --filter @vapi-network/mcp exec node dist/cli.js balance
148
- VAPI_AGENT_CASH_HOME="$PWD/.context/agent-cash" pnpm --filter @vapi-network/mcp exec node dist/cli.js sweep-back 0xYourMainWallet
149
- VAPI_AGENT_CASH_HOME="$PWD/.context/agent-cash" pnpm --filter @vapi-network/mcp exec node dist/cli.js sweep-back 0xYourMainWallet --network eip155:8453
266
+ vapi receipts export --format json --range 30d
267
+ vapi receipts export --format csv --range 30d
150
268
  ```
151
269
 
152
- Without `--network`, sweep-back attempts every configured network. Base transfers the full USDC balance because gas is paid in ETH. Arc gas is paid in USDC, so Agent Cash keeps 0.05 USDC by default instead of stranding the sweep transaction. Configure that reserve with `VAPI_ARC_GAS_HEADROOM_USDC` (for example, `0.10`).
270
+ ## Roadmap
153
271
 
154
- ## Networks
272
+ - A local gateway daemon (`vapi serve`) with per-key budgets
273
+ - OpenTelemetry traces and metrics, with exporters enabled only by the user
274
+ - `task.*` tools for posting, funding, delivering, and reviewing work
275
+ - `compute.*` tools for discovering models and paying for inference
276
+
277
+ Until the gateway lands, `vapi serve` and the provider-side `vapi publish`
278
+ command exit with a preview message. Payments remain direct from the local
279
+ wallet to each service.
155
280
 
156
- | Network | CAIP-2 | Chain ID | USDC | Gas token | RPC |
157
- | ------------ | ---------------- | -------: | -------------------------------------------- | --------- | ------------------------------------------------------ |
158
- | Base mainnet | `eip155:8453` | 8453 | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` | ETH | `BASE_RPC_URL`, defaults to `https://mainnet.base.org` |
159
- | Arc testnet | `eip155:5042002` | 5042002 | `0x3600000000000000000000000000000000000000` | USDC | `ARC_TESTNET_RPC_URL` is required |
281
+ ## Development
160
282
 
161
- Agent Cash configures Base only by default. For the staging test, first run
162
- `search {"query":"<capability>","kinds":["api"],"network":"eip155:8453"}`.
163
- In the same Agent Cash process, call the returned ref with
164
- `call {"id":"<search-result-ref>","network":"eip155:8453","maxPriceUsd":"0.02"}`.
165
- Arc remains opt-in: set a nonblank `ARC_TESTNET_RPC_URL` to add it. The same
166
- exact-scheme EIP-3009 code path handles both CAIP-2 networks. You can also edit
167
- the `networks` map in `~/.vapi/agent-cash/config.json`; entries with blank RPC
168
- URLs are ignored and cannot be selected for payment. A custom token/network
169
- entry must pin its EIP-712 domain as `"eip712Domain": { "name": "…", "version":
170
- "…" }`; provider-supplied domain text is never trusted on its own.
283
+ This is a pnpm workspace for Node.js 22 and pnpm 10.
171
284
 
172
- ## Custody and recovery
285
+ ```sh
286
+ pnpm install
287
+ pnpm lint
288
+ pnpm typecheck
289
+ pnpm test
290
+ pnpm build
291
+ pnpm pack:check
292
+ ```
173
293
 
174
- This package is self-custodied software: the encrypted payment key and spend ledger live on your machine. vAPI is discovery only in this lane. Vendors receive only narrowly scoped EIP-3009 authorizations for the exact quoted amount, recipient, token, chain, nonce, and validity window. A stolen unlocked key or passphrase can still drain the wallet, so keep only a small working balance and sweep unused funds back.
294
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for the development workflow,
295
+ [CHANGELOG.md](./CHANGELOG.md) for what shipped in each release, and
296
+ [SECURITY.md](./SECURITY.md) for private vulnerability reports.
175
297
 
176
- Back up the encrypted keystore if you need recovery. Losing both the keystore and its backup permanently loses access to its funds; losing the passphrase does too. Never share the decrypted private key.
298
+ CLI commands exit `0` on success, `1` on an operational failure, and `2` for
299
+ invalid usage or an announced preview-only command. `--json` sends both success
300
+ values and errors to stdout as one JSON value; `mcp --json` is accepted as a
301
+ no-op because the stdio transport is already JSON-RPC.
177
302
 
178
303
  ## Publishing
179
304
 
180
- npm reads `package.json` before any `prepack` hook runs, so the manifest cannot be rewritten in
181
- place. Publish from the staged directory instead:
305
+ All five packages share one version and are published together. npm reads a
306
+ package manifest before lifecycle hooks run, so the release is made from the
307
+ generated `publish/` directories, never from the workspace package roots.
182
308
 
183
- ```bash
184
- pnpm --filter @vapi-network/mcp publish:npm
309
+ First update every package to the same version and verify the exact tarballs:
310
+
311
+ ```sh
312
+ pnpm install --frozen-lockfile
313
+ pnpm pack:check
185
314
  ```
186
315
 
187
- That builds, stages `publish/` with an empty `dependencies` map (everything is bundled), runs the
188
- pack check against the staged tarball, then publishes it.
316
+ After reviewing the output, a maintainer with npm access runs these commands
317
+ manually:
318
+
319
+ ```sh
320
+ npm login
321
+ pnpm --dir packages/core publish:npm
322
+ pnpm --dir packages/sources publish:npm
323
+ pnpm --dir packages/mcp publish:npm
324
+ pnpm --dir packages/cli publish:npm
325
+ pnpm --dir packages/vapi-network publish:npm
326
+ ```
327
+
328
+ Each package's `publish:npm` script publishes its staged `./publish` directory
329
+ to the `latest` npm tag. Every package also has a `publish:npm:next` script that
330
+ publishes the same tarball to `next` instead, for preview builds. The manual
331
+ release workflow verifies and prints these commands; it never receives npm
332
+ credentials or publishes automatically.
333
+
334
+ ## License
335
+
336
+ Apache-2.0. See [LICENSE](./LICENSE).
@@ -0,0 +1,5 @@
1
+ export { callService, createVapiServer, loadServerConfig, startStdioServer, type CallToolInput, type CallToolResult, type VapiServerOptions, } from "./server.js";
2
+ export { inspectService, type InspectToolInput, type InspectToolResult } from "./tools/inspect.js";
3
+ export { resolveServiceEndpoint, resolveServiceListing, searchMarketplace, type MarketplaceSearchInput, } from "./tools/search.js";
4
+ export { getWallet, type WalletBalance } from "./tools/wallet.js";
5
+ export { buildSIWxProof, parseSIWxResponse } from "./siwx.js";