vana-cli 0.15.1 → 0.23.4
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,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outcome contract for the builder (`vana app`) command group.
|
|
3
|
+
*
|
|
4
|
+
* Every app command ends by emitting exactly one outcome through
|
|
5
|
+
* {@link emitAppOutcome}: a single JSON line in `--json` mode, readable
|
|
6
|
+
* lines otherwise. The exit code always comes from the protocol `code`
|
|
7
|
+
* through the binary-wide table in `src/core/exit-codes.ts`.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { exitCodeForProtocolCode, } from "../../core/exit-codes.js";
|
|
11
|
+
export const APP_OUTCOME_STATUSES = ["done", "failed"];
|
|
12
|
+
export const appOutcomeSchema = z
|
|
13
|
+
.object({
|
|
14
|
+
type: z.literal("outcome"),
|
|
15
|
+
status: z.enum(APP_OUTCOME_STATUSES),
|
|
16
|
+
code: z.string(),
|
|
17
|
+
exitCode: z.number().int().min(0).max(7),
|
|
18
|
+
message: z.string(),
|
|
19
|
+
remedy: z.string().optional(),
|
|
20
|
+
network: z.string().optional(),
|
|
21
|
+
data: z.record(z.string(), z.unknown()).optional(),
|
|
22
|
+
})
|
|
23
|
+
.catchall(z.unknown());
|
|
24
|
+
/** Emit the terminal outcome and return the exit code for the command. */
|
|
25
|
+
export function emitAppOutcome(options, outcome) {
|
|
26
|
+
const exitCode = exitCodeForProtocolCode(outcome.code);
|
|
27
|
+
if (options.json) {
|
|
28
|
+
const payload = appOutcomeSchema.parse({
|
|
29
|
+
type: "outcome",
|
|
30
|
+
status: outcome.status,
|
|
31
|
+
code: outcome.code,
|
|
32
|
+
exitCode,
|
|
33
|
+
message: outcome.message,
|
|
34
|
+
...(outcome.remedy ? { remedy: outcome.remedy } : {}),
|
|
35
|
+
...(outcome.network ? { network: outcome.network } : {}),
|
|
36
|
+
...(outcome.data ? { data: outcome.data } : {}),
|
|
37
|
+
});
|
|
38
|
+
process.stdout.write(`${JSON.stringify(payload)}\n`);
|
|
39
|
+
return exitCode;
|
|
40
|
+
}
|
|
41
|
+
const stream = outcome.status === "done" ? process.stdout : process.stderr;
|
|
42
|
+
stream.write(`${outcome.message}\n`);
|
|
43
|
+
if (!options.quiet) {
|
|
44
|
+
for (const [key, value] of Object.entries(outcome.data ?? {})) {
|
|
45
|
+
if (value !== undefined && value !== null) {
|
|
46
|
+
stream.write(` ${key}: ${String(value)}\n`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (outcome.remedy) {
|
|
50
|
+
stream.write(` next: ${outcome.remedy}\n`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return exitCode;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=outcome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcome.js","sourceRoot":"","sources":["../../../src/cli/app/outcome.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,uBAAuB,GAExB,MAAM,0BAA0B,CAAC;AAGlC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAU,CAAC;AAahE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACxC,OAAO,EAAE,CAAC,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ClB,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IAC3E,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,CAAC;IACrC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACnB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC;YAC9D,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBAC1C,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACnB,MAAM,CAAC,KAAK,CAAC,WAAW,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vana app read <scope> --grant <id>` - signed read of granted data,
|
|
3
|
+
* settling the fee from escrow when `--pay` allows it.
|
|
4
|
+
*
|
|
5
|
+
* Flow: resolve the grant at the gateway (grantor = owner), resolve the
|
|
6
|
+
* owner's Personal Server registrations (every active one - registrations
|
|
7
|
+
* are push-only and a record can name a dead server), then read. A stored
|
|
8
|
+
* receipt for this (network, grant, scope) is replayed before any new
|
|
9
|
+
* settlement, so a retry never pays twice; a new settlement is gated by
|
|
10
|
+
* `--pay` and `--max-fee` and its X-PAYMENT header is captured into the
|
|
11
|
+
* receipts store.
|
|
12
|
+
*
|
|
13
|
+
* The enclave delivery leg lands when the jobs result-delivery change ships
|
|
14
|
+
* in the SDK (vana-sdk#211); today every owner readable here serves through
|
|
15
|
+
* a Personal Server.
|
|
16
|
+
*/
|
|
17
|
+
import { type GatewayClient } from "@opendatalabs/vana-sdk";
|
|
18
|
+
import { readPersonalServerData } from "@opendatalabs/vana-sdk/direct/personal-server-read";
|
|
19
|
+
import { createJobsClient } from "@opendatalabs/vana-sdk/protocol/jobs-client";
|
|
20
|
+
import { resolveAppKey } from "../../core/app-key.js";
|
|
21
|
+
import { type ReceiptsStore } from "../../core/receipts.js";
|
|
22
|
+
import { type RequestsStore } from "../../core/requests-store.js";
|
|
23
|
+
import { type AppCommandOptions } from "./outcome.js";
|
|
24
|
+
export interface ReadCommandOptions extends AppCommandOptions {
|
|
25
|
+
grant?: string;
|
|
26
|
+
/** Settle a 402 from escrow instead of stopping at exit 4. */
|
|
27
|
+
pay?: boolean;
|
|
28
|
+
/** Refuse settlements above this amount, in VANA (decimal). */
|
|
29
|
+
maxFee?: string;
|
|
30
|
+
/** Explicit Personal Server URL, skipping gateway resolution. */
|
|
31
|
+
server?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ReadDeps {
|
|
34
|
+
createClient?: (gatewayUrl: string) => GatewayClient;
|
|
35
|
+
resolveKey?: typeof resolveAppKey;
|
|
36
|
+
read?: typeof readPersonalServerData;
|
|
37
|
+
receipts?: ReceiptsStore;
|
|
38
|
+
createJobs?: typeof createJobsClient;
|
|
39
|
+
/** Access-request records, to learn the delivery path for this grant. */
|
|
40
|
+
requests?: RequestsStore;
|
|
41
|
+
}
|
|
42
|
+
export declare function runAppRead(scope: string, options: ReadCommandOptions, deps?: ReadDeps): Promise<number>;
|
|
43
|
+
//# sourceMappingURL=read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/cli/app/read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EAEvB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAO/E,OAAO,EAEL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtE,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,QAAQ;IACvB,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,aAAa,CAAC;IACrD,UAAU,CAAC,EAAE,OAAO,aAAa,CAAC;IAClC,IAAI,CAAC,EAAE,OAAO,sBAAsB,CAAC;IACrC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,gBAAgB,CAAC;IACrC,yEAAyE;IACzE,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAQD,wBAAsB,UAAU,CAC9B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,kBAAkB,EAC3B,IAAI,GAAE,QAAa,GAClB,OAAO,CAAC,MAAM,CAAC,CAoSjB"}
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vana app read <scope> --grant <id>` - signed read of granted data,
|
|
3
|
+
* settling the fee from escrow when `--pay` allows it.
|
|
4
|
+
*
|
|
5
|
+
* Flow: resolve the grant at the gateway (grantor = owner), resolve the
|
|
6
|
+
* owner's Personal Server registrations (every active one - registrations
|
|
7
|
+
* are push-only and a record can name a dead server), then read. A stored
|
|
8
|
+
* receipt for this (network, grant, scope) is replayed before any new
|
|
9
|
+
* settlement, so a retry never pays twice; a new settlement is gated by
|
|
10
|
+
* `--pay` and `--max-fee` and its X-PAYMENT header is captured into the
|
|
11
|
+
* receipts store.
|
|
12
|
+
*
|
|
13
|
+
* The enclave delivery leg lands when the jobs result-delivery change ships
|
|
14
|
+
* in the SDK (vana-sdk#211); today every owner readable here serves through
|
|
15
|
+
* a Personal Server.
|
|
16
|
+
*/
|
|
17
|
+
import { CONTRACTS, createGatewayClient, } from "@opendatalabs/vana-sdk";
|
|
18
|
+
import { readPersonalServerData, } from "@opendatalabs/vana-sdk/direct/personal-server-read";
|
|
19
|
+
import { createJobsClient } from "@opendatalabs/vana-sdk/protocol/jobs-client";
|
|
20
|
+
import { formatAssetAmount, parseAssetAmount, resolveAsset, } from "../../core/assets.js";
|
|
21
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
22
|
+
import { AppKeyMissingError, resolveAppKey, } from "../../core/app-key.js";
|
|
23
|
+
import { UnknownNetworkError, resolveNetwork, } from "../../core/network.js";
|
|
24
|
+
import { createReceiptsStore, receiptKey, } from "../../core/receipts.js";
|
|
25
|
+
import { createRequestsStore, } from "../../core/requests-store.js";
|
|
26
|
+
import { emitAppOutcome } from "./outcome.js";
|
|
27
|
+
function isPaymentRequired(error) {
|
|
28
|
+
return error instanceof Error && error.name === "PaymentRequiredError";
|
|
29
|
+
}
|
|
30
|
+
export async function runAppRead(scope, options, deps = {}) {
|
|
31
|
+
let network;
|
|
32
|
+
try {
|
|
33
|
+
network = resolveNetwork(options.network);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
if (error instanceof UnknownNetworkError) {
|
|
37
|
+
return emitAppOutcome(options, {
|
|
38
|
+
status: "failed",
|
|
39
|
+
code: "bad_usage",
|
|
40
|
+
message: error.message,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
if (!options.grant) {
|
|
46
|
+
return emitAppOutcome(options, {
|
|
47
|
+
status: "failed",
|
|
48
|
+
code: "bad_usage",
|
|
49
|
+
message: "A grant id is required.",
|
|
50
|
+
remedy: `vana app read ${scope} --grant <id>`,
|
|
51
|
+
network: network.name,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
let key;
|
|
55
|
+
try {
|
|
56
|
+
key = (deps.resolveKey ?? resolveAppKey)({});
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
if (error instanceof AppKeyMissingError) {
|
|
60
|
+
return emitAppOutcome(options, {
|
|
61
|
+
status: "failed",
|
|
62
|
+
code: "grant_invalid",
|
|
63
|
+
message: "No app key on this machine; a grant cannot belong to it.",
|
|
64
|
+
remedy: "vana app register",
|
|
65
|
+
network: network.name,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
const client = (deps.createClient ?? createGatewayClient)(network.gatewayUrl);
|
|
71
|
+
// 1. The grant: existence, scope coverage, and the owner behind it.
|
|
72
|
+
let grantorAddress;
|
|
73
|
+
try {
|
|
74
|
+
const grant = await client.getGrant(options.grant);
|
|
75
|
+
if (!grant) {
|
|
76
|
+
return emitAppOutcome(options, {
|
|
77
|
+
status: "failed",
|
|
78
|
+
code: "grant_invalid",
|
|
79
|
+
message: `Grant ${options.grant} does not exist on ${network.name}.`,
|
|
80
|
+
network: network.name,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
if (!grant.scopes.includes(scope)) {
|
|
84
|
+
return emitAppOutcome(options, {
|
|
85
|
+
status: "failed",
|
|
86
|
+
code: "grant_invalid",
|
|
87
|
+
message: `The grant does not cover ${scope}.`,
|
|
88
|
+
remedy: `granted scopes: ${grant.scopes.join(", ")}`,
|
|
89
|
+
network: network.name,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
grantorAddress = grant.grantorAddress;
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
return gatewayFailure(options, network, error, "grant lookup");
|
|
96
|
+
}
|
|
97
|
+
// 2. Enclave delivery, when the access request says so. The owner's data
|
|
98
|
+
// is served by a TEE sandbox through the gateway's blind job queue, so
|
|
99
|
+
// there is no server to resolve and no endpoint to pick: the gateway is
|
|
100
|
+
// the only address a builder knows. The result comes back encrypted to
|
|
101
|
+
// this app's key, which is why the jobs client needs the raw private
|
|
102
|
+
// key rather than a signer.
|
|
103
|
+
const delivery = (deps.requests ?? createRequestsStore())
|
|
104
|
+
.list({ network: network.name })
|
|
105
|
+
.find((entry) => entry.grantId === options.grant)?.delivery;
|
|
106
|
+
if (delivery === "enclave") {
|
|
107
|
+
return runEnclaveRead(scope, options, {
|
|
108
|
+
network,
|
|
109
|
+
key,
|
|
110
|
+
grantId: options.grant,
|
|
111
|
+
owner: grantorAddress,
|
|
112
|
+
createJobs: deps.createJobs ?? createJobsClient,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
// 3. The owner's servers: every active registration, newest first.
|
|
116
|
+
let serverUrls;
|
|
117
|
+
if (options.server) {
|
|
118
|
+
serverUrls = [options.server];
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
try {
|
|
122
|
+
const servers = await client.listServersByOwner(grantorAddress);
|
|
123
|
+
serverUrls = servers.active.map((record) => record.serverUrl);
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
return gatewayFailure(options, network, error, "server resolution");
|
|
127
|
+
}
|
|
128
|
+
if (serverUrls.length === 0) {
|
|
129
|
+
return emitAppOutcome(options, {
|
|
130
|
+
status: "failed",
|
|
131
|
+
code: "owner_not_ready",
|
|
132
|
+
message: `The owner ${grantorAddress} has no registered Personal Server.`,
|
|
133
|
+
network: network.name,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
const account = privateKeyToAccount(key.privateKey);
|
|
138
|
+
const signMessage = (message) => account.signMessage({ message });
|
|
139
|
+
const receipts = deps.receipts ?? createReceiptsStore();
|
|
140
|
+
const storedKey = receiptKey(network.name, options.grant, scope);
|
|
141
|
+
const stored = receipts.getReceipt(storedKey);
|
|
142
|
+
const read = deps.read ?? readPersonalServerData;
|
|
143
|
+
const escrowContract = CONTRACTS.DataPortabilityEscrow.addresses[network.chainId];
|
|
144
|
+
// Replays the stored receipt header; captures any new X-PAYMENT header.
|
|
145
|
+
let sentPaymentHeader = null;
|
|
146
|
+
const fetchWith = (replayHeader) => {
|
|
147
|
+
return async (input, init) => {
|
|
148
|
+
const headers = { ...init.headers };
|
|
149
|
+
if (replayHeader && !headers["X-PAYMENT"]) {
|
|
150
|
+
headers["X-PAYMENT"] = replayHeader;
|
|
151
|
+
}
|
|
152
|
+
if (headers["X-PAYMENT"]) {
|
|
153
|
+
sentPaymentHeader = headers["X-PAYMENT"];
|
|
154
|
+
}
|
|
155
|
+
return fetch(input, { ...init, headers });
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
let lastError = null;
|
|
159
|
+
for (const personalServerUrl of serverUrls) {
|
|
160
|
+
// Probe (free): signed read, replaying a stored receipt when we have one.
|
|
161
|
+
try {
|
|
162
|
+
const result = await read({
|
|
163
|
+
personalServerUrl,
|
|
164
|
+
scope,
|
|
165
|
+
grantId: options.grant,
|
|
166
|
+
payerAddress: key.address,
|
|
167
|
+
signMessage,
|
|
168
|
+
fetchFn: fetchWith(stored?.header ?? null),
|
|
169
|
+
});
|
|
170
|
+
return emitReadSuccess(options, network, scope, result.data, {
|
|
171
|
+
paid: false,
|
|
172
|
+
replayedReceipt: Boolean(stored),
|
|
173
|
+
server: personalServerUrl,
|
|
174
|
+
payment: result.payment,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
if (!isPaymentRequired(error)) {
|
|
179
|
+
// Transport or server failure: a dead registration is a normal
|
|
180
|
+
// state, try the next one.
|
|
181
|
+
lastError = error;
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
// A 402 with a stale stored receipt means the receipt no longer
|
|
185
|
+
// satisfies the server; drop it so it cannot shadow a real payment.
|
|
186
|
+
if (stored) {
|
|
187
|
+
receipts.dropReceipt(storedKey);
|
|
188
|
+
}
|
|
189
|
+
const details = error.details ??
|
|
190
|
+
{};
|
|
191
|
+
const amountRaw = details.amount ?? "0";
|
|
192
|
+
// Fees are quoted in base units of an asset that is often not the
|
|
193
|
+
// native coin - data_access on mainnet is USDC.e with 6 decimals - so
|
|
194
|
+
// the asset decides both the display and the --max-fee comparison.
|
|
195
|
+
const asset = await resolveAsset(details.asset, network.rpcUrl);
|
|
196
|
+
const amountHuman = formatAssetAmount(amountRaw, asset);
|
|
197
|
+
if (!options.pay) {
|
|
198
|
+
return emitAppOutcome(options, {
|
|
199
|
+
status: "failed",
|
|
200
|
+
code: "payment_required",
|
|
201
|
+
message: `This read costs ${amountHuman} and --pay is not set.`,
|
|
202
|
+
remedy: `vana app read ${scope} --grant ${options.grant} --pay`,
|
|
203
|
+
network: network.name,
|
|
204
|
+
data: {
|
|
205
|
+
amount: amountRaw,
|
|
206
|
+
amountHuman,
|
|
207
|
+
asset: details.asset ?? null,
|
|
208
|
+
assetSymbol: asset?.symbol ?? null,
|
|
209
|
+
assetDecimals: asset?.decimals ?? null,
|
|
210
|
+
},
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
if (options.maxFee) {
|
|
214
|
+
const limit = parseAssetAmount(options.maxFee, asset);
|
|
215
|
+
if (limit === null) {
|
|
216
|
+
// Refusing to compare beats comparing in the wrong units.
|
|
217
|
+
return emitAppOutcome(options, {
|
|
218
|
+
status: "failed",
|
|
219
|
+
code: "payment_required",
|
|
220
|
+
message: `Cannot enforce --max-fee: fee asset ${details.asset} is unknown on this chain.`,
|
|
221
|
+
remedy: "drop --max-fee to accept the quoted fee",
|
|
222
|
+
network: network.name,
|
|
223
|
+
data: { amount: amountRaw, asset: details.asset ?? null },
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
if (BigInt(amountRaw) > limit) {
|
|
227
|
+
return emitAppOutcome(options, {
|
|
228
|
+
status: "failed",
|
|
229
|
+
code: "max_fee_exceeded",
|
|
230
|
+
message: `This read costs ${amountHuman}, above --max-fee ${options.maxFee} ${asset?.symbol ?? ""}.`.trim(),
|
|
231
|
+
network: network.name,
|
|
232
|
+
data: {
|
|
233
|
+
amount: amountRaw,
|
|
234
|
+
amountHuman,
|
|
235
|
+
asset: details.asset ?? null,
|
|
236
|
+
},
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (!escrowContract) {
|
|
241
|
+
return emitAppOutcome(options, {
|
|
242
|
+
status: "failed",
|
|
243
|
+
code: "internal",
|
|
244
|
+
message: `No escrow contract known for chain ${network.chainId}.`,
|
|
245
|
+
network: network.name,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
// Paid attempt: sign a fresh header (durable nonce), capture it.
|
|
249
|
+
try {
|
|
250
|
+
const result = await read({
|
|
251
|
+
personalServerUrl,
|
|
252
|
+
scope,
|
|
253
|
+
grantId: options.grant,
|
|
254
|
+
payerAddress: key.address,
|
|
255
|
+
signMessage,
|
|
256
|
+
escrow: {
|
|
257
|
+
escrowContract,
|
|
258
|
+
chainId: network.chainId,
|
|
259
|
+
signTypedData: (typedData) => account.signTypedData(typedData),
|
|
260
|
+
nonceSource: (payer) => receipts.nextNonce(payer),
|
|
261
|
+
},
|
|
262
|
+
fetchFn: fetchWith(null),
|
|
263
|
+
});
|
|
264
|
+
if (sentPaymentHeader) {
|
|
265
|
+
receipts.saveReceipt(storedKey, {
|
|
266
|
+
header: sentPaymentHeader,
|
|
267
|
+
amount: amountRaw,
|
|
268
|
+
asset: details.asset ?? "",
|
|
269
|
+
capturedAt: new Date().toISOString(),
|
|
270
|
+
payment: result.payment,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
return emitReadSuccess(options, network, scope, result.data, {
|
|
274
|
+
paid: true,
|
|
275
|
+
amount: amountRaw,
|
|
276
|
+
amountHuman,
|
|
277
|
+
server: personalServerUrl,
|
|
278
|
+
payment: result.payment,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
catch (paidError) {
|
|
282
|
+
// The fee may already be settled: report it instead of inviting a
|
|
283
|
+
// blind retry that pays again.
|
|
284
|
+
const spent = sentPaymentHeader ? amountRaw : null;
|
|
285
|
+
return emitAppOutcome(options, {
|
|
286
|
+
status: "failed",
|
|
287
|
+
code: isPaymentRequired(paidError)
|
|
288
|
+
? "payment_required"
|
|
289
|
+
: "server_unavailable",
|
|
290
|
+
message: `Read failed after payment was attempted: ${paidError instanceof Error ? paidError.message : String(paidError)}`,
|
|
291
|
+
remedy: "the signed payment header is stored; re-running replays it without paying again",
|
|
292
|
+
network: network.name,
|
|
293
|
+
data: { spentFee: spent, server: personalServerUrl },
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return emitAppOutcome(options, {
|
|
299
|
+
status: "failed",
|
|
300
|
+
code: "server_unavailable",
|
|
301
|
+
message: `No server holding this data answered (${serverUrls.length} registration${serverUrls.length === 1 ? "" : "s"} tried).`,
|
|
302
|
+
remedy: lastError instanceof Error ? lastError.message : "retry later",
|
|
303
|
+
network: network.name,
|
|
304
|
+
data: { serversTried: serverUrls.length },
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
function gatewayFailure(options, network, error, stage) {
|
|
308
|
+
return emitAppOutcome(options, {
|
|
309
|
+
status: "failed",
|
|
310
|
+
code: "gateway_unreachable",
|
|
311
|
+
message: `Gateway ${stage} failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
312
|
+
remedy: "check connectivity to " + network.gatewayUrl + " and retry",
|
|
313
|
+
network: network.name,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
function emitReadSuccess(options, network, scope, data, meta) {
|
|
317
|
+
if (options.json) {
|
|
318
|
+
return emitAppOutcome(options, {
|
|
319
|
+
status: "done",
|
|
320
|
+
code: "ok",
|
|
321
|
+
message: `Read ${scope}.`,
|
|
322
|
+
network: network.name,
|
|
323
|
+
data: { ...meta, result: data },
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
// Human mode: the payload alone on stdout (pipeable), the summary on
|
|
327
|
+
// stderr so `vana app read ... | jq` stays clean.
|
|
328
|
+
process.stdout.write(`${JSON.stringify(data, null, 2)}\n`);
|
|
329
|
+
if (!options.quiet) {
|
|
330
|
+
const paidNote = meta.paid
|
|
331
|
+
? ` (paid ${String(meta.amountHuman)})`
|
|
332
|
+
: meta.replayedReceipt
|
|
333
|
+
? " (existing receipt replayed, nothing new paid)"
|
|
334
|
+
: "";
|
|
335
|
+
process.stderr.write(`Read ${scope}${paidNote} from ${String(meta.server)}\n`);
|
|
336
|
+
}
|
|
337
|
+
return 0;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* The enclave leg: submit a raw-read job and wait for the answer.
|
|
341
|
+
*
|
|
342
|
+
* Deliberately not paid here. The gateway admits enclave jobs with
|
|
343
|
+
* `price: '0'` and `paymentState: 'none'`, so there is no fee to settle and
|
|
344
|
+
* no receipt to store; reporting `paid: false` is the honest answer rather
|
|
345
|
+
* than implying the read was free by protocol design. When the gateway
|
|
346
|
+
* starts quoting a price, this is where the escrow path plugs in.
|
|
347
|
+
*
|
|
348
|
+
* Waking a cold sandbox takes seconds, so the inline wait is used and a
|
|
349
|
+
* timeout is `not_ready` (exit 6) rather than a failure.
|
|
350
|
+
*/
|
|
351
|
+
async function runEnclaveRead(scope, options, context) {
|
|
352
|
+
const { network, key, grantId, owner } = context;
|
|
353
|
+
try {
|
|
354
|
+
const jobs = context.createJobs({
|
|
355
|
+
gatewayUrl: network.gatewayUrl,
|
|
356
|
+
chainId: network.chainId,
|
|
357
|
+
builderPrivateKey: key.privateKey,
|
|
358
|
+
});
|
|
359
|
+
const result = await jobs.readRaw({
|
|
360
|
+
owner: owner,
|
|
361
|
+
grantId: grantId,
|
|
362
|
+
scope,
|
|
363
|
+
wait: MAX_INLINE_WAIT_SECONDS,
|
|
364
|
+
});
|
|
365
|
+
const text = new TextDecoder().decode(result.body);
|
|
366
|
+
let payload = text;
|
|
367
|
+
if (result.contentType.includes("json")) {
|
|
368
|
+
try {
|
|
369
|
+
payload = JSON.parse(text);
|
|
370
|
+
}
|
|
371
|
+
catch {
|
|
372
|
+
// Keep the raw text rather than failing on a content-type lie.
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
return emitReadSuccess(options, network, scope, payload, {
|
|
376
|
+
paid: false,
|
|
377
|
+
delivery: "enclave",
|
|
378
|
+
jobId: result.jobId,
|
|
379
|
+
version: result.version,
|
|
380
|
+
server: "gateway job queue",
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
catch (error) {
|
|
384
|
+
return emitAppOutcome(options, {
|
|
385
|
+
status: "failed",
|
|
386
|
+
code: enclaveErrorCode(error),
|
|
387
|
+
message: `Enclave read failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
388
|
+
remedy: enclaveRemedy(error),
|
|
389
|
+
network: network.name,
|
|
390
|
+
data: { delivery: "enclave", owner },
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
/** Inline wait the protocol allows; a cold sandbox needs seconds, not ms. */
|
|
395
|
+
const MAX_INLINE_WAIT_SECONDS = 25;
|
|
396
|
+
/** Map the jobs client's typed errors onto the binary's exit-code table. */
|
|
397
|
+
function enclaveErrorCode(error) {
|
|
398
|
+
const name = error instanceof Error ? error.name : "";
|
|
399
|
+
switch (name) {
|
|
400
|
+
case "OwnerNotReadyError":
|
|
401
|
+
return "owner_not_ready";
|
|
402
|
+
case "GrantInvalidError":
|
|
403
|
+
return "grant_invalid";
|
|
404
|
+
case "BuilderUnknownError":
|
|
405
|
+
return "builder_unknown";
|
|
406
|
+
case "JobTimeoutError":
|
|
407
|
+
return "not_ready";
|
|
408
|
+
case "JobTransportError":
|
|
409
|
+
return "server_unavailable";
|
|
410
|
+
case "JobRequestTooLargeError":
|
|
411
|
+
return "bad_usage";
|
|
412
|
+
default:
|
|
413
|
+
return "internal";
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
function enclaveRemedy(error) {
|
|
417
|
+
const name = error instanceof Error ? error.name : "";
|
|
418
|
+
if (name === "OwnerNotReadyError") {
|
|
419
|
+
return "the owner has not finished Personal Server setup in the web app";
|
|
420
|
+
}
|
|
421
|
+
if (name === "JobTimeoutError") {
|
|
422
|
+
return "the sandbox is still waking; run the same command again";
|
|
423
|
+
}
|
|
424
|
+
if (name === "BuilderUnknownError") {
|
|
425
|
+
return "vana app register";
|
|
426
|
+
}
|
|
427
|
+
return undefined;
|
|
428
|
+
}
|
|
429
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../src/cli/app/read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,SAAS,EACT,mBAAmB,GAEpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,GAEvB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,kBAAkB,EAClB,aAAa,GAEd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,cAAc,GAEf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,UAAU,GAEX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,mBAAmB,GAEpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,cAAc,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,aAAa,CAAC,KAAc;IACnC,MAAM,IAAI,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACtD,IAAI,IAAI,KAAK,oBAAoB,EAAE,CAAC;QAClC,OAAO,iEAAiE,CAAC;IAC3E,CAAC;IACD,IAAI,IAAI,KAAK,iBAAiB,EAAE,CAAC;QAC/B,OAAO,yDAAyD,CAAC;IACnE,CAAC;IACD,IAAI,IAAI,KAAK,qBAAqB,EAAE,CAAC;QACnC,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vana app register` - idempotent builder registration at the gateway.
|
|
3
|
+
*
|
|
4
|
+
* Resolves the app key (generating one on first use), checks the gateway
|
|
5
|
+
* first and exits 0 when the app is already registered, otherwise signs the
|
|
6
|
+
* EIP-712 BuilderRegistration and posts it. Safe at the top of any script.
|
|
7
|
+
*/
|
|
8
|
+
import { type GatewayClient } from "@opendatalabs/vana-sdk";
|
|
9
|
+
import { resolveAppKey, type ResolvedAppKey } from "../../core/app-key.js";
|
|
10
|
+
import { type ResolvedNetwork } from "../../core/network.js";
|
|
11
|
+
import { type AppCommandOptions } from "./outcome.js";
|
|
12
|
+
export interface RegisterCommandOptions extends AppCommandOptions {
|
|
13
|
+
/** Public URL of the app; the gateway stores it on the record. */
|
|
14
|
+
appUrl?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface RegisterDeps {
|
|
17
|
+
createClient?: (gatewayUrl: string) => GatewayClient;
|
|
18
|
+
resolveKey?: typeof resolveAppKey;
|
|
19
|
+
}
|
|
20
|
+
export declare function builderRegistrationDomainFor(network: ResolvedNetwork): {
|
|
21
|
+
readonly name: "Vana Data Portability";
|
|
22
|
+
readonly version: "1";
|
|
23
|
+
readonly chainId: bigint;
|
|
24
|
+
readonly verifyingContract: `0x${string}`;
|
|
25
|
+
};
|
|
26
|
+
export declare function signBuilderRegistration(key: ResolvedAppKey, network: ResolvedNetwork, appUrl: string): Promise<{
|
|
27
|
+
ownerAddress: string;
|
|
28
|
+
granteeAddress: string;
|
|
29
|
+
publicKey: string;
|
|
30
|
+
appUrl: string;
|
|
31
|
+
signature: string;
|
|
32
|
+
}>;
|
|
33
|
+
export declare function runAppRegister(options: RegisterCommandOptions, deps?: RegisterDeps): Promise<number>;
|
|
34
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/cli/app/register.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,aAAa,EAEb,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtE,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAC/D,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,aAAa,CAAC;IACrD,UAAU,CAAC,EAAE,OAAO,aAAa,CAAC;CACnC;AAKD,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,eAAe;;;;gCAKlB,KAAK,MAAM,EAAE;EAE/D;AAED,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,cAAc,EACnB,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IACT,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC,CAeD;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,sBAAsB,EAC/B,IAAI,GAAE,YAAiB,GACtB,OAAO,CAAC,MAAM,CAAC,CA+EjB"}
|