@vapi-network/mcp 0.1.0 → 0.2.0-dev.2

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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,176 +1,211 @@
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 USDC on Base. Then:
25
22
 
26
- ```sh
27
- npx -y @vapi-network/mcp init
23
+ ```bash
24
+ vapi search "weather" # every catalog, merged, with provenance
25
+ vapi inspect <listing-ref> # request contract and the live 402 quote, before paying
26
+ vapi pay <listing-ref> --max 0.02
27
+ vapi balance
28
+ vapi receipts # one line per paid call: quote, settlement, latency
28
29
  ```
29
30
 
30
- Running `npx -y @vapi-network/mcp` with no command starts the MCP stdio server.
31
+ No install? Prefix any command with `npx vapi-network`, for example `npx vapi-network init`.
32
+ (`npx vapi` cannot work: the bare `vapi` name on npm belongs to an unrelated package.)
31
33
 
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.
34
+ ### Use it from an agent (MCP)
36
35
 
37
- Configure an MCP client to launch the package through npm:
36
+ Add this to Claude Desktop, Claude Code, or Cursor. The passphrase unlocks the local keystore; it never leaves the machine.
38
37
 
39
38
  ```json
40
39
  {
41
40
  "mcpServers": {
42
- "agent-cash": {
41
+ "vapi": {
43
42
  "command": "npx",
44
- "args": ["-y", "@vapi-network/mcp", "serve"],
45
- "env": {
46
- "VAPI_KEYSTORE_PASSWORD": "replace-with-your-keystore-passphrase"
47
- }
43
+ "args": ["-y", "vapi-network", "mcp"],
44
+ "env": { "VAPI_KEYSTORE_PASSWORD": "your-passphrase" }
48
45
  }
49
46
  }
50
47
  }
51
48
  ```
52
49
 
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.
58
-
59
- For a workspace-only development run, build from the repository root and keep
60
- the test wallet isolated under the gitignored `.context` directory:
61
-
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
50
+ Tools: `call.search`, `call.inspect`, `call.pay`, `wallet.address`, `wallet.balance`, `receipts.list`.
51
+ Spend caps default to $0.10 per call and $1.00 per day; the wallet checks both before it signs.
52
+
53
+ ## Discovery sources
54
+
55
+ Discovery is a plugin interface. The client can merge listings from multiple
56
+ sources, de-duplicate them by resource URL, and retain each listing's
57
+ provenance:
58
+
59
+ - **vAPI Registry** is enabled by the default distribution, using
60
+ `https://api.vapinetwork.ai/api/call/discovery` for discovery and
61
+ `https://api.vapinetwork.ai/api/call/services` for service details. If the
62
+ primary returns HTTP 404 or cannot be resolved, the client logs one notice
63
+ and tries the configured fallback at `https://console.vapinetwork.ai`.
64
+ - **Coinbase Bazaar** reads the public x402 v2
65
+ `/discovery/resources` catalog exposed by a facilitator.
66
+ - **Local file** reads a JSON array of listings for private or development
67
+ catalogs.
68
+ - **x402scan** is a deliberate stub for now. The source research documents its
69
+ discovery convention, but not a stable public read API that this client can
70
+ safely target.
71
+
72
+ Use `@vapi-network/sources` to compose only the catalogs you trust. Network
73
+ access is guarded against local and private destinations before a request is
74
+ made.
75
+
76
+ Set `VAPI_REGISTRY_URL` to replace the registry base; the client derives
77
+ `/api/call/discovery` and `/api/call/services` beneath it. The existing
78
+ `VAPI_MARKETPLACE_DISCOVERY_URL` and `VAPI_DISCOVERY_URL` variables can still
79
+ override either full endpoint separately. Registry fallbacks are stored in
80
+ `config.json` under `registryFallbacks`.
81
+
82
+ ## Packages
83
+
84
+ | Package | Purpose |
85
+ | ----------------------- | ------------------------------------------------------------------------ |
86
+ | `@vapi-network/core` | x402 protocol, wallet, spend policy, discovery merge, and receipts |
87
+ | `@vapi-network/sources` | vAPI Registry, Coinbase Bazaar, local-file, and x402scan source adapters |
88
+ | `@vapi-network/mcp` | stdio MCP server with namespaced payment tools |
89
+ | `@vapi-network/cli` | `init`, discovery, payment, wallet, receipt, and MCP commands |
90
+ | `vapi-network` | zero-dependency distribution with the `vapi` binary and defaults |
91
+
92
+ Every npm tarball is bundled and has zero runtime dependencies. The scoped
93
+ packages are useful for embedding; most users should start with
94
+ `vapi-network`.
95
+
96
+ ## SDK
97
+
98
+ The core and source packages can be used without the CLI or MCP layer. See the
99
+ runnable [SDK example](./examples/pay-with-sdk.ts) for discovery, policy
100
+ validation, local signing, and direct x402 payment construction.
101
+
102
+ Run it after initialization with `pnpm example:pay -- weather`.
103
+
104
+ ## Local state and migration
105
+
106
+ By default, local state lives in `~/.vapi/`:
107
+
108
+ ```text
109
+ config.json
110
+ keystore.json
111
+ receipts.jsonl
112
+ spend-ledger.json
66
113
  ```
67
114
 
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.
70
-
71
- Then point the MCP client at the built CLI. Replace both absolute paths with
72
- this checkout's paths:
115
+ Set `VAPI_HOME` to use a different directory. On first use of the default home,
116
+ the client copies an existing `~/.vapi/agent-cash/` configuration into
117
+ `~/.vapi/` when it can do so without overwriting files, prints a migration
118
+ notice, and leaves the old directory untouched.
73
119
 
74
- ```json
75
- {
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
- }
86
- }
87
- ```
120
+ ## Metrics
88
121
 
89
- Base uses its public RPC by default. Leave `ARC_TESTNET_RPC_URL` unset for the
90
- Base-only staging slice.
122
+ vAPI measures call and discovery health locally. Call receipts can include the
123
+ listing name and provider host, policy decision, retry count, client version,
124
+ outcome, total latency, and discovery, quote, signing, request, and settlement
125
+ phase timings. Policy declines are recorded with the quoted amount but without
126
+ a payer or transaction, so blocked spend remains visible without creating a
127
+ payment authorization. Search events record the query, sources tried,
128
+ per-source latency and result count, merged result count, and timestamp.
91
129
 
92
- Restart the MCP client. The agent can now:
130
+ Call receipts are appended to `$VAPI_HOME/receipts.jsonl`; search events are
131
+ appended to `$VAPI_HOME/searches.jsonl`. Nothing in either ledger is uploaded,
132
+ and vAPI sends no telemetry off the machine by default. The vAPI website can
133
+ show public on-chain usage for a wallet address directly from the chain; that
134
+ view does not require uploading these local files.
93
135
 
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.
136
+ Use `vapi stats --range 24h|7d|30d` for a human-readable summary or add `--json`
137
+ for the stable `{ range, generatedAt, totals, outcomes, latency, topServices,
138
+ search }` shape. `receipts.stats` exposes the same shape through MCP. Export raw
139
+ receipts for spreadsheets and dashboards with:
103
140
 
104
- `tools/list` exposes exactly these three tools: `search`, `call`, and `wallet`.
141
+ ```sh
142
+ vapi receipts export --format json --range 30d
143
+ vapi receipts export --format csv --range 30d
144
+ ```
105
145
 
106
- ## Spend caps
146
+ ## Roadmap
107
147
 
108
- The Agent Cash home's `config.json` contains atomic-USDC caps (USDC has 6 decimals):
148
+ - A local gateway daemon (`vapi serve`) with per-key budgets
149
+ - OpenTelemetry traces and metrics, with exporters enabled only by the user
150
+ - `task.*` tools for posting, funding, delivering, and reviewing work
151
+ - `compute.*` tools for discovering models and paying for inference
109
152
 
110
- ```json
111
- {
112
- "spendCaps": {
113
- "perCallAtomic": "100000",
114
- "perDayAtomic": "1000000"
115
- }
116
- }
117
- ```
153
+ Until the gateway lands, `vapi serve` and the provider-side `vapi publish`
154
+ command exit with a preview message. Payments remain direct from the local
155
+ wallet to each service.
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
+ ## Development
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
+ This is a pnpm workspace for Node.js 22 and pnpm 10.
122
160
 
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.
161
+ ```sh
162
+ pnpm install
163
+ pnpm lint
164
+ pnpm typecheck
165
+ pnpm test
166
+ pnpm build
167
+ pnpm pack:check
168
+ ```
131
169
 
132
- ## Paid-call receipts
170
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for the development workflow and
171
+ [SECURITY.md](./SECURITY.md) for private vulnerability reports.
133
172
 
134
- The `call` result keeps both payment receipt surfaces under `payment`:
173
+ CLI commands exit `0` on success, `1` on an operational failure, and `2` for
174
+ invalid usage or an announced preview-only command. `--json` sends both success
175
+ values and errors to stdout as one JSON value; `mcp --json` is accepted as a
176
+ no-op because the stdio transport is already JSON-RPC.
135
177
 
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.
178
+ ## Publishing
140
179
 
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.
180
+ All five packages share one version and are published together. npm reads a
181
+ package manifest before lifecycle hooks run, so the release is made from the
182
+ generated `publish/` directories, never from the workspace package roots.
143
183
 
144
- ## Balances and sweep-back
184
+ First update every package to the same version, keep
185
+ `publishConfig.tag = "next"`, and verify the exact tarballs:
145
186
 
146
187
  ```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
188
+ pnpm install --frozen-lockfile
189
+ pnpm pack:check
150
190
  ```
151
191
 
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`).
153
-
154
- ## Networks
192
+ After reviewing the output, a maintainer with npm access runs these commands
193
+ manually:
155
194
 
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 |
160
-
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.
195
+ ```sh
196
+ npm login
197
+ pnpm --dir packages/core publish:npm
198
+ pnpm --dir packages/sources publish:npm
199
+ pnpm --dir packages/mcp publish:npm
200
+ pnpm --dir packages/cli publish:npm
201
+ pnpm --dir packages/vapi-network publish:npm
202
+ ```
171
203
 
172
- ## Custody and recovery
204
+ Each package's `publish:npm` script publishes its staged `./publish` directory
205
+ with `npm publish ./publish --access public --tag next`. The manual release
206
+ workflow verifies and prints these commands; it never receives npm credentials
207
+ or publishes automatically.
173
208
 
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.
209
+ ## License
175
210
 
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.
211
+ Apache-2.0. See [LICENSE](./LICENSE).
@@ -0,0 +1,4 @@
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, searchMarketplace, type MarketplaceSearchInput, } from "./tools/search.js";
4
+ export { getWallet, type WalletBalance } from "./tools/wallet.js";