@t2000/cli 5.20.0 → 5.21.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.
package/dist/index.js
CHANGED
|
@@ -27789,7 +27789,8 @@ async function listModels(opts) {
|
|
|
27789
27789
|
contextWindow: m.context_window ?? m.context_length,
|
|
27790
27790
|
inputPer1M: m.pricing?.input_per_1m ?? m.pricing?.prompt,
|
|
27791
27791
|
outputPer1M: m.pricing?.output_per_1m ?? m.pricing?.completion,
|
|
27792
|
-
privacy: m.privacy ?? m.privacy_tier
|
|
27792
|
+
privacy: m.privacy ?? m.privacy_tier,
|
|
27793
|
+
reasoning: m.reasoning
|
|
27793
27794
|
}));
|
|
27794
27795
|
}
|
|
27795
27796
|
var RECEIPT_ANCHORED_SUFFIX = "::anchor::ReceiptAnchored";
|
|
@@ -27898,7 +27899,15 @@ async function verifyTdxQuote(base, model, receiptWorkloadId) {
|
|
|
27898
27899
|
};
|
|
27899
27900
|
}
|
|
27900
27901
|
try {
|
|
27901
|
-
const
|
|
27902
|
+
const dcap = await import("./src-FIYSHJR4.js");
|
|
27903
|
+
const getCollateralAndVerify = dcap.getCollateralAndVerify ?? dcap.default?.getCollateralAndVerify;
|
|
27904
|
+
if (typeof getCollateralAndVerify !== "function") {
|
|
27905
|
+
return {
|
|
27906
|
+
status: "fail",
|
|
27907
|
+
forged: false,
|
|
27908
|
+
detail: "DCAP verifier unavailable in this build"
|
|
27909
|
+
};
|
|
27910
|
+
}
|
|
27902
27911
|
const quoteBytes = hexToBytes2(quoteHex.replace(/^0x/, ""));
|
|
27903
27912
|
const vr = await getCollateralAndVerify(quoteBytes);
|
|
27904
27913
|
const td = vr.report.asTd10() ?? vr.report.asTd15()?.base ?? null;
|
|
@@ -28024,7 +28033,6 @@ async function verifyReceipt(receiptId, opts = {}) {
|
|
|
28024
28033
|
});
|
|
28025
28034
|
}
|
|
28026
28035
|
}
|
|
28027
|
-
let signatureForged = false;
|
|
28028
28036
|
let sigStatus = "skip";
|
|
28029
28037
|
let sigDetail = "no signature on receipt";
|
|
28030
28038
|
if (receipt.signature?.value) {
|
|
@@ -28041,7 +28049,6 @@ async function verifyReceipt(receiptId, opts = {}) {
|
|
|
28041
28049
|
} else {
|
|
28042
28050
|
const ok = verifyReceiptSignature(receipt, att.signingKey);
|
|
28043
28051
|
sigStatus = ok ? "pass" : "fail";
|
|
28044
|
-
signatureForged = !ok;
|
|
28045
28052
|
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
28053
|
}
|
|
28047
28054
|
} catch {
|
|
@@ -28054,7 +28061,6 @@ async function verifyReceipt(receiptId, opts = {}) {
|
|
|
28054
28061
|
detail: sigDetail,
|
|
28055
28062
|
trust: sigStatus === "skip" ? "roadmap" : "trustless"
|
|
28056
28063
|
});
|
|
28057
|
-
let quoteForged = false;
|
|
28058
28064
|
if (opts.skipQuote) {
|
|
28059
28065
|
checks.push({
|
|
28060
28066
|
name: "TDX quote (DCAP)",
|
|
@@ -28068,7 +28074,6 @@ async function verifyReceipt(receiptId, opts = {}) {
|
|
|
28068
28074
|
opts.model ?? "phala/glm-5.2",
|
|
28069
28075
|
workloadId ?? ""
|
|
28070
28076
|
);
|
|
28071
|
-
quoteForged = q.forged;
|
|
28072
28077
|
checks.push({
|
|
28073
28078
|
name: "TDX quote (DCAP)",
|
|
28074
28079
|
status: q.status,
|
|
@@ -28076,9 +28081,12 @@ async function verifyReceipt(receiptId, opts = {}) {
|
|
|
28076
28081
|
trust: "trustless"
|
|
28077
28082
|
});
|
|
28078
28083
|
}
|
|
28084
|
+
const trustlessFailed = checks.some(
|
|
28085
|
+
(c) => c.trust === "trustless" && c.status === "fail"
|
|
28086
|
+
);
|
|
28079
28087
|
return {
|
|
28080
28088
|
receiptId,
|
|
28081
|
-
verified: Boolean(wireHash && workloadId) &&
|
|
28089
|
+
verified: Boolean(wireHash && workloadId) && !trustlessFailed,
|
|
28082
28090
|
anchorVerified,
|
|
28083
28091
|
checks,
|
|
28084
28092
|
wireHash,
|
|
@@ -32127,7 +32135,8 @@ function registerChat(program3) {
|
|
|
32127
32135
|
for (const m of models) {
|
|
32128
32136
|
const price = m.inputPer1M != null ? ` \u2014 ${usd(m.inputPer1M)}/${usd(m.outputPer1M)} per 1M` : "";
|
|
32129
32137
|
const priv = m.privacy ? ` [${m.privacy}]` : "";
|
|
32130
|
-
|
|
32138
|
+
const think = m.reasoning ? import_picocolors9.default.dim(" \xB7 reasoning (deeper, slower)") : "";
|
|
32139
|
+
printLine(` ${m.id}${priv}${price}${think}`);
|
|
32131
32140
|
}
|
|
32132
32141
|
printBlank();
|
|
32133
32142
|
} catch (error) {
|
|
@@ -32196,9 +32205,10 @@ function registerVerify(program3) {
|
|
|
32196
32205
|
printLine(import_picocolors10.default.dim(` anchor: ${result.anchor.explorer}`));
|
|
32197
32206
|
}
|
|
32198
32207
|
if (result.verified) {
|
|
32208
|
+
const quoteSkipped = result.checks.find((c) => c.name === "TDX quote (DCAP)")?.status === "skip";
|
|
32199
32209
|
printLine(
|
|
32200
32210
|
import_picocolors10.default.green(
|
|
32201
|
-
" RESULT: \u2713 verified \u2014 genuine TDX quote + TEE-signed receipt + Sui anchor, all checked client-side."
|
|
32211
|
+
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
32212
|
)
|
|
32203
32213
|
);
|
|
32204
32214
|
} else {
|
|
@@ -32567,7 +32577,7 @@ function registerMcpStart(parent) {
|
|
|
32567
32577
|
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
32578
|
let mod3;
|
|
32569
32579
|
try {
|
|
32570
|
-
mod3 = await import("./dist-
|
|
32580
|
+
mod3 = await import("./dist-FBZWN6ED.js");
|
|
32571
32581
|
} catch {
|
|
32572
32582
|
console.error("MCP server not installed. Run:\n npm install -g @t2000/mcp");
|
|
32573
32583
|
process.exit(1);
|