@t2000/cli 5.20.0 → 5.20.1
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/dist/index.js
CHANGED
|
@@ -27898,7 +27898,15 @@ async function verifyTdxQuote(base, model, receiptWorkloadId) {
|
|
|
27898
27898
|
};
|
|
27899
27899
|
}
|
|
27900
27900
|
try {
|
|
27901
|
-
const
|
|
27901
|
+
const dcap = await import("./src-FIYSHJR4.js");
|
|
27902
|
+
const getCollateralAndVerify = dcap.getCollateralAndVerify ?? dcap.default?.getCollateralAndVerify;
|
|
27903
|
+
if (typeof getCollateralAndVerify !== "function") {
|
|
27904
|
+
return {
|
|
27905
|
+
status: "fail",
|
|
27906
|
+
forged: false,
|
|
27907
|
+
detail: "DCAP verifier unavailable in this build"
|
|
27908
|
+
};
|
|
27909
|
+
}
|
|
27902
27910
|
const quoteBytes = hexToBytes2(quoteHex.replace(/^0x/, ""));
|
|
27903
27911
|
const vr = await getCollateralAndVerify(quoteBytes);
|
|
27904
27912
|
const td = vr.report.asTd10() ?? vr.report.asTd15()?.base ?? null;
|
|
@@ -28024,7 +28032,6 @@ async function verifyReceipt(receiptId, opts = {}) {
|
|
|
28024
28032
|
});
|
|
28025
28033
|
}
|
|
28026
28034
|
}
|
|
28027
|
-
let signatureForged = false;
|
|
28028
28035
|
let sigStatus = "skip";
|
|
28029
28036
|
let sigDetail = "no signature on receipt";
|
|
28030
28037
|
if (receipt.signature?.value) {
|
|
@@ -28041,7 +28048,6 @@ async function verifyReceipt(receiptId, opts = {}) {
|
|
|
28041
28048
|
} else {
|
|
28042
28049
|
const ok = verifyReceiptSignature(receipt, att.signingKey);
|
|
28043
28050
|
sigStatus = ok ? "pass" : "fail";
|
|
28044
|
-
signatureForged = !ok;
|
|
28045
28051
|
sigDetail = ok ? `signed by the attested receipt key (${receipt.signature.key_id ?? "key"})` : "signature does NOT recover the attested receipt key \u2014 forged/altered";
|
|
28046
28052
|
}
|
|
28047
28053
|
} catch {
|
|
@@ -28054,7 +28060,6 @@ async function verifyReceipt(receiptId, opts = {}) {
|
|
|
28054
28060
|
detail: sigDetail,
|
|
28055
28061
|
trust: sigStatus === "skip" ? "roadmap" : "trustless"
|
|
28056
28062
|
});
|
|
28057
|
-
let quoteForged = false;
|
|
28058
28063
|
if (opts.skipQuote) {
|
|
28059
28064
|
checks.push({
|
|
28060
28065
|
name: "TDX quote (DCAP)",
|
|
@@ -28068,7 +28073,6 @@ async function verifyReceipt(receiptId, opts = {}) {
|
|
|
28068
28073
|
opts.model ?? "phala/glm-5.2",
|
|
28069
28074
|
workloadId ?? ""
|
|
28070
28075
|
);
|
|
28071
|
-
quoteForged = q.forged;
|
|
28072
28076
|
checks.push({
|
|
28073
28077
|
name: "TDX quote (DCAP)",
|
|
28074
28078
|
status: q.status,
|
|
@@ -28076,9 +28080,12 @@ async function verifyReceipt(receiptId, opts = {}) {
|
|
|
28076
28080
|
trust: "trustless"
|
|
28077
28081
|
});
|
|
28078
28082
|
}
|
|
28083
|
+
const trustlessFailed = checks.some(
|
|
28084
|
+
(c) => c.trust === "trustless" && c.status === "fail"
|
|
28085
|
+
);
|
|
28079
28086
|
return {
|
|
28080
28087
|
receiptId,
|
|
28081
|
-
verified: Boolean(wireHash && workloadId) &&
|
|
28088
|
+
verified: Boolean(wireHash && workloadId) && !trustlessFailed,
|
|
28082
28089
|
anchorVerified,
|
|
28083
28090
|
checks,
|
|
28084
28091
|
wireHash,
|
|
@@ -32196,9 +32203,10 @@ function registerVerify(program3) {
|
|
|
32196
32203
|
printLine(import_picocolors10.default.dim(` anchor: ${result.anchor.explorer}`));
|
|
32197
32204
|
}
|
|
32198
32205
|
if (result.verified) {
|
|
32206
|
+
const quoteSkipped = result.checks.find((c) => c.name === "TDX quote (DCAP)")?.status === "skip";
|
|
32199
32207
|
printLine(
|
|
32200
32208
|
import_picocolors10.default.green(
|
|
32201
|
-
" RESULT: \u2713 verified \u2014 genuine TDX quote + TEE-signed receipt + Sui anchor, all checked client-side."
|
|
32209
|
+
quoteSkipped ? " RESULT: \u2713 verified \u2014 TEE-signed receipt + trustless Sui anchor (DCAP quote check skipped)." : " RESULT: \u2713 verified \u2014 genuine TDX quote + TEE-signed receipt + Sui anchor, all checked client-side."
|
|
32202
32210
|
)
|
|
32203
32211
|
);
|
|
32204
32212
|
} else {
|
|
@@ -32567,7 +32575,7 @@ function registerMcpStart(parent) {
|
|
|
32567
32575
|
parent.command("start", { isDefault: true }).description("Start MCP server (stdio transport \u2014 for AI client integration)").option("--key <path>", "Custom wallet path (default ~/.t2000/wallet.key)").action(async (opts) => {
|
|
32568
32576
|
let mod3;
|
|
32569
32577
|
try {
|
|
32570
|
-
mod3 = await import("./dist-
|
|
32578
|
+
mod3 = await import("./dist-O7YCMJB2.js");
|
|
32571
32579
|
} catch {
|
|
32572
32580
|
console.error("MCP server not installed. Run:\n npm install -g @t2000/mcp");
|
|
32573
32581
|
process.exit(1);
|