@vapi-network/core 0.2.3 → 0.5.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.
Files changed (74) hide show
  1. package/README.md +18 -5
  2. package/dist/accounts.d.ts.map +1 -1
  3. package/dist/agent-guard.d.ts +40 -0
  4. package/dist/agent-guard.d.ts.map +1 -0
  5. package/dist/agent-link.d.ts +98 -0
  6. package/dist/agent-link.d.ts.map +1 -0
  7. package/dist/agent-link.js +1715 -0
  8. package/dist/agent-link.js.map +6 -0
  9. package/dist/agent-profile.d.ts +27 -0
  10. package/dist/agent-profile.d.ts.map +1 -0
  11. package/dist/api-key.d.ts +99 -0
  12. package/dist/api-key.d.ts.map +1 -0
  13. package/dist/api-key.js +20084 -0
  14. package/dist/api-key.js.map +6 -0
  15. package/dist/audit.d.ts +44 -0
  16. package/dist/audit.d.ts.map +1 -0
  17. package/dist/authorization-state.d.ts +58 -0
  18. package/dist/authorization-state.d.ts.map +1 -0
  19. package/dist/call-contracts-wire.d.ts +151 -11
  20. package/dist/call-contracts-wire.d.ts.map +1 -1
  21. package/dist/config.d.ts +10 -1
  22. package/dist/config.d.ts.map +1 -1
  23. package/dist/discovery.d.ts +20 -2
  24. package/dist/discovery.d.ts.map +1 -1
  25. package/dist/hd.d.ts +33 -0
  26. package/dist/hd.d.ts.map +1 -0
  27. package/dist/index.d.ts +14 -2
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +25354 -954
  30. package/dist/index.js.map +3 -3
  31. package/dist/keystore.d.ts +94 -4
  32. package/dist/keystore.d.ts.map +1 -1
  33. package/dist/marketplace-contracts.d.ts +448 -15
  34. package/dist/marketplace-contracts.d.ts.map +1 -1
  35. package/dist/networks.d.ts +16 -2
  36. package/dist/networks.d.ts.map +1 -1
  37. package/dist/onramp.d.ts +12 -28
  38. package/dist/onramp.d.ts.map +1 -1
  39. package/dist/passphrase.d.ts +47 -0
  40. package/dist/passphrase.d.ts.map +1 -0
  41. package/dist/policy.d.ts +6 -0
  42. package/dist/policy.d.ts.map +1 -1
  43. package/dist/receipts.d.ts +40 -4
  44. package/dist/receipts.d.ts.map +1 -1
  45. package/dist/router-client.d.ts +117 -0
  46. package/dist/router-client.d.ts.map +1 -0
  47. package/dist/router-client.js +27421 -0
  48. package/dist/router-client.js.map +6 -0
  49. package/dist/secret-store.d.ts +60 -0
  50. package/dist/secret-store.d.ts.map +1 -0
  51. package/dist/secrets.d.ts +14 -0
  52. package/dist/secrets.d.ts.map +1 -0
  53. package/dist/secrets.js +47238 -0
  54. package/dist/secrets.js.map +6 -0
  55. package/dist/spend-policy.d.ts +13 -1
  56. package/dist/spend-policy.d.ts.map +1 -1
  57. package/dist/stats.d.ts +3 -2
  58. package/dist/stats.d.ts.map +1 -1
  59. package/dist/support-report.d.ts +1 -1
  60. package/dist/sweep.d.ts +4 -0
  61. package/dist/sweep.d.ts.map +1 -1
  62. package/dist/wallet-name.d.ts +18 -0
  63. package/dist/wallet-name.d.ts.map +1 -0
  64. package/dist/wallet-store.d.ts +220 -0
  65. package/dist/wallet-store.d.ts.map +1 -0
  66. package/dist/wallet.d.ts +0 -5
  67. package/dist/wallet.d.ts.map +1 -1
  68. package/dist/x402-networks.d.ts +6 -9
  69. package/dist/x402-networks.d.ts.map +1 -1
  70. package/dist/x402-pay.d.ts +131 -0
  71. package/dist/x402-pay.d.ts.map +1 -0
  72. package/dist/x402.d.ts +20 -1
  73. package/dist/x402.d.ts.map +1 -1
  74. package/package.json +17 -1
