Buyer-controlled client for x402 API payments in USDC on Base.
Repo vAPI-Network/vapi-network, read from GitHub 10 h ago. vAPI-Network has not joined Take My Repo.
Tasks V2 runs on Base mainnet from the CLI, the SDK and local MCP, against the audited contracts pinned in the client.
mayVote and retaining stake through reveal.tasks namespace.Install: npm i -g vapi-network@0.16.0 · npm · Changes since v0.15.2
vapi login says why a link request never reached vAPI, lock files survive more races, and vapi agent run --result-file prints refill transaction hashes again.
ENOENT, and on Windows a waiter breaking a crashed process's lock could reject with EPERM or EBUSY naming a .stale. file.vapi login says why the link request never reached vAPI: a failed DNS lookup, a timeout, or the system error code of the connection, such as ECONNREFUSED. When HTTPS_PROXY is set without NODE_USE_ENV_PROXY=1, it says that Node.js uses the proxy only with that variable. Before, every such failure printed The vAPI agent link request failed. with no reason.vapi agent run <name> "<task>" --result-file <path> prints a Router refill's transaction hash again. The printed result went through redaction a second time, so the Transaction: line and the refills[].receipt.transaction field of --json output showed [redacted private key] while the result file kept the hash. Both show the hash now. Everything else such a run prints is redacted as before.fetchImpl, which the tests give a local stub.Install: npm i -g vapi-network@0.15.2 · npm · Changes since v0.15.1
vapi docs and the MCP docs tools read the new docs site at docs.vapinetwork.ai, and Router key writes, resumed transfers and lock files are safe against races.
vapi logout or a new vapi login can no longer finish after it. vapi router key --rotate, the Router balance key stored after a purchase and the removal of a rejected balance key now re-check the link and write under the same lock that login, logout and the token refresh use. Before, a rotation that lost the race could publish the old link again and store a Router key for a wallet that was logged out. The agent-link subentry exports withCredentialPublishLock for this.vapi send and MCP accounts.send keep the spend reservation when saving the signed authorization reports an error although the row reached the receipts ledger. The transfer then returns unknown with its nonce and is continued by running the same vapi send command again with --resume <nonce>. Before, the reservation was released while the row stayed resumable, so a resumed transfer could move money outside the spend cap. When the ledger shows no row for the nonce, the reservation is released as before.Install: npm i -g vapi-network@0.15.1 · npm · Changes since v0.15.0
Router purchases recover after an interruption without a second charge, swarm dissolution refuses while a worker is active or unresolved, and vapi login works on more Linux keyrings.
vapi router clear-pending --confirm-settled saves any missing succeeded receipt, prints payment evidence and support guidance, then retires a settled journal under the purchase lock. JSON adds receipt, receiptAppended and notice; prepared, signed and unknown entries are refused. The flag is exclusive with --confirm-unpaid and has no MCP equivalent.receipt.settlement (succeeded, rejected or unknown). MCP output schemas accept settlement_unconfirmed, credit_pending and pending_purchase_unlinked warnings.ensureRouterPurchaseReceipt to record settled purchase evidence; a separate strict sync gates retirement. Pending purchase journals optionally record baselinePurchasedUsd; older entries remain recoverable through a successful balance-key chat.settlement_unconfirmed, credit_pending and pending_purchase_unlinked to distinguish unconfirmed authorizations, credit awaiting confirmation, and settled purchases whose link changed.vapi router clear-pending [--confirm-unpaid] prints public payment evidence and explorer instructions. Before clearing, the CLI uses the same receipt/authorization-state resolution as automatic recovery: paid attempts and live authorizations are refused, and unused expired authorizations can clear. Only when chain evidence is unavailable may explicit human confirmation override the guard; output identifies that confirmation as lacking chain evidence. There is no MCP equivalent.vapi swarm forget-run <swarm> <runId> --confirm-destroyed lets an owner confirm a verified unknown/orphaned sandbox is destroyed. It prints the original recorded scope and check command, retains a timestamped forgotten run record and retires the matching sidecar. Missing scope is reported rather than guessed.swarm.stop with name and exactly one of runId or all: true. VapiServerOptions.runtimeForStop optionally resolves stop-only adapters by runtime kind. The CLI-hosted server supplies local/Railway stop adapters without enabling remote startup or stale-start confirmation over MCP.PayRequestArgs adds optional beforeSign (also on x402 payment builders) for durable public authorization journaling before signing, and optional receiptId to correlate a durable purchase reservation with its receipt ledger entry. The Router subentry exports routerPurchaseView, the shared public receipt/warning projection.PaymentWarning type. The Router subentry exports RouterPurchaseResult, RouterPurchaseWarning and routerPurchaseSummary.PAYMENT_WARNING_CODES, the list every payment warning schema is derived from, and swarmRunRefillSchema. Swarm member results, delegation records and the MCP Router tools accept the same warning codes and the receipt's settlement outcome, so a refill with an unconfirmed settlement or pending credit no longer fails output validation in a swarm run.RouterPendingPurchase. Wallet entries expose its public recovery metadata in memory, while WalletStore.setRouterPendingPurchase atomically reserves, updates or clears the matching record in router-pending/<wallet>.json, separate from the v1 wallet registry. Older registry writers cannot erase it. Existing registry records migrate on read; legacy prepared records remain unknown because older clients did not journal signing. Empty tombstones prevent stale registry snapshots from resurrecting cleared purchases.RuntimeError.code adds swarm_unavailable and launch_ambiguous. startDetachedRun reserves swarm members under the swarm lock before taking their member lock, revalidates membership and can reject with swarm_unavailable; this applies to local and Railway swarm workers. Standalone agents retain the member-only lock.stopRun now attempts to stop unknown workers and requires successful adapter completion before persisting stopped. Runtime.stop adds an optional { requireSuccessfulExit: true } argument, passed by stopRun for running, unknown and starting Railway records with a saved sandbox id and by launch-persistence rollback; adapters must honor it without text-based absence inference. The Railway adapter always requires destroy exit 0, with or without the option, across launch-failure, signal, terminal-status and direct-stop cleanup; destroyRailwaySidecar requires exit 0 for every sidecar it retires. Stderr warnings are harmless on success; non-zero, interrupted and timeout outcomes reject even when text says not found. Local stops retain their behavior.AgentEvent adds the refill member with public Router purchase evidence and warnings.receipt.id, receipt.amountUsd, receipt.network and optional receipt.transaction replace the flat receiptId, amountUsd, network and transaction fields. Human output includes the public receipt and transaction references.buyRouterBalance returns RouterPurchaseResult with optional PaymentWarning entries. routerPurchaseSummary, CLI purchase JSON and MCP purchase output allow amountUsd: null and network: "unknown" when charged metadata is absent.payRequest returns a confirmed in-memory receipt with warnings when receipt persistence or post-settlement processing fails, instead of rejecting. Callers must retain the receipt and must not repeat the payment for these warnings.RouterClientError adds refill_pending, an optional prior refill purchase (fourth constructor argument, including interrupted purchases awaiting confirmation), and a public toJSON() summary. ChatResult adds optional refill: RouterPurchaseResult; CLI/MCP chat results and errors preserve public payment evidence and warnings.refreshRunRecord now acquires the member lock, re-reads the stored record and returns its fresh state. Unknown and terminal records are never polled from stale snapshots. Missing records reject with RuntimeError("run_not_found"), changed member identity with runtime_unavailable, and lock contention with member_busy. MCP exports withMemberRunLock(home, account, operation) for the same lifecycle lock; no run-record schema or function argument changes in this round.destroyRailwaySidecar serializes cleanup on the recorded member and re-reads ownership/state before acting. Concurrent completed confirmation with no sidecar returns destroyed: true without another Railway call; conflicting/current metadata or contention returns a failed cleanup result. Unattributed legacy cleanup is serialized by run id and does not rewrite failed metadata without a member lock.RunState adds orphaned and forgotten; RunRecord and DetachedRunSummary add optional forgottenAt and confirmedBy: "cli". A forgotten record requires both confirmation fields. RuntimeHandle adds optional railwayScope: { projectId?, environmentId? } for original creation metadata when available. MCP read-only run summaries include these states/confirmation fields; no forget tool is exposed.SwarmErrorCode adds swarm_workers_active for active/unresolved-worker dissolution refusals. CLI JSON and MCP return that shared domain code instead of an untyped error.unknown and leaves the sidecar unchanged. Without a run record, use swarm stop --all first; a failed destroy marks the sidecar orphaned for forget-run --confirm-destroyed. Failed starting/running stops become unknown with sanitized detail; when sidecar persistence succeeds, launch-failure and signal cleanup retain an identified orphaned sidecar that CLI forget-run can clear without a reservation, and failed persistence rollback retains its sidecar. Terminal-result cleanup stays running and retries on refresh; a failed explicit stop then becomes unknown. Nonterminal status polls keep Railway starts unresolved, including when status requests fail. CLI and MCP stop errors and identified failed-launch diagnostics name vapi swarm forget-run <swarm> <runId> --confirm-destroyed after verification in the original project/environment. CLI swarm stop --all and MCP swarm.stop retry unknown workers instead of permanently stranding a disappeared sandbox; only successful destruction or explicit CLI confirmation unblocks dissolution. CLI confirmation also accepts finished, failed or stopped Railway records with an identified orphaned sidecar; id-less sidecars remain refused.launch_ambiguous with the stale-start confirmation command. After five minutes and owner verification, stop --confirm-worker-stopped clears the id-less sidecar; failures before Railway receives a request still clear the reservation.RunAgentResult.refills, CLI stderr, JSON and result files, including purchases carried by failed chats. Stops preserve refill_pending recovery guidance.client.router.buy() returns RouterPurchaseResult so callers can read warnings. The main core entry exports RouterPurchaseResult and RouterPurchaseWarning types.unknown, keeps its reservation and can be resumed. Wallet renames require the receipt rewrite to sync before replacement and sync its directory best effort afterward.refill evidence when a missing link message is normalized. Human errors print purchase warnings, including the settled-retirement command; JSON retains the warning codes and messages.credit_pending warning and allow balance-key chat; repeated recovery never appends another succeeded row for the same purchase.not_linked with pending_purchase_unlinked. Login and logout serialize link changes with purchases using the purchase lock before credential locks.vapi login no longer fails with "The agent link could not be stored consistently" on keyrings where secret-tool clear exits 1 without a message when it matches nothing. An exit 1 without a message for an entry the lookup did not find now counts as nothing to remove; any other exit code, a failure with a reason, and a failure to remove an entry the lookup found are still reported. Reported in #41, first fixed by @Rizal9 in #31.The vAPI agent link request failed (HTTP 429, rate_limited). Earlier versions printed only "The vAPI agent link request failed." for a rate limit, a refusal and a proxy error alike (#30, #42). A gateway or proxy error page without a JSON body is reported the same way and no longer as "response was invalid".prepared, journaled signed, confirmed settled, and legacy/unsupported unknown attempts. Recovery under a per-wallet purchase lock clears unsigned reservations. Signed EIP-3009 attempts query the token's authorizationState(from, nonce) on the configured network RPC: used nonces recover the original purchase; unused nonces clear only after validBefore plus a 30-second clock margin. Live authorizations return refill_pending with a retry time. RPC errors and unsupported networks fail closed with CLI recovery guidance.vapi router clear-pending.null.SwarmCapitalDeps adds an optional reconcileRuns port; local run records remain the authority for the final eligibility check. Existing capital locks and movement-journal formats are unchanged.forget-run has retired it and retained the confirmation.unknown, keeps the reservation and can be resumed. A relayed transfer whose receipt row cannot be written still returns sent (with the transaction when the relay reported one) or unknown with the nonce instead of a filesystem error. --resume with that nonce records the result once the receipt can be written.constructor can now be created on a machine that has none. Earlier versions reported it as an existing wallet, so creating it failed with "already exists" while vapi wallet list showed nothing. Reported and fixed by @goranai in #48 and #49.constructor that does not exist now says "No wallet named constructor" instead of failing with a JavaScript error, and the ceiling sweep no longer claims a window for it. Reported by @goranai in #48.launch_ambiguous, so vapi swarm stop <swarm> <runId> --confirm-worker-stopped can clear the marker after the five-minute window. Identified sidecars still use vapi swarm stop <swarm> <runId> and vapi swarm forget-run <swarm> <runId> --confirm-destroyed after verified destruction.railway sandbox create output that matches the member key, the bundle or a credential exported with the member as unreadable. The launch returns launch_ambiguous and the value is not written to the sidecar, the run record or a railway command line. Failure text from railway is scrubbed before it is shortened, and an echoed VAPI_MEMBER_BUNDLE value is always removed.Install: npm i -g vapi-network@0.15.0 · npm · Changes since v0.14.0
Send ETH that landed on an agent account back to its owner with vapi sweep --asset eth.
vapi sweep --asset eth sends an account's ETH on Base back to an address, or to the linked owner when no address is given. It keeps the Base network fee (gas plus the L1 data fee, with a 20% margin) and checks gas for the exact amount before signing. It works on Base and Base Sepolia only; Arc and Solana are refused. Without --asset, vapi sweep moves USDC exactly as before.Install: npm i -g vapi-network@0.14.0 · npm · Changes since v0.13.0
vapi setup works on Linux machines without a keyring, such as servers, containers and GitHub Codespaces.
vapi setup works on Linux without a keyring (servers, containers, GitHub Codespaces): set VAPI_VAULT_PASSWORD (at least 12 characters) and the device key and agent link are kept in ~/.vapi/secrets.json, encrypted with that password. The choice is pinned once per vault in ~/.vapi/secret-store.json; existing vaults, macOS and Windows keep the OS store.VAPI_VAULT_PASSWORD.Install: npm i -g vapi-network@0.13.0 · npm · Changes since v0.12.1