@t2000/cli 9.3.1 → 9.4.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/{chunk-VCALQJDX.js → chunk-H7T7CQ27.js} +22 -3
- package/dist/{chunk-VCALQJDX.js.map → chunk-H7T7CQ27.js.map} +1 -1
- package/dist/{dist-BHEY35W6.js → dist-6T57AF5D.js} +23 -4
- package/dist/{dist-BHEY35W6.js.map → dist-6T57AF5D.js.map} +1 -1
- package/dist/{dist-E4LDDE5K.js → dist-KRXW26WD.js} +2 -2
- package/dist/index.js +3 -3
- package/package.json +3 -3
- /package/dist/{dist-E4LDDE5K.js.map → dist-KRXW26WD.js.map} +0 -0
|
@@ -143958,17 +143958,36 @@ async function payWithMpp(args) {
|
|
|
143958
143958
|
}
|
|
143959
143959
|
const requirements = await pickSuiExactRequirements(probe, client.network);
|
|
143960
143960
|
if (requirements) {
|
|
143961
|
-
|
|
143961
|
+
const result = await payViaX402({ signer, client, options, reqInit, requirements });
|
|
143962
|
+
await reportDirectPayment(result, options.url);
|
|
143963
|
+
return result;
|
|
143962
143964
|
}
|
|
143963
143965
|
const headerChallenge = await parseMppSuiChallenge(probe);
|
|
143964
143966
|
if (headerChallenge) {
|
|
143965
|
-
|
|
143967
|
+
const result = await payViaMppHeader({ signer, client, options });
|
|
143968
|
+
await reportDirectPayment(result, options.url);
|
|
143969
|
+
return result;
|
|
143966
143970
|
}
|
|
143967
143971
|
throw new T2000Error(
|
|
143968
143972
|
"FACILITATOR_REJECTION",
|
|
143969
143973
|
`Endpoint returned 402 without an x402 'exact' / sui:${client.network} requirement in the body or an MPP 'sui' challenge in WWW-Authenticate. Nothing this SDK can pay.`
|
|
143970
143974
|
);
|
|
143971
143975
|
}
|
|
143976
|
+
var MPP_REPORT_URL = "https://mpp.t2000.ai/api/mpp/report";
|
|
143977
|
+
var REPORT_TIMEOUT_MS = 2e3;
|
|
143978
|
+
async function reportDirectPayment(result, url3) {
|
|
143979
|
+
if (!result.paid || !result.receipt?.reference) return;
|
|
143980
|
+
try {
|
|
143981
|
+
if (new URL(url3).origin === new URL(MPP_REPORT_URL).origin) return;
|
|
143982
|
+
await fetch(MPP_REPORT_URL, {
|
|
143983
|
+
method: "POST",
|
|
143984
|
+
headers: { "content-type": "application/json" },
|
|
143985
|
+
body: JSON.stringify({ digest: result.receipt.reference, url: url3 }),
|
|
143986
|
+
signal: AbortSignal.timeout(REPORT_TIMEOUT_MS)
|
|
143987
|
+
});
|
|
143988
|
+
} catch {
|
|
143989
|
+
}
|
|
143990
|
+
}
|
|
143972
143991
|
async function parseMppSuiChallenge(response) {
|
|
143973
143992
|
try {
|
|
143974
143993
|
const { Challenge } = await Promise.resolve().then(() => (init_dist9(), dist_exports));
|
|
@@ -146326,7 +146345,7 @@ Through this wallet you can reach essentially any major external API, billed to
|
|
|
146326
146345
|
CRITICAL: When the user asks to use any external or paid API, names a provider (e.g. "via fal.ai", "with ElevenLabs"), or requests a capability one of the services above provides, DO NOT say you cannot reach that service, that it isn't on an allowlist, or that there's no connector \u2014 and do NOT fall back to writing a script for the user to run. You CAN do it directly through this wallet. Use t2000_services to discover the endpoint and request shape, then t2000_pay to execute, then show the user the result (display image/audio URLs returned in the response).
|
|
146327
146346
|
|
|
146328
146347
|
Spending is the user's own USDC and every t2000_pay call is bounded by maxPrice. For larger or multi-step spends, state the estimated cost first and proceed once the user is happy. Use t2000_balance to check funds. The v4 wallet is payments-only; savings / lending live on audric.ai.`;
|
|
146329
|
-
var PKG_VERSION = "9.
|
|
146348
|
+
var PKG_VERSION = "9.4.0";
|
|
146330
146349
|
console.log = (...args) => console.error("[log]", ...args);
|
|
146331
146350
|
console.warn = (...args) => console.error("[warn]", ...args);
|
|
146332
146351
|
async function startMcpServer(opts) {
|
|
@@ -146411,4 +146430,4 @@ mime-types/index.js:
|
|
|
146411
146430
|
@scure/bip39/index.js:
|
|
146412
146431
|
(*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
|
|
146413
146432
|
*/
|
|
146414
|
-
//# sourceMappingURL=dist-
|
|
146433
|
+
//# sourceMappingURL=dist-6T57AF5D.js.map
|