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.
- package/README.md +73 -15
- package/dist/cli/app/ask.d.ts +38 -0
- package/dist/cli/app/ask.d.ts.map +1 -0
- package/dist/cli/app/ask.js +110 -0
- package/dist/cli/app/ask.js.map +1 -0
- package/dist/cli/app/derivatives.d.ts +41 -0
- package/dist/cli/app/derivatives.d.ts.map +1 -0
- package/dist/cli/app/derivatives.js +227 -0
- package/dist/cli/app/derivatives.js.map +1 -0
- package/dist/cli/app/escrow.d.ts +44 -0
- package/dist/cli/app/escrow.d.ts.map +1 -0
- package/dist/cli/app/escrow.js +275 -0
- package/dist/cli/app/escrow.js.map +1 -0
- package/dist/cli/app/index.d.ts +11 -0
- package/dist/cli/app/index.d.ts.map +1 -0
- package/dist/cli/app/index.js +151 -0
- package/dist/cli/app/index.js.map +1 -0
- package/dist/cli/app/onchain.d.ts +14 -0
- package/dist/cli/app/onchain.d.ts.map +1 -0
- package/dist/cli/app/onchain.js +84 -0
- package/dist/cli/app/onchain.js.map +1 -0
- package/dist/cli/app/outcome.d.ts +45 -0
- package/dist/cli/app/outcome.d.ts.map +1 -0
- package/dist/cli/app/outcome.js +55 -0
- package/dist/cli/app/outcome.js.map +1 -0
- package/dist/cli/app/read.d.ts +43 -0
- package/dist/cli/app/read.d.ts.map +1 -0
- package/dist/cli/app/read.js +429 -0
- package/dist/cli/app/read.js.map +1 -0
- package/dist/cli/app/register.d.ts +34 -0
- package/dist/cli/app/register.d.ts.map +1 -0
- package/dist/cli/app/register.js +113 -0
- package/dist/cli/app/register.js.map +1 -0
- package/dist/cli/app/request.d.ts +50 -0
- package/dist/cli/app/request.d.ts.map +1 -0
- package/dist/cli/app/request.js +252 -0
- package/dist/cli/app/request.js.map +1 -0
- package/dist/cli/app/requests.d.ts +21 -0
- package/dist/cli/app/requests.d.ts.map +1 -0
- package/dist/cli/app/requests.js +163 -0
- package/dist/cli/app/requests.js.map +1 -0
- package/dist/cli/app/whoami.d.ts +13 -0
- package/dist/cli/app/whoami.d.ts.map +1 -0
- package/dist/cli/app/whoami.js +71 -0
- package/dist/cli/app/whoami.js.map +1 -0
- package/dist/cli/auth.d.ts +18 -0
- package/dist/cli/auth.d.ts.map +1 -1
- package/dist/cli/auth.js +82 -4
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +304 -54
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp-server.d.ts.map +1 -1
- package/dist/cli/mcp-server.js +32 -3
- package/dist/cli/mcp-server.js.map +1 -1
- package/dist/core/app-key.d.ts +50 -0
- package/dist/core/app-key.d.ts.map +1 -0
- package/dist/core/app-key.js +171 -0
- package/dist/core/app-key.js.map +1 -0
- package/dist/core/assets.d.ts +33 -0
- package/dist/core/assets.d.ts.map +1 -0
- package/dist/core/assets.js +87 -0
- package/dist/core/assets.js.map +1 -0
- package/dist/core/cli-types.d.ts +30 -0
- package/dist/core/cli-types.d.ts.map +1 -1
- package/dist/core/cli-types.js +16 -0
- package/dist/core/cli-types.js.map +1 -1
- package/dist/core/exit-codes.d.ts +48 -0
- package/dist/core/exit-codes.d.ts.map +1 -0
- package/dist/core/exit-codes.js +96 -0
- package/dist/core/exit-codes.js.map +1 -0
- package/dist/core/network.d.ts +52 -0
- package/dist/core/network.d.ts.map +1 -0
- package/dist/core/network.js +83 -0
- package/dist/core/network.js.map +1 -0
- package/dist/core/paths.d.ts +4 -2
- package/dist/core/paths.d.ts.map +1 -1
- package/dist/core/paths.js +8 -6
- package/dist/core/paths.js.map +1 -1
- package/dist/core/receipts.d.ts +37 -0
- package/dist/core/receipts.d.ts.map +1 -0
- package/dist/core/receipts.js +72 -0
- package/dist/core/receipts.js.map +1 -0
- package/dist/core/requests-store.d.ts +54 -0
- package/dist/core/requests-store.d.ts.map +1 -0
- package/dist/core/requests-store.js +83 -0
- package/dist/core/requests-store.js.map +1 -0
- package/dist/personal-server/registered.d.ts +25 -0
- package/dist/personal-server/registered.d.ts.map +1 -0
- package/dist/personal-server/registered.js +49 -0
- package/dist/personal-server/registered.js.map +1 -0
- 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.
|
|
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": "^
|
|
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",
|