vana-cli 0.15.1 → 0.23.3

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 (93) hide show
  1. package/README.md +73 -15
  2. package/dist/cli/app/ask.d.ts +38 -0
  3. package/dist/cli/app/ask.d.ts.map +1 -0
  4. package/dist/cli/app/ask.js +110 -0
  5. package/dist/cli/app/ask.js.map +1 -0
  6. package/dist/cli/app/derivatives.d.ts +41 -0
  7. package/dist/cli/app/derivatives.d.ts.map +1 -0
  8. package/dist/cli/app/derivatives.js +227 -0
  9. package/dist/cli/app/derivatives.js.map +1 -0
  10. package/dist/cli/app/escrow.d.ts +44 -0
  11. package/dist/cli/app/escrow.d.ts.map +1 -0
  12. package/dist/cli/app/escrow.js +275 -0
  13. package/dist/cli/app/escrow.js.map +1 -0
  14. package/dist/cli/app/index.d.ts +11 -0
  15. package/dist/cli/app/index.d.ts.map +1 -0
  16. package/dist/cli/app/index.js +151 -0
  17. package/dist/cli/app/index.js.map +1 -0
  18. package/dist/cli/app/onchain.d.ts +14 -0
  19. package/dist/cli/app/onchain.d.ts.map +1 -0
  20. package/dist/cli/app/onchain.js +84 -0
  21. package/dist/cli/app/onchain.js.map +1 -0
  22. package/dist/cli/app/outcome.d.ts +45 -0
  23. package/dist/cli/app/outcome.d.ts.map +1 -0
  24. package/dist/cli/app/outcome.js +55 -0
  25. package/dist/cli/app/outcome.js.map +1 -0
  26. package/dist/cli/app/read.d.ts +43 -0
  27. package/dist/cli/app/read.d.ts.map +1 -0
  28. package/dist/cli/app/read.js +429 -0
  29. package/dist/cli/app/read.js.map +1 -0
  30. package/dist/cli/app/register.d.ts +34 -0
  31. package/dist/cli/app/register.d.ts.map +1 -0
  32. package/dist/cli/app/register.js +113 -0
  33. package/dist/cli/app/register.js.map +1 -0
  34. package/dist/cli/app/request.d.ts +50 -0
  35. package/dist/cli/app/request.d.ts.map +1 -0
  36. package/dist/cli/app/request.js +252 -0
  37. package/dist/cli/app/request.js.map +1 -0
  38. package/dist/cli/app/requests.d.ts +21 -0
  39. package/dist/cli/app/requests.d.ts.map +1 -0
  40. package/dist/cli/app/requests.js +163 -0
  41. package/dist/cli/app/requests.js.map +1 -0
  42. package/dist/cli/app/whoami.d.ts +13 -0
  43. package/dist/cli/app/whoami.d.ts.map +1 -0
  44. package/dist/cli/app/whoami.js +71 -0
  45. package/dist/cli/app/whoami.js.map +1 -0
  46. package/dist/cli/auth.d.ts +18 -0
  47. package/dist/cli/auth.d.ts.map +1 -1
  48. package/dist/cli/auth.js +82 -4
  49. package/dist/cli/auth.js.map +1 -1
  50. package/dist/cli/index.d.ts +2 -2
  51. package/dist/cli/index.d.ts.map +1 -1
  52. package/dist/cli/index.js +304 -54
  53. package/dist/cli/index.js.map +1 -1
  54. package/dist/cli/mcp-server.d.ts.map +1 -1
  55. package/dist/cli/mcp-server.js +32 -3
  56. package/dist/cli/mcp-server.js.map +1 -1
  57. package/dist/core/app-key.d.ts +50 -0
  58. package/dist/core/app-key.d.ts.map +1 -0
  59. package/dist/core/app-key.js +171 -0
  60. package/dist/core/app-key.js.map +1 -0
  61. package/dist/core/assets.d.ts +33 -0
  62. package/dist/core/assets.d.ts.map +1 -0
  63. package/dist/core/assets.js +87 -0
  64. package/dist/core/assets.js.map +1 -0
  65. package/dist/core/cli-types.d.ts +30 -0
  66. package/dist/core/cli-types.d.ts.map +1 -1
  67. package/dist/core/cli-types.js +16 -0
  68. package/dist/core/cli-types.js.map +1 -1
  69. package/dist/core/exit-codes.d.ts +48 -0
  70. package/dist/core/exit-codes.d.ts.map +1 -0
  71. package/dist/core/exit-codes.js +96 -0
  72. package/dist/core/exit-codes.js.map +1 -0
  73. package/dist/core/network.d.ts +52 -0
  74. package/dist/core/network.d.ts.map +1 -0
  75. package/dist/core/network.js +83 -0
  76. package/dist/core/network.js.map +1 -0
  77. package/dist/core/paths.d.ts +4 -2
  78. package/dist/core/paths.d.ts.map +1 -1
  79. package/dist/core/paths.js +8 -6
  80. package/dist/core/paths.js.map +1 -1
  81. package/dist/core/receipts.d.ts +37 -0
  82. package/dist/core/receipts.d.ts.map +1 -0
  83. package/dist/core/receipts.js +72 -0
  84. package/dist/core/receipts.js.map +1 -0
  85. package/dist/core/requests-store.d.ts +54 -0
  86. package/dist/core/requests-store.d.ts.map +1 -0
  87. package/dist/core/requests-store.js +83 -0
  88. package/dist/core/requests-store.js.map +1 -0
  89. package/dist/personal-server/registered.d.ts +25 -0
  90. package/dist/personal-server/registered.d.ts.map +1 -0
  91. package/dist/personal-server/registered.js +49 -0
  92. package/dist/personal-server/registered.js.map +1 -0
  93. package/package.json +2 -2
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Lookup of the owner's registered Personal Server URLs at the gateway.
3
+ *
4
+ * The local transport URL (how this CLI reaches the server, often
5
+ * localhost) and the registered public URL (what builders resolve through
6
+ * the gateway) are two names for the same server. Display surfaces show
7
+ * both; this module supplies the second, best-effort and offline-tolerant.
8
+ */
9
+ import { createGatewayClient } from "@opendatalabs/vana-sdk";
10
+ import { type VanaNetworkName } from "../core/network.js";
11
+ export interface RegisteredServer {
12
+ network: VanaNetworkName;
13
+ url: string;
14
+ serverAddress: string;
15
+ status: string;
16
+ }
17
+ /**
18
+ * Active registrations for an owner across both networks, newest first per
19
+ * network. Failures and timeouts yield an empty list, never an error - a
20
+ * display concern must not break a status command.
21
+ */
22
+ export declare function lookupRegisteredServers(owner: string, deps?: {
23
+ createClient?: typeof createGatewayClient;
24
+ }): Promise<RegisteredServer[]>;
25
+ //# sourceMappingURL=registered.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registered.d.ts","sourceRoot":"","sources":["../../src/personal-server/registered.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,eAAe,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAaD;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,MAAM,EACb,IAAI,GAAE;IAAE,YAAY,CAAC,EAAE,OAAO,mBAAmB,CAAA;CAAO,GACvD,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA6B7B"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Lookup of the owner's registered Personal Server URLs at the gateway.
3
+ *
4
+ * The local transport URL (how this CLI reaches the server, often
5
+ * localhost) and the registered public URL (what builders resolve through
6
+ * the gateway) are two names for the same server. Display surfaces show
7
+ * both; this module supplies the second, best-effort and offline-tolerant.
8
+ */
9
+ import { createGatewayClient } from "@opendatalabs/vana-sdk";
10
+ import { VANA_NETWORKS, resolveNetwork, } from "../core/network.js";
11
+ const LOOKUP_TIMEOUT_MS = 5_000;
12
+ function withTimeout(promise, fallback) {
13
+ return Promise.race([
14
+ promise,
15
+ new Promise((resolve) => setTimeout(() => resolve(fallback), LOOKUP_TIMEOUT_MS).unref?.()),
16
+ ]).catch(() => fallback);
17
+ }
18
+ /**
19
+ * Active registrations for an owner across both networks, newest first per
20
+ * network. Failures and timeouts yield an empty list, never an error - a
21
+ * display concern must not break a status command.
22
+ */
23
+ export async function lookupRegisteredServers(owner, deps = {}) {
24
+ const createClient = deps.createClient ?? createGatewayClient;
25
+ const perNetwork = await Promise.all(VANA_NETWORKS.map(async (name) => {
26
+ try {
27
+ // Note: VANA_ENV=dev refuses mainnet host resolution; that network
28
+ // simply contributes nothing rather than failing the lookup.
29
+ const network = resolveNetwork(name, process.env);
30
+ const result = await withTimeout(createClient(network.gatewayUrl).listServersByOwner(owner), null);
31
+ if (!result?.active?.length) {
32
+ return [];
33
+ }
34
+ return result.active
35
+ .filter((record) => Boolean(record.serverUrl))
36
+ .map((record) => ({
37
+ network: name,
38
+ url: record.serverUrl,
39
+ serverAddress: record.serverAddress,
40
+ status: record.status ?? "unknown",
41
+ }));
42
+ }
43
+ catch {
44
+ return [];
45
+ }
46
+ }));
47
+ return perNetwork.flat();
48
+ }
49
+ //# sourceMappingURL=registered.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registered.js","sourceRoot":"","sources":["../../src/personal-server/registered.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,cAAc,GAEf,MAAM,oBAAoB,CAAC;AAS5B,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEhC,SAAS,WAAW,CAAI,OAAmB,EAAE,QAAW;IACtD,OAAO,OAAO,CAAC,IAAI,CAAC;QAClB,OAAO;QACP,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,EAAE,CACzB,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC,CAAC,KAAK,EAAE,EAAE,CACjE;KACF,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,KAAa,EACb,OAAsD,EAAE;IAExD,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,mBAAmB,CAAC;IAC9D,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,GAAG,CAClC,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAA+B,EAAE;QAC5D,IAAI,CAAC;YACH,mEAAmE;YACnE,6DAA6D;YAC7D,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;YAClD,MAAM,MAAM,GAAG,MAAM,WAAW,CAC9B,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAC1D,IAAI,CACL,CAAC;YACF,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;gBAC5B,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,OAAO,MAAM,CAAC,MAAM;iBACjB,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;iBAC7C,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBAChB,OAAO,EAAE,IAAI;gBACb,GAAG,EAAE,MAAM,CAAC,SAAS;gBACrB,aAAa,EAAE,MAAM,CAAC,aAAa;gBACnC,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,SAAS;aACnC,CAAC,CAAC,CAAC;QACR,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CACH,CAAC;IACF,OAAO,UAAU,CAAC,IAAI,EAAE,CAAC;AAC3B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vana-cli",
3
- "version": "0.15.1",
3
+ "version": "0.23.3",
4
4
  "description": "Vana data-portability CLI",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -102,7 +102,7 @@
102
102
  "@inquirer/prompts": "8.3.0",
103
103
  "@inquirer/search": "^4.1.6",
104
104
  "@modelcontextprotocol/sdk": "^1.27.1",
105
- "@opendatalabs/vana-sdk": "^3.9.0",
105
+ "@opendatalabs/vana-sdk": "^4.0.0",
106
106
  "chromium-bidi": "15.0.0",
107
107
  "commander": "14.0.3",
108
108
  "fuse.js": "^7.1.0",