@vapi-network/cli 0.3.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 +11 -2
- package/dist/accounts.d.ts +11 -0
- package/dist/agent.d.ts +14 -0
- package/dist/check.d.ts +46 -0
- package/dist/cli.d.ts +193 -2
- package/dist/cli.js +19310 -3905
- package/dist/cli.js.map +3 -3
- package/dist/cloud-backup.d.ts +20 -0
- package/dist/identity.d.ts +30 -0
- package/dist/index.js +19267 -3900
- package/dist/index.js.map +3 -3
- package/dist/login.d.ts +14 -0
- package/dist/main-module.d.ts +9 -0
- package/dist/mcp-install.d.ts +13 -0
- package/dist/publish-client.d.ts +193 -0
- package/dist/router.d.ts +4 -0
- package/dist/send.d.ts +2 -0
- package/dist/setup.d.ts +6 -0
- package/dist/stake.d.ts +3 -0
- package/dist/status.d.ts +10 -0
- package/dist/vault.d.ts +3 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
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
|
-
|
|
14
|
-
|
|
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/agent.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { listAgentProfiles, readAgentProfile, readSpendLedgerRows, removeAgentProfile, writeAgentProfile } from "@vapi-network/core";
|
|
2
|
+
import { createAgentRunDeps, getWallet, runAgent } from "@vapi-network/mcp";
|
|
3
|
+
import { type CliDependencies, type CliIo } from "./cli.js";
|
|
4
|
+
export type AgentCommandDependencies = {
|
|
5
|
+
readAgentProfile?: typeof readAgentProfile;
|
|
6
|
+
writeAgentProfile?: typeof writeAgentProfile;
|
|
7
|
+
listAgentProfiles?: typeof listAgentProfiles;
|
|
8
|
+
removeAgentProfile?: typeof removeAgentProfile;
|
|
9
|
+
readSpendLedgerRows?: typeof readSpendLedgerRows;
|
|
10
|
+
createAgentRunDeps?: typeof createAgentRunDeps;
|
|
11
|
+
runAgent?: typeof runAgent;
|
|
12
|
+
getWallet?: typeof getWallet;
|
|
13
|
+
};
|
|
14
|
+
export declare function agentCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<number>;
|
package/dist/check.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vapi check <url>`: a free, local x402 conformance doctor. It asks the URL
|
|
3
|
+
* for its price the way a client would, without paying, and grades the 402
|
|
4
|
+
* rule by rule, including its advertised extensions; then it looks for the
|
|
5
|
+
* origin's discovery document and an OpenAPI description beside the checked
|
|
6
|
+
* path, at the origin root, or through the origin's API catalog. No wallet is
|
|
7
|
+
* opened, nothing is signed, and no registry is called: every request goes to
|
|
8
|
+
* the origin being checked.
|
|
9
|
+
*
|
|
10
|
+
* Offer issue codes use the registry's snake_case `probe.conformance`
|
|
11
|
+
* vocabulary, so `vapi check` and `vapi inspect` speak one language. The local
|
|
12
|
+
* extensions finding does not change that registry-shaped record.
|
|
13
|
+
*/
|
|
14
|
+
import { type ListingConformance } from "@vapi-network/core";
|
|
15
|
+
export type CheckResult = "pass" | "warn" | "fail";
|
|
16
|
+
export type CheckRule = {
|
|
17
|
+
rule: string;
|
|
18
|
+
result: CheckResult;
|
|
19
|
+
detail: string;
|
|
20
|
+
issues: string[];
|
|
21
|
+
};
|
|
22
|
+
export type CheckReport = {
|
|
23
|
+
url: string;
|
|
24
|
+
method: string;
|
|
25
|
+
status: number;
|
|
26
|
+
/** Which payment protocol the 402 speaks; absent when the response is not a 402 or carries neither. */
|
|
27
|
+
transport?: "x402" | "mpp";
|
|
28
|
+
/** The same record the registry keeps per listing; null when there is no offer to grade. */
|
|
29
|
+
conformance: ListingConformance | null;
|
|
30
|
+
/** Known x402 extensions advertised by the declared offer, in a stable order. */
|
|
31
|
+
extensions: string[];
|
|
32
|
+
rules: CheckRule[];
|
|
33
|
+
summary: Record<CheckResult, number>;
|
|
34
|
+
};
|
|
35
|
+
export type MppChallenge = {
|
|
36
|
+
intent?: string;
|
|
37
|
+
method?: string;
|
|
38
|
+
};
|
|
39
|
+
export declare function checkX402(target: URL, options: {
|
|
40
|
+
method: string;
|
|
41
|
+
fetchImpl: typeof fetch;
|
|
42
|
+
}): Promise<CheckReport>;
|
|
43
|
+
/** One line per rule, then the tally. */
|
|
44
|
+
export declare function formatCheckReport(report: CheckReport): string;
|
|
45
|
+
/** Finds the MPP scheme and keeps only the challenge fields used in check output. */
|
|
46
|
+
export declare function parseMppChallenge(headerValue: string | null): MppChallenge | undefined;
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { type SecretStore } from "@vapi-network/core";
|
|
2
|
-
|
|
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
|
+
import { type pollDeviceLink, type startDeviceLink } from "@vapi-network/core/agent-link";
|
|
3
|
+
import type { buyRouterBalance, listRouterModels, ownerStake, rotateRouterKey, routerChat, routerCredentials, routerUsage } from "@vapi-network/core/router-client";
|
|
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 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.";
|
|
3
6
|
export type CliIo = {
|
|
4
7
|
stdout(message: string): void;
|
|
5
8
|
stderr(message: string): void;
|
|
@@ -19,10 +22,198 @@ export type CliDependencies = {
|
|
|
19
22
|
prompts?: CliPrompts;
|
|
20
23
|
/** Whether a person is watching. Only then is a recovery phrase shown. */
|
|
21
24
|
interactive?: boolean;
|
|
25
|
+
/** Whether stdin is a terminal, independently of redirected stdout. */
|
|
26
|
+
stdinIsTTY?: boolean;
|
|
22
27
|
/** The environment this run sees: wallet selection and agent detection. */
|
|
23
28
|
env?: NodeJS.ProcessEnv;
|
|
24
29
|
/** The OS secret store `vapi unlock` and `vapi lock` act on. */
|
|
25
30
|
secretStore?: SecretStore;
|
|
31
|
+
/** Injected clock, so a signed message is reproducible in a test. */
|
|
32
|
+
now?: () => Date;
|
|
33
|
+
/** Injected hostname, so device naming is reproducible in a test. */
|
|
34
|
+
hostname?: () => string;
|
|
35
|
+
/** Device-link operations, injected so tests never touch the account service. */
|
|
36
|
+
agentLink?: {
|
|
37
|
+
startDeviceLink?: typeof startDeviceLink;
|
|
38
|
+
pollDeviceLink?: typeof pollDeviceLink;
|
|
39
|
+
forgetAgentLink?: typeof import("@vapi-network/core/agent-link").forgetAgentLink;
|
|
40
|
+
};
|
|
41
|
+
/** Router operations, injected so CLI tests never make service requests. */
|
|
42
|
+
router?: {
|
|
43
|
+
listRouterModels?: typeof listRouterModels;
|
|
44
|
+
routerUsage?: typeof routerUsage;
|
|
45
|
+
routerChat?: typeof routerChat;
|
|
46
|
+
buyRouterBalance?: typeof buyRouterBalance;
|
|
47
|
+
rotateRouterKey?: typeof rotateRouterKey;
|
|
48
|
+
ownerStake?: typeof ownerStake;
|
|
49
|
+
routerCredentials?: typeof routerCredentials;
|
|
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
|
+
};
|
|
72
|
+
/** Agent profile and run operations, injected so tests stay local and deterministic. */
|
|
73
|
+
agent?: AgentCommandDependencies;
|
|
74
|
+
/** Reads stdin to EOF for `vapi router chat ... -` and scripted vault restores. */
|
|
75
|
+
readStdin?: () => Promise<string>;
|
|
76
|
+
/** Opens one public URL in the platform browser. */
|
|
77
|
+
openUrl?: (url: string) => boolean;
|
|
78
|
+
/** Moves a wallet balance, injected for deterministic sweep command tests. */
|
|
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
|
+
};
|
|
26
96
|
};
|
|
97
|
+
export declare class UsageError extends Error {
|
|
98
|
+
}
|
|
99
|
+
export declare function getPrompts(dependencies: CliDependencies): CliPrompts;
|
|
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>;
|
|
111
|
+
/** The wallet one invocation acts on, resolved before any passphrase is read. */
|
|
112
|
+
export type WalletTarget = {
|
|
113
|
+
store: WalletStore;
|
|
114
|
+
name: WalletName;
|
|
115
|
+
path: string;
|
|
116
|
+
entry: WalletEntry;
|
|
117
|
+
address?: string;
|
|
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>;
|
|
121
|
+
/** Opens the store and picks the wallet in one step, for the usual command. */
|
|
122
|
+
export declare function targetWallet(parsed: {
|
|
123
|
+
one(name: string): string | undefined;
|
|
124
|
+
}, dependencies: CliDependencies): Promise<WalletTarget>;
|
|
125
|
+
/** The OS secret store this run uses: the machine's, or the one a test injects. */
|
|
126
|
+
export declare function getSecretStore(dependencies: CliDependencies): SecretStore;
|
|
127
|
+
/** Opens the selected wallet, and keeps the passphrase for callers that need it. */
|
|
128
|
+
export declare function unlockTarget(target: WalletTarget, dependencies: CliDependencies): Promise<{
|
|
129
|
+
account: VapiPaymentAccount;
|
|
130
|
+
passphrase: string;
|
|
131
|
+
}>;
|
|
132
|
+
/** One audit line. The home is the wallet store's, so `VAPI_HOME` is honoured. */
|
|
133
|
+
export declare function recordAudit(dependencies: CliDependencies, event: AuditEvent | "vault.cloud_backup_on" | "vault.cloud_backup_off", options?: {
|
|
134
|
+
wallet?: string;
|
|
135
|
+
detail?: string;
|
|
136
|
+
}): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* The gate in front of `vapi backup` and `vapi export-key`: refuse, log the
|
|
139
|
+
* attempt, and say which stream or which variable decided it. Nothing is
|
|
140
|
+
* printed to stdout, so a caller capturing it gets nothing either way.
|
|
141
|
+
*/
|
|
142
|
+
export declare function requireSecretsAllowed(dependencies: CliDependencies, event: AuditEvent, wallet: string | undefined, options?: {
|
|
143
|
+
refusal?: string;
|
|
144
|
+
forcedReason?: string;
|
|
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>;
|
|
27
151
|
/** Run one CLI invocation and return its process exit code. */
|
|
28
152
|
export declare function runCli(argv?: string[], io?: CliIo, dependencies?: CliDependencies): Promise<number>;
|
|
153
|
+
/**
|
|
154
|
+
* Creates another wallet on this machine, with the same custody notice and
|
|
155
|
+
* the same one-time phrase as `vapi init`.
|
|
156
|
+
* No network call: a fresh wallet has nothing to look up.
|
|
157
|
+
*/
|
|
158
|
+
export declare function walletCreateCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<void>;
|
|
159
|
+
/** Compatibility export for the agent command while account management moves modules. */
|
|
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;
|
|
166
|
+
/**
|
|
167
|
+
* The registry behind the configured discovery URLs. `VAPI_REGISTRY_URL` has
|
|
168
|
+
* already moved those by the time the config is loaded, so deriving the base
|
|
169
|
+
* from them follows the env override, a self-hosted registry and a mount
|
|
170
|
+
* prefix alike. A hand-edited discovery URL falls back to the shipped default.
|
|
171
|
+
*/
|
|
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;
|
|
176
|
+
/**
|
|
177
|
+
* The short word for how far a listing got through vAPI review. A mirrored
|
|
178
|
+
* external row is called `external` rather than `unverified`: vAPI reviewed
|
|
179
|
+
* nothing it merely mirrored, and saying "unverified" would read as a verdict
|
|
180
|
+
* on a catalog vAPI never claimed to judge.
|
|
181
|
+
*/
|
|
182
|
+
export declare function verificationTag(listing: {
|
|
183
|
+
verification?: ListingVerification;
|
|
184
|
+
external?: boolean;
|
|
185
|
+
}): "verified" | "requested" | "unverified" | "external";
|
|
186
|
+
/**
|
|
187
|
+
* One line, above the result, when the listing that was just paid is not
|
|
188
|
+
* vAPI-verified. It never blocks and never prompts: the payment has already
|
|
189
|
+
* happened, and the point is that the next one is an informed choice.
|
|
190
|
+
*/
|
|
191
|
+
export declare function verificationNotice(verification: ListingVerification | undefined): string[];
|
|
192
|
+
/**
|
|
193
|
+
* Open a funding URL without ever failing the command: a headless or locked-down
|
|
194
|
+
* machine simply keeps the printed link.
|
|
195
|
+
*/
|
|
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>;
|
|
205
|
+
type ArgumentSpec = {
|
|
206
|
+
valueOptions: Set<string>;
|
|
207
|
+
booleanOptions?: Set<string>;
|
|
208
|
+
repeatableOptions?: Set<string>;
|
|
209
|
+
maximumPositionals: number;
|
|
210
|
+
};
|
|
211
|
+
export declare function parseArguments(argv: string[], spec: ArgumentSpec): {
|
|
212
|
+
positionals: string[];
|
|
213
|
+
one: (name: string) => string | undefined;
|
|
214
|
+
many: (name: string) => string[];
|
|
215
|
+
has: (name: string) => boolean;
|
|
216
|
+
};
|
|
217
|
+
export declare function requiredPositional(value: string | undefined, argument: string, usage: string): string;
|
|
218
|
+
export declare function fileExists(path: string): Promise<boolean>;
|
|
219
|
+
export {};
|