@t2000/cli 5.24.1 → 5.24.3

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.
@@ -99283,7 +99283,7 @@ CRITICAL: When the user asks to use any external or paid API, names a provider (
99283
99283
  The wallet can also HIRE OTHER AGENTS: the agent store (agents.t2000.ai) lists agents selling one-call services (market reads, data feeds, tools) with receipt-backed reputation. Browse with t2000_agents, buy with t2000_agent_pay (escrowed \u2014 auto-refund if delivery fails). The user's wallet can EARN too: reward tasks + a community task board live at mpp.t2000.ai/tasks (see the skill-hire prompt or the t2000-hire skill).
99284
99284
 
99285
99285
  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.`;
99286
- var PKG_VERSION = "5.24.1";
99286
+ var PKG_VERSION = "5.24.3";
99287
99287
  console.log = (...args) => console.error("[log]", ...args);
99288
99288
  console.warn = (...args) => console.error("[warn]", ...args);
99289
99289
  async function startMcpServer(opts) {
@@ -99357,4 +99357,4 @@ mime-types/index.js:
99357
99357
  @scure/bip39/index.js:
99358
99358
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
99359
99359
  */
99360
- //# sourceMappingURL=dist-57KQG4RN.js.map
99360
+ //# sourceMappingURL=dist-UCB5RASG.js.map
package/dist/index.js CHANGED
@@ -33109,7 +33109,7 @@ function registerMcpStart(parent) {
33109
33109
  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) => {
33110
33110
  let mod3;
33111
33111
  try {
33112
- mod3 = await import("./dist-57KQG4RN.js");
33112
+ mod3 = await import("./dist-UCB5RASG.js");
33113
33113
  } catch {
33114
33114
  console.error("MCP server not installed. Run:\n npm install -g @t2000/mcp");
33115
33115
  process.exit(1);
@@ -33949,7 +33949,8 @@ Subcommands:
33949
33949
  const maxPrice = opts.maxPrice ? Number.parseFloat(opts.maxPrice) : opts.amount ? Number.parseFloat(opts.amount) : 1;
33950
33950
  const gateway = opts.gateway ?? DEFAULT_GATEWAY;
33951
33951
  const agent = await withAgent({ keyPath: opts.key });
33952
- const url = opts.amount ? `${gateway}/commerce/pay/${seller}?amount=${encodeURIComponent(opts.amount)}` : `${gateway}/commerce/pay/${seller}`;
33952
+ const resolvedSeller = seller.startsWith("0x") ? seller : (await agent.resolveRecipient(seller)).address;
33953
+ const url = opts.amount ? `${gateway}/commerce/pay/${resolvedSeller}?amount=${encodeURIComponent(opts.amount)}` : `${gateway}/commerce/pay/${resolvedSeller}`;
33953
33954
  const result = await agent.pay({
33954
33955
  url,
33955
33956
  method: "POST",
@@ -33958,12 +33959,17 @@ Subcommands:
33958
33959
  force: opts.force
33959
33960
  });
33960
33961
  const body2 = result.body;
33962
+ if (result.status >= 400) {
33963
+ throw new Error(
33964
+ `${body2?.error ?? `Request failed (HTTP ${result.status})`}${result.paid ? "" : " \u2014 nothing was paid."}`
33965
+ );
33966
+ }
33961
33967
  const receipt = body2?.receipt;
33962
33968
  const chargedMicros = receipt?.chargedMicros ?? receipt?.grossMicros;
33963
33969
  const paidUsd = typeof chargedMicros === "number" ? chargedMicros / 1e6 : opts.amount ? Number.parseFloat(opts.amount) : result.cost ?? 0;
33964
33970
  if (isJsonMode()) {
33965
33971
  printJson({
33966
- seller,
33972
+ seller: resolvedSeller,
33967
33973
  amount: paidUsd,
33968
33974
  paid: result.paid,
33969
33975
  cost: result.cost,
@@ -33973,7 +33979,9 @@ Subcommands:
33973
33979
  return;
33974
33980
  }
33975
33981
  printBlank();
33976
- printSuccess(`Paid ${formatUsd(paidUsd)} to ${truncateAddress(seller)}`);
33982
+ printSuccess(
33983
+ `Paid ${formatUsd(paidUsd)} to ${seller.startsWith("0x") ? truncateAddress(seller) : `${seller} (${truncateAddress(resolvedSeller)})`}`
33984
+ );
33977
33985
  if (receipt) {
33978
33986
  if (typeof receipt.refundMicros === "number" && receipt.refundMicros > 0 && typeof receipt.authorizedMicros === "number") {
33979
33987
  printKeyValue(
@@ -34262,7 +34270,7 @@ function registerTask(program3) {
34262
34270
  );
34263
34271
  group.command("post").description(
34264
34272
  "Post a community task \u2014 pays the FULL budget (reward \xD7 completions) into escrow via x402; auto-moderated at post time. SAVE the returned manageKey."
34265
- ).requiredOption("--title <text>", "What needs doing (8+ chars)").requiredOption("--description <text>", "Exactly what the worker must deliver + what proof (30+ chars)").requiredOption("--reward <usdc>", "Reward per approved completion ($0.01\u2013$50)").option("--completions <n>", "Max completions (default 1)", "1").option("--expiry-days <n>", "Days until unspent budget auto-refunds (default 7)", "7").option("--category <category>", "research | data | marketing | dev | creative | other", "other").option("--gateway <url>", `Gateway base URL (default ${DEFAULT_GATEWAY2})`).option("--force", "Override spending limits for this call (see `t2 limit`)").option("--key <path>", "Custom wallet path (default ~/.t2000/wallet.key)").action(
34273
+ ).requiredOption("--title <text>", "What needs doing (8+ chars)").requiredOption("--description <text>", "Exactly what the worker must deliver + what proof (30+ chars)").requiredOption("--reward <usdc>", "Reward per approved completion ($0.01\u2013$50)").option("--completions <n>", "Max completions (default 1)", "1").option("--expiry-days <n>", "Days until unspent budget auto-refunds (default 7)", "7").option("--category <category>", "research | data | marketing | dev | creative | other", "other").option("--notify-email <email>", "Email me when submissions arrive + when the refund settles (per-task, one-click stop in every mail)").option("--gateway <url>", `Gateway base URL (default ${DEFAULT_GATEWAY2})`).option("--force", "Override spending limits for this call (see `t2 limit`)").option("--key <path>", "Custom wallet path (default ~/.t2000/wallet.key)").action(
34266
34274
  async (opts) => {
34267
34275
  try {
34268
34276
  const gateway = opts.gateway ?? DEFAULT_GATEWAY2;
@@ -34282,7 +34290,8 @@ function registerTask(program3) {
34282
34290
  rewardUsd: reward,
34283
34291
  maxCompletions: completions,
34284
34292
  expiryDays: Number.parseInt(opts.expiryDays, 10),
34285
- category: opts.category
34293
+ category: opts.category,
34294
+ ...opts.notifyEmail ? { notifyEmail: opts.notifyEmail } : {}
34286
34295
  }),
34287
34296
  maxPrice: budget,
34288
34297
  force: opts.force