@t2000/cli 9.3.0 → 9.3.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.
@@ -48231,11 +48231,11 @@ var init_fetch = __esm({
48231
48231
  return "half";
48232
48232
  }
48233
48233
  });
48234
- const hasContentType = request.headers.has("Content-Type");
48234
+ const hasContentType2 = request.headers.has("Content-Type");
48235
48235
  if (request.body != null) {
48236
48236
  request.body.cancel();
48237
48237
  }
48238
- return duplexAccessed && !hasContentType;
48238
+ return duplexAccessed && !hasContentType2;
48239
48239
  });
48240
48240
  const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response3("").body));
48241
48241
  const resolvers = {
@@ -143935,11 +143935,18 @@ function preflightPay(input) {
143935
143935
  return PREFLIGHT_OK;
143936
143936
  }
143937
143937
  async function payWithMpp(args) {
143938
- const { signer, client, options } = args;
143938
+ const { signer, client } = args;
143939
+ let options = args.options;
143939
143940
  const pf = preflightPay({ url: options.url, maxPrice: options.maxPrice });
143940
143941
  if (!pf.valid) throw new T2000Error(pf.code, pf.error);
143941
143942
  const method = (options.method ?? "GET").toUpperCase();
143942
143943
  const canHaveBody = method !== "GET" && method !== "HEAD";
143944
+ if (canHaveBody && typeof options.body === "string" && isJsonText(options.body) && !hasContentType(options.headers)) {
143945
+ options = {
143946
+ ...options,
143947
+ headers: { ...options.headers ?? {}, "content-type": "application/json" }
143948
+ };
143949
+ }
143943
143950
  const reqInit = {
143944
143951
  method,
143945
143952
  headers: options.headers,
@@ -144126,6 +144133,18 @@ async function ensureAddressBalanceCovers(args) {
144126
144133
  const migration = await executeTx(client, signer, () => tx, { buildClient: grpcClient });
144127
144134
  return migration.gasCostSui;
144128
144135
  }
144136
+ function isJsonText(text) {
144137
+ try {
144138
+ JSON.parse(text);
144139
+ return true;
144140
+ } catch {
144141
+ return false;
144142
+ }
144143
+ }
144144
+ function hasContentType(headers) {
144145
+ if (!headers) return false;
144146
+ return Object.keys(headers).some((k) => k.toLowerCase() === "content-type");
144147
+ }
144129
144148
  async function finalize2(response, opts) {
144130
144149
  const contentType = response.headers.get("content-type") ?? "";
144131
144150
  let body2;
@@ -146307,7 +146326,7 @@ Through this wallet you can reach essentially any major external API, billed to
146307
146326
  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).
146308
146327
 
146309
146328
  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.`;
146310
- var PKG_VERSION = "9.3.0";
146329
+ var PKG_VERSION = "9.3.1";
146311
146330
  console.log = (...args) => console.error("[log]", ...args);
146312
146331
  console.warn = (...args) => console.error("[warn]", ...args);
146313
146332
  async function startMcpServer(opts) {
@@ -146392,4 +146411,4 @@ mime-types/index.js:
146392
146411
  @scure/bip39/index.js:
146393
146412
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
146394
146413
  */
146395
- //# sourceMappingURL=dist-HPMGTXOX.js.map
146414
+ //# sourceMappingURL=dist-BHEY35W6.js.map