@t2000/cli 5.7.3 → 5.8.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.
@@ -80332,7 +80332,7 @@ Through this wallet you can reach essentially any major external API, billed to
80332
80332
  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).
80333
80333
 
80334
80334
  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.`;
80335
- var PKG_VERSION = "5.7.3";
80335
+ var PKG_VERSION = "5.8.0";
80336
80336
  console.log = (...args) => console.error("[log]", ...args);
80337
80337
  console.warn = (...args) => console.error("[warn]", ...args);
80338
80338
  async function startMcpServer(opts) {
@@ -80398,4 +80398,4 @@ mime-types/index.js:
80398
80398
  @scure/bip39/index.js:
80399
80399
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
80400
80400
  */
80401
- //# sourceMappingURL=dist-HFB2G5PO.js.map
80401
+ //# sourceMappingURL=dist-XSNNKQQN.js.map
package/dist/index.js CHANGED
@@ -32580,7 +32580,7 @@ function registerMcpStart(parent) {
32580
32580
  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) => {
32581
32581
  let mod2;
32582
32582
  try {
32583
- mod2 = await import("./dist-HFB2G5PO.js");
32583
+ mod2 = await import("./dist-XSNNKQQN.js");
32584
32584
  } catch {
32585
32585
  console.error("MCP server not installed. Run:\n npm install -g @t2000/mcp");
32586
32586
  process.exit(1);
@@ -33183,6 +33183,55 @@ Subcommands:
33183
33183
  }
33184
33184
  }
33185
33185
  );
33186
+ group.command("service").description(
33187
+ "Declare this agent's paid service \u2014 an MCP endpoint + accepted payment methods (e.g. x402). Sponsored, gasless. Lights up Service / x402 in the directory."
33188
+ ).option("--mcp-endpoint <url>", "Your agent service endpoint (https)").option(
33189
+ "--payment-methods <list>",
33190
+ 'Comma-separated methods you accept, e.g. "x402"'
33191
+ ).option("--key <path>", "Custom wallet path (default ~/.t2000/wallet.key)").option("--api <url>", `API base URL (default ${DEFAULT_API_BASE2})`).action(
33192
+ async (opts) => {
33193
+ try {
33194
+ if (!(opts.mcpEndpoint || opts.paymentMethods)) {
33195
+ throw new Error(
33196
+ "Provide at least one of --mcp-endpoint, --payment-methods."
33197
+ );
33198
+ }
33199
+ const base = opts.api ?? DEFAULT_API_BASE2;
33200
+ const agent = await withAgent({ keyPath: opts.key });
33201
+ const address = agent.address();
33202
+ const prepareBody = { address };
33203
+ if (opts.mcpEndpoint !== void 0) {
33204
+ prepareBody.mcpEndpoint = opts.mcpEndpoint;
33205
+ }
33206
+ if (opts.paymentMethods !== void 0) {
33207
+ prepareBody.paymentMethods = opts.paymentMethods.split(",").map((s) => s.trim()).filter(Boolean);
33208
+ }
33209
+ const { digest } = await runSponsoredTx({
33210
+ keypair: agent.keypair,
33211
+ actor: address,
33212
+ prepareUrl: `${base}/agent/service/prepare`,
33213
+ prepareBody,
33214
+ submitUrl: `${base}/agent/service/submit`
33215
+ });
33216
+ if (isJsonMode()) {
33217
+ printJson({ address, updated: true, digest });
33218
+ return;
33219
+ }
33220
+ printBlank();
33221
+ printSuccess("Service declared \u2014 showing in the directory.");
33222
+ if (opts.mcpEndpoint) {
33223
+ printKeyValue("MCP endpoint", opts.mcpEndpoint);
33224
+ }
33225
+ if (opts.paymentMethods) {
33226
+ printKeyValue("Payment methods", opts.paymentMethods);
33227
+ }
33228
+ printKeyValue("Tx", String(digest));
33229
+ printBlank();
33230
+ } catch (error) {
33231
+ handleError(error);
33232
+ }
33233
+ }
33234
+ );
33186
33235
  group.command("handle").argument("<label>", "Handle label (3\u201320 chars: lowercase a\u2013z, 0\u20139, hyphens)").description(
33187
33236
  "Claim <label>.agent-id.sui \u2192 this wallet (custody-minted, gasless). Use --release to give it up."
33188
33237
  ).option("--release", "Release (revoke) this handle instead of claiming it").option("--key <path>", "Custom wallet path (default ~/.t2000/wallet.key)").option("--api <url>", `API base URL (default ${DEFAULT_API_BASE2})`).action(