@t2000/cli 8.0.2 → 8.2.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.
@@ -99891,6 +99891,70 @@ ${text}`;
99891
99891
  }
99892
99892
  }
99893
99893
  );
99894
+ server.tool(
99895
+ "t2000_agent_sell",
99896
+ "List this agent's x402 API endpoint on its public Agent ID profile so buyers can pay it per call in USDC. The endpoint is LIVE-PROBED server-side first (must answer 402 with a valid Sui payment challenge \u2014 probe failures are returned per-check), then one sponsored (gasless) signature sets it on-chain. The listing appears on agents.t2000.ai and api.t2000.ai/v1/agents/{address} immediately. Requires an on-chain Agent ID (`t2 agent register`). Set remove: true to clear the listing. Mirrors `t2 agent sell <endpoint>`. This does NOT spend funds.",
99897
+ {
99898
+ endpoint: external_exports.string().optional().describe("Your x402 endpoint URL (https). Omit only with remove: true."),
99899
+ remove: external_exports.boolean().optional().describe("Remove the listing instead of setting one (default: false)")
99900
+ },
99901
+ async ({ endpoint, remove }) => {
99902
+ try {
99903
+ if (!(remove || endpoint)) {
99904
+ throw new Error("Provide the x402 endpoint URL (or remove: true to clear the listing).");
99905
+ }
99906
+ const address = agent.address();
99907
+ const target = remove ? "" : endpoint;
99908
+ const base = "https://api.t2000.ai/v1";
99909
+ const prepRes = await fetch(`${base}/agent/service/prepare`, {
99910
+ method: "POST",
99911
+ headers: { "Content-Type": "application/json" },
99912
+ body: JSON.stringify({ address, endpoint: target })
99913
+ });
99914
+ const prep = await prepRes.json().catch(() => ({}));
99915
+ if (!prepRes.ok) {
99916
+ const msg = typeof prep.error === "string" ? prep.error : prep.error?.message ?? `HTTP ${prepRes.status}`;
99917
+ return {
99918
+ content: [{
99919
+ type: "text",
99920
+ text: JSON.stringify({ ok: false, error: msg, probeIssues: prep.probe?.issues ?? [] })
99921
+ }],
99922
+ isError: true
99923
+ };
99924
+ }
99925
+ if (!(prep.nonce && prep.txBytes)) {
99926
+ throw new Error("Failed to prepare the listing.");
99927
+ }
99928
+ const bytes = new Uint8Array(Buffer.from(prep.txBytes, "base64"));
99929
+ const { signature } = await agent.signer.signTransaction(bytes);
99930
+ const subRes = await fetch(`${base}/agent/service/submit`, {
99931
+ method: "POST",
99932
+ headers: { "Content-Type": "application/json" },
99933
+ body: JSON.stringify({ nonce: prep.nonce, address, signature })
99934
+ });
99935
+ const sub2 = await subRes.json().catch(() => ({}));
99936
+ if (!subRes.ok) {
99937
+ const msg = typeof sub2.error === "string" ? sub2.error : sub2.error?.message ?? `HTTP ${subRes.status}`;
99938
+ throw new Error(msg);
99939
+ }
99940
+ return {
99941
+ content: [{
99942
+ type: "text",
99943
+ text: JSON.stringify({
99944
+ ok: true,
99945
+ listed: !remove,
99946
+ endpoint: remove ? null : target,
99947
+ pricePerCall: prep.probe?.amount ? `${prep.probe.amount} ${prep.probe.currency ?? "USDC"}` : void 0,
99948
+ profile: `https://agents.t2000.ai/${address}`,
99949
+ digest: sub2.digest
99950
+ })
99951
+ }]
99952
+ };
99953
+ } catch (err) {
99954
+ return errorResult(err);
99955
+ }
99956
+ }
99957
+ );
99894
99958
  }
99895
99959
  function readLimits(configDir) {
99896
99960
  const limits = getLimits(configDir);
@@ -100069,7 +100133,7 @@ Through this wallet you can reach essentially any major external API, billed to
100069
100133
  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).
100070
100134
 
100071
100135
  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.`;
100072
- var PKG_VERSION = "8.0.2";
100136
+ var PKG_VERSION = "8.2.0";
100073
100137
  console.log = (...args) => console.error("[log]", ...args);
100074
100138
  console.warn = (...args) => console.error("[warn]", ...args);
100075
100139
  async function startMcpServer(opts) {
@@ -100145,4 +100209,4 @@ mime-types/index.js:
100145
100209
  @scure/bip39/index.js:
100146
100210
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
100147
100211
  */
100148
- //# sourceMappingURL=dist-JNPBEKR5.js.map
100212
+ //# sourceMappingURL=dist-7ZQFQB45.js.map