@@ -0,0 +1,60 @@
1
+ /**
2
+ * The OS secret store, so an agent never needs a passphrase in plain text.
3
+ *
4
+ * A wallet's passphrase is kept by the operating system's own credential
5
+ * store — the macOS Keychain, or libsecret on Linux — under the service
6
+ * `vapi-network` and the wallet's name as the account. `vapi unlock` puts it
7
+ * there, `vapi lock` takes it out, and every unlock path reads it from there
8
+ * before falling back to a prompt.
9
+ *
10
+ * There is no dependency: the store is driven through the OS binaries with
11
+ * `execFile` and an argument array, never a shell string, so nothing a wallet
12
+ * name or a passphrase contains can be read as a command. The passphrase
13
+ * itself is written to the binary's stdin and never appears in an argument,
14
+ * where `ps` would show it to every process on the machine.
15
+ */
16
+ /** The service name every vAPI entry is filed under. */
17
+ export declare const SECRET_STORE_SERVICE = "vapi-network";
18
+ /** What one run of an OS binary produced. A runner never throws for a non-zero exit. */
19
+ export type SecretStoreOutcome = {
20
+ /** The exit code, or null when the binary could not be run at all. */
21
+ code: number | null;
22
+ stdout: string;
23
+ stderr: string;
24
+ /** The binary is not installed on this machine. */
25
+ notFound?: boolean;
26
+ };
27
+ /**
28
+ * Runs one OS binary. Injected by the tests, which assert the command line
29
+ * rather than touching a real keychain.
30
+ */
31
+ export type SecretStoreRunner = (file: string, args: readonly string[], input?: string) => Promise<SecretStoreOutcome>;
32
+ export type SecretStore = {
33
+ /** Whether this platform has a store vAPI can drive at all. */
34
+ available: boolean;
35
+ platform: NodeJS.Platform;
36
+ /** How to name this store to a person, such as "the macOS Keychain". */
37
+ description: string;
38
+ /** The stored passphrase of a wallet, or undefined when there is none. */
39
+ get(name: string): Promise<string | undefined>;
40
+ /** Whether a wallet has a stored passphrase, without reading the secret. */
41
+ has(name: string): Promise<boolean>;
42
+ set(name: string, passphrase: string): Promise<void>;
43
+ /** Removes the entry; false when there was nothing to remove. */
44
+ remove(name: string): Promise<boolean>;
45
+ /**
46
+ * The wallet names this store holds, where the platform can answer it
47
+ * without handing back the secrets themselves. Neither platform can today,
48
+ * so callers list the wallets they know and ask `has` about each.
49
+ */
50
+ list?(): Promise<string[]>;
51
+ };
52
+ export type SecretStoreOptions = {
53
+ /** Defaults to `process.platform`. */
54
+ platform?: NodeJS.Platform | undefined;
55
+ /** Defaults to running the real binary. */
56
+ run?: SecretStoreRunner | undefined;
57
+ };
58
+ /** The secret store of this machine, or one that refuses on every call. */
59
+ export declare function secretStore(options?: SecretStoreOptions): SecretStore;
60
+ //# sourceMappingURL=secret-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3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Q,CAAC,EAAE,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC;IACvC,2CAA2C;IAC3C,GAAG,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;CACrC,CAAC;AAEF,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,WAAW,CAMzE"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `@vapi-network/core/secrets` — the human-only corner of the SDK.
3
+ *
4
+ * Everything here returns a recovery phrase or a private key. It is a separate
5
+ * package entry point, and deliberately not re-exported from the main index,
6
+ * so that a package which must never hold a secret — the MCP server above all —
7
+ * cannot reach one by importing `@vapi-network/core`. The repository lint rules
8
+ * enforce that for `packages/mcp`.
9
+ *
10
+ * Callers must print the result to the person in front of the terminal and
11
+ * nowhere else: not to a log, not to a file, not into a tool result.
12
+ */
13
+ export { createKeystoreWithPhrase, decryptPrivateKey, exportKeystoreKeys, exportRecoveryPhrase, type ExportedVapiKeys, } from "./keystore.js";
14
+ //# sourceMappingURL=secrets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC"}