@vapi-network/cli 0.5.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 CHANGED
@@ -10,5 +10,14 @@ Two entry points: `@vapi-network/cli` exports `runCli` and the `HELP` text for
10
10
  embedding, and `@vapi-network/cli/cli` is the executable itself.
11
11
 
12
12
  Most users should install or run the unscoped `vapi-network` package instead.
13
- See the [root README](https://github.com/vAPI-Network/vapi-network#readme) for
14
- the full command reference.
13
+
14
+ ## Exports
15
+
16
+ | Name | What it is | Since |
17
+ | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
18
+ | `CliDependencies` | type CliDependencies = { fetchImpl?: typeof fetch; prompts?: CliPrompts; interactive?: boolean; env?: NodeJS.ProcessEnv; secretStore?: SecretStore; now?: () => Date; agentLink?: { startDeviceLink?: typeof startDeviceLink; pollDeviceLink?: typeof pollDeviceL... | 0.5.0 or earlier |
19
+ | `CliIo` | type CliIo = { stdout(message: string): void; stderr(message: string): void; } | 0.5.0 or earlier |
20
+ | `HELP` | constant HELP: "vAPI Network\n\nUsage:\n vapi init [--networks <base,arc,solana>] [--json]\n vapi wallet list [--json]\n vapi wallet create <name> [--networks <base,arc,solana>] [--label <text>] [--json]\n vapi wallet use <name> [--json]\n vapi wallet renam... | 0.5.0 or earlier |
21
+ | `runCli` | function (argv = process.argv.slice(2), io: CliIo = processIo, dependencies: CliDependencies = {}): Promise<number> | 0.5.0 or earlier |
22
+
23
+ See the [root README](https://github.com/vAPI-Network/vapi-network/blob/main/README.md#cli-reference) for the full command reference.
@@ -0,0 +1,11 @@
1
+ import { type CliDependencies, type CliIo } from "./cli.js";
2
+ export declare function accountsCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<number>;
3
+ export declare function accountsListCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<void>;
4
+ export declare function accountsAddCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<void>;
5
+ export declare function accountsImportCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<void>;
6
+ export declare function accountsRenameCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<void>;
7
+ export declare function accountsUseCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<void>;
8
+ export declare function accountsRemoveCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<void>;
9
+ export declare function accountsRestoreCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<void>;
10
+ export declare function accountsCapsCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<void>;
11
+ export declare function accountsDistributeCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<number>;
package/dist/cli.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { sweepBack, WalletStore, type AuditEvent, type ListingVerification, type SecretStore, type VapiConfig, type VapiPaymentAccount, type WalletEntry, type WalletName } from "@vapi-network/core";
1
+ import { drainCeilingSweeps, sweepBack, WalletStore, type AuditEvent, type CeilingBalanceReader, type CeilingSiblingsFetcher, type CeilingTransfer, type DistributeArgs, type ListingVerification, type SecretStore, type VapiConfig, type VapiPaymentAccount, type WalletBalanceReader, type WalletEntry, type WalletName, type TransferArgs } from "@vapi-network/core";
2
2
  import { type pollDeviceLink, type startDeviceLink } from "@vapi-network/core/agent-link";
3
3
  import type { buyRouterBalance, listRouterModels, ownerStake, rotateRouterKey, routerChat, routerCredentials, routerUsage } from "@vapi-network/core/router-client";
4
4
  import { type AgentCommandDependencies } from "./agent.js";
5
- export declare const HELP = "vAPI Network\n\nUsage:\n vapi init [--networks <base,arc,solana>] [--json]\n vapi wallet list [--json]\n vapi wallet create <name> [--networks <base,arc,solana>] [--label <text>] [--json]\n vapi wallet use <name> [--json]\n vapi wallet rename <old> <new> [--json]\n vapi wallet remove <name> [--force] [--json]\n vapi wallet restore <name> [--json]\n vapi wallet caps <name> [--per-call <usd>] [--per-day <usd>] [--json]\n vapi fund [--amount <usd>] [--wallet <name>] [--json]\n vapi accounts [--enable <solana|arc>] [--wallet <name>] [--json]\n vapi search [query] [--kind <kind>] [--network <caip2>] [--limit <n>] [--cursor <cursor>] [--include-unverified] [--json]\n vapi inspect <id> [--endpoint <name>] [--json]\n vapi pay <id-or-url> [--method <method>] [--endpoint <name>] [--body <json>] [--content-type <type>] [--network <caip2>] [--expected-pay-to <address>] [--max <amount>] [--wallet <name>] [--json]\n vapi pay --resume <receipt-id> [--json]\n vapi check <url> [--method <method>] [--json]\n vapi balance [--wallet <name>] [--json]\n vapi receipts [--limit <n>] [--wallet <name>] [--all-wallets] [--json]\n vapi receipts export --format <json|csv> [--range <24h|7d|30d>] [--wallet <name>] [--all-wallets]\n vapi stats [--range <24h|7d|30d>] [--wallet <name>] [--all-wallets] [--json]\n vapi sweep [<address>] [--network <caip2>] [--wallet <name>] [--json]\n vapi agent create <name> --model <id> --instructions <file> [--call-budget <usd>] [--max-per-call <usd>] [--router-budget <usd>] [--approve-above <usd>] [--include-unverified] [--max-steps <n>] [--json]\n vapi agent run <name> \"<task>\" [--json]\n vapi agent list [--json]\n vapi agent pause <name> [--json]\n vapi agent resume <name> [--json]\n vapi agent revoke <name> [--json]\n vapi login [--wallet <name>] [--label <name>] [--publish] [--no-browser] [--json]\n vapi logout [--wallet <name>] [--json]\n vapi whoami [--wallet <name>] [--json]\n vapi router models [--wallet <name>] [--json]\n vapi router usage [--wallet <name>] [--json]\n vapi router chat --model <id> [--system <text>] [--max-tokens <n>] \"<prompt>\" [--wallet <name>] [--json]\n vapi router buy <1|5|20|50> [--wallet <name>] [--json]\n vapi router buy --auto <1|5|20|50> --below <usd> [--wallet <name>] [--json]\n vapi router buy --auto off [--wallet <name>] [--json]\n vapi router key [--rotate] [--wallet <name>] [--json]\n vapi stake status [--wallet <name>] [--json]\n vapi stake open [--wallet <name>] [--no-browser] [--json]\n vapi export-key [--network <caip2>] [--wallet <name>] [--json]\n vapi backup [--wallet <name>] [--json]\n vapi import (--phrase | --key) [--wallet <name>] [--networks <base,arc,solana>] [--replace] [--force] [--json]\n vapi passphrase [--wallet <name>] [--json]\n vapi unlock [--wallet <name>] [--json]\n vapi lock [--wallet <name> | --all] [--json]\n vapi report \"<what happened>\" [--include-addresses] [--send] [--json]\n vapi auth set-key [--json]\n vapi auth status [--json]\n vapi auth clear [--json]\n vapi publish <url> [--method <method>] [--mode <origin|endpoint|openapi>] [--name <text>] [--description <text>] [--category <ai|data|crypto|compute|search>] [--select <names>] [--wallet <name>] [--yes] [--resume] [--json]\n vapi publish activate <slug> [--json]\n vapi publish verify-request <slug> [--json]\n vapi publish list [--json]\n vapi claim <origin> [--wallet <name>] [--json]\n vapi mcp [--wallet <name>] [--json]\n vapi serve [--json]\n vapi version [--json]\n vapi help [--json]\n\nEvery command that touches a wallet takes `--wallet <name>`, falls back to `VAPI_WALLET`, then to the default set by `vapi wallet use`, and names the wallet it used on its first line.\n\n`vapi search` answers with vAPI-verified listings plus the mirrored external catalogs. `--include-unverified` also returns self-listed APIs that passed vAPI's automated x402 probe but were never reviewed; every result is tagged `[verified]`, `[requested]`, `[unverified]` or `[external]`.\n\n`vapi check <url>` grades an x402 API's 402 without paying: status, transport, declared version and its required fields, the exact scheme, canonical USDC, payTo, maxTimeoutSeconds, advertised extensions, and the origin's /.well-known/x402. It looks for OpenAPI beside the checked path, at /openapi.json, then through same-origin service-desc links in /.well-known/api-catalog. No wallet, no payment, no registry call. It exits 1 when a rule fails. A 402 that answers with Stripe/Tempo's MPP challenge (WWW-Authenticate: Payment) is recognised and reported as transport mpp; vapi pay cannot pay it.\n\n`vapi pay --resume <receipt-id>` answers the one question a lost response leaves: did that payment settle? It reads the signed authorization's state on-chain \u2014 settled, expired, or still pending \u2014 and never pays.\n\n`vapi fund` opens the funding page: card via Coinbase (needs a Coinbase account; US guest checkout), send from MetaMask/Coinbase Wallet/WalletConnect, or bridge from another chain.\n\n`vapi unlock` keeps one wallet's passphrase in the OS secret store \u2014 the macOS Keychain, or libsecret on Linux \u2014 so an agent can pay without `VAPI_KEYSTORE_PASSWORD` in its configuration. `vapi lock` takes it out again. Unlock order: `VAPI_KEYSTORE_PASSWORD`, then the secret store, then a prompt on a terminal. Windows still needs the variable.\n\n`vapi backup` and `vapi export-key` print a secret, so they run only on a real terminal, never for an agent, and ask you to type the wallet name first. Set `VAPI_NO_SECRETS=1` to switch them off entirely. Every export and every wallet change is logged to ~/.vapi/audit.log.\n\n`vapi publish <url>` lists an API you own. vAPI probes the URL \u2014 an origin, one endpoint, or an OpenAPI document \u2014 you choose which endpoints to list, and your wallet signs one line naming where the payouts go. Listing is permissionless: a listing that passed the probe goes live with `vapi publish activate <slug>`, and `vapi publish verify-request <slug>` asks for the review that puts it in the default search. Deploying the FeeSplitter that receives the payouts is a wallet transaction and stays in the console. A catalog of more than 20 endpoints is listed as several listings of up to 20, with one result line per endpoint; `--resume` skips every endpoint this key already lists.\n\n`vapi claim <origin>` takes ownership of the listings vAPI indexed from your API. The wallet their payments go to signs one line, `Claim the vAPI Call listings served from <origin>`; the listings stay paid directly to that wallet, and `vapi publish list` shows them.\n\n`vapi auth set-key` types the registry API key once, on a terminal, into the same OS secret store as the passphrase. A key is a secret: it is never an argument, `VAPI_API_KEY` is the route for CI, and no agent or MCP tool can reach it.\n\nWith no command, vapi shows this help. The MCP server starts only with `vapi mcp`.";
5
+ export declare const HELP = "vAPI Network\n\nUsage:\n vapi init [--networks <base,arc,solana>] [--json]\n vapi setup [--no-cloud-backup] [--json]\n vapi accounts [--all] [--json]\n vapi accounts add <name> [--label <text>] [--no-link] [--json]\n vapi accounts import <name> [--keystore <path> | --key-file <path>] [--label <text>] [--json]\n vapi accounts rename <old> <new> [--json]\n vapi accounts use <name> [--json]\n vapi accounts remove <name> [--force] [--json]\n vapi accounts restore <name> [--json]\n vapi accounts caps <name> [--per-call <usd>] [--per-day <usd>] [--ceiling <usd|off>] [--json]\n vapi accounts distribute <amount> --from <account> [--to <a,b,c>] [--network base|arc] [--json]\n vapi accounts distribute --resume <id> [--json]\n vapi send <amount> --from <account> --to <account|owner|0x\u2026> [--network base|arc] [--resume <nonce>] [--json]\n vapi fund [--amount <usd>] [--account <name>] [--json]\n vapi search [query] [--kind <kind>] [--network <caip2>] [--limit <n>] [--cursor <cursor>] [--include-unverified] [--json]\n vapi inspect <id> [--endpoint <name>] [--json]\n vapi pay <id-or-url> [--method <method>] [--endpoint <name>] [--body <json>] [--content-type <type>] [--network <caip2>] [--expected-pay-to <address>] [--max <amount>] [--account <name>] [--json]\n vapi pay --resume <receipt-id> [--json]\n vapi check <url> [--method <method>] [--json]\n vapi balance [--account <name>] [--json]\n vapi receipts [--limit <n>] [--account <name>] [--all-wallets] [--json]\n vapi receipts export --format <json|csv> [--range <24h|7d|30d>] [--account <name>] [--all-wallets]\n vapi stats [--range <24h|7d|30d>] [--account <name>] [--all-wallets] [--json]\n vapi sweep [<address>] [--network <caip2>] [--account <name>] [--json]\n vapi agent create <name> --model <id> --instructions <file> [--call-budget <usd>] [--max-per-call <usd>] [--router-budget <usd>] [--approve-above <usd>] [--include-unverified] [--max-steps <n>] [--json]\n vapi agent run <name> \"<task>\" [--json]\n vapi agent list [--json]\n vapi agent pause <name> [--json]\n vapi agent resume <name> [--json]\n vapi agent revoke <name> [--json]\n vapi login [--account <name>] [--label <name>] [--publish] [--no-browser] [--json]\n vapi logout [--account <name>] [--json]\n vapi whoami [--account <name>] [--json]\n vapi router models [--account <name>] [--json]\n vapi router usage [--account <name>] [--json]\n vapi router chat --model <id> [--system <text>] [--max-tokens <n>] \"<prompt>\" [--account <name>] [--json]\n vapi router buy <1|5|20|50> [--account <name>] [--json]\n vapi router buy --auto <1|5|20|50> --below <usd> [--account <name>] [--json]\n vapi router buy --auto off [--account <name>] [--json]\n vapi router key [--rotate] [--account <name>] [--json]\n vapi stake status [--account <name>] [--json]\n vapi stake open [--account <name>] [--no-browser] [--json]\n vapi export-key [--network <caip2>] [--account <name>] [--json]\n vapi backup [--account <name>] [--cloud [off]] [--json]\n vapi restore [--from-owner [--owner <0x\u2026>]] [--json]\n vapi import (--phrase | --key) [--account <name>] [--networks <base,arc,solana>] [--replace] [--force] [--json]\n vapi passphrase [--account <name>] [--json]\n vapi vault protect [--json]\n vapi vault unprotect [--json]\n vapi vault lock [--json]\n vapi vault unlock [--json]\n vapi vault status [--json]\n vapi unlock [--account <name>] [--json]\n vapi lock [--account <name> | --all] [--json]\n vapi report \"<what happened>\" [--include-addresses] [--send] [--json]\n vapi auth set-key [--json]\n vapi auth status [--json]\n vapi auth clear [--json]\n vapi publish <url> [--method <method>] [--mode <origin|endpoint|openapi>] [--name <text>] [--description <text>] [--category <ai|data|crypto|compute|search>] [--select <names>] [--account <name>] [--yes] [--resume] [--json]\n vapi publish activate <slug> [--json]\n vapi publish verify-request <slug> [--json]\n vapi publish list [--json]\n vapi claim <origin> [--account <name>] [--json]\n vapi mcp [--account <name>] [--json]\n vapi mcp install <claude|cursor|codex> [--home <dir>] [--registry <url>] [--json]\n vapi serve [--json]\n vapi version [--json]\n vapi help [--json]\n\nEvery command that touches a wallet takes `--account <name>`, falls back to `VAPI_WALLET`, then to the default account set by `vapi accounts use`, and names the wallet it used on its first line.\n\n`vapi search` answers with vAPI-verified listings plus the mirrored external catalogs. `--include-unverified` also returns self-listed APIs that passed vAPI's automated x402 probe but were never reviewed; every result is tagged `[verified]`, `[requested]`, `[unverified]` or `[external]`.\n\n`vapi check <url>` grades an x402 API's 402 without paying: status, transport, declared version and its required fields, the exact scheme, canonical USDC, payTo, maxTimeoutSeconds, advertised extensions, and the origin's /.well-known/x402. It looks for OpenAPI beside the checked path, at /openapi.json, then through same-origin service-desc links in /.well-known/api-catalog. No wallet, no payment, no registry call. It exits 1 when a rule fails. A 402 that answers with Stripe/Tempo's MPP challenge (WWW-Authenticate: Payment) is recognised and reported as transport mpp; vapi pay cannot pay it.\n\n`vapi pay --resume <receipt-id>` answers the one question a lost response leaves: did that payment settle? It reads the signed authorization's state on-chain \u2014 settled, expired, or still pending \u2014 and never pays.\n\n`vapi fund` opens the funding page: card via Coinbase (needs a Coinbase account; US guest checkout), send from MetaMask/Coinbase Wallet/WalletConnect, or bridge from another chain.\n\n`vapi vault protect` adds a password to the device vault. `vapi vault unlock` opens it on this device for 8 hours; for unattended use, set `VAPI_VAULT_PASSWORD`. `vapi unlock` and `vapi lock` remain aliases for one release.\n\n`vapi backup` and `vapi export-key` print a secret, so they run only on a real terminal, never for an agent, and ask you to type the wallet name first. `vapi backup --cloud` keeps an encrypted vault copy that only the owner can approve for recovery. `vapi restore` rebuilds the vault from the phrase and re-derives accounts until an unused address. Set `VAPI_NO_SECRETS=1` to switch exports off entirely. Every export and every wallet change is logged to ~/.vapi/audit.log.\n\n`vapi publish <url>` lists an API you own. vAPI probes the URL \u2014 an origin, one endpoint, or an OpenAPI document \u2014 you choose which endpoints to list, and your wallet signs one line naming where the payouts go. Listing is permissionless: a listing that passed the probe goes live with `vapi publish activate <slug>`, and `vapi publish verify-request <slug>` asks for the review that puts it in the default search. Deploying the FeeSplitter that receives the payouts is a wallet transaction and stays in the console. A catalog of more than 20 endpoints is listed as several listings of up to 20, with one result line per endpoint; `--resume` skips every endpoint this key already lists.\n\n`vapi claim <origin>` takes ownership of the listings vAPI indexed from your API. The wallet their payments go to signs one line, `Claim the vAPI Call listings served from <origin>`; the listings stay paid directly to that wallet, and `vapi publish list` shows them.\n\n`vapi auth set-key` types the registry API key once, on a terminal, into the same OS secret store as the passphrase. A key is a secret: it is never an argument, `VAPI_API_KEY` is the route for CI, and no agent or MCP tool can reach it.\n\nWith no command, vapi shows the status screen; vapi help prints this text. The MCP server starts only with `vapi mcp`; `vapi mcp install <app>` writes that app's MCP config and prints the file it touched.";
6
6
  export type CliIo = {
7
7
  stdout(message: string): void;
8
8
  stderr(message: string): void;
@@ -22,12 +22,16 @@ export type CliDependencies = {
22
22
  prompts?: CliPrompts;
23
23
  /** Whether a person is watching. Only then is a recovery phrase shown. */
24
24
  interactive?: boolean;
25
+ /** Whether stdin is a terminal, independently of redirected stdout. */
26
+ stdinIsTTY?: boolean;
25
27
  /** The environment this run sees: wallet selection and agent detection. */
26
28
  env?: NodeJS.ProcessEnv;
27
29
  /** The OS secret store `vapi unlock` and `vapi lock` act on. */
28
30
  secretStore?: SecretStore;
29
31
  /** Injected clock, so a signed message is reproducible in a test. */
30
32
  now?: () => Date;
33
+ /** Injected hostname, so device naming is reproducible in a test. */
34
+ hostname?: () => string;
31
35
  /** Device-link operations, injected so tests never touch the account service. */
32
36
  agentLink?: {
33
37
  startDeviceLink?: typeof startDeviceLink;
@@ -44,18 +48,66 @@ export type CliDependencies = {
44
48
  ownerStake?: typeof ownerStake;
45
49
  routerCredentials?: typeof routerCredentials;
46
50
  };
51
+ /** Status-screen deadlines, injected so timeout behavior is deterministic in tests. */
52
+ status?: {
53
+ timeoutMs?: number;
54
+ };
55
+ /** Cloud-backup seams, injected so relay and upload tests stay deterministic. */
56
+ cloudBackup?: {
57
+ startRelay?: typeof import("@vapi-network/core/cloud-backup").startRelay;
58
+ awaitRelay?: typeof import("@vapi-network/core/cloud-backup").awaitRelay;
59
+ uploadBackup?: typeof import("@vapi-network/core/cloud-backup").uploadBackup;
60
+ fetchSiblings?: typeof import("@vapi-network/core").fetchSiblings;
61
+ sleep?: (milliseconds: number, signal?: AbortSignal) => Promise<void>;
62
+ randomBytes?: (size: number) => Uint8Array;
63
+ uploadTimeoutMs?: number;
64
+ };
65
+ /** MCP client locations, injected so installer tests never touch user config. */
66
+ mcpInstall?: {
67
+ platform?: NodeJS.Platform;
68
+ homedir?: string;
69
+ cwd?: string;
70
+ appData?: string;
71
+ };
47
72
  /** Agent profile and run operations, injected so tests stay local and deterministic. */
48
73
  agent?: AgentCommandDependencies;
49
- /** Reads stdin to EOF for `vapi router chat ... -`. */
74
+ /** Reads stdin to EOF for `vapi router chat ... -` and scripted vault restores. */
50
75
  readStdin?: () => Promise<string>;
51
76
  /** Opens one public URL in the platform browser. */
52
77
  openUrl?: (url: string) => boolean;
53
78
  /** Moves a wallet balance, injected for deterministic sweep command tests. */
54
79
  sweepBack?: typeof sweepBack;
80
+ /** Transfer authorization inputs, injected so send tests are deterministic. */
81
+ transfer?: {
82
+ nonce?: TransferArgs["nonce"];
83
+ timeoutMs?: number;
84
+ };
85
+ /** Distribution seams, injected so CLI tests never sign or relay live transfers. */
86
+ distribute?: Pick<DistributeArgs, "balanceReader" | "siblingsReader" | "transfer" | "authorizationState" | "randomId" | "randomNonce" | "timeoutMs" | "lockTimeoutMs">;
87
+ /** Automatic ceiling sweep seams for status and short-lived paid calls. */
88
+ ceiling?: {
89
+ sweepAllAboveCeiling?: typeof import("@vapi-network/core").sweepAllAboveCeiling;
90
+ drainCeilingSweeps?: typeof drainCeilingSweeps;
91
+ balanceReader?: CeilingBalanceReader;
92
+ fetchSiblingsImpl?: CeilingSiblingsFetcher;
93
+ transfer?: CeilingTransfer;
94
+ timeoutMs?: number;
95
+ };
55
96
  };
56
97
  export declare class UsageError extends Error {
57
98
  }
99
+ export declare function getPrompts(dependencies: CliDependencies): CliPrompts;
58
100
  export declare function getEnvironment(dependencies: CliDependencies): NodeJS.ProcessEnv;
101
+ /** A recovery phrase is shown only when a person can write it down. */
102
+ export declare function isInteractive(dependencies: CliDependencies): boolean;
103
+ /** Whether a secret can be typed without being echoed, even when stdout is redirected. */
104
+ export declare function isStdinInteractive(dependencies: CliDependencies): boolean;
105
+ /**
106
+ * Reads one visible line. The prompt and the echo go to stderr, so a typed
107
+ * confirmation never lands in the stdout a caller may be capturing.
108
+ */
109
+ export declare function promptForLine(prompt: string): Promise<string>;
110
+ export declare function getLinePrompt(dependencies: CliDependencies): (prompt: string) => Promise<string>;
59
111
  /** The wallet one invocation acts on, resolved before any passphrase is read. */
60
112
  export type WalletTarget = {
61
113
  store: WalletStore;
@@ -64,6 +116,8 @@ export type WalletTarget = {
64
116
  entry: WalletEntry;
65
117
  address?: string;
66
118
  };
119
+ /** Opens the wallet store for this home, migrating a 0.2.x layout on the way. */
120
+ export declare function openWalletStore(dependencies: CliDependencies): Promise<WalletStore>;
67
121
  /** Opens the store and picks the wallet in one step, for the usual command. */
68
122
  export declare function targetWallet(parsed: {
69
123
  one(name: string): string | undefined;
@@ -76,7 +130,7 @@ export declare function unlockTarget(target: WalletTarget, dependencies: CliDepe
76
130
  passphrase: string;
77
131
  }>;
78
132
  /** One audit line. The home is the wallet store's, so `VAPI_HOME` is honoured. */
79
- export declare function recordAudit(dependencies: CliDependencies, event: AuditEvent, options?: {
133
+ export declare function recordAudit(dependencies: CliDependencies, event: AuditEvent | "vault.cloud_backup_on" | "vault.cloud_backup_off", options?: {
80
134
  wallet?: string;
81
135
  detail?: string;
82
136
  }): Promise<void>;
@@ -89,16 +143,26 @@ export declare function requireSecretsAllowed(dependencies: CliDependencies, eve
89
143
  refusal?: string;
90
144
  forcedReason?: string;
91
145
  }): Promise<void>;
146
+ /**
147
+ * Printing a secret or trashing a wallet is worth one deliberate act: the
148
+ * person types the wallet's own name. A mismatch stops before anything moves.
149
+ */
150
+ export declare function confirmWalletName(name: string, prompt: string, refusal: string, dependencies: CliDependencies): Promise<void>;
92
151
  /** Run one CLI invocation and return its process exit code. */
93
152
  export declare function runCli(argv?: string[], io?: CliIo, dependencies?: CliDependencies): Promise<number>;
94
153
  /**
95
- * Creates another wallet on this machine, with the same custody notice, the
96
- * same passphrase confirmation and the same one-time phrase as `vapi init`.
154
+ * Creates another wallet on this machine, with the same custody notice and
155
+ * the same one-time phrase as `vapi init`.
97
156
  * No network call: a fresh wallet has nothing to look up.
98
157
  */
99
158
  export declare function walletCreateCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<void>;
100
- /** Per-wallet spend caps, in US dollars, converted to atomic USDC on the way in. */
159
+ /** Compatibility export for the agent command while account management moves modules. */
101
160
  export declare function walletCapsCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<void>;
161
+ /**
162
+ * The Base USDC balance of an address, read the way `vapi accounts` reads it,
163
+ * so removing a wallet can refuse to walk away from money.
164
+ */
165
+ export declare function baseUsdcBalanceReader(config: VapiConfig, dependencies: CliDependencies): WalletBalanceReader;
102
166
  /**
103
167
  * The registry behind the configured discovery URLs. `VAPI_REGISTRY_URL` has
104
168
  * already moved those by the time the config is loaded, so deriving the base
@@ -106,6 +170,9 @@ export declare function walletCapsCommand(argv: string[], json: boolean, io: Cli
106
170
  * prefix alike. A hand-edited discovery URL falls back to the shipped default.
107
171
  */
108
172
  export declare function registryBaseUrl(config: VapiConfig): string;
173
+ /** Loads the config and reports any retired registry URL it had to repair. */
174
+ export declare function readConfig(path: string, io: CliIo): Promise<VapiConfig>;
175
+ export declare function output(io: CliIo, json: boolean, value: unknown, human: string): void;
109
176
  /**
110
177
  * The short word for how far a listing got through vAPI review. A mirrored
111
178
  * external row is called `external` rather than `unverified`: vAPI reviewed
@@ -127,6 +194,14 @@ export declare function verificationNotice(verification: ListingVerification | u
127
194
  * machine simply keeps the printed link.
128
195
  */
129
196
  export declare function openInBrowser(url: string): boolean;
197
+ export declare const CUSTODY_NOTICE: string;
198
+ /**
199
+ * The phrase is shown once, to a person, and waits until they say they have it.
200
+ * A script, a piped run or anything an agent drives gets the pointer to
201
+ * `vapi backup` instead: the wallet is still created, but nothing here may end
202
+ * up in a transcript or a log file.
203
+ */
204
+ export declare function showRecoveryPhrase(phrase: string, io: CliIo, dependencies: CliDependencies): Promise<void>;
130
205
  type ArgumentSpec = {
131
206
  valueOptions: Set<string>;
132
207
  booleanOptions?: Set<string>;
@@ -139,4 +214,6 @@ export declare function parseArguments(argv: string[], spec: ArgumentSpec): {
139
214
  many: (name: string) => string[];
140
215
  has: (name: string) => boolean;
141
216
  };
217
+ export declare function requiredPositional(value: string | undefined, argument: string, usage: string): string;
218
+ export declare function fileExists(path: string): Promise<boolean>;
142
219
  export {};