@lucid-agents/taskmarket 1.47.0 → 1.48.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.
Files changed (25) hide show
  1. package/dist/agent-compatibility.json +1 -1
  2. package/dist/{api-ENHCGR7K.js → api-2PFUP432.js} +2 -2
  3. package/dist/{channels-LX2DTMKZ.js → channels-Z6VN7FXP.js} +4 -4
  4. package/dist/{chunk-PPJNXEWM.js → chunk-AB3BDUMS.js} +3 -3
  5. package/dist/{chunk-WOPSQ2GZ.js → chunk-DKBI3SE3.js} +1 -1
  6. package/dist/{chunk-XRM455ZG.js → chunk-GPKAJ7QH.js} +1 -1
  7. package/dist/{chunk-O53R76N3.js → chunk-JXBWKGXC.js} +10969 -10737
  8. package/dist/{chunk-4MAQWPJ2.js → chunk-KTT6PSHQ.js} +1 -1
  9. package/dist/{chunk-AMT2L4BR.js → chunk-QRNIBDYX.js} +3 -3
  10. package/dist/{chunk-PDVDVVVF.js → chunk-SV6LNVI5.js} +2 -2
  11. package/dist/{chunk-AS6EFS2V.js → chunk-UJ3FRWUU.js} +6 -13
  12. package/dist/{chunk-RO5AHGHC.js → chunk-VENFZBAZ.js} +1 -1
  13. package/dist/{chunk-TUP4MTW6.js → chunk-VYYJ7FUB.js} +3 -3
  14. package/dist/{chunk-V2BCPGOB.js → chunk-WPJRL4F7.js} +8 -8
  15. package/dist/{chunk-54J54BK7.js → chunk-YAUYTYQI.js} +5 -5
  16. package/dist/{doctor-PEAKIDKS.js → doctor-6ASEDCCF.js} +8 -8
  17. package/dist/index.js +869 -594
  18. package/dist/{launch-CEJWCOQA.js → launch-JVXJSXJF.js} +11 -11
  19. package/dist/pi-extensions/xgate.cjs +650 -214
  20. package/dist/{read-auth-524RVF3G.js → read-auth-OQ3VVA4V.js} +3 -3
  21. package/dist/{reconcile-GMYKLZTG.js → reconcile-TJ2VXC6R.js} +4 -4
  22. package/dist/{status-Y6JAL4DR.js → status-LU7AKAKJ.js} +8 -8
  23. package/dist/{sync-pull-YFIWHI4H.js → sync-pull-52G7XZZT.js} +4 -4
  24. package/dist/{task-access-grants-GXJ6WOQK.js → task-access-grants-HUYBGG5E.js} +2 -2
  25. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  listWorkerSubmissions,
15
15
  submitTaskFiles,
16
16
  taskRequirementsOf
17
- } from "./chunk-V2BCPGOB.js";
17
+ } from "./chunk-WPJRL4F7.js";
18
18
  import {
19
19
  ComputeCreditError,
20
20
  applyComputeCreditSetup,
@@ -39,14 +39,14 @@ import {
39
39
  withPaymentProtocol,
40
40
  x402FeePost,
41
41
  x402PaymentProtocol
42
- } from "./chunk-TUP4MTW6.js";
42
+ } from "./chunk-VYYJ7FUB.js";
43
43
  import {
44
44
  signReadAuth
45
- } from "./chunk-PDVDVVVF.js";
45
+ } from "./chunk-SV6LNVI5.js";
46
46
  import {
47
47
  saveTaskAccessGrant,
48
48
  taskAccessGrantHeaders
49
- } from "./chunk-WOPSQ2GZ.js";
49
+ } from "./chunk-DKBI3SE3.js";
50
50
  import {
51
51
  MPP_TEMPO_DEFAULT_VALIDITY_SECONDS,
52
52
  X402PayError,
@@ -65,7 +65,7 @@ import {
65
65
  setX402PolicyRuleEnabled,
66
66
  signSponsoredTempoTransfer,
67
67
  signTaskmarketFeePayment
68
- } from "./chunk-XRM455ZG.js";
68
+ } from "./chunk-GPKAJ7QH.js";
69
69
  import {
70
70
  ALL_NETWORKS,
71
71
  ApiError,
@@ -94,6 +94,7 @@ import {
94
94
  fetchDeviceKey,
95
95
  generateKeypair,
96
96
  generateTapKey,
97
+ getKeystorePath,
97
98
  getNetwork,
98
99
  getWalletAddress,
99
100
  idempotencyKeyForError,
@@ -130,7 +131,7 @@ import {
130
131
  withErrorContext,
131
132
  withIdempotentWrite,
132
133
  withTapSignature
133
- } from "./chunk-AS6EFS2V.js";
134
+ } from "./chunk-UJ3FRWUU.js";
134
135
  import {
135
136
  AGENT_AVATAR_MAX_BYTES,
136
137
  AGENT_HIRES_ROLES,
@@ -402,14 +403,13 @@ import {
402
403
  validateWorkflowDocument,
403
404
  validateWorkflowTemplate,
404
405
  vaultCallGasLimit7702,
405
- verifierProviderId,
406
406
  verifiersUnsupportedOnChain,
407
407
  viemChainFor
408
- } from "./chunk-O53R76N3.js";
408
+ } from "./chunk-JXBWKGXC.js";
409
409
  import "./chunk-S7SJMJ2I.js";
410
410
 
411
411
  // src/index.ts
412
- import { Command as Command157 } from "commander";
412
+ import { Command as Command158 } from "commander";
413
413
  import { createRequire } from "module";
414
414
 
415
415
  // src/commands/init.ts
@@ -486,6 +486,130 @@ function readLastError() {
486
486
  }
487
487
  }
488
488
 
489
+ // src/lib/output.ts
490
+ import fs2 from "fs";
491
+
492
+ // src/lib/next-steps.ts
493
+ function chainOf(chainId) {
494
+ try {
495
+ const chain = taskmarketChain(chainId);
496
+ return { name: chain.name, symbol: chain.payment.symbol, testnet: chain.testnet };
497
+ } catch {
498
+ return { name: `chain ${chainId}`, symbol: "USDC", testnet: false };
499
+ }
500
+ }
501
+ function amountText(baseUnits2, chainId) {
502
+ try {
503
+ return formatPaymentAmount(baseUnits2, chainId);
504
+ } catch {
505
+ return `${formatUsdcBaseUnits(baseUnits2)} USDC`;
506
+ }
507
+ }
508
+ var SKILL_INSTALL_COMMAND = "curl -fsSL https://taskmarket.dev/install-skill.sh | sh -s -- https://taskmarket.dev";
509
+ var FREE_WORK_WHY = "Find paid work. Taking a claim task and your first 5 submissions to a bounty are free, so an empty wallet can earn.";
510
+ function hasGuidance(next) {
511
+ return next !== void 0 && (next.commands.length > 0 || next.askHuman.length > 0);
512
+ }
513
+ function isZero(baseUnits2) {
514
+ if (baseUnits2 === void 0) return false;
515
+ try {
516
+ return BigInt(baseUnits2) === 0n;
517
+ } catch {
518
+ return false;
519
+ }
520
+ }
521
+ function fundingAsk(wallet, requiredBaseUnits) {
522
+ const chain = chainOf(wallet.chainId);
523
+ const symbol = chain.symbol;
524
+ const where = `on ${chain.name} to ${wallet.address}`;
525
+ if (requiredBaseUnits !== void 0 && requiredBaseUnits > 0n) {
526
+ return `The Taskmarket action I tried costs ${amountText(requiredBaseUnits, wallet.chainId)} and my wallet holds less; nothing was charged. Please send ${symbol} ${where} to cover it.`;
527
+ }
528
+ const source = chain.testnet ? ` This is a testnet: ${symbol} comes from a faucet.` : "";
529
+ return `My Taskmarket wallet holds 0 ${symbol}. Please send ${symbol} ${where} so I can post tasks, hire workers and pay the 0.001 ${symbol} action fees. I can already do free work without it.${source}`;
530
+ }
531
+ function testnetStep(chainId) {
532
+ if (!chainOf(chainId).testnet) return [];
533
+ return [
534
+ {
535
+ command: "taskmarket --network base identity register",
536
+ why: "This network is a testnet with no real rewards. Paid work is on base and tempo; the same wallet works there once its identity is registered (free)."
537
+ }
538
+ ];
539
+ }
540
+ function nextAfterInit(wallet) {
541
+ return {
542
+ commands: [
543
+ { command: "taskmarket start", why: "See open work and what your wallet still needs." },
544
+ { command: "taskmarket task list --status open", why: FREE_WORK_WHY },
545
+ {
546
+ command: SKILL_INSTALL_COMMAND,
547
+ why: "Install the Taskmarket skill: the rules for each task mode and for every paid action."
548
+ },
549
+ ...testnetStep(wallet.chainId)
550
+ ],
551
+ askHuman: [
552
+ fundingAsk({ ...wallet, balanceBaseUnits: "0" }),
553
+ withdrawalAddressAsk(wallet.chainId)
554
+ ]
555
+ };
556
+ }
557
+ function withdrawalAddressAsk(chainId) {
558
+ const chain = chainOf(chainId);
559
+ return `Which address should my ${chain.name} earnings be withdrawn to? It is set once per chain with \`taskmarket wallet set-withdrawal-address <address>\` and I will not set it without your approval.`;
560
+ }
561
+ function nextForBalance(wallet) {
562
+ if (!isZero(wallet.balanceBaseUnits)) return { commands: [], askHuman: [] };
563
+ return {
564
+ commands: [{ command: "taskmarket task list --status open", why: FREE_WORK_WHY }],
565
+ askHuman: [fundingAsk(wallet)]
566
+ };
567
+ }
568
+ function nextForHome(state) {
569
+ const commands = [];
570
+ const askHuman = [];
571
+ if (state.needsYou > 0) {
572
+ commands.push({
573
+ command: "taskmarket inbox --actions-only",
574
+ why: `${state.needsYou} action${state.needsYou === 1 ? "" : "s"} waiting on you. Finish these before taking new work.`
575
+ });
576
+ }
577
+ commands.push({ command: "taskmarket task list --status open", why: FREE_WORK_WHY });
578
+ if (state.activeTasks === 0) {
579
+ commands.push({
580
+ command: "taskmarket agent listing",
581
+ why: "Check your worker listing. A listing with services and availability is how requesters find and hire you."
582
+ });
583
+ }
584
+ commands.push(...testnetStep(state.chainId));
585
+ if (isZero(state.balanceBaseUnits)) askHuman.push(fundingAsk(state));
586
+ if (state.withdrawalAddressSet === false) askHuman.push(withdrawalAddressAsk(state.chainId));
587
+ return { commands, askHuman };
588
+ }
589
+ function nextForInsufficientFunds(wallet, requiredBaseUnits) {
590
+ return {
591
+ commands: [
592
+ {
593
+ command: "taskmarket wallet balance",
594
+ why: "Confirm the balance once funds arrive, then run the refused command again."
595
+ },
596
+ { command: "taskmarket deposit", why: "The address, token and funding routes to relay." }
597
+ ],
598
+ askHuman: wallet ? [fundingAsk(wallet, requiredBaseUnits ?? 0n)] : []
599
+ };
600
+ }
601
+ function nextForMissingWallet() {
602
+ return {
603
+ commands: [
604
+ {
605
+ command: "taskmarket --network <name> init",
606
+ why: "Create this machine wallet once. Use base or tempo for paid work, base-sepolia or tempo-testnet to try things out."
607
+ }
608
+ ],
609
+ askHuman: ["Which Taskmarket network should I work on: base, tempo, or a testnet?"]
610
+ };
611
+ }
612
+
489
613
  // src/lib/output.ts
490
614
  function cliWarning(code, message, details) {
491
615
  return { ...details, code, message };
@@ -493,15 +617,40 @@ function cliWarning(code, message, details) {
493
617
  function printResult(data, options) {
494
618
  const idempotencyKey = options?.idempotencyKey;
495
619
  const warnings = options?.warnings ?? [];
620
+ const next = options?.next;
496
621
  console.log(
497
622
  JSON.stringify({
498
623
  ok: true,
499
624
  data,
500
625
  ...idempotencyKey !== void 0 ? { idempotencyKey } : {},
501
- ...warnings.length > 0 ? { warnings } : {}
626
+ ...warnings.length > 0 ? { warnings } : {},
627
+ ...hasGuidance(next) ? { next } : {}
502
628
  })
503
629
  );
504
630
  }
631
+ function recoverableFailure(message, status) {
632
+ if (/^No keystore found\b/.test(message)) {
633
+ return { code: "wallet_missing", next: nextForMissingWallet() };
634
+ }
635
+ if (status !== 402 || !/insufficient_funds/.test(message)) return void 0;
636
+ const quoted = /"amount":"(\d+)"/.exec(message)?.[1];
637
+ const required = quoted !== void 0 ? BigInt(quoted) : void 0;
638
+ const chainId = selectedNetworkOrUndefined()?.chainId;
639
+ let address3;
640
+ try {
641
+ const keystore = JSON.parse(fs2.readFileSync(getKeystorePath(), "utf8"));
642
+ if (typeof keystore.walletAddress === "string") address3 = keystore.walletAddress;
643
+ } catch {
644
+ }
645
+ return {
646
+ code: "insufficient_funds",
647
+ next: nextForInsufficientFunds(
648
+ address3 !== void 0 && chainId !== void 0 ? { address: address3, chainId } : void 0,
649
+ required
650
+ ),
651
+ ...quoted !== void 0 ? { required: { baseUnits: quoted } } : {}
652
+ };
653
+ }
505
654
  var X402_FAILURE_HINTS = {
506
655
  challenge_expired: "The seller's payment challenge ran out before it could be paid. Nothing was signed. Request the resource again for a fresh challenge.",
507
656
  no_supported_rail: "No payment option in the 402 can be paid here. The CLI pays x402 exact and upto, and MPP tempo charge. Check --protocol and the seller's advertised methods.",
@@ -538,6 +687,7 @@ function renderFailure(error, options) {
538
687
  const envelope = apiError?.envelope;
539
688
  const status = apiError?.status ?? x402PayError?.status;
540
689
  const errorCode = error?.code;
690
+ const recoverable = recoverableFailure(message, status);
541
691
  const recorded = recordLastError({
542
692
  message,
543
693
  code: envelope?.reason ?? errorCode,
@@ -557,7 +707,11 @@ function renderFailure(error, options) {
557
707
  ...x402PayError?.payment !== void 0 ? { payment: x402PayError.payment } : {},
558
708
  ...x402PayError !== void 0 ? x402FailureFields(x402PayError) : {},
559
709
  ...options?.details ?? {},
560
- ...recorded ? { reportBug: REPORT_BUG_HINT } : {}
710
+ ...recoverable !== void 0 ? {
711
+ code: recoverable.code,
712
+ ...recoverable.required !== void 0 ? { required: recoverable.required } : {},
713
+ next: recoverable.next
714
+ } : recorded ? { reportBug: REPORT_BUG_HINT } : {}
561
715
  }) + "\n"
562
716
  );
563
717
  process.exitCode = 1;
@@ -760,9 +914,9 @@ function bundleEvidence(bundle) {
760
914
  return JSON.stringify({
761
915
  acceptanceStatement: bundle.acceptanceStatement,
762
916
  bundleDigest: bundle.bundleDigest,
763
- documents: bundle.documents.map(({ contentHash, title, type, version: version2 }) => ({
917
+ documents: bundle.documents.map(({ contentHash, title: title2, type, version: version2 }) => ({
764
918
  contentHash,
765
- title,
919
+ title: title2,
766
920
  type,
767
921
  version: version2
768
922
  })),
@@ -833,8 +987,8 @@ var statusCommand = new Command("status").description("Show whether this CLI has
833
987
  bundleVersion: status.bundle.version,
834
988
  enforcementEnabled: status.bundle.enforcementEnabled,
835
989
  status: status.bundle.status,
836
- documents: status.bundle.documents.map(({ title, url, version: version2 }) => ({
837
- title,
990
+ documents: status.bundle.documents.map(({ title: title2, url, version: version2 }) => ({
991
+ title: title2,
838
992
  url,
839
993
  version: version2
840
994
  }))
@@ -7296,15 +7450,15 @@ async function createSolanaSignerFromKeystore(keystore) {
7296
7450
  function signSolanaTransaction(message) {
7297
7451
  return signTransactionMessageWithSigners(message);
7298
7452
  }
7299
- function formatBaseUnits(amount, decimals) {
7300
- const negative = amount < 0n;
7301
- const digits = (negative ? -amount : amount).toString().padStart(decimals + 1, "0");
7453
+ function formatBaseUnits(amount2, decimals) {
7454
+ const negative = amount2 < 0n;
7455
+ const digits = (negative ? -amount2 : amount2).toString().padStart(decimals + 1, "0");
7302
7456
  const whole = digits.slice(0, digits.length - decimals);
7303
7457
  const fraction = digits.slice(digits.length - decimals).replace(/0+$/, "");
7304
7458
  return `${negative ? "-" : ""}${whole}${fraction ? `.${fraction}` : ""}`;
7305
7459
  }
7306
- function parseTokenAmount(amount, decimals) {
7307
- const match = /^(\d+)(?:\.(\d+))?$/.exec(amount.trim());
7460
+ function parseTokenAmount(amount2, decimals) {
7461
+ const match = /^(\d+)(?:\.(\d+))?$/.exec(amount2.trim());
7308
7462
  if (!match) throw new Error("Invalid amount: must be a positive number (e.g. 5)");
7309
7463
  const fraction = match[2] ?? "";
7310
7464
  if (fraction.length > decimals) {
@@ -7444,10 +7598,13 @@ async function signWalletWrite(scope, change) {
7444
7598
 
7445
7599
  // src/lib/tap-enrol.ts
7446
7600
  function verifierEnrolmentMessage(chainId) {
7447
- return `Chain ${chainId} does not use the simulated TAP directory: TAP is off there, or it uses the verifier's directory. Enrolment with the verifier is not available from the CLI yet; the stored key stays unenrolled. To use a key the verifier issued, import it with 'taskmarket tap import --key-id <id> --key-file <path> --force'.`;
7601
+ return `TAP keys cannot be enrolled on chain ${chainId} from the CLI: TAP is off there, or the verifier's registrar is not available. The stored key stays unenrolled. To use a key the verifier issued, import it with 'taskmarket tap import --key-id <id> --key-file <path> --signature-agent <url> --force'.`;
7602
+ }
7603
+ function isNoEnrolmentOnChain(error) {
7604
+ return !/retry/i.test(error.message);
7448
7605
  }
7449
7606
  function explainEnrolFailure(error, chainId) {
7450
- if (error instanceof ApiError && error.envelope?.reason === "verifier_unavailable") {
7607
+ if (error instanceof ApiError && error.envelope?.reason === "verifier_unavailable" && isNoEnrolmentOnChain(error)) {
7451
7608
  return new ApiError(
7452
7609
  error.status,
7453
7610
  verifierEnrolmentMessage(chainId),
@@ -7458,9 +7615,9 @@ function explainEnrolFailure(error, chainId) {
7458
7615
  return error;
7459
7616
  }
7460
7617
  async function enrolTapKey(stored, chainId) {
7461
- if (stored.alg !== "ed25519" && stored.alg !== "ecdsa-p256-sha256") {
7618
+ if (stored.alg !== "ecdsa-p256-sha256") {
7462
7619
  throw new Error(
7463
- `Only an ed25519 or ECDSA P-256 TAP key can be enrolled with the simulated directory, not ${stored.alg}.`
7620
+ `Only an ECDSA P-256 TAP key can be enrolled, not ${stored.alg}. Create one with 'taskmarket tap create --force'.`
7464
7621
  );
7465
7622
  }
7466
7623
  const auth = await signReadAuth();
@@ -7487,13 +7644,17 @@ function withTapEnrolment(stored, enrolment) {
7487
7644
  if (typeof enrolment.keyId !== "string" || typeof enrolment.chainId !== "number") {
7488
7645
  throw new Error(`The enrolment answer has no key id: ${JSON.stringify(enrolment)}`);
7489
7646
  }
7490
- return {
7647
+ const next = {
7491
7648
  ...stored,
7492
7649
  // The key id is quoted into every TAP signature, so it is checked like an imported one.
7493
7650
  keyId: validateTapKeyId(enrolment.keyId),
7494
- chainId: enrolment.chainId,
7495
- simulated: enrolment.simulated
7651
+ chainId: enrolment.chainId
7496
7652
  };
7653
+ delete next.signatureAgent;
7654
+ if (typeof enrolment.signatureAgent === "string") {
7655
+ next.signatureAgent = validateTapSignatureAgent(enrolment.signatureAgent);
7656
+ }
7657
+ return next;
7497
7658
  }
7498
7659
  var TAP_STATUS_MAX_PUBLIC_KEY = 512;
7499
7660
  async function readTapKeyStatus(stored, chainId) {
@@ -7506,8 +7667,7 @@ async function readTapKeyStatus(stored, chainId) {
7506
7667
  chainId: data.chainId,
7507
7668
  resolves: data.resolves,
7508
7669
  trust: data.trust ?? null,
7509
- matches: data.matches,
7510
- simulated: data.simulated
7670
+ matches: data.matches
7511
7671
  };
7512
7672
  }
7513
7673
 
@@ -7625,7 +7785,7 @@ var initCommand = new Command2("init").description(
7625
7785
  "On a machine that already has a wallet, add its Solana wallet (new wallets get one anyway)"
7626
7786
  ).option(
7627
7787
  "--tap",
7628
- "Also create a TAP signing key (ECDSA P-256) and enrol it with the simulated directory where the network's chain uses it; on a machine that already has a wallet, add one. Off unless given."
7788
+ "Also create a TAP signing key (ECDSA P-256) and enrol it with the verifier where the network's chain supports it; on a machine that already has a wallet, add one. Off unless given."
7629
7789
  ).action(async (opts) => {
7630
7790
  if ((opts.solana || opts.tap) && await keystoreExists()) {
7631
7791
  if (opts.solana && opts.tap) {
@@ -7732,19 +7892,114 @@ var initCommand = new Command2("init").description(
7732
7892
  emailAddress,
7733
7893
  ...tapKey ? { tapKey: tapKeySummary(tapKey) } : {}
7734
7894
  },
7735
- { warnings }
7895
+ { warnings, next: nextAfterInit({ address: address3, chainId: selectedNetwork().chainId }) }
7736
7896
  );
7737
7897
  });
7738
7898
 
7739
- // src/commands/address.ts
7899
+ // src/commands/start.ts
7740
7900
  import { Command as Command3 } from "commander";
7741
- var addressCommand = new Command3("address").description("Print the wallet address").action(async () => {
7901
+ var OPEN_WORK_LIMIT = 5;
7902
+ var TITLE_LENGTH = 120;
7903
+ async function settle(read4) {
7904
+ try {
7905
+ return await read4();
7906
+ } catch {
7907
+ return null;
7908
+ }
7909
+ }
7910
+ function amount(baseUnits2, chainId) {
7911
+ try {
7912
+ return formatPaymentAmount(baseUnits2, chainId);
7913
+ } catch {
7914
+ return baseUnits2;
7915
+ }
7916
+ }
7917
+ function title(description) {
7918
+ const firstLine = (description ?? "").split("\n")[0].trim();
7919
+ return firstLine.length > TITLE_LENGTH ? `${firstLine.slice(0, TITLE_LENGTH)}...` : firstLine;
7920
+ }
7921
+ var startCommand = new Command3("start").description(
7922
+ "Start here, at the top of every session: your balance, what is waiting on you, the best-paid open tasks on the selected --network, and in `next` what to run and what to ask your human"
7923
+ ).action(async () => {
7924
+ const auth = await signReadAuth();
7925
+ if (!auth) {
7926
+ printError("No keystore found. Run `taskmarket init` first.");
7927
+ return;
7928
+ }
7929
+ const address3 = auth.walletAddress;
7930
+ const chainId = selectedNetwork().chainId;
7931
+ const [balance, queue, withdrawal, open] = await Promise.all([
7932
+ settle(
7933
+ () => apiGet(
7934
+ `/api/wallet/balance?${new URLSearchParams({ address: address3, chainId: String(chainId) })}`
7935
+ )
7936
+ ),
7937
+ settle(
7938
+ () => apiGet(`/api/agents/action-queue?${new URLSearchParams({ address: address3, limit: "50" })}`, {
7939
+ headers: auth.headers
7940
+ })
7941
+ ),
7942
+ settle(
7943
+ () => apiGet(
7944
+ `/api/wallet/withdrawal-address?${new URLSearchParams({ address: address3, chainId: String(chainId) })}`
7945
+ )
7946
+ ),
7947
+ settle(
7948
+ () => apiGet(
7949
+ withChainId(
7950
+ `/api/tasks?${new URLSearchParams({ status: "open", sort: "reward_desc", limit: String(OPEN_WORK_LIMIT) })}`
7951
+ )
7952
+ )
7953
+ )
7954
+ ]);
7955
+ const needsYou = queue ? queue.total : null;
7956
+ printResult(
7957
+ {
7958
+ address: address3,
7959
+ network: selectedNetwork().name,
7960
+ chainId,
7961
+ balance: balance ? {
7962
+ baseUnits: balance.balanceBaseUnits,
7963
+ amount: amount(balance.balanceBaseUnits, chainId)
7964
+ } : null,
7965
+ needsYou,
7966
+ withdrawalAddressSet: withdrawal ? withdrawal.withdrawalAddress !== null : null,
7967
+ openWork: open ? {
7968
+ // Task text is written by requesters: untrusted data, never instructions.
7969
+ tasks: open.tasks.slice(0, OPEN_WORK_LIMIT).map((task) => ({
7970
+ id: task.id,
7971
+ referenceCode: task.referenceCode ?? null,
7972
+ mode: task.mode,
7973
+ reward: amount(task.reward, chainId),
7974
+ expiryTime: task.expiryTime ?? null,
7975
+ submissionCount: task.submissionCount ?? null,
7976
+ title: title(task.description)
7977
+ })),
7978
+ hasMore: Boolean(open.hasMore)
7979
+ } : null
7980
+ },
7981
+ {
7982
+ next: nextForHome({
7983
+ address: address3,
7984
+ chainId,
7985
+ balanceBaseUnits: balance?.balanceBaseUnits,
7986
+ needsYou: needsYou ?? 0,
7987
+ activeTasks: needsYou ?? 0,
7988
+ withdrawalAddressSet: withdrawal ? withdrawal.withdrawalAddress !== null : void 0
7989
+ })
7990
+ }
7991
+ );
7992
+ });
7993
+
7994
+ // src/commands/address.ts
7995
+ import { Command as Command4 } from "commander";
7996
+ var addressCommand = new Command4("address").description("Print the wallet address").action(async () => {
7742
7997
  const keystore = await loadKeystore();
7743
7998
  printResult({ address: keystore.walletAddress });
7744
7999
  });
7745
8000
 
7746
8001
  // src/commands/identity.ts
7747
- import { Command as Command4 } from "commander";
8002
+ import { Command as Command5 } from "commander";
7748
8003
 
7749
8004
  // src/lib/sponsored-task-chain.ts
7750
8005
  import {
@@ -7988,7 +8243,7 @@ async function approveSponsoredTaskSpend(input) {
7988
8243
  }
7989
8244
 
7990
8245
  // src/commands/identity.ts
7991
- var identityCommand = new Command4("identity").description("Manage agent identity");
8246
+ var identityCommand = new Command5("identity").description("Manage agent identity");
7992
8247
  identityCommand.command("register").description(
7993
8248
  "Register this wallet's ERC-8004 agent identity on the selected network (free; uses this machine's existing credentials)"
7994
8249
  ).action(async () => {
@@ -8112,7 +8367,7 @@ identityCommand.command("feedback").description(
8112
8367
  });
8113
8368
 
8114
8369
  // src/commands/whoami.ts
8115
- import { Command as Command5 } from "commander";
8370
+ import { Command as Command6 } from "commander";
8116
8371
  var NOT_LINKED_YET = "not linked yet (links on your next accept or cancel)";
8117
8372
  var LINK_READ_FAILED_REASON = "Requester links could not be read from the chain right now (RPC error); try again";
8118
8373
  function siblingNetworks(selected) {
@@ -8126,7 +8381,7 @@ function describeReputationLink(link) {
8126
8381
  return `unavailable: ${link.linkUnavailableReason ?? LINK_READ_FAILED_REASON}`;
8127
8382
  return link.linkedAgentId ? `linked to agent #${link.linkedAgentId}` : NOT_LINKED_YET;
8128
8383
  }
8129
- var whoamiCommand = new Command5("whoami").description(
8384
+ var whoamiCommand = new Command6("whoami").description(
8130
8385
  "Show this wallet, its agent ID on each chain and its requester reputation link on the selected --network"
8131
8386
  ).action(async () => {
8132
8387
  const keystore = await loadKeystore();
@@ -8152,7 +8407,7 @@ var whoamiCommand = new Command5("whoami").description(
8152
8407
  });
8153
8408
 
8154
8409
  // src/commands/stats.ts
8155
- import { Command as Command6 } from "commander";
8410
+ import { Command as Command7 } from "commander";
8156
8411
 
8157
8412
  // src/lib/parse-input.ts
8158
8413
  function parseInput(schema, input) {
@@ -8231,7 +8486,7 @@ async function platformView(opts) {
8231
8486
  printResult(await apiGet(withChainId(`/api/stats/agent-time-series?${query(input)}`)));
8232
8487
  return true;
8233
8488
  }
8234
- var statsCommand = new Command6("stats").description("View agent or platform-wide statistics on the selected --network").option("--address <addr>", "Wallet address (defaults to own wallet)").option("--agent <agentId>", "Agent ID (alternative to --address)").option("--platform", "Platform-wide market stats, breakdowns and time series").option("--activity", "Recent platform activity feed").option("--heatmap", "Market activity heat map").option("--series", "An agent's earnings, ratings and activity time series").option("--range <range>", "Time range for --platform, --heatmap, --series: 7d, 30d, 90d or all").option("--bucket <bucket>", "Bucket for --platform and --series: day or week").option("--dimension <dimension>", "Heat map dimension for --heatmap: mode or hourOfWeek").option("--limit <n>", "Items for --activity (1-50)").option("--cursor <cursor>", "nextCursor from a previous --activity page").action(async (opts) => {
8489
+ var statsCommand = new Command7("stats").description("View agent or platform-wide statistics on the selected --network").option("--address <addr>", "Wallet address (defaults to own wallet)").option("--agent <agentId>", "Agent ID (alternative to --address)").option("--platform", "Platform-wide market stats, breakdowns and time series").option("--activity", "Recent platform activity feed").option("--heatmap", "Market activity heat map").option("--series", "An agent's earnings, ratings and activity time series").option("--range <range>", "Time range for --platform, --heatmap, --series: 7d, 30d, 90d or all").option("--bucket <bucket>", "Bucket for --platform and --series: day or week").option("--dimension <dimension>", "Heat map dimension for --heatmap: mode or hourOfWeek").option("--limit <n>", "Items for --activity (1-50)").option("--cursor <cursor>", "nextCursor from a previous --activity page").action(async (opts) => {
8235
8490
  try {
8236
8491
  if (await platformView(opts)) return;
8237
8492
  } catch (err) {
@@ -8303,7 +8558,7 @@ var statsCommand = new Command6("stats").description("View agent or platform-wid
8303
8558
  });
8304
8559
 
8305
8560
  // src/commands/explorer.ts
8306
- import { Command as Command7 } from "commander";
8561
+ import { Command as Command8 } from "commander";
8307
8562
  var RANGES = ["7", "30", "90"];
8308
8563
  var ADDRESS_PATTERN = /^0x[0-9a-fA-F]{40}$/;
8309
8564
  var NODE_LIMIT = 500;
@@ -8319,7 +8574,7 @@ function snapshotPath(windowDays, maxNodes) {
8319
8574
  `/api/ecosystem/snapshot?windowDays=${windowDays}&maxNodes=${maxNodes}&maxLinks=1`
8320
8575
  );
8321
8576
  }
8322
- var eventsCommand = new Command7("events").description("Public market events on the selected --network (the web Explorer feed)").option(
8577
+ var eventsCommand = new Command8("events").description("Public market events on the selected --network (the web Explorer feed)").option(
8323
8578
  "--type <types>",
8324
8579
  `Only these event types, comma separated: ${EcosystemEventTypeEnum.options.join(", ")}`
8325
8580
  ).option("--limit <n>", "Events to read (1-200, default 100)").option("--cursor <cursor>", "cursor from a previous page: return only newer events").option("--newest", "Read newest first and page backwards with nextBefore").option(
@@ -8361,7 +8616,7 @@ var eventsCommand = new Command7("events").description("Public market events on
8361
8616
  renderFailure(err);
8362
8617
  }
8363
8618
  });
8364
- var statsCommand2 = new Command7("stats").description("Market totals and the activity histogram for a 7, 30 or 90 day window").option("--range <days>", `Window in days: ${RANGES.join(", ")} (default 7)`).action(async (opts) => {
8619
+ var statsCommand2 = new Command8("stats").description("Market totals and the activity histogram for a 7, 30 or 90 day window").option("--range <days>", `Window in days: ${RANGES.join(", ")} (default 7)`).action(async (opts) => {
8365
8620
  try {
8366
8621
  const windowDays = parseRange(opts.range, "7");
8367
8622
  const snapshot = await apiGet(snapshotPath(windowDays, 1));
@@ -8377,7 +8632,7 @@ var statsCommand2 = new Command7("stats").description("Market totals and the act
8377
8632
  renderFailure(err);
8378
8633
  }
8379
8634
  });
8380
- var addressCommand2 = new Command7("address").description("One wallet on the selected --network: earnings, completed tasks, rating, events").argument("<address>", "wallet address (0x...)").option("--range <days>", `Window in days: ${RANGES.join(", ")} (default 30)`).action(async (address3, opts) => {
8635
+ var addressCommand2 = new Command8("address").description("One wallet on the selected --network: earnings, completed tasks, rating, events").argument("<address>", "wallet address (0x...)").option("--range <days>", `Window in days: ${RANGES.join(", ")} (default 30)`).action(async (address3, opts) => {
8381
8636
  try {
8382
8637
  if (!ADDRESS_PATTERN.test(address3)) throw new Error("address must be a 0x wallet address");
8383
8638
  const windowDays = parseRange(opts.range, "30");
@@ -8402,10 +8657,10 @@ var addressCommand2 = new Command7("address").description("One wallet on the sel
8402
8657
  renderFailure(err);
8403
8658
  }
8404
8659
  });
8405
- var explorerCommand = new Command7("explorer").description("Read the live market activity log").addCommand(eventsCommand).addCommand(statsCommand2).addCommand(addressCommand2);
8660
+ var explorerCommand = new Command8("explorer").description("Read the live market activity log").addCommand(eventsCommand).addCommand(statsCommand2).addCommand(addressCommand2);
8406
8661
 
8407
8662
  // src/commands/search.ts
8408
- import { Command as Command8 } from "commander";
8663
+ import { Command as Command9 } from "commander";
8409
8664
  var SEARCH_MIN_LENGTH = 2;
8410
8665
  var SEARCH_MAX_LENGTH = 80;
8411
8666
  var SEARCH_GROUP_LIMIT = 5;
@@ -8431,7 +8686,7 @@ function normalizeQuery(raw) {
8431
8686
  }
8432
8687
  return query4;
8433
8688
  }
8434
- var searchCommand = new Command8("search").description(
8689
+ var searchCommand = new Command9("search").description(
8435
8690
  "Search tasks (title or id), agents (agent id or address) and funding projects (name prefix or id) on the selected --network: the web search palette, as JSON. 5 results per group."
8436
8691
  ).argument("<query>", `text to search for (${SEARCH_MIN_LENGTH}-${SEARCH_MAX_LENGTH} characters)`).action(async (raw) => {
8437
8692
  try {
@@ -8476,11 +8731,11 @@ var searchCommand = new Command8("search").description(
8476
8731
  });
8477
8732
 
8478
8733
  // src/commands/task/index.ts
8479
- import { Command as Command55 } from "commander";
8734
+ import { Command as Command56 } from "commander";
8480
8735
 
8481
8736
  // src/commands/task/review.ts
8482
8737
  import { readFile, stat } from "fs/promises";
8483
- import { Command as Command9, Option } from "commander";
8738
+ import { Command as Command10, Option } from "commander";
8484
8739
  import { z as z2 } from "zod";
8485
8740
 
8486
8741
  // src/lib/submission-reviews.ts
@@ -8810,18 +9065,18 @@ function chainOption(flag, role) {
8810
9065
  // src/commands/task/review.ts
8811
9066
  var integer = (value) => z2.coerce.number().int().positive().safe().parse(value);
8812
9067
  var collect = (value, values) => [...values, value];
8813
- var taskCommand = (name, description) => new Command9(name).description(description).argument("<taskId>", "Task ID").option(
9068
+ var taskCommand = (name, description) => new Command10(name).description(description).argument("<taskId>", "Task ID").option(
8814
9069
  "--chain-id <chain>",
8815
9070
  "Require this task chain (name or id)",
8816
9071
  chainOption("--chain-id", "market")
8817
9072
  );
8818
- var runCommand = (name, description) => new Command9(name).description(description).argument("<runId>", "Private review run ID").requiredOption(
9073
+ var runCommand = (name, description) => new Command10(name).description(description).argument("<runId>", "Private review run ID").requiredOption(
8819
9074
  "--chain-id <chain>",
8820
9075
  "Chain recorded on the review run (name or id)",
8821
9076
  chainOption("--chain-id", "market")
8822
9077
  );
8823
9078
  function createReviewCommand() {
8824
- const group = new Command9("review").description(
9079
+ const group = new Command10("review").description(
8825
9080
  "Requester-private advisory brief review and experimental taste scoring; never awards or rejects work"
8826
9081
  );
8827
9082
  group.addCommand(
@@ -8854,7 +9109,7 @@ function createReviewCommand() {
8854
9109
  )
8855
9110
  );
8856
9111
  group.addCommand(
8857
- new Command9("start").description(
9112
+ new Command10("start").description(
8858
9113
  "Sign and start the exact saved preview; obtain a fresh preview if sources changed"
8859
9114
  ).argument("<taskId>", "Task ID").requiredOption("--preview-file <path>", "JSON output from task review preview").action(async (taskId, options) => {
8860
9115
  const info = await stat(options.previewFile);
@@ -8889,7 +9144,7 @@ function createReviewCommand() {
8889
9144
  )
8890
9145
  );
8891
9146
  group.addCommand(
8892
- new Command9("lookup").description("Recover an accepted run by request key without sending the write again").argument("<requestKey>", "Idempotency key from the start result or error").requiredOption(
9147
+ new Command10("lookup").description("Recover an accepted run by request key without sending the write again").argument("<requestKey>", "Idempotency key from the start result or error").requiredOption(
8893
9148
  "--chain-id <chain>",
8894
9149
  "Chain from the saved preview (name or id)",
8895
9150
  chainOption("--chain-id", "market")
@@ -9028,7 +9283,7 @@ function createReviewCommand() {
9028
9283
  var reviewCmd = createReviewCommand();
9029
9284
 
9030
9285
  // src/commands/task/create.ts
9031
- import { Command as Command11 } from "commander";
9286
+ import { Command as Command12 } from "commander";
9032
9287
  import { parseUnits } from "viem";
9033
9288
 
9034
9289
  // src/lib/x402.ts
@@ -9177,21 +9432,6 @@ function parseRequirementFilter(value, schema, flag) {
9177
9432
  }
9178
9433
  return { value: trimmed };
9179
9434
  }
9180
- function tapSimulatedMessage(chainId) {
9181
- return `TAP on chain ${chainId} is simulated: a TAP check there proves only that the worker holds a key it enrolled with Taskmarket, not that the verifier knows it. Passed checks are recorded as tap-simulated. Every simulated key is a known agent, so use tap:identity:known there: a tap:identity:verified requirement is never met.`;
9182
- }
9183
- async function tapSimulatedWarnings(verifiedBy, chainId) {
9184
- if (chainId === void 0 || !verifiedBy?.some((id) => verifierProviderId(id) === "tap"))
9185
- return [];
9186
- try {
9187
- const response = await apiGet("/trpc/network.info");
9188
- const chain = chainInfoFor(response?.result?.data, chainId);
9189
- if (!chain?.tapSimulated) return [];
9190
- } catch {
9191
- return [];
9192
- }
9193
- return [cliWarning("tap_simulated", tapSimulatedMessage(chainId), { chainId })];
9194
- }
9195
9435
 
9196
9436
  // src/lib/hook-registry.ts
9197
9437
  async function fetchHookRegistry(address3) {
@@ -9392,10 +9632,10 @@ var PAYOUT_GATE_ABI = [
9392
9632
  function parseDurationSeconds(raw) {
9393
9633
  const match = /^(\d+(?:\.\d+)?)([smhd]?)$/.exec(raw.trim());
9394
9634
  if (!match) throw new Error(`Invalid duration "${raw}": use e.g. 90m, 48h, 7d or hours`);
9395
- const amount = Number(match[1]);
9635
+ const amount2 = Number(match[1]);
9396
9636
  const unit = match[2] || "h";
9397
9637
  const factor = { s: 1, m: 60, h: 3600, d: 86400 }[unit];
9398
- return Math.round(amount * factor);
9638
+ return Math.round(amount2 * factor);
9399
9639
  }
9400
9640
  function isTaskId(value) {
9401
9641
  return TASK_ID_RE.test(value) && !/^0x0{64}$/.test(value);
@@ -9441,7 +9681,7 @@ function payoutGateStatus(hook, gate) {
9441
9681
  }
9442
9682
 
9443
9683
  // src/commands/task/payout-gate.ts
9444
- import { Command as Command10 } from "commander";
9684
+ import { Command as Command11 } from "commander";
9445
9685
  import { createPublicClient as createPublicClient2, http as http2 } from "viem";
9446
9686
 
9447
9687
  // src/lib/payout-gate-hook.ts
@@ -9573,7 +9813,7 @@ async function readPayoutGate(taskId, options = {}) {
9573
9813
  }
9574
9814
  return null;
9575
9815
  }
9576
- var payoutGateCmd = new Command10("payout-gate").description(
9816
+ var payoutGateCmd = new Command11("payout-gate").description(
9577
9817
  "Show a task's payout gate: its gating task, deadline, and whether the payout may proceed"
9578
9818
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
9579
9819
  try {
@@ -9596,7 +9836,7 @@ function extendGateRelayBody(taskId, deadline) {
9596
9836
  return { taskId, deadline };
9597
9837
  }
9598
9838
  var SETTLED_GATE_MESSAGE = "a gate changes only before accept";
9599
- var linkGateCmd = new Command10("link-gate").description(
9839
+ var linkGateCmd = new Command11("link-gate").description(
9600
9840
  "Link the task whose payout this task's payout gate waits on: once when the gate has none, or to replace a gating task that ended cancelled or expired, once (requester or project operator; relayed by the platform for the standard action fee)"
9601
9841
  ).argument("<taskId>", "The gated task ID (0x-prefixed hex)").requiredOption("--gated-by <taskId>", "The gating task ID (0x-prefixed hex)").action(async (taskId, opts) => {
9602
9842
  try {
@@ -9656,7 +9896,7 @@ function parseGateDeadline(raw, nowSecs) {
9656
9896
  if (/^\d{9,}$/.test(trimmed)) return Number(trimmed);
9657
9897
  return nowSecs + parseDurationSeconds(trimmed);
9658
9898
  }
9659
- var extendGateCmd = new Command10("extend-gate").description(
9899
+ var extendGateCmd = new Command11("extend-gate").description(
9660
9900
  "Move a task's payout gate deadline later (requester or project operator; upward only, at most 180 days after the task was created, only while the gate is closed; relayed by the platform for the standard action fee)"
9661
9901
  ).argument("<taskId>", "The gated task ID (0x-prefixed hex)").requiredOption(
9662
9902
  "--deadline <when>",
@@ -10103,7 +10343,7 @@ function parseHireOptions(opts) {
10103
10343
  }
10104
10344
  return { hire };
10105
10345
  }
10106
- var createCmd = new Command11("create").description("Create a new task (costs the reward, in the payment token)").option(
10346
+ var createCmd = new Command12("create").description("Create a new task (costs the reward, in the payment token)").option(
10107
10347
  "--description <text>",
10108
10348
  "Task description (required unless --template composes it; an explicit value overrides the template)"
10109
10349
  ).option(
@@ -10418,10 +10658,6 @@ async function runCreateTask(input, extra = {}) {
10418
10658
  if ("error" in requirements) {
10419
10659
  return void printError(requirements.error);
10420
10660
  }
10421
- const tapWarnings = await tapSimulatedWarnings(
10422
- requirements.fields.verifiedBy,
10423
- selectedNetwork().chainId
10424
- );
10425
10661
  const metricAndDrop = parseMetricAndDropOptions(opts);
10426
10662
  if ("error" in metricAndDrop) {
10427
10663
  return void printError(metricAndDrop.error);
@@ -10836,7 +11072,7 @@ async function runCreateTask(input, extra = {}) {
10836
11072
  deadline: payoutGate.deadline
10837
11073
  } : null;
10838
11074
  const terms = result.terms ?? resolvedTerms;
10839
- const warnings = [...extra.warnings ?? [], ...tapWarnings, ...hookListings?.warnings ?? []];
11075
+ const warnings = [...extra.warnings ?? [], ...hookListings?.warnings ?? []];
10840
11076
  printResult(
10841
11077
  {
10842
11078
  taskId: result.taskId,
@@ -10861,7 +11097,7 @@ async function runCreateTask(input, extra = {}) {
10861
11097
  }
10862
11098
 
10863
11099
  // src/commands/task/search.ts
10864
- import { Command as Command12 } from "commander";
11100
+ import { Command as Command13 } from "commander";
10865
11101
 
10866
11102
  // src/lib/chain-name.ts
10867
11103
  function chainDisplayName(chainId) {
@@ -10885,7 +11121,7 @@ function withChainNames(value) {
10885
11121
  }
10886
11122
 
10887
11123
  // src/commands/task/search.ts
10888
- var listCmd = new Command12("list").alias("search").description("List available tasks").option(
11124
+ var listCmd = new Command13("list").alias("search").description("List available tasks").option(
10889
11125
  "--status <status>",
10890
11126
  "Filter by status (e.g. open); defaults to open unless --phase is given"
10891
11127
  ).option(
@@ -10953,7 +11189,7 @@ var listCmd = new Command12("list").alias("search").description("List available
10953
11189
  );
10954
11190
 
10955
11191
  // src/commands/task/get.ts
10956
- import { Command as Command13 } from "commander";
11192
+ import { Command as Command14 } from "commander";
10957
11193
  var TASK_CODE_PREFIX = /^TSK-/i;
10958
11194
  function looksLikeTaskCode(value) {
10959
11195
  return TASK_CODE_PREFIX.test(value.trim());
@@ -10967,7 +11203,7 @@ async function resolveTaskCode(code) {
10967
11203
  const match = page.tasks.find((task) => task.referenceCode?.toUpperCase() === code);
10968
11204
  return match?.id ?? null;
10969
11205
  }
10970
- var getCmd = new Command13("get").description(
11206
+ var getCmd = new Command14("get").description(
10971
11207
  "Get task details, by 0x task ID or by TSK- reference code (codes resolve only for listed tasks)"
10972
11208
  ).argument("<taskId>", "Task ID (0x-prefixed hex) or task reference code (TSK-XXXXXXXX)").action(async (taskRef) => {
10973
11209
  let taskId = taskRef;
@@ -11065,7 +11301,7 @@ async function termsAmountsAndDeadlines(taskId) {
11065
11301
  }
11066
11302
 
11067
11303
  // src/commands/task/submit.ts
11068
- import { Command as Command14, Option as Option2 } from "commander";
11304
+ import { Command as Command15, Option as Option2 } from "commander";
11069
11305
 
11070
11306
  // src/lib/stake-confirmation.ts
11071
11307
  async function confirmStakeTerms(action, taskId, yes) {
@@ -11504,7 +11740,7 @@ function checksSummary(run2) {
11504
11740
  function collectFile(value, previous) {
11505
11741
  return [...previous, value];
11506
11742
  }
11507
- var submitCmd = new Command14("submit").description("Submit work for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").option("--file <path>", "Path to a submission file (repeatable)", collectFile, []).addOption(
11743
+ var submitCmd = new Command15("submit").description("Submit work for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").option("--file <path>", "Path to a submission file (repeatable)", collectFile, []).addOption(
11508
11744
  new Option2("--role <role>", "Artifact role applied to all files").choices(["preview", "source", "final", "attachment"]).default("attachment")
11509
11745
  ).option(
11510
11746
  "--accept-unverified-hooks",
@@ -11605,7 +11841,7 @@ var submitCmd = new Command14("submit").description("Submit work for a task").ar
11605
11841
  });
11606
11842
 
11607
11843
  // src/commands/task/accept.ts
11608
- import { Command as Command15 } from "commander";
11844
+ import { Command as Command16 } from "commander";
11609
11845
  function sameAddress(left, right) {
11610
11846
  return left.toLowerCase() === right.toLowerCase();
11611
11847
  }
@@ -11637,7 +11873,7 @@ async function acceptTarget(taskId, opts) {
11637
11873
  const latest = (submissions ?? []).filter((submission) => sameAddress(submission.workerAddress, worker) && !submission.rejectedAt).sort(compareSubmissionVersionsNewestFirst)[0];
11638
11874
  return latest ? { submissionId: latest.id, worker } : { worker };
11639
11875
  }
11640
- var acceptCmd = new Command15("accept").description(
11876
+ var acceptCmd = new Command16("accept").description(
11641
11877
  "Accept a submission (costs 0.001 in the payment token). The accepted submission is recorded as the winning submission; with --worker alone it is that worker's latest active submission."
11642
11878
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").option("--worker <addr>", "Worker wallet address (optional with --submission; must match it)").option(
11643
11879
  "--submission <id>",
@@ -11694,7 +11930,7 @@ var acceptCmd = new Command15("accept").description(
11694
11930
  });
11695
11931
 
11696
11932
  // src/commands/task/accept-submissions.ts
11697
- import { Command as Command16 } from "commander";
11933
+ import { Command as Command17 } from "commander";
11698
11934
  function parseWinner(spec) {
11699
11935
  const parts = spec.split(":");
11700
11936
  if (parts.length < 2 || parts.length > 3) {
@@ -11713,7 +11949,7 @@ function parseWinner(spec) {
11713
11949
  const submissionId = submissionIdStr ? submissionIdStr : void 0;
11714
11950
  return { worker, share, ...submissionId !== void 0 && { submissionId } };
11715
11951
  }
11716
- var acceptSubmissionsCmd = new Command16("accept-submissions").description(
11952
+ var acceptSubmissionsCmd = new Command17("accept-submissions").description(
11717
11953
  "Accept N submissions for a Bounty/Benchmark task with explicit share basis points (costs 0.001 in the payment token).\nShares must sum to 10000. The contract resolves each deliverable from onchain submission history.\n\nFor ranked payouts, pass winners in rank order \u2014 workers[0] is the primary winner.\n\nTo pin a specific submission version, append the submission ID as a third field.\n\nExamples:\n task accept-submissions 0x\u2026 --winner 0xAlice:5000 --winner 0xBob:3000 --winner 0xCarol:2000\n task accept-submissions 0x\u2026 --winner 0xAlice:5000:sub_abc123 --winner 0xBob:5000:sub_def456"
11718
11954
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption(
11719
11955
  "--winner <spec...>",
@@ -11747,8 +11983,8 @@ var acceptSubmissionsCmd = new Command16("accept-submissions").description(
11747
11983
  });
11748
11984
 
11749
11985
  // src/commands/task/rate.ts
11750
- import { Command as Command17 } from "commander";
11751
- var rateCmd = new Command17("rate").description("Rate a worker (costs 0.001 in the payment token)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--worker <addr>", "Worker wallet address").requiredOption("--rating <n>", "Rating 0-100").option("--feedback <text>", "Optional feedback text").action(async (taskId, opts) => {
11986
+ import { Command as Command18 } from "commander";
11987
+ var rateCmd = new Command18("rate").description("Rate a worker (costs 0.001 in the payment token)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--worker <addr>", "Worker wallet address").requiredOption("--rating <n>", "Rating 0-100").option("--feedback <text>", "Optional feedback text").action(async (taskId, opts) => {
11752
11988
  const rating = parseInt(opts.rating, 10);
11753
11989
  if (rating < 0 || rating > 100) {
11754
11990
  printError("Rating must be between 0 and 100");
@@ -11771,13 +12007,13 @@ var rateCmd = new Command17("rate").description("Rate a worker (costs 0.001 in t
11771
12007
  });
11772
12008
 
11773
12009
  // src/commands/task/claim.ts
11774
- import { Command as Command20 } from "commander";
12010
+ import { Command as Command21 } from "commander";
11775
12011
 
11776
12012
  // src/commands/hires.ts
11777
- import { Command as Command19 } from "commander";
12013
+ import { Command as Command20 } from "commander";
11778
12014
 
11779
12015
  // src/lib/settlement-action.ts
11780
- import { Command as Command18 } from "commander";
12016
+ import { Command as Command19 } from "commander";
11781
12017
  async function readTerms(taskId) {
11782
12018
  try {
11783
12019
  return await getTaskTerms(cliTaskReadContext(), { taskId });
@@ -11821,7 +12057,7 @@ async function confirmSettlementAction(name, confirm2, taskId, yes) {
11821
12057
  return false;
11822
12058
  }
11823
12059
  function settlementActionCommand(spec) {
11824
- const command = new Command18(spec.name).description(spec.description).argument("<taskId>", "Task ID (0x-prefixed hex)");
12060
+ const command = new Command19(spec.name).description(spec.description).argument("<taskId>", "Task ID (0x-prefixed hex)");
11825
12061
  if (spec.confirm === "release-cost") {
11826
12062
  command.option("--yes", "Accept the stake forfeited by releasing now (releaseCostNow)");
11827
12063
  } else if (spec.confirm === "always") {
@@ -11934,7 +12170,7 @@ function parseTab(value) {
11934
12170
  const tab = value === "review" ? "in_review" : value;
11935
12171
  return HIRE_TABS.includes(tab) ? tab : null;
11936
12172
  }
11937
- var listCmd2 = new Command19("list").description(
12173
+ var listCmd2 = new Command20("list").description(
11938
12174
  "List hires: offers made to you (--role worker, the default) or hires you made, including quotes and requests (--role requester). Signed, so your private hires are included."
11939
12175
  ).option("--role <role>", `Whose hires: ${ROLES.join(" or ")}`, "worker").option("--state <state>", `Filter by hire state: ${HireState.options.join(", ")}`).option(
11940
12176
  "--tab <tab>",
@@ -11976,7 +12212,7 @@ var listCmd2 = new Command19("list").description(
11976
12212
  }
11977
12213
  }
11978
12214
  );
11979
- var acceptCmd2 = new Command19("accept").description(
12215
+ var acceptCmd2 = new Command20("accept").description(
11980
12216
  "Accept a hire offer made to you: claims the task on its terms (hired worker only, before the accept-by time)"
11981
12217
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").option("--yes", "Accept the task's settlement terms, including paying any required stake").action(async (taskId, opts) => {
11982
12218
  try {
@@ -12016,10 +12252,10 @@ var declineCmd = settlementActionCommand({
12016
12252
  return hireAnswerError(task, keystore.walletAddress, "decline");
12017
12253
  }
12018
12254
  });
12019
- var hiresCommand = new Command19("hires").description("Hire offers made to you, and hires you made: list, accept, decline").addCommand(listCmd2).addCommand(acceptCmd2).addCommand(declineCmd);
12255
+ var hiresCommand = new Command20("hires").description("Hire offers made to you, and hires you made: list, accept, decline").addCommand(listCmd2).addCommand(acceptCmd2).addCommand(declineCmd);
12020
12256
 
12021
12257
  // src/commands/task/claim.ts
12022
- var claimCmd = new Command20("claim").description("Claim a task as a worker").argument("<taskId>", "Task ID (0x-prefixed hex)").option("--yes", "Accept the task's settlement terms, including paying any required stake").option(
12258
+ var claimCmd = new Command21("claim").description("Claim a task as a worker").argument("<taskId>", "Task ID (0x-prefixed hex)").option("--yes", "Accept the task's settlement terms, including paying any required stake").option(
12023
12259
  "--accept-unverified-hooks",
12024
12260
  "Proceed although the task has a hook the hook registry does not list (it can refuse every submission)"
12025
12261
  ).action(async (taskId, opts) => {
@@ -12043,8 +12279,8 @@ var claimCmd = new Command20("claim").description("Claim a task as a worker").ar
12043
12279
  });
12044
12280
 
12045
12281
  // src/commands/task/pitch.ts
12046
- import { Command as Command21 } from "commander";
12047
- var pitchCmd = new Command21("pitch").description("Submit a pitch for a task (costs 0.001 in the payment token, anchors hash onchain)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--text <text>", "Pitch text").option("--duration <hours>", "Estimated duration in hours").option("--yes", "Accept the task's settlement terms, including any required stake").option(
12282
+ import { Command as Command22 } from "commander";
12283
+ var pitchCmd = new Command22("pitch").description("Submit a pitch for a task (costs 0.001 in the payment token, anchors hash onchain)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--text <text>", "Pitch text").option("--duration <hours>", "Estimated duration in hours").option("--yes", "Accept the task's settlement terms, including any required stake").option(
12048
12284
  "--accept-unverified-hooks",
12049
12285
  "Proceed although the task has a hook the hook registry does not list (it can refuse every submission)"
12050
12286
  ).action(
@@ -12077,8 +12313,8 @@ var pitchCmd = new Command21("pitch").description("Submit a pitch for a task (co
12077
12313
  );
12078
12314
 
12079
12315
  // src/commands/task/pitches.ts
12080
- import { Command as Command22 } from "commander";
12081
- var pitchesCmd = new Command22("pitches").description("List pitches for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").option("--limit <n>", "Page size (1-500; default 500)").option("--cursor <id>", "Last returned id; read the following page").action(async (taskId, opts) => {
12316
+ import { Command as Command23 } from "commander";
12317
+ var pitchesCmd = new Command23("pitches").description("List pitches for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").option("--limit <n>", "Page size (1-500; default 500)").option("--cursor <id>", "Last returned id; read the following page").action(async (taskId, opts) => {
12082
12318
  try {
12083
12319
  const page = TaskChildListSchema.parse({ taskId, ...opts });
12084
12320
  const params = new URLSearchParams({ limit: String(page.limit) });
@@ -12092,8 +12328,8 @@ var pitchesCmd = new Command22("pitches").description("List pitches for a task")
12092
12328
  });
12093
12329
 
12094
12330
  // src/commands/task/select-worker.ts
12095
- import { Command as Command23 } from "commander";
12096
- var selectWorkerCmd = new Command23("select-worker").description(
12331
+ import { Command as Command24 } from "commander";
12332
+ var selectWorkerCmd = new Command24("select-worker").description(
12097
12333
  "Select a worker from pitches (requester only). Refused for a worker whose listing is at capacity (fully booked)."
12098
12334
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--pitch <pitchId>", "Pitch ID to select").requiredOption("--worker <address>", "Worker wallet address to assign").action(async (taskId, opts) => {
12099
12335
  const atCapacity = await hireSelectCapacityError(opts.worker);
@@ -12122,8 +12358,8 @@ var selectWorkerCmd = new Command23("select-worker").description(
12122
12358
  });
12123
12359
 
12124
12360
  // src/commands/task/proof.ts
12125
- import { Command as Command24 } from "commander";
12126
- var proofCmd = new Command24("proof").description("Submit a benchmark proof (costs 0.001 in the payment token, anchors hash onchain)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--data <data>", "Proof data").requiredOption("--type <type>", "Proof type").option("--metric <val>", "Metric value").action(async (taskId, opts) => {
12361
+ import { Command as Command25 } from "commander";
12362
+ var proofCmd = new Command25("proof").description("Submit a benchmark proof (costs 0.001 in the payment token, anchors hash onchain)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--data <data>", "Proof data").requiredOption("--type <type>", "Proof type").option("--metric <val>", "Metric value").action(async (taskId, opts) => {
12127
12363
  const keystore = await loadKeystore();
12128
12364
  const signature = await signMessage(buildProofMessage(taskId), keystore);
12129
12365
  const { data: result, idempotencyKey } = await attestedWorkerAction(
@@ -12147,8 +12383,8 @@ var proofCmd = new Command24("proof").description("Submit a benchmark proof (cos
12147
12383
  });
12148
12384
 
12149
12385
  // src/commands/task/proofs.ts
12150
- import { Command as Command25 } from "commander";
12151
- var proofsCmd = new Command25("proofs").description("List proofs for a benchmark task").argument("<taskId>", "Task ID (0x-prefixed hex)").option("--limit <n>", "Page size (1-500; default 500)").option("--cursor <id>", "Last returned id; read the following page").action(async (taskId, opts) => {
12386
+ import { Command as Command26 } from "commander";
12387
+ var proofsCmd = new Command26("proofs").description("List proofs for a benchmark task").argument("<taskId>", "Task ID (0x-prefixed hex)").option("--limit <n>", "Page size (1-500; default 500)").option("--cursor <id>", "Last returned id; read the following page").action(async (taskId, opts) => {
12152
12388
  try {
12153
12389
  const page = TaskChildListSchema.parse({ taskId, ...opts });
12154
12390
  const params = new URLSearchParams({ limit: String(page.limit) });
@@ -12162,8 +12398,8 @@ var proofsCmd = new Command25("proofs").description("List proofs for a benchmark
12162
12398
  });
12163
12399
 
12164
12400
  // src/commands/task/bid.ts
12165
- import { Command as Command26 } from "commander";
12166
- var bidCmd = new Command26("bid").description("Submit a bid on an auction task").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--price <amount>", "Bid price in the payment token (e.g. 3 or 1.5)").option("--yes", "Accept the task's settlement terms, including any required stake").option(
12401
+ import { Command as Command27 } from "commander";
12402
+ var bidCmd = new Command27("bid").description("Submit a bid on an auction task").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--price <amount>", "Bid price in the payment token (e.g. 3 or 1.5)").option("--yes", "Accept the task's settlement terms, including any required stake").option(
12167
12403
  "--accept-unverified-hooks",
12168
12404
  "Proceed although the task has a hook the hook registry does not list (it can refuse every submission)"
12169
12405
  ).action(
@@ -12199,8 +12435,8 @@ var bidCmd = new Command26("bid").description("Submit a bid on an auction task")
12199
12435
  );
12200
12436
 
12201
12437
  // src/commands/task/auction-accept.ts
12202
- import { Command as Command27 } from "commander";
12203
- var auctionAcceptCmd = new Command27("auction-accept").description("Accept current clock price on a dutch or reverse_dutch auction task").argument("<taskId>", "Task ID (0x-prefixed hex)").option(
12438
+ import { Command as Command28 } from "commander";
12439
+ var auctionAcceptCmd = new Command28("auction-accept").description("Accept current clock price on a dutch or reverse_dutch auction task").argument("<taskId>", "Task ID (0x-prefixed hex)").option(
12204
12440
  "--min-price <amount>",
12205
12441
  "Reject if current clock price is below this value (price floor guard)"
12206
12442
  ).action(async (taskId, opts) => {
@@ -12242,7 +12478,7 @@ var auctionAcceptCmd = new Command27("auction-accept").description("Accept curre
12242
12478
  });
12243
12479
 
12244
12480
  // src/commands/task/submissions.ts
12245
- import { Command as Command28 } from "commander";
12481
+ import { Command as Command29 } from "commander";
12246
12482
  import { z as z3 } from "zod";
12247
12483
  var SubmissionPageSchema = TaskChildListSchema.pick({ cursor: true }).extend({
12248
12484
  limit: TaskChildListSchema.shape.limit.removeDefault().optional(),
@@ -12250,7 +12486,7 @@ var SubmissionPageSchema = TaskChildListSchema.pick({ cursor: true }).extend({
12250
12486
  (value) => value.split(",").map((id) => id.trim()).filter(Boolean)
12251
12487
  ).pipe(z3.array(z3.string().uuid().toLowerCase()).min(1).max(50)).optional()
12252
12488
  });
12253
- var submissionsCmd = new Command28("submissions").description("List submissions for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").option(
12489
+ var submissionsCmd = new Command29("submissions").description("List submissions for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").option(
12254
12490
  "--passed-check <provider>",
12255
12491
  "Only submissions whose worker passed this check when submitting: erc8004:identity:registered, erc8004:reputation:reputable, tap:identity:known or tap:identity:verified"
12256
12492
  ).option("--limit <n>", "Page size (1-500); without it every submission is listed").option("--cursor <id>", "Last returned id; read the following page").option("--ids <ids>", "Only these submissions: comma-separated ids (at most 50)").action(
@@ -12288,8 +12524,8 @@ var submissionsCmd = new Command28("submissions").description("List submissions
12288
12524
  );
12289
12525
 
12290
12526
  // src/commands/task/claims.ts
12291
- import { Command as Command29 } from "commander";
12292
- var claimsCmd = new Command29("claims").description("Show a Claim task's claim, with the checks its worker passed").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
12527
+ import { Command as Command30 } from "commander";
12528
+ var claimsCmd = new Command30("claims").description("Show a Claim task's claim, with the checks its worker passed").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
12293
12529
  try {
12294
12530
  const auth = await signReadAuth();
12295
12531
  const headers = { ...auth?.headers ?? {}, ...await taskAccessGrantHeaders(taskId) };
@@ -12300,8 +12536,8 @@ var claimsCmd = new Command29("claims").description("Show a Claim task's claim,
12300
12536
  });
12301
12537
 
12302
12538
  // src/commands/task/bids.ts
12303
- import { Command as Command30 } from "commander";
12304
- var bidsCmd = new Command30("bids").description("List an auction task's bids, with the checks each bidder passed").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
12539
+ import { Command as Command31 } from "commander";
12540
+ var bidsCmd = new Command31("bids").description("List an auction task's bids, with the checks each bidder passed").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
12305
12541
  try {
12306
12542
  const auth = await signReadAuth();
12307
12543
  const headers = { ...auth?.headers ?? {}, ...await taskAccessGrantHeaders(taskId) };
@@ -12312,8 +12548,8 @@ var bidsCmd = new Command30("bids").description("List an auction task's bids, wi
12312
12548
  });
12313
12549
 
12314
12550
  // src/commands/task/select-winner.ts
12315
- import { Command as Command31 } from "commander";
12316
- var selectWinnerCmd = new Command31("select-winner").description("Permissionlessly finalize the lowest bidder after the auction deadline").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
12551
+ import { Command as Command32 } from "commander";
12552
+ var selectWinnerCmd = new Command32("select-winner").description("Permissionlessly finalize the lowest bidder after the auction deadline").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
12317
12553
  let result;
12318
12554
  let idempotencyKey;
12319
12555
  try {
@@ -12329,8 +12565,8 @@ var selectWinnerCmd = new Command31("select-winner").description("Permissionless
12329
12565
  });
12330
12566
 
12331
12567
  // src/commands/task/start-review.ts
12332
- import { Command as Command32 } from "commander";
12333
- var startReviewCmd = new Command32("start-review").description(
12568
+ import { Command as Command33 } from "commander";
12569
+ var startReviewCmd = new Command33("start-review").description(
12334
12570
  "Start the review window on a delivery made before the settlement-terms upgrade that has none yet (anyone may call). Once the window lapses undecided, `task settle` pays the worker."
12335
12571
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
12336
12572
  try {
@@ -12348,9 +12584,9 @@ var startReviewCmd = new Command32("start-review").description(
12348
12584
  });
12349
12585
 
12350
12586
  // src/commands/task/download.ts
12351
- import { Command as Command33 } from "commander";
12587
+ import { Command as Command34 } from "commander";
12352
12588
  import { writeFileSync } from "fs";
12353
- var downloadCmd = new Command33("download").description("Download a submission file (requester or worker)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--submission <id>", "Submission ID (from `task submissions`)").option("--artifact <id>", "Artifact ID for multi-artifact submissions").option("--output <path>", "Save to a file instead of returning the text as `content`").action(
12589
+ var downloadCmd = new Command34("download").description("Download a submission file (requester or worker)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--submission <id>", "Submission ID (from `task submissions`)").option("--artifact <id>", "Artifact ID for multi-artifact submissions").option("--output <path>", "Save to a file instead of returning the text as `content`").action(
12354
12590
  async (taskId, opts) => {
12355
12591
  const keystore = await loadKeystore();
12356
12592
  let presignedUrl;
@@ -12398,7 +12634,7 @@ var downloadCmd = new Command33("download").description("Download a submission f
12398
12634
  );
12399
12635
 
12400
12636
  // src/commands/task/cancel.ts
12401
- import { Command as Command34 } from "commander";
12637
+ import { Command as Command35 } from "commander";
12402
12638
 
12403
12639
  // src/lib/decision-window.ts
12404
12640
  var DECISION_WINDOW_LAPSED_CODE = "decision_window_lapsed";
@@ -12430,7 +12666,7 @@ function renderDecisionWindowLapsed(action, lapse) {
12430
12666
  }
12431
12667
 
12432
12668
  // src/commands/task/cancel.ts
12433
- var cancelCmd = new Command34("cancel").description(
12669
+ var cancelCmd = new Command35("cancel").description(
12434
12670
  "Cancel an open task and refund the escrowed reward (costs 0.001 in the payment token)"
12435
12671
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
12436
12672
  const lapse = await decisionWindowLapse(taskId, { requireLiveSubmissions: true });
@@ -12450,8 +12686,8 @@ var cancelCmd = new Command34("cancel").description(
12450
12686
  });
12451
12687
 
12452
12688
  // src/commands/task/refund-expired.ts
12453
- import { Command as Command35 } from "commander";
12454
- var refundExpiredCmd = new Command35("refund-expired").description(
12689
+ import { Command as Command36 } from "commander";
12690
+ var refundExpiredCmd = new Command36("refund-expired").description(
12455
12691
  "Refund an expired task back to the requester; bounty and benchmark tasks need every submission rejected first (costs 0.001 in the payment token)"
12456
12692
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
12457
12693
  const lapse = await decisionWindowLapse(taskId, { requireLiveSubmissions: true });
@@ -12475,7 +12711,7 @@ var refundExpiredCmd = new Command35("refund-expired").description(
12475
12711
  });
12476
12712
 
12477
12713
  // src/commands/task/requester-timeout.ts
12478
- import { Command as Command36 } from "commander";
12714
+ import { Command as Command37 } from "commander";
12479
12715
 
12480
12716
  // src/lib/requester-timeout.ts
12481
12717
  var REQUESTER_TIMEOUT_REFUSED_CODE = "requester_timeout_refused";
@@ -12508,7 +12744,7 @@ function renderRequesterTimeoutRefused(reason) {
12508
12744
  }
12509
12745
 
12510
12746
  // src/commands/task/requester-timeout.ts
12511
- var requesterTimeoutCmd = new Command36("requester-timeout").description(
12747
+ var requesterTimeoutCmd = new Command37("requester-timeout").description(
12512
12748
  "End a bounty or benchmark whose requester left live submissions undecided past the decision deadline; refunds the escrow to the requester (anyone; costs 0.001 in the payment token)"
12513
12749
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
12514
12750
  const blocker = await requesterTimeoutBlocker(taskId);
@@ -12532,8 +12768,8 @@ var requesterTimeoutCmd = new Command36("requester-timeout").description(
12532
12768
  });
12533
12769
 
12534
12770
  // src/commands/task/reject-submission.ts
12535
- import { Command as Command37 } from "commander";
12536
- var rejectSubmissionCmd = new Command37("reject-submission").description(
12771
+ import { Command as Command38 } from "commander";
12772
+ var rejectSubmissionCmd = new Command38("reject-submission").description(
12537
12773
  "Reject a spam or low-quality submission (costs a 0.001 relay fee in the payment token). Once all submissions are rejected, the task can be cancelled to recover escrow."
12538
12774
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--worker <address>", "Worker address whose submission to reject").action(async (taskId, opts) => {
12539
12775
  const lapse = await decisionWindowLapse(taskId, { requireLiveSubmissions: false });
@@ -12560,7 +12796,7 @@ var rejectSubmissionCmd = new Command37("reject-submission").description(
12560
12796
  });
12561
12797
 
12562
12798
  // src/commands/task/reject-all-submissions.ts
12563
- import { Command as Command38 } from "commander";
12799
+ import { Command as Command39 } from "commander";
12564
12800
  function activeSubmissionWorkers(submissions) {
12565
12801
  const workers = /* @__PURE__ */ new Map();
12566
12802
  for (const submission of submissions) {
@@ -12570,7 +12806,7 @@ function activeSubmissionWorkers(submissions) {
12570
12806
  }
12571
12807
  return [...workers.values()];
12572
12808
  }
12573
- var rejectAllSubmissionsCmd = new Command38("reject-all-submissions").description(
12809
+ var rejectAllSubmissionsCmd = new Command39("reject-all-submissions").description(
12574
12810
  "Reject every active submission on a bounty or benchmark task in one go. Lists active submissions, rejects each unique worker in sequence, then cancels the task. Use this to recover escrow when all submitted work is unsuitable."
12575
12811
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").option("--no-cancel", "Reject all submissions but do not cancel the task afterward").action(async (taskId, opts) => {
12576
12812
  let submissions;
@@ -12650,8 +12886,8 @@ var rejectAllSubmissionsCmd = new Command38("reject-all-submissions").descriptio
12650
12886
  });
12651
12887
 
12652
12888
  // src/commands/task/my-submissions.ts
12653
- import { Command as Command39 } from "commander";
12654
- var mySubmissionsCmd = new Command39("my-submissions").description("List all submissions made by your wallet across all tasks.").option("--address <address>", "Wallet address to query (defaults to own wallet from keystore)").action(async (opts) => {
12889
+ import { Command as Command40 } from "commander";
12890
+ var mySubmissionsCmd = new Command40("my-submissions").description("List all submissions made by your wallet across all tasks.").option("--address <address>", "Wallet address to query (defaults to own wallet from keystore)").action(async (opts) => {
12655
12891
  try {
12656
12892
  const result = await listWorkerSubmissions(cliTaskReadContext(), { address: opts.address });
12657
12893
  printResult(withChainNames(result));
@@ -12663,7 +12899,7 @@ var mySubmissionsCmd = new Command39("my-submissions").description("List all sub
12663
12899
  });
12664
12900
 
12665
12901
  // src/commands/task/update.ts
12666
- import { Command as Command40 } from "commander";
12902
+ import { Command as Command41 } from "commander";
12667
12903
  function pendingHireUpdateError(task, taskId, nowMs = Date.now()) {
12668
12904
  const hire = task.hire;
12669
12905
  if (task.status !== "open" || hire?.kind !== "reserved" || hire.state !== "offered" || !hire.acceptBy || Date.parse(hire.acceptBy) < nowMs) {
@@ -12674,15 +12910,15 @@ function pendingHireUpdateError(task, taskId, nowMs = Date.now()) {
12674
12910
  function projectIdOf(task) {
12675
12911
  return typeof task.projectId === "number" ? task.projectId : null;
12676
12912
  }
12677
- function projectTopUp(projectId, amount, kind) {
12913
+ function projectTopUp(projectId, amount2, kind) {
12678
12914
  return {
12679
12915
  projectId,
12680
- amount: amount.toString(),
12916
+ amount: amount2.toString(),
12681
12917
  fundedFrom: "project_budget",
12682
- note: `The ${kind} of ${amount} base units was drawn from project ${projectId}'s budget; you paid only the action fee.`
12918
+ note: `The ${kind} of ${amount2} base units was drawn from project ${projectId}'s budget; you paid only the action fee.`
12683
12919
  };
12684
12920
  }
12685
- var updateCmd = new Command40("update").description(
12921
+ var updateCmd = new Command41("update").description(
12686
12922
  "Update an open task (costs 0.001 plus any reward increase, in the payment token; on a project task the increase comes from the project's budget and only the 0.001 is paid)"
12687
12923
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").option("--reward <amount>", 'New reward in the payment token (human units, e.g. "50")').option("--extend-expiry <seconds>", "Extend expiry by this many seconds").option("--bid-deadline <iso>", "New bid deadline (ISO 8601)").option("--pitch-deadline <iso>", "New pitch deadline (ISO 8601)").option("--auction-floor-price <amount>", "New auction floor price in the payment token").option("--auction-start-price <amount>", "New auction start price in the payment token").option("--description <text>", "New description").option("--tags <csv>", "New tags (comma-separated)").option("--metric-description <text>", "New metric description").option(
12688
12924
  "--require-identity <protocols>",
@@ -12784,10 +13020,6 @@ var updateCmd = new Command40("update").description(
12784
13020
  return;
12785
13021
  }
12786
13022
  Object.assign(body, requirements.fields);
12787
- const warnings = await tapSimulatedWarnings(
12788
- requirements.fields.verifiedBy,
12789
- typeof task.chainId === "number" ? task.chainId : void 0
12790
- );
12791
13023
  const projectId = projectIdOf(task);
12792
13024
  const increase = body.reward === void 0 || projectId === null ? 0n : BigInt(String(body.reward)) - BigInt(String(task.reward));
12793
13025
  const { data: result, idempotencyKey } = await x402Post(
@@ -12801,14 +13033,14 @@ var updateCmd = new Command40("update").description(
12801
13033
  );
12802
13034
  printResult(
12803
13035
  projectId !== null && increase > 0n ? { ...result, projectTopUp: projectTopUp(projectId, increase, "reward increase") } : result,
12804
- { idempotencyKey, ...warnings.length > 0 ? { warnings } : {} }
13036
+ { idempotencyKey }
12805
13037
  );
12806
13038
  }
12807
13039
  );
12808
13040
 
12809
13041
  // src/commands/task/forfeit.ts
12810
- import { Command as Command41 } from "commander";
12811
- var forfeitCmd = new Command41("forfeit").description("Reclaim a claim-mode task whose worker's claim has expired (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
13042
+ import { Command as Command42 } from "commander";
13043
+ var forfeitCmd = new Command42("forfeit").description("Reclaim a claim-mode task whose worker's claim has expired (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
12812
13044
  try {
12813
13045
  const keystore = await loadKeystore();
12814
13046
  const message = buildForfeitMessage(taskId);
@@ -12831,7 +13063,7 @@ var forfeitCmd = new Command41("forfeit").description("Reclaim a claim-mode task
12831
13063
  });
12832
13064
 
12833
13065
  // src/commands/task/assign-evaluator.ts
12834
- import { Command as Command42 } from "commander";
13066
+ import { Command as Command43 } from "commander";
12835
13067
  var ADDRESS_PATTERN3 = /^0x[0-9a-fA-F]{40}$/;
12836
13068
  async function projectIdOfTask(taskId) {
12837
13069
  try {
@@ -12842,7 +13074,7 @@ async function projectIdOfTask(taskId) {
12842
13074
  return null;
12843
13075
  }
12844
13076
  }
12845
- var assignEvaluatorCmd = new Command42("assign-evaluator").description(
13077
+ var assignEvaluatorCmd = new Command43("assign-evaluator").description(
12846
13078
  "Assign an evaluator to an open, unclaimed task you requested (costs 0.001 in the payment token). Only possible before a worker claims the task."
12847
13079
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").option("--evaluator <address>", "Evaluator wallet address").option(
12848
13080
  "--evaluator-from-listing <address>",
@@ -12939,8 +13171,8 @@ var assignEvaluatorCmd = new Command42("assign-evaluator").description(
12939
13171
  );
12940
13172
 
12941
13173
  // src/commands/task/evaluate.ts
12942
- import { Command as Command43 } from "commander";
12943
- var evaluateCmd = new Command43("evaluate").description("Submit an evaluation verdict for a task in Review state").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--verdict <type>", "Verdict: approve, reject, or partial").option("--score <n>", "Score 0-1000 (default: 1000)", "1000").option("--confidence <n>", "Confidence 0-1000 (default: 1000)", "1000").option("--evidence-hash <hash>", "Evidence hash (32-byte hex)").option(
13174
+ import { Command as Command44 } from "commander";
13175
+ var evaluateCmd = new Command44("evaluate").description("Submit an evaluation verdict for a task in Review state").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--verdict <type>", "Verdict: approve, reject, or partial").option("--score <n>", "Score 0-1000 (default: 1000)", "1000").option("--confidence <n>", "Confidence 0-1000 (default: 1000)", "1000").option("--evidence-hash <hash>", "Evidence hash (32-byte hex)").option(
12944
13176
  "--award <worker:amount:rank>",
12945
13177
  "Award entry (repeatable): worker:amount:rank",
12946
13178
  collect2,
@@ -12957,7 +13189,7 @@ var evaluateCmd = new Command43("evaluate").description("Submit an evaluation ve
12957
13189
  if (parts.length < 3 || !parts[0] || !parts[1] || !parts[2]) {
12958
13190
  return void printError(`Invalid award format '${entry}'. Expected worker:amount:rank`);
12959
13191
  }
12960
- const [worker, amount, rankStr] = parts;
13192
+ const [worker, amount2, rankStr] = parts;
12961
13193
  if (!/^0x[0-9a-fA-F]{40}$/.test(worker)) {
12962
13194
  return void printError(
12963
13195
  `Invalid worker address in '${entry}': must be 0x-prefixed 40-char hex`
@@ -12965,7 +13197,7 @@ var evaluateCmd = new Command43("evaluate").description("Submit an evaluation ve
12965
13197
  }
12966
13198
  let microUnits;
12967
13199
  try {
12968
- microUnits = usdcToBaseUnits(amount);
13200
+ microUnits = usdcToBaseUnits(amount2);
12969
13201
  } catch (err) {
12970
13202
  renderFailure(withErrorContext(err, `Invalid amount in '${entry}'`));
12971
13203
  return;
@@ -13007,8 +13239,8 @@ function collect2(val, prev) {
13007
13239
  }
13008
13240
 
13009
13241
  // src/commands/task/appeal.ts
13010
- import { Command as Command44 } from "commander";
13011
- var appealCmd = new Command44("appeal").description("Appeal an evaluator verdict while in Appealing state").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
13242
+ import { Command as Command45 } from "commander";
13243
+ var appealCmd = new Command45("appeal").description("Appeal an evaluator verdict while in Appealing state").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
13012
13244
  const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/appeal`, { taskId }, { maxAmount: ACTION_FEE_MAX_AMOUNT });
13013
13245
  printResult(
13014
13246
  { txHash: result.txHash, ...await settleRecording(result, idempotencyKey) },
@@ -13017,8 +13249,8 @@ var appealCmd = new Command44("appeal").description("Appeal an evaluator verdict
13017
13249
  });
13018
13250
 
13019
13251
  // src/commands/task/evaluator-timeout.ts
13020
- import { Command as Command45 } from "commander";
13021
- var evaluatorTimeoutCmd = new Command45("evaluator-timeout").description(
13252
+ import { Command as Command46 } from "commander";
13253
+ var evaluatorTimeoutCmd = new Command46("evaluator-timeout").description(
13022
13254
  "Trigger evaluator timeout after the evaluation window expires (anyone); also bounty and benchmark tasks with an evaluator and a live submission"
13023
13255
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
13024
13256
  const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/evaluator-timeout`, { taskId }, { maxAmount: ACTION_FEE_MAX_AMOUNT });
@@ -13029,8 +13261,8 @@ var evaluatorTimeoutCmd = new Command45("evaluator-timeout").description(
13029
13261
  });
13030
13262
 
13031
13263
  // src/commands/task/finalize-verdict.ts
13032
- import { Command as Command46 } from "commander";
13033
- var finalizeVerdictCmd = new Command46("finalize-verdict").description("Finalize an evaluator verdict after the appeal window expires (permissionless)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
13264
+ import { Command as Command47 } from "commander";
13265
+ var finalizeVerdictCmd = new Command47("finalize-verdict").description("Finalize an evaluator verdict after the appeal window expires (permissionless)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
13034
13266
  const { data: result, idempotencyKey } = await apiPost(`/api/tasks/${taskId}/finalize-verdict`, { taskId });
13035
13267
  printResult(
13036
13268
  { txHash: result.txHash, ...await settleRecording(result, idempotencyKey) },
@@ -13039,7 +13271,7 @@ var finalizeVerdictCmd = new Command46("finalize-verdict").description("Finalize
13039
13271
  });
13040
13272
 
13041
13273
  // src/commands/task/resolve-dispute.ts
13042
- import { Command as Command47 } from "commander";
13274
+ import { Command as Command48 } from "commander";
13043
13275
  function parseAward(spec) {
13044
13276
  const parts = spec.split(":");
13045
13277
  if (parts.length !== 3) {
@@ -13049,18 +13281,18 @@ function parseAward(spec) {
13049
13281
  if (!/^0x[0-9a-fA-F]{40}$/.test(worker)) {
13050
13282
  throw new Error(`Invalid worker address in "${spec}"`);
13051
13283
  }
13052
- const amount = usdcToBaseUnits(amountStr);
13284
+ const amount2 = usdcToBaseUnits(amountStr);
13053
13285
  const rank = parseInt(rankStr, 10);
13054
13286
  if (!Number.isInteger(rank) || rank < 1) {
13055
13287
  throw new Error(`Invalid rank in "${spec}" \u2014 must be an integer >= 1`);
13056
13288
  }
13057
13289
  return {
13058
13290
  worker,
13059
- amount,
13291
+ amount: amount2,
13060
13292
  rank
13061
13293
  };
13062
13294
  }
13063
- var resolveDisputeCmd = new Command47("resolve-dispute").description(
13295
+ var resolveDisputeCmd = new Command48("resolve-dispute").description(
13064
13296
  "Resolve a disputed task as the designated dispute resolver (X402 required).\n\nExamples:\n task resolve-dispute 0x\u2026 --verdict approve --award 0xAlice:5:1\n task resolve-dispute 0x\u2026 --verdict partial --award 0xAlice:3:1 --award 0xBob:2:2"
13065
13297
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--verdict <type>", "Verdict type: approve or partial").requiredOption(
13066
13298
  "--award <spec...>",
@@ -13093,8 +13325,8 @@ var resolveDisputeCmd = new Command47("resolve-dispute").description(
13093
13325
  });
13094
13326
 
13095
13327
  // src/commands/task/unlock.ts
13096
- import { Command as Command48 } from "commander";
13097
- var unlockCmd = new Command48("unlock").description("Unlock a private task with its password, caching a task-scoped access grant").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--password <password>", "The private task's password").action(async (taskId, opts) => {
13328
+ import { Command as Command49 } from "commander";
13329
+ var unlockCmd = new Command49("unlock").description("Unlock a private task with its password, caching a task-scoped access grant").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--password <password>", "The private task's password").action(async (taskId, opts) => {
13098
13330
  let result;
13099
13331
  let idempotencyKey;
13100
13332
  try {
@@ -13111,8 +13343,8 @@ var unlockCmd = new Command48("unlock").description("Unlock a private task with
13111
13343
  });
13112
13344
 
13113
13345
  // src/commands/task/invite.ts
13114
- import { Command as Command49 } from "commander";
13115
- var inviteCmd = new Command49("invite").description("Invite a wallet to view a private task (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").argument("<address>", "Wallet address to invite").action(async (taskId, address3) => {
13346
+ import { Command as Command50 } from "commander";
13347
+ var inviteCmd = new Command50("invite").description("Invite a wallet to view a private task (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").argument("<address>", "Wallet address to invite").action(async (taskId, address3) => {
13116
13348
  const auth = await signReadAuth();
13117
13349
  if (!auth || Object.keys(auth.headers).length === 0) {
13118
13350
  printError("No keystore found. Run `taskmarket init` first.");
@@ -13131,8 +13363,8 @@ var inviteCmd = new Command49("invite").description("Invite a wallet to view a p
13131
13363
  });
13132
13364
 
13133
13365
  // src/commands/task/uninvite.ts
13134
- import { Command as Command50 } from "commander";
13135
- var uninviteCmd = new Command50("uninvite").description("Remove a wallet from a private task's allowlist (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").argument("<address>", "Wallet address to remove").action(async (taskId, address3) => {
13366
+ import { Command as Command51 } from "commander";
13367
+ var uninviteCmd = new Command51("uninvite").description("Remove a wallet from a private task's allowlist (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").argument("<address>", "Wallet address to remove").action(async (taskId, address3) => {
13136
13368
  const auth = await signReadAuth();
13137
13369
  if (!auth || Object.keys(auth.headers).length === 0) {
13138
13370
  printError("No keystore found. Run `taskmarket init` first.");
@@ -13150,8 +13382,8 @@ var uninviteCmd = new Command50("uninvite").description("Remove a wallet from a
13150
13382
  });
13151
13383
 
13152
13384
  // src/commands/task/viewers.ts
13153
- import { Command as Command51 } from "commander";
13154
- var viewersCmd = new Command51("viewers").description("List a private task's wallet allowlist (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
13385
+ import { Command as Command52 } from "commander";
13386
+ var viewersCmd = new Command52("viewers").description("List a private task's wallet allowlist (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
13155
13387
  const auth = await signReadAuth();
13156
13388
  if (!auth || Object.keys(auth.headers).length === 0) {
13157
13389
  printError("No keystore found. Run `taskmarket init` first.");
@@ -13168,8 +13400,8 @@ var viewersCmd = new Command51("viewers").description("List a private task's wal
13168
13400
  });
13169
13401
 
13170
13402
  // src/commands/task/terms.ts
13171
- import { Command as Command52 } from "commander";
13172
- var termsCmd = new Command52("terms").description(
13403
+ import { Command as Command53 } from "commander";
13404
+ var termsCmd = new Command53("terms").description(
13173
13405
  "Show a task's settlement terms: stake, review window, reject fee and outcome, revisions, release cost now and deadlines"
13174
13406
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
13175
13407
  const detail = await getTaskTerms(cliTaskReadContext(), { taskId });
@@ -13183,8 +13415,8 @@ var termsCmd = new Command52("terms").description(
13183
13415
  });
13184
13416
 
13185
13417
  // src/commands/task/template.ts
13186
- import { Command as Command53 } from "commander";
13187
- var listCmd3 = new Command53("list").description("List the curated task templates (id, mode, what it is for, what the brief covers)").option(
13418
+ import { Command as Command54 } from "commander";
13419
+ var listCmd3 = new Command54("list").description("List the curated task templates (id, mode, what it is for, what the brief covers)").option(
13188
13420
  "--mode <mode>",
13189
13421
  "Only templates for one task mode: bounty, claim, pitch, benchmark, auction"
13190
13422
  ).action((opts) => {
@@ -13193,18 +13425,18 @@ var listCmd3 = new Command53("list").description("List the curated task template
13193
13425
  }
13194
13426
  printResult({ templates: listTemplates(opts.mode) });
13195
13427
  });
13196
- var showCmd = new Command53("show").description("Show one template: its fields, mode terms and full brief").argument("<id>", "Template id (see `taskmarket task template list`)").action((id) => {
13428
+ var showCmd = new Command54("show").description("Show one template: its fields, mode terms and full brief").argument("<id>", "Template id (see `taskmarket task template list`)").action((id) => {
13197
13429
  const template = findTemplate(id);
13198
13430
  if (!template) return void printError(templateNotFound(id));
13199
13431
  printResult(templateDetail(template));
13200
13432
  });
13201
- var templateCmd = new Command53("template").description(
13433
+ var templateCmd = new Command54("template").description(
13202
13434
  "Browse the curated task templates; create from one with `task create --template <id>`"
13203
13435
  ).addCommand(listCmd3).addCommand(showCmd);
13204
13436
 
13205
13437
  // src/commands/task/checks.ts
13206
13438
  import { readFileSync as readFileSync2 } from "fs";
13207
- import { Command as Command54 } from "commander";
13439
+ import { Command as Command55 } from "commander";
13208
13440
 
13209
13441
  // src/lib/task-hidden-checks.ts
13210
13442
  import { createHash } from "crypto";
@@ -13242,7 +13474,7 @@ function readBytes(path10) {
13242
13474
  return `Cannot read ${path10}: ${error.message}`;
13243
13475
  }
13244
13476
  }
13245
- var commitCmd = new Command54("commit").description(
13477
+ var commitCmd = new Command55("commit").description(
13246
13478
  "Commit to a hidden checks file: validates it and prints { commitment, count }. Put both in the public spec's hiddenChecks, then encrypt the file to each verifier with `taskmarket encrypt`"
13247
13479
  ).requiredOption("--file <path>", "The hidden checks file (a taskmarket.checks/1 spec)").action((opts) => {
13248
13480
  const bytes = readBytes(opts.file);
@@ -13251,7 +13483,7 @@ var commitCmd = new Command54("commit").description(
13251
13483
  if (!file.valid) return void printError(file.error);
13252
13484
  printResult({ commitment: hiddenChecksCommitment(bytes), count: file.count });
13253
13485
  });
13254
- var verifyCmd = new Command54("verify").description("Check a decrypted hidden checks file against the commitment in the public spec").requiredOption("--file <path>", "The decrypted hidden checks file").requiredOption("--commitment <sha256:...>", "The spec's hiddenChecks.commitment").action((opts) => {
13486
+ var verifyCmd = new Command55("verify").description("Check a decrypted hidden checks file against the commitment in the public spec").requiredOption("--file <path>", "The decrypted hidden checks file").requiredOption("--commitment <sha256:...>", "The spec's hiddenChecks.commitment").action((opts) => {
13255
13487
  if (!isCommitment(opts.commitment)) {
13256
13488
  return void printError("--commitment must look like sha256:<64 lowercase hex characters>");
13257
13489
  }
@@ -13266,7 +13498,7 @@ var verifyCmd = new Command54("verify").description("Check a decrypted hidden ch
13266
13498
  count: file.valid ? file.count : null
13267
13499
  });
13268
13500
  });
13269
- var checksCmd = new Command54("checks").description(
13501
+ var checksCmd = new Command55("checks").description(
13270
13502
  "Hidden checks: commit to a private checks file and verify it against the commitment"
13271
13503
  ).addCommand(commitCmd).addCommand(verifyCmd);
13272
13504
 
@@ -13295,7 +13527,7 @@ var settleCmd = settlementActionCommand({
13295
13527
  });
13296
13528
 
13297
13529
  // src/commands/task/index.ts
13298
- var taskCommand2 = new Command55("task").description("Manage tasks");
13530
+ var taskCommand2 = new Command56("task").description("Manage tasks");
13299
13531
  taskCommand2.addCommand(createCmd);
13300
13532
  taskCommand2.addCommand(templateCmd);
13301
13533
  taskCommand2.addCommand(listCmd);
@@ -13348,10 +13580,10 @@ taskCommand2.addCommand(reviewCmd, { hidden: true });
13348
13580
  taskCommand2.addCommand(startReviewCmd);
13349
13581
 
13350
13582
  // src/commands/agent/index.ts
13351
- import { Command as Command59, Option as Option4 } from "commander";
13583
+ import { Command as Command60, Option as Option4 } from "commander";
13352
13584
 
13353
13585
  // src/commands/agent/credits.ts
13354
- import { Command as Command56 } from "commander";
13586
+ import { Command as Command57 } from "commander";
13355
13587
 
13356
13588
  // src/lib/tty-confirm.ts
13357
13589
  import { createInterface as createInterface3 } from "readline";
@@ -13404,7 +13636,7 @@ function setupLines(plan, pricing) {
13404
13636
  ...rateLines(pricing)
13405
13637
  ];
13406
13638
  }
13407
- var setupCommand = new Command56("setup").description(
13639
+ var setupCommand = new Command57("setup").description(
13408
13640
  "Approve the compute allocation that pays for sandboxes: daily and monthly caps, and optional auto-top-up"
13409
13641
  ).requiredOption("--per-day <usd>", "Most compute credit bought in one UTC day, in USD").requiredOption("--per-month <usd>", "Most compute credit bought in one UTC month, in USD").option("--total <usd>", "Most this allocation ever buys, in USD (default: 12 months)").option(
13410
13642
  "--auto-top-up-below <credits>",
@@ -13441,7 +13673,7 @@ var setupCommand = new Command56("setup").description(
13441
13673
  printResult({ config, caps: plan.caps, autoTopUp: plan.autoTopUp ?? null });
13442
13674
  }
13443
13675
  );
13444
- var buyCommand = new Command56("buy").description("Buy compute credit over x402 from the compute allocation, after showing the rate").option("--amount <usd>", "Purchase size in whole USD (see `credits status` for the sizes)").option("--yes", "Skip the confirmation prompt (the allocation caps still apply)").action(async (options) => {
13676
+ var buyCommand = new Command57("buy").description("Buy compute credit over x402 from the compute allocation, after showing the rate").option("--amount <usd>", "Purchase size in whole USD (see `credits status` for the sizes)").option("--yes", "Skip the confirmation prompt (the allocation caps still apply)").action(async (options) => {
13445
13677
  const config = await loadComputeCreditConfig();
13446
13678
  if (!config) {
13447
13679
  throw new ComputeCreditError(
@@ -13471,17 +13703,17 @@ var buyCommand = new Command56("buy").description("Buy compute credit over x402
13471
13703
  rate: { rateCardVersion: pricing.rateCardVersion, usdPerCredit: pricing.usdPerCredit }
13472
13704
  });
13473
13705
  });
13474
- var statusCommand2 = new Command56("status").description(
13706
+ var statusCommand2 = new Command57("status").description(
13475
13707
  "Show compute credit balance, rate, recent debits and purchases, and the caps; an approved auto-top-up runs when the balance is below its threshold"
13476
13708
  ).action(async () => {
13477
13709
  printResult(await computeCreditStatus());
13478
13710
  });
13479
- var checkCommand = new Command56("check").description(
13711
+ var checkCommand = new Command57("check").description(
13480
13712
  "Check the compute credit balance and, when auto-top-up was approved and the balance is low, buy one chunk"
13481
13713
  ).action(async () => {
13482
13714
  printResult(await checkComputeBalance());
13483
13715
  });
13484
- var reconcileCommand = new Command56("reconcile").description(
13716
+ var reconcileCommand = new Command57("reconcile").description(
13485
13717
  "Settle purchases whose outcome was lost, by their idempotency key; never pays again"
13486
13718
  ).option(
13487
13719
  "--release <key>",
@@ -13528,10 +13760,10 @@ var reconcileCommand = new Command56("reconcile").description(
13528
13760
  ...recoveryError === void 0 ? {} : { recoveryError }
13529
13761
  });
13530
13762
  });
13531
- var disableAutoTopUpCommand = new Command56("disable-auto-top-up").description("Turn off auto-top-up and close its allocation").action(async () => {
13763
+ var disableAutoTopUpCommand = new Command57("disable-auto-top-up").description("Turn off auto-top-up and close its allocation").action(async () => {
13532
13764
  printResult({ config: await disableComputeAutoTopUp() });
13533
13765
  });
13534
- var agentCreditsCommand = new Command56("credits").description("Prepaid compute credit for agent sandboxes, bought over x402").addCommand(setupCommand).addCommand(buyCommand).addCommand(statusCommand2).addCommand(checkCommand).addCommand(reconcileCommand).addCommand(disableAutoTopUpCommand);
13766
+ var agentCreditsCommand = new Command57("credits").description("Prepaid compute credit for agent sandboxes, bought over x402").addCommand(setupCommand).addCommand(buyCommand).addCommand(statusCommand2).addCommand(checkCommand).addCommand(reconcileCommand).addCommand(disableAutoTopUpCommand);
13535
13767
 
13536
13768
  // src/commands/agent/launch.ts
13537
13769
  var EXPERIMENTAL_AGENT_ENV = "TASKMARKET_EXPERIMENTAL_AGENT";
@@ -13553,7 +13785,7 @@ async function runAgentCommand(options) {
13553
13785
  try {
13554
13786
  const { assertAgentCompatibility } = await import("./compatibility-636WJOEX.js");
13555
13787
  const pi = assertAgentCompatibility();
13556
- const { runAgent } = await import("./launch-CEJWCOQA.js");
13788
+ const { runAgent } = await import("./launch-JVXJSXJF.js");
13557
13789
  result = await runAgent({
13558
13790
  model: options.model,
13559
13791
  pi,
@@ -13587,7 +13819,7 @@ async function runAgentCommand(options) {
13587
13819
  import { createHash as createHash2, randomBytes as randomBytes4 } from "crypto";
13588
13820
  import { readFile as readFile2 } from "fs/promises";
13589
13821
  import { extname } from "path";
13590
- import { Command as Command57, Option as Option3 } from "commander";
13822
+ import { Command as Command58, Option as Option3 } from "commander";
13591
13823
  var WRITE_TTL_SECONDS2 = 5 * 60;
13592
13824
  var HOUR = 3600;
13593
13825
  var LISTING_UNTRUSTED_FIELDS = [
@@ -13720,7 +13952,7 @@ async function ownListing() {
13720
13952
  const keystore = await loadKeystore();
13721
13953
  return fetchListing(keystore.walletAddress);
13722
13954
  }
13723
- var profileCommand = new Command57("profile").description(
13955
+ var profileCommand = new Command58("profile").description(
13724
13956
  "Your listing's profile: name, description, roles, specialties and capabilities"
13725
13957
  );
13726
13958
  profileCommand.command("set").description(
@@ -13872,7 +14104,7 @@ function addServiceOptions(command) {
13872
14104
  "fixed or quote: a hire of this service must name an evaluator before it is accepted"
13873
14105
  ).option("--no-requires-evaluator", "fixed or quote: hires need no evaluator (the default)");
13874
14106
  }
13875
- var serviceCommand = new Command57("service").description(
14107
+ var serviceCommand = new Command58("service").description(
13876
14108
  "Your listing services: the priced offers requesters hire you for"
13877
14109
  );
13878
14110
  addServiceOptions(
@@ -13894,8 +14126,8 @@ addServiceOptions(
13894
14126
  if (!stored) throw new Error(`No service ${serviceId} on your listing`);
13895
14127
  let base = serviceInputFromStored(stored);
13896
14128
  if (opts.kind !== void 0 && opts.kind !== stored.kind) {
13897
- const { title, description, deliverable, specialties, acceptedChainIds } = base;
13898
- base = { title, description, deliverable, specialties };
14129
+ const { title: title2, description, deliverable, specialties, acceptedChainIds } = base;
14130
+ base = { title: title2, description, deliverable, specialties };
13899
14131
  if (acceptedChainIds) base.acceptedChainIds = acceptedChainIds;
13900
14132
  }
13901
14133
  await writeListingChange({
@@ -13914,7 +14146,7 @@ serviceCommand.command("remove").description("Remove a service from your listing
13914
14146
  renderFailure(err);
13915
14147
  }
13916
14148
  });
13917
- var availabilityCommand = new Command57("availability").description(
14149
+ var availabilityCommand = new Command58("availability").description(
13918
14150
  "Open your listing for hires or pause it (services stay visible but cannot be hired), and set your capacity"
13919
14151
  ).argument("[state]", "open or paused; keeps the saved state when left out").option("--capacity <n>", 'Most hires in progress at once, or "none" for no limit').action(async (state, opts) => {
13920
14152
  try {
@@ -13934,7 +14166,7 @@ var availabilityCommand = new Command57("availability").description(
13934
14166
  renderFailure(err);
13935
14167
  }
13936
14168
  });
13937
- var listingCommand = new Command57("listing").description(
14169
+ var listingCommand = new Command58("listing").description(
13938
14170
  "Show your listing, or another worker's, with whether it is taking hires now and each service's track record on the selected --network"
13939
14171
  ).argument("[address]", "Wallet address; your own when left out").action(async (address3) => {
13940
14172
  try {
@@ -13961,7 +14193,7 @@ function agentListingCommands() {
13961
14193
  }
13962
14194
 
13963
14195
  // src/commands/agent/manage.ts
13964
- import { Command as Command58 } from "commander";
14196
+ import { Command as Command59 } from "commander";
13965
14197
  async function run(work) {
13966
14198
  try {
13967
14199
  const value = await work();
@@ -13984,27 +14216,27 @@ async function requireExperimental() {
13984
14216
  );
13985
14217
  }
13986
14218
  function agentManagementCommands() {
13987
- const status = new Command58("status").description(
14219
+ const status = new Command59("status").description(
13988
14220
  "Show the agent channels (locked, charged, refundable), purchases with an unknown outcome, the sandbox and compute credit. Reads only."
13989
14221
  ).action(async () => {
13990
- const { collectAgentStatus } = await import("./status-Y6JAL4DR.js");
14222
+ const { collectAgentStatus } = await import("./status-LU7AKAKJ.js");
13991
14223
  await run(() => collectAgentStatus());
13992
14224
  });
13993
- const doctor = new Command58("doctor").description(
14225
+ const doctor = new Command59("doctor").description(
13994
14226
  "Check that the agent can start: Node and the bundled runtime, wallet and policy, channels, API, sandbox broker, host keys, xgate and RPC. Reads only."
13995
14227
  ).action(async () => {
13996
- const { runDoctor } = await import("./doctor-PEAKIDKS.js");
14228
+ const { runDoctor } = await import("./doctor-6ASEDCCF.js");
13997
14229
  const report = await run(() => runDoctor());
13998
14230
  if (report && !report.ok) process.exitCode = 1;
13999
14231
  });
14000
- const reconcile = new Command58("reconcile").description(
14232
+ const reconcile = new Command59("reconcile").description(
14001
14233
  "Decide an agent purchase whose outcome is unknown, by its invocation ID; or, with --channel or --rail, everything one channel still has open. Never sends anything again."
14002
14234
  ).argument("[invocation-id]", "The purchase, as status or the agent named it").option("--rail <id>", "Reconcile the open purchases of this rail's channel").option(
14003
14235
  "--channel <channel-id>",
14004
14236
  "Reconcile the open purchases of this channel, as status lists it; also reaches retired channels"
14005
14237
  ).action(
14006
14238
  async (invocationId, options) => {
14007
- const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-GMYKLZTG.js");
14239
+ const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-TJ2VXC6R.js");
14008
14240
  const choice = { rail: options.rail, channel: options.channel };
14009
14241
  if (invocationId !== void 0) {
14010
14242
  await run(() => reconcileInvocation(invocationId, { choice }));
@@ -14022,23 +14254,23 @@ function agentManagementCommands() {
14022
14254
  });
14023
14255
  }
14024
14256
  );
14025
- const topup = new Command58("topup").description(
14257
+ const topup = new Command59("topup").description(
14026
14258
  "Check a channel top-up against the approved budget: within it, the channel deposits by itself with the next turn that needs funds; over it, a new approval is needed"
14027
14259
  ).requiredOption("--amount <usdc>", "Top-up in USDC, e.g. 5 or 2.50").option("--rail <id>", "The rail to top up (required when the policy has more than one)").action(async (options) => {
14028
14260
  await run(async () => {
14029
14261
  await requireExperimental();
14030
14262
  const { usdcToAtomic, AGENT_VIEW_VERSION } = await import("./budget-view-J6L7X6EY.js");
14031
14263
  const { AgentLaunchError } = await import("./errors-2L357HGA.js");
14032
- const amount = usdcToAtomic(options.amount);
14033
- if (amount === void 0 || amount === "0") {
14264
+ const amount2 = usdcToAtomic(options.amount);
14265
+ if (amount2 === void 0 || amount2 === "0") {
14034
14266
  throw new AgentLaunchError(
14035
14267
  "invalid_amount",
14036
14268
  `Not a USDC amount: ${options.amount} (digits, at most 6 decimals)`
14037
14269
  );
14038
14270
  }
14039
- const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-LX2DTMKZ.js");
14271
+ const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-Z6VN7FXP.js");
14040
14272
  const { rails } = await openAgentChannels();
14041
- const result = await requestTopUp(selectRail(rails, options.rail), amount);
14273
+ const result = await requestTopUp(selectRail(rails, options.rail), amount2);
14042
14274
  return {
14043
14275
  version: AGENT_VIEW_VERSION,
14044
14276
  kind: "taskmarket.agent.topup",
@@ -14047,7 +14279,7 @@ function agentManagementCommands() {
14047
14279
  };
14048
14280
  });
14049
14281
  });
14050
- const close = new Command58("close").description(
14282
+ const close = new Command59("close").description(
14051
14283
  "Close the agent's channel and refund its unused balance cooperatively; checks an earlier close instead of sending it again"
14052
14284
  ).option("--rail <id>", "The rail to close (required when the policy has more than one)").option(
14053
14285
  "--channel <channel-id>",
@@ -14056,8 +14288,8 @@ function agentManagementCommands() {
14056
14288
  await run(async () => {
14057
14289
  await requireExperimental();
14058
14290
  const { AGENT_VIEW_VERSION } = await import("./budget-view-J6L7X6EY.js");
14059
- const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-LX2DTMKZ.js");
14060
- const { reconcileLeasedPurchase } = await import("./reconcile-GMYKLZTG.js");
14291
+ const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-Z6VN7FXP.js");
14292
+ const { reconcileLeasedPurchase } = await import("./reconcile-TJ2VXC6R.js");
14061
14293
  const opened = await openAgentChannels();
14062
14294
  const { rail, retired } = selectChannel(opened, options);
14063
14295
  const result = await closeChannel(
@@ -14088,7 +14320,7 @@ function agentManagementCommands() {
14088
14320
  };
14089
14321
  });
14090
14322
  });
14091
- const pull = new Command58("pull").description(
14323
+ const pull = new Command59("pull").description(
14092
14324
  "After a session: review the changes the agent left in its sandbox (saved when the session ended; the sandbox is not resumed) and apply them to this project on approval. Conflicts with your local edits and host configuration are listed, never applied. Inside a session use /pull."
14093
14325
  ).option("--diff", "Print the full diff").option("--apply", "Apply the clean changes without asking").option(
14094
14326
  "--overwrite <path>",
@@ -14111,7 +14343,7 @@ function agentManagementCommands() {
14111
14343
  async (options) => {
14112
14344
  await run(async () => {
14113
14345
  await requireExperimental();
14114
- const { runPull } = await import("./sync-pull-YFIWHI4H.js");
14346
+ const { runPull } = await import("./sync-pull-52G7XZZT.js");
14115
14347
  const { terminalPrompter } = await import("./prompter-LSICEYSQ.js");
14116
14348
  return runPull(options, {
14117
14349
  interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
@@ -14129,7 +14361,7 @@ function agentManagementCommands() {
14129
14361
 
14130
14362
  // src/commands/agent/index.ts
14131
14363
  var experimental = agentCommandEnabled();
14132
- var agentCommand = new Command59("agent").description(
14364
+ var agentCommand = new Command60("agent").description(
14133
14365
  experimental ? "The Taskmarket agent and the compute it runs on. Without a subcommand (experimental), open Pi's interactive coding agent in this project, with paid xgate inference from your wallet and tools in your cloud sandbox" : "The Taskmarket agent and the compute it runs on"
14134
14366
  ).addOption(
14135
14367
  new Option4("--model <id>", "Start on one model from your approved spending policy").hideHelp(
@@ -14166,7 +14398,7 @@ for (const command of agentManagementCommands()) {
14166
14398
  }
14167
14399
 
14168
14400
  // src/commands/agents.ts
14169
- import { Command as Command60 } from "commander";
14401
+ import { Command as Command61 } from "commander";
14170
14402
  var MIN_RATINGS = ["3", "4", "4.5"];
14171
14403
  var MIN_TASKS = ["5", "10", "50"];
14172
14404
  var AVAILABILITIES = ["available", "unavailable", "any"];
@@ -14176,7 +14408,7 @@ function allowListed(flag, value, allowed) {
14176
14408
  throw new Error(`${flag} must be one of: ${allowed.join(", ")}`);
14177
14409
  }
14178
14410
  }
14179
- var agentsCommand = new Command60("agents").description("Browse the worker directory (agents and humans) on the selected --network").enablePositionalOptions().option(
14411
+ var agentsCommand = new Command61("agents").description("Browse the worker directory (agents and humans) on the selected --network").enablePositionalOptions().option(
14180
14412
  "--sort <order>",
14181
14413
  "Sort order: reputation (top rated), tasks, hires (most hired: completed reserved, quote and request hires) or volume (settled earnings)",
14182
14414
  "reputation"
@@ -14422,7 +14654,7 @@ agentsCommand.command("report").description("Report a worker's listing, or one o
14422
14654
  });
14423
14655
 
14424
14656
  // src/commands/dashboard.ts
14425
- import { Command as Command61 } from "commander";
14657
+ import { Command as Command62 } from "commander";
14426
14658
 
14427
14659
  // src/lib/dashboard.ts
14428
14660
  var DASHBOARD_LIST_LIMIT = 5;
@@ -14612,14 +14844,14 @@ function buildWorkflows(workflows, schedules, limit = DASHBOARD_LIST_LIMIT) {
14612
14844
  // src/commands/dashboard.ts
14613
14845
  var PROJECTS_READ_LIMIT = 25;
14614
14846
  var SWARM_NOTE = "Hosted agents are managed in the web app (/dashboard/swarm) and need a web sign-in, so the CLI does not read them.";
14615
- async function settle(read4) {
14847
+ async function settle2(read4) {
14616
14848
  try {
14617
14849
  return { value: await read4(), error: null };
14618
14850
  } catch (error) {
14619
14851
  return { value: null, error: error instanceof Error ? error.message : String(error) };
14620
14852
  }
14621
14853
  }
14622
- var dashboardCommand = new Command61("dashboard").description(
14854
+ var dashboardCommand = new Command62("dashboard").description(
14623
14855
  "Show your home base: what needs you, your money, tasks you posted and work you do, projects and workflows, and recent activity"
14624
14856
  ).action(async () => {
14625
14857
  const auth = await signReadAuth();
@@ -14636,36 +14868,36 @@ var dashboardCommand = new Command61("dashboard").description(
14636
14868
  limit: String(AUTOMATIONS_READ_LIMIT)
14637
14869
  });
14638
14870
  const [queue, inbox, workflows, schedules, projects, balance, activity] = await Promise.all([
14639
- settle(
14871
+ settle2(
14640
14872
  () => apiGet(`/api/agents/action-queue?${new URLSearchParams({ address: address3, limit: "50" })}`, {
14641
14873
  headers
14642
14874
  })
14643
14875
  ),
14644
- settle(
14876
+ settle2(
14645
14877
  () => apiGet(
14646
14878
  `/api/agents/inbox?${new URLSearchParams({ address: address3, sort: "attention", limit: String(DASHBOARD_TASK_LIMIT) })}`,
14647
14879
  { headers }
14648
14880
  )
14649
14881
  ),
14650
- settle(
14882
+ settle2(
14651
14883
  () => apiGet(withChainId(`/api/workflows?${owner}`))
14652
14884
  ),
14653
- settle(
14885
+ settle2(
14654
14886
  () => apiGet(withChainId(`/api/schedules?${owner}`))
14655
14887
  ),
14656
- settle(
14888
+ settle2(
14657
14889
  () => apiGet(
14658
14890
  withChainId(
14659
14891
  `/api/projects?${new URLSearchParams({ address: address3, role: "owner", status: "open", limit: String(PROJECTS_READ_LIMIT) })}`
14660
14892
  )
14661
14893
  )
14662
14894
  ),
14663
- settle(
14895
+ settle2(
14664
14896
  () => apiGet(
14665
14897
  `/api/wallet/balance?${new URLSearchParams({ address: address3, chainId: String(chainId) })}`
14666
14898
  )
14667
14899
  ),
14668
- settle(
14900
+ settle2(
14669
14901
  () => apiGet(
14670
14902
  `/api/market-events?${new URLSearchParams({
14671
14903
  order: "newest",
@@ -14686,17 +14918,18 @@ var dashboardCommand = new Command61("dashboard").description(
14686
14918
  if (projects.error) errors.projects = projects.error;
14687
14919
  if (balance.error) errors.balance = balance.error;
14688
14920
  if (activity.error) errors.activity = activity.error;
14921
+ const needsYou = buildNeedsYou({
14922
+ actions: queue.value?.items,
14923
+ workflows: workflows.value?.workflows,
14924
+ schedules: schedules.value?.schedules,
14925
+ more: Boolean(queue.value?.nextCursor)
14926
+ });
14689
14927
  printResult(
14690
14928
  withChainNames({
14691
14929
  address: address3,
14692
14930
  chainId,
14693
14931
  generatedAt: new Date(nowMs).toISOString(),
14694
- needsYou: buildNeedsYou({
14695
- actions: queue.value?.items,
14696
- workflows: workflows.value?.workflows,
14697
- schedules: schedules.value?.schedules,
14698
- more: Boolean(queue.value?.nextCursor)
14699
- }),
14932
+ needsYou,
14700
14933
  money: {
14701
14934
  balance: balance.value ? {
14702
14935
  baseUnits: balance.value.balanceBaseUnits,
@@ -14723,13 +14956,22 @@ var dashboardCommand = new Command61("dashboard").description(
14723
14956
  summary: event.summary
14724
14957
  })),
14725
14958
  ...Object.keys(errors).length > 0 ? { errors } : {}
14726
- })
14959
+ }),
14960
+ {
14961
+ next: nextForHome({
14962
+ address: address3,
14963
+ chainId,
14964
+ balanceBaseUnits: balance.value?.balanceBaseUnits,
14965
+ needsYou: needsYou.total,
14966
+ activeTasks: posted.length + work.length
14967
+ })
14968
+ }
14727
14969
  );
14728
14970
  });
14729
14971
 
14730
14972
  // src/commands/inbox.ts
14731
- import { Command as Command62 } from "commander";
14732
- var inboxCommand = new Command62("inbox").description(
14973
+ import { Command as Command63 } from "commander";
14974
+ var inboxCommand = new Command63("inbox").description(
14733
14975
  "Show what you need to do now, then tasks you created, tasks you are working on, and private tasks you were invited to"
14734
14976
  ).option(
14735
14977
  "--limit <n>",
@@ -14872,7 +15114,7 @@ var inboxCommand = new Command62("inbox").description(
14872
15114
  );
14873
15115
 
14874
15116
  // src/commands/deposit.ts
14875
- import { Command as Command63 } from "commander";
15117
+ import { Command as Command64 } from "commander";
14876
15118
 
14877
15119
  // src/lib/relay-bridge.ts
14878
15120
  import { z as z4 } from "zod";
@@ -14952,10 +15194,10 @@ async function fundingOptionsFor(chainId) {
14952
15194
  symbol: route.destination.symbol
14953
15195
  }
14954
15196
  })) : [],
14955
- note: "Run `taskmarket deposit --relay-route <routeId> --amount <n>` for a Relay deposit address. Fiat funding: see issue #2720."
15197
+ note: "Send the payment token to `address` on this network, or run `taskmarket deposit --relay-route <routeId> --amount <n>` for a Relay deposit address. The CLI has no fiat on-ramp: a person funds the wallet."
14956
15198
  };
14957
15199
  }
14958
- var depositCommand = new Command63("deposit").description(
15200
+ var depositCommand = new Command64("deposit").description(
14959
15201
  "Show wallet address, network info and cross-chain funding options for the selected --network"
14960
15202
  ).option(
14961
15203
  "--relay-route <routeId>",
@@ -15006,7 +15248,19 @@ var depositCommand = new Command63("deposit").description(
15006
15248
  renderFailure(new Error("--amount needs --relay-route"));
15007
15249
  return;
15008
15250
  }
15009
- printResult({ ...data, fundingOptions });
15251
+ const balance = await apiGet(
15252
+ `/api/wallet/balance?address=${address3}&chainId=${chainId}`
15253
+ ).catch(() => null);
15254
+ printResult(
15255
+ { ...data, fundingOptions },
15256
+ {
15257
+ next: nextForBalance({
15258
+ address: address3,
15259
+ chainId,
15260
+ balanceBaseUnits: balance?.balanceBaseUnits
15261
+ })
15262
+ }
15263
+ );
15010
15264
  return;
15011
15265
  }
15012
15266
  try {
@@ -15045,10 +15299,10 @@ var depositCommand = new Command63("deposit").description(
15045
15299
  });
15046
15300
 
15047
15301
  // src/commands/wallet/index.ts
15048
- import { Command as Command74 } from "commander";
15302
+ import { Command as Command75 } from "commander";
15049
15303
 
15050
15304
  // src/commands/wallet/balance.ts
15051
- import { Command as Command64 } from "commander";
15305
+ import { Command as Command65 } from "commander";
15052
15306
  function balancePath(address3, chainId) {
15053
15307
  return `/api/wallet/balance?address=${address3}&chainId=${chainId}`;
15054
15308
  }
@@ -15082,7 +15336,7 @@ async function allChainBalances(address3) {
15082
15336
  );
15083
15337
  return { address: address3, chains };
15084
15338
  }
15085
- var walletBalanceCommand = new Command64("balance").description("Show the wallet's payment-token balance on the selected network").option("--address <addr>", "Address to check (defaults to own wallet)").option(
15339
+ var walletBalanceCommand = new Command65("balance").description("Show the wallet's payment-token balance on the selected network").option("--address <addr>", "Address to check (defaults to own wallet)").option(
15086
15340
  "--all-chains",
15087
15341
  "Show the balance on every chain the selected deployment serves, one entry per chain"
15088
15342
  ).option(
@@ -15102,6 +15356,7 @@ var walletBalanceCommand = new Command64("balance").description("Show the wallet
15102
15356
  return;
15103
15357
  }
15104
15358
  let address3 = opts.address;
15359
+ const ownWallet = !address3;
15105
15360
  if (!address3) {
15106
15361
  const keystore = await loadKeystore();
15107
15362
  address3 = keystore.walletAddress;
@@ -15114,15 +15369,19 @@ var walletBalanceCommand = new Command64("balance").description("Show the wallet
15114
15369
  }
15115
15370
  return;
15116
15371
  }
15117
- const result = await apiGet(
15118
- balancePath(address3, selectedNetwork().chainId)
15372
+ const chainId = selectedNetwork().chainId;
15373
+ const result = await apiGet(balancePath(address3, chainId));
15374
+ printResult(
15375
+ result,
15376
+ ownWallet ? {
15377
+ next: nextForBalance({ address: address3, chainId, balanceBaseUnits: result.balanceBaseUnits })
15378
+ } : void 0
15119
15379
  );
15120
- printResult(result);
15121
15380
  }
15122
15381
  );
15123
15382
 
15124
15383
  // src/commands/wallet/import.ts
15125
- import { Command as Command65 } from "commander";
15384
+ import { Command as Command66 } from "commander";
15126
15385
  import { createInterface as createInterface4 } from "readline";
15127
15386
  import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
15128
15387
  function normalizePrivateKey(raw) {
@@ -15196,7 +15455,7 @@ async function importSolanaWallet(flagKey) {
15196
15455
  { warnings: argvKeyWarnings(keySource) }
15197
15456
  );
15198
15457
  }
15199
- var walletImportCommand = new Command65("import").description("Import an existing private key as the agent wallet").option(
15458
+ var walletImportCommand = new Command66("import").description("Import an existing private key as the agent wallet").option(
15200
15459
  "--key <privateKey>",
15201
15460
  "Private key to import (64 hex chars, with or without 0x prefix; with --solana, a base58 or JSON-array Solana secret key)"
15202
15461
  ).option(
@@ -15287,7 +15546,7 @@ var walletImportCommand = new Command65("import").description("Import an existin
15287
15546
 
15288
15547
  // src/commands/wallet/set-withdrawal-address.ts
15289
15548
  import { randomBytes as randomBytes5 } from "crypto";
15290
- import { Command as Command66 } from "commander";
15549
+ import { Command as Command67 } from "commander";
15291
15550
 
15292
15551
  // src/lib/withdrawal-pin.ts
15293
15552
  var WithdrawalAddressMismatchError = class extends Error {
@@ -15364,7 +15623,7 @@ var SIGNATURE_TTL_SECONDS = 5 * 60;
15364
15623
  function isValidAddress(addr) {
15365
15624
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
15366
15625
  }
15367
- var setWithdrawalAddressCommand = new Command66("set-withdrawal-address").description(
15626
+ var setWithdrawalAddressCommand = new Command67("set-withdrawal-address").description(
15368
15627
  "Set the withdrawal address for payment-token withdrawals on the selected network (once per chain, free)"
15369
15628
  ).argument("<address>", "Ethereum address to receive withdrawals").action(async (address3) => {
15370
15629
  if (!isValidAddress(address3)) {
@@ -15425,8 +15684,8 @@ var setWithdrawalAddressCommand = new Command66("set-withdrawal-address").descri
15425
15684
  });
15426
15685
 
15427
15686
  // src/commands/wallet/get-withdrawal-address.ts
15428
- import { Command as Command67 } from "commander";
15429
- var getWithdrawalAddressCommand = new Command67("get-withdrawal-address").description(
15687
+ import { Command as Command68 } from "commander";
15688
+ var getWithdrawalAddressCommand = new Command68("get-withdrawal-address").description(
15430
15689
  "Show the withdrawal address registered on the selected network, if any (the address is per chain)"
15431
15690
  ).option("--address <addr>", "Wallet address to check (defaults to own wallet)").action(async (opts) => {
15432
15691
  let address3 = opts.address;
@@ -15442,14 +15701,14 @@ var getWithdrawalAddressCommand = new Command67("get-withdrawal-address").descri
15442
15701
  });
15443
15702
 
15444
15703
  // src/commands/wallet/change-withdrawal-address.ts
15445
- import { Command as Command68 } from "commander";
15704
+ import { Command as Command69 } from "commander";
15446
15705
  function isValidAddress2(addr) {
15447
15706
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
15448
15707
  }
15449
15708
  function isValidRecoveryCode(code) {
15450
15709
  return /^\d{8}$/.test(code);
15451
15710
  }
15452
- var changeWithdrawalAddressCommand = new Command68("change-withdrawal-address").description(
15711
+ var changeWithdrawalAddressCommand = new Command69("change-withdrawal-address").description(
15453
15712
  "Change the selected network's withdrawal address using that chain's account recovery code (RFC-0012)"
15454
15713
  ).argument("<recovery-code>", "The 8-digit account recovery code from set-withdrawal-address").argument("<new-address>", "New Ethereum address to receive withdrawals").action(async (recoveryCode, newAddress) => {
15455
15714
  if (!isValidRecoveryCode(recoveryCode)) {
@@ -15501,8 +15760,8 @@ var changeWithdrawalAddressCommand = new Command68("change-withdrawal-address").
15501
15760
  });
15502
15761
 
15503
15762
  // src/commands/wallet/sync-withdrawal-address.ts
15504
- import { Command as Command69 } from "commander";
15505
- var syncWithdrawalAddressCommand = new Command69("sync-withdrawal-address").description(
15763
+ import { Command as Command70 } from "commander";
15764
+ var syncWithdrawalAddressCommand = new Command70("sync-withdrawal-address").description(
15506
15765
  "Accept the selected network's withdrawal address registered on the server as the locally pinned one (after a change made elsewhere, e.g. on the web)"
15507
15766
  ).action(async () => {
15508
15767
  let keystore;
@@ -15535,8 +15794,8 @@ var syncWithdrawalAddressCommand = new Command69("sync-withdrawal-address").desc
15535
15794
  });
15536
15795
 
15537
15796
  // src/commands/wallet/reveal-recovery-code.ts
15538
- import { Command as Command70 } from "commander";
15539
- var revealRecoveryCodeCommand = new Command70("reveal-recovery-code").description(
15797
+ import { Command as Command71 } from "commander";
15798
+ var revealRecoveryCodeCommand = new Command71("reveal-recovery-code").description(
15540
15799
  "One-time reveal of the selected network's account recovery code, if one has not been generated yet"
15541
15800
  ).action(async () => {
15542
15801
  let keystore;
@@ -15575,8 +15834,8 @@ var revealRecoveryCodeCommand = new Command70("reveal-recovery-code").descriptio
15575
15834
  });
15576
15835
 
15577
15836
  // src/commands/wallet/publish-key.ts
15578
- import { Command as Command71 } from "commander";
15579
- var publishKeyCommand = new Command71("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
15837
+ import { Command as Command72 } from "commander";
15838
+ var publishKeyCommand = new Command72("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
15580
15839
  let keystore;
15581
15840
  try {
15582
15841
  keystore = await loadKeystore();
@@ -15596,7 +15855,7 @@ var publishKeyCommand = new Command71("publish-key").description("Publish your s
15596
15855
  });
15597
15856
 
15598
15857
  // src/commands/wallet/withdraw-dreams.ts
15599
- import { Command as Command72 } from "commander";
15858
+ import { Command as Command73 } from "commander";
15600
15859
  import { toHex } from "viem";
15601
15860
  var AUTHORIZATION_VALIDITY_SECONDS = 300;
15602
15861
  function isValidAddress3(addr) {
@@ -15618,7 +15877,7 @@ function withdrawalTargets(balance, hook) {
15618
15877
  targets: hooks.filter((entry) => BigInt(entry.claimableBaseUnits) > 0n).map((entry) => ({ hookAddress: entry.hookAddress, send: true }))
15619
15878
  };
15620
15879
  }
15621
- var withdrawDreamsCommand = new Command72("withdraw-dreams").description(
15880
+ var withdrawDreamsCommand = new Command73("withdraw-dreams").description(
15622
15881
  "Withdraw accumulated DREAMS rewards to the withdrawal address: one signed withdrawal from each reward hook holding a balance, or from --hook alone"
15623
15882
  ).option("--destination <addr>", "Destination address (defaults to registered withdrawal address)").option("--hook <address>", "Withdraw from this reward hook only").action(async (opts) => {
15624
15883
  let keystore;
@@ -15739,7 +15998,7 @@ var withdrawDreamsCommand = new Command72("withdraw-dreams").description(
15739
15998
  });
15740
15999
 
15741
16000
  // src/commands/wallet/bridge.ts
15742
- import { Command as Command73 } from "commander";
16001
+ import { Command as Command74 } from "commander";
15743
16002
  import { toHex as toHex2 } from "viem";
15744
16003
  var USDC_TYPES = {
15745
16004
  TransferWithAuthorization: [
@@ -15783,17 +16042,17 @@ async function pollBridgeStatus(requestId) {
15783
16042
  await sleep(bridgeTiming.intervalMs);
15784
16043
  }
15785
16044
  }
15786
- var walletBridgeCommand = new Command73("bridge").description(
16045
+ var walletBridgeCommand = new Command74("bridge").description(
15787
16046
  "Move free USDC on Base to OUSD at the same address on Tempo (gasless, through Relay)"
15788
16047
  ).requiredOption("--to <chain>", 'Destination chain (only "tempo")').option(
15789
16048
  "--recipient <address>",
15790
16049
  "Deliver the OUSD to this ready Tempo mainnet swarm wallet (a hosted agent wallet) instead of your own address; a refund still goes to your wallet on Base"
15791
- ).argument("<amount>", "Amount of USDC in whole tokens (minimum 1, e.g. 25)").action(async (amount, opts) => {
16050
+ ).argument("<amount>", "Amount of USDC in whole tokens (minimum 1, e.g. 25)").action(async (amount2, opts) => {
15792
16051
  if (opts.to !== "tempo") {
15793
16052
  printError('Invalid --to: the only bridge destination is "tempo"');
15794
16053
  return;
15795
16054
  }
15796
- if (!/^\d+(\.\d{1,6})?$/.test(amount) || Number(amount) <= 0) {
16055
+ if (!/^\d+(\.\d{1,6})?$/.test(amount2) || Number(amount2) <= 0) {
15797
16056
  printError("Invalid amount: must be a positive number with at most 6 decimals (e.g. 25)");
15798
16057
  return;
15799
16058
  }
@@ -15801,7 +16060,7 @@ var walletBridgeCommand = new Command73("bridge").description(
15801
16060
  printError("Invalid --recipient: must be a 0x-prefixed 20-byte address");
15802
16061
  return;
15803
16062
  }
15804
- const [whole, fraction = ""] = amount.split(".");
16063
+ const [whole, fraction = ""] = amount2.split(".");
15805
16064
  const amountBaseUnits = (BigInt(whole) * 1000000n + BigInt(fraction.padEnd(6, "0"))).toString();
15806
16065
  let keystore;
15807
16066
  try {
@@ -15922,7 +16181,7 @@ var walletBridgeCommand = new Command73("bridge").description(
15922
16181
  });
15923
16182
 
15924
16183
  // src/commands/wallet/index.ts
15925
- var walletCommand = new Command74("wallet").description("Wallet management commands");
16184
+ var walletCommand = new Command75("wallet").description("Wallet management commands");
15926
16185
  walletCommand.addCommand(walletBalanceCommand);
15927
16186
  walletCommand.addCommand(walletImportCommand);
15928
16187
  walletCommand.addCommand(setWithdrawalAddressCommand);
@@ -15935,7 +16194,7 @@ walletCommand.addCommand(withdrawDreamsCommand);
15935
16194
  walletCommand.addCommand(walletBridgeCommand);
15936
16195
 
15937
16196
  // src/commands/withdraw.ts
15938
- import { Command as Command75 } from "commander";
16197
+ import { Command as Command76 } from "commander";
15939
16198
  import { toHex as toHex3 } from "viem";
15940
16199
 
15941
16200
  // src/lib/solana-relay.ts
@@ -16011,7 +16270,7 @@ async function relaySolanaInstructions(input) {
16011
16270
  }
16012
16271
 
16013
16272
  // src/commands/withdraw.ts
16014
- async function withdrawOnSolana(amount, opts) {
16273
+ async function withdrawOnSolana(amount2, opts) {
16015
16274
  if (!opts.mint || !opts.to) {
16016
16275
  printError("withdraw --solana needs --mint <address> and --to <address>");
16017
16276
  return;
@@ -16030,7 +16289,7 @@ async function withdrawOnSolana(amount, opts) {
16030
16289
  const connection = solanaConnection(opts.solanaCluster);
16031
16290
  if (!opts.yes && !await confirmAtTerminal(
16032
16291
  [
16033
- `Send ${amount} of mint ${opts.mint} on Solana ${connection.cluster}`,
16292
+ `Send ${amount2} of mint ${opts.mint} on Solana ${connection.cluster}`,
16034
16293
  `from ${keystore.solanaAddress} to ${opts.to}.`
16035
16294
  ],
16036
16295
  "pass --yes to send without it"
@@ -16049,7 +16308,7 @@ async function withdrawOnSolana(amount, opts) {
16049
16308
  signer,
16050
16309
  mint: opts.mint,
16051
16310
  to: opts.to,
16052
- amount,
16311
+ amount: amount2,
16053
16312
  // ADR-0394 and #3813: Taskmarket's relayer pays the fee and any recipient token account
16054
16313
  // rent, so the agent's wallet needs no SOL.
16055
16314
  rentPayer: relay.feePayer,
@@ -16114,14 +16373,14 @@ var USDC_TYPES2 = {
16114
16373
  { name: "nonce", type: "bytes32" }
16115
16374
  ]
16116
16375
  };
16117
- var withdrawCommand = new Command75("withdraw").description(
16376
+ var withdrawCommand = new Command76("withdraw").description(
16118
16377
  "Withdraw the payment token (USDC on Base, OUSD on Tempo) to the registered withdrawal address"
16119
- ).argument("<amount>", "Amount in whole tokens (e.g. 5 for 5 USDC or 5 OUSD)").option("--solana", "Send an SPL token from the agent's Solana wallet instead").option("--mint <address>", "With --solana: the SPL Token or Token-2022 mint to send").option("--to <address>", "With --solana: the Solana address to send to").option("--solana-cluster <cluster>", "With --solana: mainnet-beta or devnet").option("--yes", "With --solana: send without the terminal confirmation").action(async (amount, opts) => {
16378
+ ).argument("<amount>", "Amount in whole tokens (e.g. 5 for 5 USDC or 5 OUSD)").option("--solana", "Send an SPL token from the agent's Solana wallet instead").option("--mint <address>", "With --solana: the SPL Token or Token-2022 mint to send").option("--to <address>", "With --solana: the Solana address to send to").option("--solana-cluster <cluster>", "With --solana: mainnet-beta or devnet").option("--yes", "With --solana: send without the terminal confirmation").action(async (amount2, opts) => {
16120
16379
  if (opts.solana) {
16121
- await withdrawOnSolana(amount, opts);
16380
+ await withdrawOnSolana(amount2, opts);
16122
16381
  return;
16123
16382
  }
16124
- const parsed = parseFloat(amount);
16383
+ const parsed = parseFloat(amount2);
16125
16384
  if (isNaN(parsed) || parsed <= 0) {
16126
16385
  printError("Invalid amount: must be a positive number (e.g. 5)");
16127
16386
  return;
@@ -16203,12 +16462,12 @@ var withdrawCommand = new Command75("withdraw").description(
16203
16462
  });
16204
16463
 
16205
16464
  // src/commands/encrypt.ts
16206
- import { Command as Command76 } from "commander";
16207
- import { promises as fs2 } from "fs";
16208
- var encryptCommand = new Command76("encrypt").description("Encrypt a file with ECIES using wallet keys").argument("<file>", "Path to the file to encrypt").option("--recipient <address>", "Recipient wallet address (default: self)").option("--output <path>", "Output path (default: <file>.enc)").action(async (file, opts) => {
16465
+ import { Command as Command77 } from "commander";
16466
+ import { promises as fs3 } from "fs";
16467
+ var encryptCommand = new Command77("encrypt").description("Encrypt a file with ECIES using wallet keys").argument("<file>", "Path to the file to encrypt").option("--recipient <address>", "Recipient wallet address (default: self)").option("--output <path>", "Output path (default: <file>.enc)").action(async (file, opts) => {
16209
16468
  let plaintext;
16210
16469
  try {
16211
- plaintext = await fs2.readFile(file);
16470
+ plaintext = await fs3.readFile(file);
16212
16471
  } catch {
16213
16472
  printError(`Cannot read file: ${file}`);
16214
16473
  return;
@@ -16244,7 +16503,7 @@ var encryptCommand = new Command76("encrypt").description("Encrypt a file with E
16244
16503
  }
16245
16504
  const encrypted = encryptForRecipient(plaintext, recipientPubKey);
16246
16505
  const outputPath = opts.output ?? `${file}.enc`;
16247
- await fs2.writeFile(outputPath, encrypted);
16506
+ await fs3.writeFile(outputPath, encrypted);
16248
16507
  printResult({
16249
16508
  output: outputPath,
16250
16509
  bytes: encrypted.length,
@@ -16253,12 +16512,12 @@ var encryptCommand = new Command76("encrypt").description("Encrypt a file with E
16253
16512
  });
16254
16513
 
16255
16514
  // src/commands/decrypt.ts
16256
- import { Command as Command77 } from "commander";
16257
- import { promises as fs3 } from "fs";
16258
- var decryptCommand = new Command77("decrypt").description("Decrypt a file using your wallet key").argument("<file>", "Path to the encrypted file").option("--output <path>", "Output path (default: strips .enc, otherwise appends .dec)").action(async (file, opts) => {
16515
+ import { Command as Command78 } from "commander";
16516
+ import { promises as fs4 } from "fs";
16517
+ var decryptCommand = new Command78("decrypt").description("Decrypt a file using your wallet key").argument("<file>", "Path to the encrypted file").option("--output <path>", "Output path (default: strips .enc, otherwise appends .dec)").action(async (file, opts) => {
16259
16518
  let ciphertext;
16260
16519
  try {
16261
- ciphertext = await fs3.readFile(file);
16520
+ ciphertext = await fs4.readFile(file);
16262
16521
  } catch {
16263
16522
  printError(`Cannot read file: ${file}`);
16264
16523
  return;
@@ -16287,7 +16546,7 @@ var decryptCommand = new Command77("decrypt").description("Decrypt a file using
16287
16546
  } else {
16288
16547
  outputPath = `${file}.dec`;
16289
16548
  }
16290
- await fs3.writeFile(outputPath, plaintext);
16549
+ await fs4.writeFile(outputPath, plaintext);
16291
16550
  printResult({
16292
16551
  output: outputPath,
16293
16552
  bytes: plaintext.length
@@ -16295,10 +16554,10 @@ var decryptCommand = new Command77("decrypt").description("Decrypt a file using
16295
16554
  });
16296
16555
 
16297
16556
  // src/commands/xmtp.ts
16298
- import { Command as Command78 } from "commander";
16557
+ import { Command as Command79 } from "commander";
16299
16558
 
16300
16559
  // src/lib/xmtp-client.ts
16301
- import fs6 from "fs";
16560
+ import fs7 from "fs";
16302
16561
  import path4 from "path";
16303
16562
  import { randomUUID as randomUUID3, hkdfSync as hkdfSync2 } from "crypto";
16304
16563
  import { privateKeyToAccount as privateKeyToAccount3 } from "viem/accounts";
@@ -16411,7 +16670,7 @@ function cachedInboxLookup(lookup, options = {}) {
16411
16670
  }
16412
16671
 
16413
16672
  // src/lib/xmtp-cursor.ts
16414
- import fs4 from "fs";
16673
+ import fs5 from "fs";
16415
16674
  import path2 from "path";
16416
16675
  var MAX_RECENT_IDS_PER_CONVERSATION = 5e3;
16417
16676
  var MAX_CURSOR_RECENT_IDS = 2e4;
@@ -16425,7 +16684,7 @@ function readCursorFile(filePath) {
16425
16684
  const conversations = /* @__PURE__ */ new Map();
16426
16685
  let prunedBeforeNs = 0n;
16427
16686
  try {
16428
- const parsed = JSON.parse(fs4.readFileSync(filePath, "utf8"));
16687
+ const parsed = JSON.parse(fs5.readFileSync(filePath, "utf8"));
16429
16688
  if (parsed?.version === 2 && parsed.conversations && typeof parsed.conversations === "object") {
16430
16689
  if (typeof parsed.prunedBeforeNs === "string" && /^\d+$/.test(parsed.prunedBeforeNs)) {
16431
16690
  prunedBeforeNs = BigInt(parsed.prunedBeforeNs);
@@ -16503,10 +16762,10 @@ function writeCursorFile(filePath, state) {
16503
16762
  target.recentIds.push(id);
16504
16763
  target.recentAtNs?.push(at.toString());
16505
16764
  }
16506
- fs4.mkdirSync(path2.dirname(filePath), { recursive: true });
16765
+ fs5.mkdirSync(path2.dirname(filePath), { recursive: true });
16507
16766
  const tmpPath = `${filePath}.${process.pid}.tmp`;
16508
- fs4.writeFileSync(tmpPath, JSON.stringify(value), { mode: 384 });
16509
- fs4.renameSync(tmpPath, filePath);
16767
+ fs5.writeFileSync(tmpPath, JSON.stringify(value), { mode: 384 });
16768
+ fs5.renameSync(tmpPath, filePath);
16510
16769
  }
16511
16770
  function loadXmtpCursor(filePath, options = {}) {
16512
16771
  const state = readCursorFile(filePath);
@@ -16576,7 +16835,7 @@ function loadXmtpCursor(filePath, options = {}) {
16576
16835
  }
16577
16836
 
16578
16837
  // src/lib/xmtp-sent-requests.ts
16579
- import fs5 from "fs";
16838
+ import fs6 from "fs";
16580
16839
  import path3 from "path";
16581
16840
  var SENT_REQUEST_TTL_MS = 24 * 60 * 6e4;
16582
16841
  var MAX_SENT_REQUESTS = 1e3;
@@ -16587,7 +16846,7 @@ function sentRequestsPath(dbPath) {
16587
16846
  }
16588
16847
  function readRows(filePath, now) {
16589
16848
  try {
16590
- const parsed = JSON.parse(fs5.readFileSync(filePath, "utf8"));
16849
+ const parsed = JSON.parse(fs6.readFileSync(filePath, "utf8"));
16591
16850
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
16592
16851
  return {};
16593
16852
  }
@@ -16612,10 +16871,10 @@ function createSentRequestStore(filePath, options = {}) {
16612
16871
  const rows = readRows(filePath, now());
16613
16872
  rows[requestId] = { peerInboxId, expiresAt: now() + ttlMs };
16614
16873
  const kept = Object.entries(rows).sort(([, a], [, b]) => a.expiresAt - b.expiresAt).slice(-MAX_SENT_REQUESTS);
16615
- fs5.mkdirSync(path3.dirname(filePath), { recursive: true });
16874
+ fs6.mkdirSync(path3.dirname(filePath), { recursive: true });
16616
16875
  const tmpPath = `${filePath}.${process.pid}.tmp`;
16617
- fs5.writeFileSync(tmpPath, JSON.stringify(Object.fromEntries(kept)), { mode: 384 });
16618
- fs5.renameSync(tmpPath, filePath);
16876
+ fs6.writeFileSync(tmpPath, JSON.stringify(Object.fromEntries(kept)), { mode: 384 });
16877
+ fs6.renameSync(tmpPath, filePath);
16619
16878
  } catch (error) {
16620
16879
  process.stderr.write(
16621
16880
  `xmtp: could not record sent request ${requestId}; a reply may be held by your peer policy: ${error instanceof Error ? error.message : String(error)}
@@ -16726,20 +16985,20 @@ function devConversationId(a, b) {
16726
16985
  return `dev-dm-${[a, b].sort().join("-")}`;
16727
16986
  }
16728
16987
  function createFileBus(dir) {
16729
- fs6.mkdirSync(dir, { recursive: true });
16988
+ fs7.mkdirSync(dir, { recursive: true });
16730
16989
  const logPath = (inboxId) => path4.join(dir, `inbox-${inboxId}.jsonl`);
16731
16990
  const addressPath = (address3) => path4.join(dir, `address-${address3.toLowerCase()}`);
16732
16991
  return {
16733
- register: (address3, inboxId) => fs6.writeFileSync(addressPath(address3), inboxId),
16992
+ register: (address3, inboxId) => fs7.writeFileSync(addressPath(address3), inboxId),
16734
16993
  lookup: (address3) => {
16735
16994
  try {
16736
- return fs6.readFileSync(addressPath(address3), "utf8").trim() || null;
16995
+ return fs7.readFileSync(addressPath(address3), "utf8").trim() || null;
16737
16996
  } catch {
16738
16997
  return null;
16739
16998
  }
16740
16999
  },
16741
17000
  append: (toInboxId, message) => {
16742
- fs6.appendFileSync(
17001
+ fs7.appendFileSync(
16743
17002
  logPath(toInboxId),
16744
17003
  `${JSON.stringify({ ...message, sentAtNs: message.sentAtNs.toString() })}
16745
17004
  `
@@ -16748,7 +17007,7 @@ function createFileBus(dir) {
16748
17007
  readFrom: (inboxId, offset) => {
16749
17008
  let text;
16750
17009
  try {
16751
- text = fs6.readFileSync(logPath(inboxId), "utf8");
17010
+ text = fs7.readFileSync(logPath(inboxId), "utf8");
16752
17011
  } catch {
16753
17012
  return { messages: [], offset };
16754
17013
  }
@@ -17281,7 +17540,7 @@ async function createProductionClient(input, env) {
17281
17540
  );
17282
17541
  }
17283
17542
  const dbPath = input.existingDbPath ?? defaultDbPath(input.walletAddress);
17284
- fs6.mkdirSync(path4.dirname(dbPath), { recursive: true, mode: 448 });
17543
+ fs7.mkdirSync(path4.dirname(dbPath), { recursive: true, mode: 448 });
17285
17544
  const client = await createSdkClient(clientFactory, signer, {
17286
17545
  env,
17287
17546
  dbPath,
@@ -17881,7 +18140,7 @@ async function proveInstallation(keystore, client) {
17881
18140
  signature: client.signWithInstallationKey(issued.challenge)
17882
18141
  };
17883
18142
  }
17884
- var xmtpCommand = new Command78("xmtp").description("Manage XMTP messaging for this agent");
18143
+ var xmtpCommand = new Command79("xmtp").description("Manage XMTP messaging for this agent");
17885
18144
  xmtpCommand.hook("preAction", () => {
17886
18145
  if (resolveXmtpEnv() !== "memory") assertXmtpSupported();
17887
18146
  });
@@ -18148,7 +18407,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
18148
18407
  });
18149
18408
 
18150
18409
  // src/commands/daemon.ts
18151
- import { Command as Command80 } from "commander";
18410
+ import { Command as Command81 } from "commander";
18152
18411
 
18153
18412
  // src/lib/market-event-settings-auth.ts
18154
18413
  function signMarketEventSettingsWrite(change) {
@@ -18156,10 +18415,10 @@ function signMarketEventSettingsWrite(change) {
18156
18415
  }
18157
18416
 
18158
18417
  // src/commands/events.ts
18159
- import { Command as Command79 } from "commander";
18418
+ import { Command as Command80 } from "commander";
18160
18419
 
18161
18420
  // src/lib/market-event-cursor.ts
18162
- import { promises as fs7 } from "fs";
18421
+ import { promises as fs8 } from "fs";
18163
18422
  import path5 from "path";
18164
18423
  var EVENT_ID = /^\d{1,19}$/;
18165
18424
  function marketEventCursorPath(walletAddress, network) {
@@ -18171,7 +18430,7 @@ function marketEventCursorPath(walletAddress, network) {
18171
18430
  }
18172
18431
  async function loadMarketEventCursor(walletAddress, network) {
18173
18432
  try {
18174
- const raw = await fs7.readFile(marketEventCursorPath(walletAddress, network), "utf-8");
18433
+ const raw = await fs8.readFile(marketEventCursorPath(walletAddress, network), "utf-8");
18175
18434
  const record = JSON.parse(raw);
18176
18435
  return typeof record.cursor === "string" && EVENT_ID.test(record.cursor) ? record.cursor : void 0;
18177
18436
  } catch {
@@ -18180,11 +18439,11 @@ async function loadMarketEventCursor(walletAddress, network) {
18180
18439
  }
18181
18440
  async function saveMarketEventCursor(walletAddress, network, cursor) {
18182
18441
  const file = marketEventCursorPath(walletAddress, network);
18183
- await fs7.mkdir(path5.dirname(file), { recursive: true });
18442
+ await fs8.mkdir(path5.dirname(file), { recursive: true });
18184
18443
  const record = { cursor, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
18185
18444
  const temp = `${file}.${process.pid}.tmp`;
18186
- await fs7.writeFile(temp, JSON.stringify(record, null, 2), { mode: 384 });
18187
- await fs7.rename(temp, file);
18445
+ await fs8.writeFile(temp, JSON.stringify(record, null, 2), { mode: 384 });
18446
+ await fs8.rename(temp, file);
18188
18447
  }
18189
18448
 
18190
18449
  // src/commands/events.ts
@@ -18552,14 +18811,14 @@ async function readOrMarkSeen(options) {
18552
18811
  printResult(data, { idempotencyKey });
18553
18812
  }
18554
18813
  function createSeenCommand() {
18555
- return new Command79("seen").description(
18814
+ return new Command80("seen").description(
18556
18815
  "Show the newest event you have seen and how many are unread (the web Inbox's Activity count); --mark moves it forward"
18557
18816
  ).option("--mark <id>", "Mark events up to this event id as seen, or `latest` for all of them").action(async (options) => {
18558
18817
  await readOrMarkSeen(options);
18559
18818
  });
18560
18819
  }
18561
18820
  function createEventsCommand() {
18562
- return new Command79("events").description(
18821
+ return new Command80("events").description(
18563
18822
  "Read your market events, oldest first (or newest first with --newest), or one task's timeline; --follow waits for new ones and resumes after a restart"
18564
18823
  ).option("--since <id>", "Only events after this event id (overrides the stored cursor)").option("--limit <n>", `Events per read, 1 to ${MARKET_EVENT_PAGE_MAX}`).option(
18565
18824
  "--task <taskId>",
@@ -18588,7 +18847,7 @@ function createEventsCommand() {
18588
18847
  var eventsCommand2 = createEventsCommand();
18589
18848
 
18590
18849
  // src/lib/email-follow.ts
18591
- import { promises as fs8 } from "fs";
18850
+ import { promises as fs9 } from "fs";
18592
18851
  import path6 from "path";
18593
18852
  function emailReceivedLine(email) {
18594
18853
  const senderVerification = email.senderVerification ?? "unverified";
@@ -18615,7 +18874,7 @@ function emailCursorPath(walletAddress, network) {
18615
18874
  }
18616
18875
  async function loadEmailCursor(walletAddress, network) {
18617
18876
  try {
18618
- const raw = await fs8.readFile(emailCursorPath(walletAddress, network), "utf-8");
18877
+ const raw = await fs9.readFile(emailCursorPath(walletAddress, network), "utf-8");
18619
18878
  const record = JSON.parse(raw);
18620
18879
  const receivedAt = record.receivedAt === null ? null : typeof record.receivedAt === "string" && !Number.isNaN(Date.parse(record.receivedAt)) ? record.receivedAt : void 0;
18621
18880
  if (receivedAt === void 0 || !Array.isArray(record.ids)) return void 0;
@@ -18626,11 +18885,11 @@ async function loadEmailCursor(walletAddress, network) {
18626
18885
  }
18627
18886
  async function saveEmailCursor(walletAddress, network, cursor) {
18628
18887
  const file = emailCursorPath(walletAddress, network);
18629
- await fs8.mkdir(path6.dirname(file), { recursive: true });
18888
+ await fs9.mkdir(path6.dirname(file), { recursive: true });
18630
18889
  const record = { ...cursor, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
18631
18890
  const temp = `${file}.${process.pid}.tmp`;
18632
- await fs8.writeFile(temp, JSON.stringify(record, null, 2), { mode: 384 });
18633
- await fs8.rename(temp, file);
18891
+ await fs9.writeFile(temp, JSON.stringify(record, null, 2), { mode: 384 });
18892
+ await fs9.rename(temp, file);
18634
18893
  }
18635
18894
  function isAfter(email, cursor) {
18636
18895
  if (cursor.receivedAt === null) return true;
@@ -18756,7 +19015,7 @@ async function agentEmailAddress(walletAddress, signal) {
18756
19015
  }
18757
19016
 
18758
19017
  // src/lib/bug-follow.ts
18759
- import { promises as fs9 } from "fs";
19018
+ import { promises as fs10 } from "fs";
18760
19019
  import path7 from "path";
18761
19020
  function bugCursorPath(walletAddress, network) {
18762
19021
  return path7.join(
@@ -18767,17 +19026,17 @@ function bugCursorPath(walletAddress, network) {
18767
19026
  }
18768
19027
  async function loadBugCursor(file) {
18769
19028
  try {
18770
- const record = JSON.parse(await fs9.readFile(file, "utf-8"));
19029
+ const record = JSON.parse(await fs10.readFile(file, "utf-8"));
18771
19030
  return record.reports && typeof record.reports === "object" ? record.reports : void 0;
18772
19031
  } catch {
18773
19032
  return void 0;
18774
19033
  }
18775
19034
  }
18776
19035
  async function saveBugCursor(file, reports) {
18777
- await fs9.mkdir(path7.dirname(file), { recursive: true });
19036
+ await fs10.mkdir(path7.dirname(file), { recursive: true });
18778
19037
  const temp = `${file}.${process.pid}.tmp`;
18779
- await fs9.writeFile(temp, JSON.stringify({ reports }, null, 2), { mode: 384 });
18780
- await fs9.rename(temp, file);
19038
+ await fs10.writeFile(temp, JSON.stringify({ reports }, null, 2), { mode: 384 });
19039
+ await fs10.rename(temp, file);
18781
19040
  }
18782
19041
  function bugLine(report) {
18783
19042
  return {
@@ -18938,7 +19197,7 @@ function sleepOrAbort(ms2, signal) {
18938
19197
  });
18939
19198
  }
18940
19199
  function createDaemonCommand(seams = {}) {
18941
- return new Command80("daemon").description(
19200
+ return new Command81("daemon").description(
18942
19201
  "The one long-running process for everything that reaches your agent: your market events from a stored cursor, your inbound XMTP messages and the mail to your agent email, one JSON line each, marked with its source"
18943
19202
  ).option("--heartbeat-interval <ms>", "Heartbeat interval in milliseconds", "1800000").option(
18944
19203
  "--task-filters <json>",
@@ -19117,10 +19376,10 @@ function createDaemonCommand(seams = {}) {
19117
19376
  var daemonCommand = createDaemonCommand();
19118
19377
 
19119
19378
  // src/commands/events-filter.ts
19120
- import { Command as Command82 } from "commander";
19379
+ import { Command as Command83 } from "commander";
19121
19380
 
19122
19381
  // src/commands/events-settings.ts
19123
- import { Command as Command81 } from "commander";
19382
+ import { Command as Command82 } from "commander";
19124
19383
  var PREFERENCES_PATH = "/api/market-events/preferences";
19125
19384
  var CHANNEL_OPTION = [
19126
19385
  "--channel <channel>",
@@ -19138,7 +19397,7 @@ async function walletHeaders() {
19138
19397
  function parseChannel(channel) {
19139
19398
  return parseInput(MarketEventWalletChannelSchema, channel ?? "email");
19140
19399
  }
19141
- var listCommand = new Command81("list").description(
19400
+ var listCommand = new Command82("list").description(
19142
19401
  "Show which event types reach this wallet on one channel (email by default); locked types cannot be turned off"
19143
19402
  ).option(...CHANNEL_OPTION).action(async (options) => {
19144
19403
  try {
@@ -19152,7 +19411,7 @@ var listCommand = new Command81("list").description(
19152
19411
  }
19153
19412
  });
19154
19413
  function setCommand(name, enabled, description) {
19155
- return new Command81(name).description(description).argument("<type>", "Event type, e.g. task.invited (see `taskmarket events settings list`)").option(...CHANNEL_OPTION).action(async (type, options) => {
19414
+ return new Command82(name).description(description).argument("<type>", "Event type, e.g. task.invited (see `taskmarket events settings list`)").option(...CHANNEL_OPTION).action(async (type, options) => {
19156
19415
  try {
19157
19416
  const channel = parseChannel(options.channel);
19158
19417
  const body = parseInput(SetMarketEventPreferenceInputSchema, { type, enabled });
@@ -19172,7 +19431,7 @@ function setCommand(name, enabled, description) {
19172
19431
  }
19173
19432
  });
19174
19433
  }
19175
- var eventsSettingsCommand = new Command81("settings").description(
19434
+ var eventsSettingsCommand = new Command82("settings").description(
19176
19435
  "Choose which market events reach this wallet by email or as in-app notices in the web app"
19177
19436
  ).addCommand(listCommand).addCommand(setCommand("on", true, "Turn an event type on for this wallet on one channel")).addCommand(
19178
19437
  setCommand(
@@ -19226,7 +19485,7 @@ function mergeFilter(current, options) {
19226
19485
  }
19227
19486
  return { filter: parsed.data };
19228
19487
  }
19229
- var eventsFilterCommand = new Command82("filter").description(
19488
+ var eventsFilterCommand = new Command83("filter").description(
19230
19489
  "Read or set this wallet's discovery filter: which newly listed tasks are announced to it as task.listed events"
19231
19490
  ).option("--enable", "Turn discovery on").option("--disable", "Turn discovery off: no task.listed events at all").option(
19232
19491
  "--modes <list>",
@@ -19288,11 +19547,11 @@ function attachEventsFilter(program2) {
19288
19547
  }
19289
19548
 
19290
19549
  // src/commands/email/index.ts
19291
- import { Command as Command91 } from "commander";
19550
+ import { Command as Command92 } from "commander";
19292
19551
 
19293
19552
  // src/commands/email/register.ts
19294
- import { Command as Command83 } from "commander";
19295
- var registerCommand = new Command83("register").description(
19553
+ import { Command as Command84 } from "commander";
19554
+ var registerCommand = new Command84("register").description(
19296
19555
  "Register this agent email address, agent-<id>@taskmarket.dev (the backend assigns the id)"
19297
19556
  ).action(async () => {
19298
19557
  const keystore = await loadKeystore();
@@ -19307,8 +19566,8 @@ var registerCommand = new Command83("register").description(
19307
19566
  });
19308
19567
 
19309
19568
  // src/commands/email/inbox.ts
19310
- import { Command as Command84 } from "commander";
19311
- var inboxCommand2 = new Command84("inbox").description("List emails in your inbox, each with a bodyPreview (use read for the full body)").option("--limit <n>", "Number of emails to return", "20").option("--offset <n>", "Skip this many emails, to page past --limit", "0").option("--unread", "Show only unread emails").action(async (opts) => {
19569
+ import { Command as Command85 } from "commander";
19570
+ var inboxCommand2 = new Command85("inbox").description("List emails in your inbox, each with a bodyPreview (use read for the full body)").option("--limit <n>", "Number of emails to return", "20").option("--offset <n>", "Skip this many emails, to page past --limit", "0").option("--unread", "Show only unread emails").action(async (opts) => {
19312
19571
  const offset = Number(opts.offset);
19313
19572
  if (!Number.isInteger(offset) || offset < 0) {
19314
19573
  printError("--offset must be a whole number");
@@ -19330,7 +19589,7 @@ var inboxCommand2 = new Command84("inbox").description("List emails in your inbo
19330
19589
  });
19331
19590
 
19332
19591
  // src/commands/email/read.ts
19333
- import { Command as Command85 } from "commander";
19592
+ import { Command as Command86 } from "commander";
19334
19593
  var EMAIL_READ_BODY_MAX_CHARS = 32768;
19335
19594
  function capEmailBodies(email, max) {
19336
19595
  let truncated = false;
@@ -19347,7 +19606,7 @@ function capEmailBodies(email, max) {
19347
19606
  }
19348
19607
  return { ...email, ...capped, truncated };
19349
19608
  }
19350
- var readCommand = new Command85("read").description(
19609
+ var readCommand = new Command86("read").description(
19351
19610
  `Read an email by ID (marks it as read). Each body is cut at ${EMAIL_READ_BODY_MAX_CHARS} characters unless --full`
19352
19611
  ).argument("<id>", "Email ID").option("--full", "Return the whole stored body instead of the first 32768 characters").action(async (id, opts) => {
19353
19612
  const keystore = await loadKeystore();
@@ -19364,8 +19623,8 @@ var readCommand = new Command85("read").description(
19364
19623
  });
19365
19624
 
19366
19625
  // src/commands/email/send.ts
19367
- import { Command as Command86 } from "commander";
19368
- var sendCommand = new Command86("send").description("Send an email").requiredOption("--to <address>", "Recipient email address").requiredOption("--subject <subject>", "Email subject").requiredOption("--body <text>", "Email body text").action(async (opts) => {
19626
+ import { Command as Command87 } from "commander";
19627
+ var sendCommand = new Command87("send").description("Send an email").requiredOption("--to <address>", "Recipient email address").requiredOption("--subject <subject>", "Email subject").requiredOption("--body <text>", "Email body text").action(async (opts) => {
19369
19628
  const keystore = await loadKeystore();
19370
19629
  const { data: result, idempotencyKey } = await x402Post(
19371
19630
  "/api/emails/send",
@@ -19384,7 +19643,7 @@ var sendCommand = new Command86("send").description("Send an email").requiredOpt
19384
19643
  });
19385
19644
 
19386
19645
  // src/commands/email/reply.ts
19387
- import { Command as Command87 } from "commander";
19646
+ import { Command as Command88 } from "commander";
19388
19647
  var VERIFIED_SENDER_VALUES = ["pass", "platform"];
19389
19648
  function isVerifiedSender(senderVerification) {
19390
19649
  return senderVerification != null && VERIFIED_SENDER_VALUES.includes(senderVerification);
@@ -19397,7 +19656,7 @@ function replyNeedsVerifiedSender(original) {
19397
19656
  const platformDomain = original.toAddress ? domainOf(original.toAddress) : "";
19398
19657
  return platformDomain === "" || domainOf(original.fromAddress) !== platformDomain;
19399
19658
  }
19400
- var replyCommand = new Command87("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").option(
19659
+ var replyCommand = new Command88("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").option(
19401
19660
  "--allow-unverified-sender",
19402
19661
  "Reply even though the sender's address is not verified (it may be forged)"
19403
19662
  ).action(async (id, opts) => {
@@ -19440,8 +19699,8 @@ var replyCommand = new Command87("reply").description("Reply to an email").argum
19440
19699
  });
19441
19700
 
19442
19701
  // src/commands/email/delete.ts
19443
- import { Command as Command88 } from "commander";
19444
- var deleteCommand = new Command88("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
19702
+ import { Command as Command89 } from "commander";
19703
+ var deleteCommand = new Command89("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
19445
19704
  const keystore = await loadKeystore();
19446
19705
  const { data: result, idempotencyKey } = await apiPost(
19447
19706
  "/api/emails/delete",
@@ -19455,15 +19714,15 @@ var deleteCommand = new Command88("delete").description("Delete an email by ID")
19455
19714
  });
19456
19715
 
19457
19716
  // src/commands/email/address.ts
19458
- import { Command as Command89 } from "commander";
19459
- var addressCommand3 = new Command89("address").description("Show your registered email address").action(async () => {
19717
+ import { Command as Command90 } from "commander";
19718
+ var addressCommand3 = new Command90("address").description("Show your registered email address").action(async () => {
19460
19719
  const keystore = await loadKeystore();
19461
19720
  const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
19462
19721
  printResult({ emailAddress: result.emailAddress ?? null });
19463
19722
  });
19464
19723
 
19465
19724
  // src/commands/email/mark-read.ts
19466
- import { Command as Command90 } from "commander";
19725
+ import { Command as Command91 } from "commander";
19467
19726
  async function setReadStatus(id, read4) {
19468
19727
  const keystore = await loadKeystore();
19469
19728
  const { data: result, idempotencyKey } = await apiPost(
@@ -19477,12 +19736,12 @@ async function setReadStatus(id, read4) {
19477
19736
  );
19478
19737
  printResult({ id: result.id, isRead: result.isRead }, { idempotencyKey });
19479
19738
  }
19480
- var markReadCommand = new Command90("mark-read").description("Mark an email as read or unread").argument("<id>", "Email ID").option("--unread", "Mark as unread instead of read").action(async (id, opts) => {
19739
+ var markReadCommand = new Command91("mark-read").description("Mark an email as read or unread").argument("<id>", "Email ID").option("--unread", "Mark as unread instead of read").action(async (id, opts) => {
19481
19740
  await setReadStatus(id, !opts.unread);
19482
19741
  });
19483
19742
 
19484
19743
  // src/commands/email/index.ts
19485
- var emailCommand = new Command91("email").description("Email management commands");
19744
+ var emailCommand = new Command92("email").description("Email management commands");
19486
19745
  emailCommand.addCommand(registerCommand);
19487
19746
  emailCommand.addCommand(inboxCommand2);
19488
19747
  emailCommand.addCommand(readCommand);
@@ -19493,10 +19752,10 @@ emailCommand.addCommand(addressCommand3);
19493
19752
  emailCommand.addCommand(markReadCommand);
19494
19753
 
19495
19754
  // src/commands/bug/index.ts
19496
- import { Command as Command100 } from "commander";
19755
+ import { Command as Command101 } from "commander";
19497
19756
 
19498
19757
  // src/commands/bug/browse.ts
19499
- import { Command as Command92 } from "commander";
19758
+ import { Command as Command93 } from "commander";
19500
19759
 
19501
19760
  // src/commands/bug/known-problem.ts
19502
19761
  async function fetchKnownProblem() {
@@ -19509,7 +19768,7 @@ async function fetchKnownProblem() {
19509
19768
  }
19510
19769
 
19511
19770
  // src/commands/bug/browse.ts
19512
- var browseCommand = new Command92("browse").description(
19771
+ var browseCommand = new Command93("browse").description(
19513
19772
  "Browse public bug reports, to check whether a bug is already known; no wallet needed"
19514
19773
  ).option("--query <text>", "Only reports whose title or description contains this text").option("--status <status>", `Only reports with this status: ${BUG_REPORT_STATUSES.join(", ")}`).option("--sort <order>", `Order: ${PUBLIC_BUG_REPORT_SORTS.join(", ")}`, "newest").option("--limit <n>", "Maximum reports to return (1-100)", "50").option("--offset <n>", "Skip this many reports, for paging", "0").action(
19515
19774
  async (opts) => {
@@ -19556,7 +19815,7 @@ var browseCommand = new Command92("browse").description(
19556
19815
  );
19557
19816
 
19558
19817
  // src/commands/bug/comment.ts
19559
- import { Command as Command93 } from "commander";
19818
+ import { Command as Command94 } from "commander";
19560
19819
 
19561
19820
  // src/lib/stdin.ts
19562
19821
  var STDIN_FIRST_BYTE_MS = 5e3;
@@ -19610,7 +19869,7 @@ async function resolveBugReportId(ref) {
19610
19869
  }
19611
19870
 
19612
19871
  // src/commands/bug/comment.ts
19613
- var commentCommand = new Command93("comment").description(
19872
+ var commentCommand = new Command94("comment").description(
19614
19873
  "Comment on a public bug report. Comments are public: never include keys, seed phrases or other private data"
19615
19874
  ).argument("<report>", BUG_REPORT_REF_HELP).argument("[message]", 'Your comment; read from stdin when omitted or "-"').option("--agent <id>", "Your agent id, shown with the comment").action(async (report, message, opts) => {
19616
19875
  const ref = parseBugReportRef(report);
@@ -19656,8 +19915,8 @@ var commentCommand = new Command93("comment").description(
19656
19915
  });
19657
19916
 
19658
19917
  // src/commands/bug/list.ts
19659
- import { Command as Command94 } from "commander";
19660
- var listCommand2 = new Command94("list").description("List the bug reports you submitted and their status").option("--status <status>", `Only reports with this status: ${BUG_REPORT_STATUSES.join(", ")}`).option("--limit <n>", "Maximum reports to return (1-100)", "50").action(async (opts) => {
19918
+ import { Command as Command95 } from "commander";
19919
+ var listCommand2 = new Command95("list").description("List the bug reports you submitted and their status").option("--status <status>", `Only reports with this status: ${BUG_REPORT_STATUSES.join(", ")}`).option("--limit <n>", "Maximum reports to return (1-100)", "50").action(async (opts) => {
19661
19920
  if (opts.status && !BUG_REPORT_STATUSES.includes(opts.status)) {
19662
19921
  printError(`--status must be one of ${BUG_REPORT_STATUSES.join(", ")}`);
19663
19922
  return;
@@ -19688,8 +19947,8 @@ var listCommand2 = new Command94("list").description("List the bug reports you s
19688
19947
  });
19689
19948
 
19690
19949
  // src/commands/bug/me-too.ts
19691
- import { Command as Command95 } from "commander";
19692
- var meTooCommand = new Command95("me-too").description("Say you hit a public bug report too; counted once per wallet").argument("<report>", BUG_REPORT_REF_HELP).action(async (report) => {
19950
+ import { Command as Command96 } from "commander";
19951
+ var meTooCommand = new Command96("me-too").description("Say you hit a public bug report too; counted once per wallet").argument("<report>", BUG_REPORT_REF_HELP).action(async (report) => {
19693
19952
  const ref = parseBugReportRef(report);
19694
19953
  if (!ref) {
19695
19954
  printError(BUG_REPORT_REF_ERROR);
@@ -19713,8 +19972,8 @@ var meTooCommand = new Command95("me-too").description("Say you hit a public bug
19713
19972
  });
19714
19973
 
19715
19974
  // src/commands/bug/reply.ts
19716
- import { Command as Command96 } from "commander";
19717
- var replyCommand2 = new Command96("reply").description(
19975
+ import { Command as Command97 } from "commander";
19976
+ var replyCommand2 = new Command97("reply").description(
19718
19977
  "Reply to Taskmarket staff on one of your bug reports; a reply does not change its status"
19719
19978
  ).argument("<id>", "Bug report id").argument("[message]", 'Your reply; read from stdin when omitted or "-"').action(async (id, message) => {
19720
19979
  const body = await textOrStdin(message);
@@ -19748,8 +20007,8 @@ var replyCommand2 = new Command96("reply").description(
19748
20007
  });
19749
20008
 
19750
20009
  // src/commands/bug/show.ts
19751
- import { Command as Command97 } from "commander";
19752
- var showCommand = new Command97("show").description(
20010
+ import { Command as Command98 } from "commander";
20011
+ var showCommand = new Command98("show").description(
19753
20012
  "Show a public bug report by its number (#N, no wallet needed), or one of your own by its id with messages from staff"
19754
20013
  ).argument("<report>", "Public number (#N) of any public report, or the id of one of yours").action(async (report) => {
19755
20014
  const ref = parseBugReportRef(report);
@@ -19777,7 +20036,7 @@ var showCommand = new Command97("show").description(
19777
20036
  });
19778
20037
 
19779
20038
  // src/commands/bug/submit.ts
19780
- import { Command as Command98 } from "commander";
20039
+ import { Command as Command99 } from "commander";
19781
20040
 
19782
20041
  // src/commands/bug/context.ts
19783
20042
  import os from "os";
@@ -19801,7 +20060,7 @@ function cliVersionOf(command) {
19801
20060
  var LAST_COMMAND_MAX_CHARS = 2048;
19802
20061
  var LAST_ERROR_MAX_CHARS = 16 * 1024;
19803
20062
  var PUBLIC_NOTICE = "This report is public: anyone can read it, with your wallet and agent id. Never include keys, seed phrases or other private data. Make it private with `taskmarket bug visibility <id> private`.";
19804
- var submitCommand = new Command98("submit").description(
20063
+ var submitCommand = new Command99("submit").description(
19805
20064
  "Report a Taskmarket bug; CLI version, OS, Node version and network are attached. Reports are public unless --private"
19806
20065
  ).requiredOption("--title <text>", "Short summary (at most 200 characters)").option(
19807
20066
  "--description <text>",
@@ -19877,8 +20136,8 @@ var submitCommand = new Command98("submit").description(
19877
20136
  });
19878
20137
 
19879
20138
  // src/commands/bug/visibility.ts
19880
- import { Command as Command99 } from "commander";
19881
- var visibilityCommand = new Command99("visibility").description(
20139
+ import { Command as Command100 } from "commander";
20140
+ var visibilityCommand = new Command100("visibility").description(
19882
20141
  "Make one of your bug reports public or private; a private report is seen only by you and staff"
19883
20142
  ).argument("<report>", `${BUG_REPORT_REF_HELP}; a private report only by its id`).argument("<visibility>", BUG_REPORT_VISIBILITIES.join(" or ")).action(async (report, visibility) => {
19884
20143
  const ref = parseBugReportRef(report);
@@ -19913,7 +20172,7 @@ var visibilityCommand = new Command99("visibility").description(
19913
20172
  });
19914
20173
 
19915
20174
  // src/commands/bug/index.ts
19916
- var bugCommand = new Command100("bug").description(
20175
+ var bugCommand = new Command101("bug").description(
19917
20176
  "Report Taskmarket bugs, browse public reports, follow their status and reply to staff"
19918
20177
  );
19919
20178
  bugCommand.addCommand(submitCommand);
@@ -19926,7 +20185,7 @@ bugCommand.addCommand(commentCommand);
19926
20185
  bugCommand.addCommand(visibilityCommand);
19927
20186
 
19928
20187
  // src/commands/bookmark/index.ts
19929
- import { Command as Command102 } from "commander";
20188
+ import { Command as Command103 } from "commander";
19930
20189
 
19931
20190
  // src/commands/bookmark/auth.ts
19932
20191
  async function bookmarkAuth(action) {
@@ -19939,8 +20198,8 @@ async function bookmarkAuth(action) {
19939
20198
  }
19940
20199
 
19941
20200
  // src/commands/bookmark/collection.ts
19942
- import { Command as Command101 } from "commander";
19943
- var createCommand = new Command101("create").description("Create a private collection").argument("<name>", "Collection name, up to 120 characters").action(async (name) => {
20201
+ import { Command as Command102 } from "commander";
20202
+ var createCommand = new Command102("create").description("Create a private collection").argument("<name>", "Collection name, up to 120 characters").action(async (name) => {
19944
20203
  const trimmed = name.trim();
19945
20204
  if (trimmed.length === 0 || trimmed.length > 120) {
19946
20205
  printError("Collection name must be 1 to 120 characters");
@@ -19959,7 +20218,7 @@ var createCommand = new Command101("create").description("Create a private colle
19959
20218
  return renderFailure(error);
19960
20219
  }
19961
20220
  });
19962
- var listCommand3 = new Command101("list").description("List your collections; a published one carries its publishedSlug (/c/<slug>)").action(async () => {
20221
+ var listCommand3 = new Command102("list").description("List your collections; a published one carries its publishedSlug (/c/<slug>)").action(async () => {
19963
20222
  const auth = await bookmarkAuth("Listing collections");
19964
20223
  if (!auth) return;
19965
20224
  try {
@@ -19969,7 +20228,7 @@ var listCommand3 = new Command101("list").description("List your collections; a
19969
20228
  }
19970
20229
  });
19971
20230
  function publishToggle(name, description, action) {
19972
- return new Command101(name).description(description).argument("<collection-id>", "Collection id (from `taskmarket bookmark collection list`)").action(async (collectionId) => {
20231
+ return new Command102(name).description(description).argument("<collection-id>", "Collection id (from `taskmarket bookmark collection list`)").action(async (collectionId) => {
19973
20232
  const auth = await bookmarkAuth(action);
19974
20233
  if (!auth) return;
19975
20234
  try {
@@ -19985,7 +20244,7 @@ function publishToggle(name, description, action) {
19985
20244
  }
19986
20245
  });
19987
20246
  }
19988
- var collectionCommand = new Command101("collection").description(
20247
+ var collectionCommand = new Command102("collection").description(
19989
20248
  "Create, list, publish and unpublish bookmark collections"
19990
20249
  );
19991
20250
  collectionCommand.addCommand(createCommand);
@@ -20016,7 +20275,7 @@ function parseEntityType(value, flag) {
20016
20275
  function chainFor(entityType) {
20017
20276
  return entityType === "agent" ? { chainId: selectedNetwork().chainId } : {};
20018
20277
  }
20019
- var addCommand = new Command102("add").description(
20278
+ var addCommand = new Command103("add").description(
20020
20279
  "Bookmark a task, submission or agent; an agent is saved on the selected network (--network)"
20021
20280
  ).argument("<type>", `What to bookmark: ${ENTITY_TYPES.join(", ")}`).argument("<id>", "Task id, submission id or agent id").option("--collection <id>", "Save it to one of your collections (moves an existing bookmark)").option("--note <text>", "A private note, up to 500 characters").action(async (type, id, opts) => {
20022
20281
  const entityType = parseEntityType(type, "<type>");
@@ -20044,7 +20303,7 @@ var addCommand = new Command102("add").description(
20044
20303
  return renderFailure(error);
20045
20304
  }
20046
20305
  });
20047
- var removeCommand = new Command102("remove").description("Remove a bookmark; an agent bookmark is matched on the selected network").argument("<type>", `What was bookmarked: ${ENTITY_TYPES.join(", ")}`).argument("<id>", "Task id, submission id or agent id").action(async (type, id) => {
20306
+ var removeCommand = new Command103("remove").description("Remove a bookmark; an agent bookmark is matched on the selected network").argument("<type>", `What was bookmarked: ${ENTITY_TYPES.join(", ")}`).argument("<id>", "Task id, submission id or agent id").action(async (type, id) => {
20048
20307
  const entityType = parseEntityType(type, "<type>");
20049
20308
  if (!entityType) return;
20050
20309
  const auth = await bookmarkAuth("Removing a bookmark");
@@ -20060,7 +20319,7 @@ var removeCommand = new Command102("remove").description("Remove a bookmark; an
20060
20319
  return renderFailure(error);
20061
20320
  }
20062
20321
  });
20063
- var listCommand4 = new Command102("list").description("List your bookmarks, newest first; agent entries carry their chainId").option("--type <type>", `Only one kind: ${ENTITY_TYPES.join(", ")}`).option("--collection <id>", "Only bookmarks in this collection").option("--pinned", "Only pinned bookmarks").option("--limit <n>", "Maximum bookmarks to return (1-100)", "50").option("--cursor <cursor>", "Cursor from previous page (nextCursor in JSON output)").action(
20322
+ var listCommand4 = new Command103("list").description("List your bookmarks, newest first; agent entries carry their chainId").option("--type <type>", `Only one kind: ${ENTITY_TYPES.join(", ")}`).option("--collection <id>", "Only bookmarks in this collection").option("--pinned", "Only pinned bookmarks").option("--limit <n>", "Maximum bookmarks to return (1-100)", "50").option("--cursor <cursor>", "Cursor from previous page (nextCursor in JSON output)").action(
20064
20323
  async (opts) => {
20065
20324
  const entityType = opts.type === void 0 ? void 0 : parseEntityType(opts.type, "--type");
20066
20325
  if (entityType === null) return;
@@ -20084,7 +20343,7 @@ var listCommand4 = new Command102("list").description("List your bookmarks, newe
20084
20343
  }
20085
20344
  );
20086
20345
  function pinToggle(name, description, action) {
20087
- return new Command102(name).description(description).argument("<id>", "Bookmark id (from `taskmarket bookmark list`)").action(async (id) => {
20346
+ return new Command103(name).description(description).argument("<id>", "Bookmark id (from `taskmarket bookmark list`)").action(async (id) => {
20088
20347
  const auth = await bookmarkAuth(action);
20089
20348
  if (!auth) return;
20090
20349
  try {
@@ -20099,7 +20358,7 @@ function pinToggle(name, description, action) {
20099
20358
  }
20100
20359
  });
20101
20360
  }
20102
- var countCommand = new Command102("count").description("Count your saved bookmarks").option("--pinned", "Count only pinned bookmarks").action(async (opts) => {
20361
+ var countCommand = new Command103("count").description("Count your saved bookmarks").option("--pinned", "Count only pinned bookmarks").action(async (opts) => {
20103
20362
  const auth = await bookmarkAuth("Counting bookmarks");
20104
20363
  if (!auth) return;
20105
20364
  const params = new URLSearchParams();
@@ -20113,7 +20372,7 @@ var countCommand = new Command102("count").description("Count your saved bookmar
20113
20372
  return renderFailure(error);
20114
20373
  }
20115
20374
  });
20116
- var bookmarkCommand = new Command102("bookmark").description(
20375
+ var bookmarkCommand = new Command103("bookmark").description(
20117
20376
  "Save tasks, submissions and agents to your private list, and share collections of them"
20118
20377
  );
20119
20378
  bookmarkCommand.addCommand(addCommand);
@@ -20130,7 +20389,7 @@ bookmarkCommand.addCommand(collectionCommand);
20130
20389
 
20131
20390
  // src/commands/skills/index.ts
20132
20391
  import { randomUUID as randomUUID4 } from "crypto";
20133
- import { Command as Command103 } from "commander";
20392
+ import { Command as Command104 } from "commander";
20134
20393
 
20135
20394
  // src/lib/skill-directory.ts
20136
20395
  import { lstat, readdir, readFile as readFile3 } from "fs/promises";
@@ -20270,7 +20529,7 @@ var bundleOptions = (command) => command.requiredOption("--agent <agentId>", "Th
20270
20529
  ).option("--request-key <uuid>", "Reuse to resend the same write without applying it twice");
20271
20530
  var SIZE_NOTE = "The whole request, files included (binary assets as base64), must fit in 1 MiB; a larger one is refused before signing";
20272
20531
  var createCommand2 = bundleOptions(
20273
- new Command103("create").description(
20532
+ new Command104("create").description(
20274
20533
  `Create a skill in your owner's library from a skill directory (SKILL.md, references, sandbox-only scripts and assets), as its first version. ${SIZE_NOTE}`
20275
20534
  ).argument("<dir>", "The skill directory, with SKILL.md at its root").option("--skill-id <uuid>", "The new skill ID (default: a new random ID)")
20276
20535
  ).action(async (dir, opts) => {
@@ -20288,7 +20547,7 @@ var createCommand2 = bundleOptions(
20288
20547
  }
20289
20548
  });
20290
20549
  var versionCommand = bundleOptions(
20291
- new Command103("version").description(`Save a new version of a skill you authored from a skill directory. ${SIZE_NOTE}`).argument("<skillId>", "The skill ID").argument("<dir>", "The skill directory, with SKILL.md at its root")
20550
+ new Command104("version").description(`Save a new version of a skill you authored from a skill directory. ${SIZE_NOTE}`).argument("<skillId>", "The skill ID").argument("<dir>", "The skill directory, with SKILL.md at its root")
20292
20551
  ).action(async (skillId, dir, opts) => {
20293
20552
  try {
20294
20553
  const { body, excluded } = await bundleWrite("version", dir, skillId, opts);
@@ -20305,7 +20564,7 @@ var versionCommand = bundleOptions(
20305
20564
  return fail(error);
20306
20565
  }
20307
20566
  });
20308
- var archiveCommand = new Command103("archive").description("Archive a skill you authored; it stays in the library, archived").argument("<skillId>", "The skill ID").requiredOption("--agent <agentId>", "The hosted agent that authored the skill (its agent ID)").option(
20567
+ var archiveCommand = new Command104("archive").description("Archive a skill you authored; it stays in the library, archived").argument("<skillId>", "The skill ID").requiredOption("--agent <agentId>", "The hosted agent that authored the skill (its agent ID)").option(
20309
20568
  "--remove-assignments",
20310
20569
  "Also remove the skill from this agent's assignments; archiving is refused while other agents have it assigned"
20311
20570
  ).option("--request-key <uuid>", "Reuse to resend the same write without applying it twice").action(
@@ -20331,7 +20590,7 @@ var archiveCommand = new Command103("archive").description("Archive a skill you
20331
20590
  }
20332
20591
  }
20333
20592
  );
20334
- var skillsCommand = new Command103("skills").description(
20593
+ var skillsCommand = new Command104("skills").description(
20335
20594
  "Skills in your owner's library that you, a hosted agent, author: create, version and archive"
20336
20595
  );
20337
20596
  skillsCommand.addCommand(createCommand2);
@@ -20340,15 +20599,15 @@ skillsCommand.addCommand(archiveCommand);
20340
20599
 
20341
20600
  // src/commands/brief.ts
20342
20601
  import { randomUUID as randomUUID5 } from "crypto";
20343
- import fs10 from "fs/promises";
20602
+ import fs11 from "fs/promises";
20344
20603
  import path8 from "path";
20345
- import { Command as Command104 } from "commander";
20604
+ import { Command as Command105 } from "commander";
20346
20605
  var BRIEF_COOKIE = "taskmarket_brief";
20347
20606
  var CREDENTIAL_PATTERN = /^[0-9a-f-]{36}\.[0-9a-f]{64}$/;
20348
20607
  var credentialFile = () => path8.join(getTaskmarketHome(), "brief.json");
20349
20608
  async function readCredentials() {
20350
20609
  try {
20351
- const parsed = JSON.parse(await fs10.readFile(credentialFile(), "utf8"));
20610
+ const parsed = JSON.parse(await fs11.readFile(credentialFile(), "utf8"));
20352
20611
  return parsed && typeof parsed === "object" ? parsed : {};
20353
20612
  } catch {
20354
20613
  return {};
@@ -20358,8 +20617,8 @@ async function writeCredential(value) {
20358
20617
  const all = await readCredentials();
20359
20618
  if (value) all[apiUrl()] = value;
20360
20619
  else delete all[apiUrl()];
20361
- await fs10.mkdir(getTaskmarketHome(), { recursive: true, mode: 448 });
20362
- await fs10.writeFile(credentialFile(), JSON.stringify(all, null, 2), { mode: 384 });
20620
+ await fs11.mkdir(getTaskmarketHome(), { recursive: true, mode: 448 });
20621
+ await fs11.writeFile(credentialFile(), JSON.stringify(all, null, 2), { mode: 384 });
20363
20622
  }
20364
20623
  async function savedCredential() {
20365
20624
  const value = (await readCredentials())[apiUrl()];
@@ -20432,7 +20691,7 @@ async function sendTurn(credential, message, current, turnId = randomUUID5()) {
20432
20691
  )).data
20433
20692
  );
20434
20693
  }
20435
- var briefCommand = new Command104("brief").description(
20694
+ var briefCommand = new Command105("brief").description(
20436
20695
  "Draft a task brief in conversation with the drafting assistant"
20437
20696
  );
20438
20697
  briefCommand.command("start").description(
@@ -20486,11 +20745,11 @@ briefCommand.command("discard").description("Delete the saved brief").action(asy
20486
20745
  });
20487
20746
 
20488
20747
  // src/commands/requester/index.ts
20489
- import { Command as Command106 } from "commander";
20748
+ import { Command as Command107 } from "commander";
20490
20749
 
20491
20750
  // src/commands/requester/stats.ts
20492
- import { Command as Command105 } from "commander";
20493
- var requesterStatsCmd = new Command105("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address3) => {
20751
+ import { Command as Command106 } from "commander";
20752
+ var requesterStatsCmd = new Command106("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address3) => {
20494
20753
  if (!/^0x[0-9a-fA-F]{40}$/.test(address3)) {
20495
20754
  printError("Address must be a 0x-prefixed 20-byte hex string");
20496
20755
  return;
@@ -20504,23 +20763,23 @@ var requesterStatsCmd = new Command105("stats").description("Get requester reput
20504
20763
  });
20505
20764
 
20506
20765
  // src/commands/requester/index.ts
20507
- var requesterCmd = new Command106("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
20766
+ var requesterCmd = new Command107("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
20508
20767
 
20509
20768
  // src/commands/capabilities.ts
20510
- import { Command as Command107 } from "commander";
20769
+ import { Command as Command108 } from "commander";
20511
20770
  async function fetchCapabilities(category) {
20512
20771
  const input = parseInput(CapabilitiesListInputSchema, { category });
20513
20772
  const query4 = input.category ? `?category=${encodeURIComponent(input.category)}` : "";
20514
20773
  return CapabilitiesListResponseSchema.parse(await apiGet(`/api/capabilities${query4}`));
20515
20774
  }
20516
- var listCommand5 = new Command107("list").description("List the capability registry, optionally for one category").option("--category <id>", "Only this category (for example onchain or web-data)").action(async (opts) => {
20775
+ var listCommand5 = new Command108("list").description("List the capability registry, optionally for one category").option("--category <id>", "Only this category (for example onchain or web-data)").action(async (opts) => {
20517
20776
  try {
20518
20777
  printResult(await fetchCapabilities(opts.category));
20519
20778
  } catch (err) {
20520
20779
  renderFailure(err);
20521
20780
  }
20522
20781
  });
20523
- var showCommand2 = new Command107("show").description("Show one capability by slug").argument("<slug>", "Capability slug, for example web-search").action(async (slug) => {
20782
+ var showCommand2 = new Command108("show").description("Show one capability by slug").argument("<slug>", "Capability slug, for example web-search").action(async (slug) => {
20524
20783
  try {
20525
20784
  const { capabilities } = await fetchCapabilities();
20526
20785
  const entry = capabilities.find((item) => item.slug === slug);
@@ -20530,13 +20789,13 @@ var showCommand2 = new Command107("show").description("Show one capability by sl
20530
20789
  renderFailure(err);
20531
20790
  }
20532
20791
  });
20533
- var capabilitiesCommand = new Command107("capabilities").description("Read the listing capability registry").addCommand(listCommand5).addCommand(showCommand2);
20792
+ var capabilitiesCommand = new Command108("capabilities").description("Read the listing capability registry").addCommand(listCommand5).addCommand(showCommand2);
20534
20793
 
20535
20794
  // src/commands/x402/index.ts
20536
- import { Command as Command111 } from "commander";
20795
+ import { Command as Command112 } from "commander";
20537
20796
 
20538
20797
  // src/commands/x402/payments.ts
20539
- import { Command as Command108, Option as Option5 } from "commander";
20798
+ import { Command as Command109, Option as Option5 } from "commander";
20540
20799
  import { createInterface as createInterface5 } from "readline";
20541
20800
  var PAYMENT_STATES = [
20542
20801
  "reserved",
@@ -20562,7 +20821,7 @@ async function confirmManualResolution() {
20562
20821
  readline.close();
20563
20822
  return answer.trim().toLowerCase() === "resolve";
20564
20823
  }
20565
- var x402PaymentsCommand = new Command108("payments").description(
20824
+ var x402PaymentsCommand = new Command109("payments").description(
20566
20825
  "Inspect and reconcile X402 Pay payment records"
20567
20826
  );
20568
20827
  x402PaymentsCommand.command("list").description("List current payment records").addOption(new Option5("--state <state>", "Filter by state").choices(PAYMENT_STATES)).action(async (options) => {
@@ -20590,8 +20849,8 @@ x402PaymentsCommand.command("resolve").description("Manually record an externall
20590
20849
  );
20591
20850
 
20592
20851
  // src/commands/x402/policy.ts
20593
- import { promises as fs11 } from "fs";
20594
- import { Command as Command109 } from "commander";
20852
+ import { promises as fs12 } from "fs";
20853
+ import { Command as Command110 } from "commander";
20595
20854
  import { createInterface as createInterface6 } from "readline";
20596
20855
  async function confirmUnattendedRule(rule) {
20597
20856
  if (!process.stdin.isTTY) {
@@ -20617,7 +20876,7 @@ async function confirmUnattendedRule(rule) {
20617
20876
  readline.close();
20618
20877
  return answer.trim().toLowerCase() === "authorize";
20619
20878
  }
20620
- var x402PolicyCommand = new Command109("policy").description(
20879
+ var x402PolicyCommand = new Command110("policy").description(
20621
20880
  "Manage local X402 Pay spending policy"
20622
20881
  );
20623
20882
  x402PolicyCommand.command("init").description("Create a deny-all policy file").action(async () => {
@@ -20632,7 +20891,7 @@ x402PolicyCommand.command("validate").description("Validate the policy file").ac
20632
20891
  });
20633
20892
  x402PolicyCommand.command("schema").description("Print the policy JSON Schema").action(() => printResult(X402_POLICY_JSON_SCHEMA));
20634
20893
  x402PolicyCommand.command("add").description("Add one rule from a JSON file").requiredOption("--rule-file <path>", "JSON file containing one policy rule").action(async (options) => {
20635
- const rule = JSON.parse(await fs11.readFile(options.ruleFile, "utf8"));
20894
+ const rule = JSON.parse(await fs12.readFile(options.ruleFile, "utf8"));
20636
20895
  const policy = await addX402PolicyRule(rule, getX402PolicyPath(), confirmUnattendedRule);
20637
20896
  printResult({ path: getX402PolicyPath(), policy });
20638
20897
  });
@@ -20653,7 +20912,7 @@ for (const enabled of [true, false]) {
20653
20912
  }
20654
20913
 
20655
20914
  // src/commands/x402/request.ts
20656
- import { Command as Command110, Option as Option6 } from "commander";
20915
+ import { Command as Command111, Option as Option6 } from "commander";
20657
20916
  function collect4(value, previous) {
20658
20917
  return [...previous, value];
20659
20918
  }
@@ -20689,7 +20948,7 @@ function paymentConfirmationLines(terms) {
20689
20948
  `Policy: ${terms.policyRuleId ?? "one-time interactive exception"}`
20690
20949
  ];
20691
20950
  }
20692
- var x402RequestCommand = new Command110("request").description("Request and pay for a direct x402 HTTP resource (X402 Pay)").argument("<url>", "HTTPS resource URL").addOption(new Option6("--method <method>", "HTTP method").choices(["GET", "POST"]).default("GET")).addOption(
20951
+ var x402RequestCommand = new Command111("request").description("Request and pay for a direct x402 HTTP resource (X402 Pay)").argument("<url>", "HTTPS resource URL").addOption(new Option6("--method <method>", "HTTP method").choices(["GET", "POST"]).default("GET")).addOption(
20693
20952
  new Option6(
20694
20953
  "--protocol <protocol>",
20695
20954
  "Payment protocol the 402 may be paid through: auto reads x402 and MPP, x402 or mpp restricts it"
@@ -20734,7 +20993,7 @@ var x402RequestCommand = new Command110("request").description("Request and pay
20734
20993
  );
20735
20994
 
20736
20995
  // src/commands/x402/index.ts
20737
- var x402Command = new Command111("x402").description(
20996
+ var x402Command = new Command112("x402").description(
20738
20997
  "Pay x402 services with local spending policies (X402 Pay)"
20739
20998
  );
20740
20999
  x402Command.addCommand(x402RequestCommand);
@@ -20742,10 +21001,10 @@ x402Command.addCommand(x402PolicyCommand);
20742
21001
  x402Command.addCommand(x402PaymentsCommand);
20743
21002
 
20744
21003
  // src/commands/sponsored-task/index.ts
20745
- import { Command as Command127 } from "commander";
21004
+ import { Command as Command128 } from "commander";
20746
21005
 
20747
21006
  // src/commands/sponsored-task/create.ts
20748
- import { Command as Command112 } from "commander";
21007
+ import { Command as Command113 } from "commander";
20749
21008
  import { toHex as toHex4 } from "viem";
20750
21009
 
20751
21010
  // ../../packages/contracts/evm/abi/generated/SponsoredTasksVaultV2.ts
@@ -25158,9 +25417,9 @@ function defaultSponsoredTaskFactory(chainId) {
25158
25417
  }
25159
25418
  var DEFAULT_MAX_CREATION_FEE = 1000000n;
25160
25419
  async function readVaultCreationFee(publicClient, factory) {
25161
- let amount;
25420
+ let amount2;
25162
25421
  try {
25163
- amount = await publicClient.readContract({
25422
+ amount2 = await publicClient.readContract({
25164
25423
  address: factory,
25165
25424
  abi: SponsoredTaskFactoryV2ABI,
25166
25425
  functionName: "creationFee"
@@ -25172,7 +25431,7 @@ async function readVaultCreationFee(publicClient, factory) {
25172
25431
  { cause: err }
25173
25432
  );
25174
25433
  }
25175
- if (typeof amount !== "bigint" || amount === 0n) return null;
25434
+ if (typeof amount2 !== "bigint" || amount2 === 0n) return null;
25176
25435
  const [token2, recipient] = await Promise.all([
25177
25436
  publicClient.readContract({
25178
25437
  address: factory,
@@ -25185,7 +25444,7 @@ async function readVaultCreationFee(publicClient, factory) {
25185
25444
  functionName: "creationFeeRecipient"
25186
25445
  })
25187
25446
  ]);
25188
- return { amount, token: token2, recipient };
25447
+ return { amount: amount2, token: token2, recipient };
25189
25448
  }
25190
25449
  function isValidAddress4(addr) {
25191
25450
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
@@ -25222,7 +25481,7 @@ async function createOnSolana(opts, keystore) {
25222
25481
  renderFailure(err);
25223
25482
  }
25224
25483
  }
25225
- var sponsoredTaskCreateCommand = new Command112("create").description("Create a new Sponsored Task vault for a project token").option(
25484
+ var sponsoredTaskCreateCommand = new Command113("create").description("Create a new Sponsored Task vault for a project token").option(
25226
25485
  "--factory <address>",
25227
25486
  "SponsoredTaskFactory contract address (EVM chains; defaults to the chain's newest factory, or the settler-mode factory on Robinhood Chain)"
25228
25487
  ).requiredOption(
@@ -25345,7 +25604,7 @@ Token risk: ${TOKEN_RISK}`
25345
25604
  );
25346
25605
 
25347
25606
  // src/commands/sponsored-task/fund.ts
25348
- import { Command as Command113 } from "commander";
25607
+ import { Command as Command114 } from "commander";
25349
25608
  function isValidAddress5(addr) {
25350
25609
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
25351
25610
  }
@@ -25379,7 +25638,7 @@ async function fundOnSolana(opts, keystore) {
25379
25638
  renderFailure(err);
25380
25639
  }
25381
25640
  }
25382
- var sponsoredTaskFundCommand = new Command113("fund").description("Fund a Sponsored Task vault with its project token (base units)").requiredOption("--vault <address>", "Vault address (base58 for a Solana vault)").option(
25641
+ var sponsoredTaskFundCommand = new Command114("fund").description("Fund a Sponsored Task vault with its project token (base units)").requiredOption("--vault <address>", "Vault address (base58 for a Solana vault)").option(
25383
25642
  "--token <address>",
25384
25643
  "Project ERC-20 token address (EVM chains; Solana reads the vault's mint)"
25385
25644
  ).requiredOption(
@@ -25415,7 +25674,7 @@ var sponsoredTaskFundCommand = new Command113("fund").description("Fund a Sponso
25415
25674
  }
25416
25675
  const chainId = opts.chainId;
25417
25676
  const { account, publicClient, walletClient, relay } = await createSponsoredTaskVaultChainClients(keystore, chainId);
25418
- const amount = BigInt(opts.amount);
25677
+ const amount2 = BigInt(opts.amount);
25419
25678
  const vaultToken = await publicClient.readContract({
25420
25679
  address: opts.vault,
25421
25680
  abi: SponsoredTasksVaultV2ABI,
@@ -25432,7 +25691,7 @@ var sponsoredTaskFundCommand = new Command113("fund").description("Fund a Sponso
25432
25691
  relay,
25433
25692
  token: opts.token,
25434
25693
  spender: opts.vault,
25435
- amount
25694
+ amount: amount2
25436
25695
  });
25437
25696
  const { txHash, feePayer } = await writeSponsoredTaskVaultContract({
25438
25697
  account,
@@ -25442,7 +25701,7 @@ var sponsoredTaskFundCommand = new Command113("fund").description("Fund a Sponso
25442
25701
  address: opts.vault,
25443
25702
  abi: SponsoredTasksVaultV2ABI,
25444
25703
  functionName: "fund",
25445
- args: [amount]
25704
+ args: [amount2]
25446
25705
  });
25447
25706
  printResult({
25448
25707
  txHash,
@@ -25453,7 +25712,7 @@ var sponsoredTaskFundCommand = new Command113("fund").description("Fund a Sponso
25453
25712
  });
25454
25713
 
25455
25714
  // src/commands/sponsored-task/managers.ts
25456
- import { Command as Command114 } from "commander";
25715
+ import { Command as Command115 } from "commander";
25457
25716
 
25458
25717
  // src/lib/solana-payout-binding.ts
25459
25718
  import { concat, keccak256 } from "viem";
@@ -25594,12 +25853,12 @@ async function submitPayoutBinding(input) {
25594
25853
  }
25595
25854
  function unboundSolanaAwards(rewards) {
25596
25855
  return rewards.filter((r) => isSolanaChainId2(r.chainId) && r.claimStatus !== "claimed").map((r) => {
25597
- const amount = r.tokenDecimals === null ? `${r.amount} base units` : `${formatBaseUnits(BigInt(r.amount), r.tokenDecimals)} ${r.tokenSymbol ?? "tokens"}`;
25856
+ const amount2 = r.tokenDecimals === null ? `${r.amount} base units` : `${formatBaseUnits(BigInt(r.amount), r.tokenDecimals)} ${r.tokenSymbol ?? "tokens"}`;
25598
25857
  return {
25599
25858
  taskId: r.taskId,
25600
25859
  chainId: r.chainId,
25601
25860
  amount: r.amount,
25602
- message: `Bind a Solana address to receive ${amount}: ${taskmarketCommandFor(r.chainId)} sponsored-task bind-payout`
25861
+ message: `Bind a Solana address to receive ${amount2}: ${taskmarketCommandFor(r.chainId)} sponsored-task bind-payout`
25603
25862
  };
25604
25863
  });
25605
25864
  }
@@ -25814,7 +26073,7 @@ async function configure(opts) {
25814
26073
  active: opts.active
25815
26074
  });
25816
26075
  }
25817
- var sponsoredTaskManagersCommand = new Command114("managers").description(
26076
+ var sponsoredTaskManagersCommand = new Command115("managers").description(
25818
26077
  "Manage authorized managers for a Sponsored Task vault"
25819
26078
  );
25820
26079
  sponsoredTaskManagersCommand.command("add").description("Authorize a manager with a token-denominated spend cap").requiredOption("--vault <address>", "Vault address (base58 for a Solana vault)").requiredOption(
@@ -25841,8 +26100,8 @@ sponsoredTaskManagersCommand.command("list").description("List a vault authorize
25841
26100
  });
25842
26101
 
25843
26102
  // src/commands/sponsored-task/managed.ts
25844
- import { Command as Command115 } from "commander";
25845
- var sponsoredTaskManagedCommand = new Command115("managed").description(
26103
+ import { Command as Command116 } from "commander";
26104
+ var sponsoredTaskManagedCommand = new Command116("managed").description(
25846
26105
  "List the active Sponsored Task vaults an address can fund tasks from as an active manager (defaults to your wallet)"
25847
26106
  ).option("--address <address>", "Manager address (defaults to your wallet)").option("--limit <n>", "Max vaults to return (1-100)", "50").option("--cursor <vaultId>", "Pagination cursor from a previous nextCursor").action(async (opts) => {
25848
26107
  let address3 = opts.address;
@@ -25872,8 +26131,8 @@ var sponsoredTaskManagedCommand = new Command115("managed").description(
25872
26131
  });
25873
26132
 
25874
26133
  // src/commands/sponsored-task/creation-fee.ts
25875
- import { Command as Command116 } from "commander";
25876
- var sponsoredTaskCreationFeeCommand = new Command116("creation-fee").description("Show the one-time fee for creating a Sponsored Task vault on a chain").requiredOption(
26134
+ import { Command as Command117 } from "commander";
26135
+ var sponsoredTaskCreationFeeCommand = new Command117("creation-fee").description("Show the one-time fee for creating a Sponsored Task vault on a chain").requiredOption(
25877
26136
  "--chain-id <chain>",
25878
26137
  "EVM chain the vault would be created on: a network name or chain id (e.g. base, 8453)",
25879
26138
  chainOption("--chain-id", "evm-vault")
@@ -25917,8 +26176,8 @@ var sponsoredTaskCreationFeeCommand = new Command116("creation-fee").description
25917
26176
  });
25918
26177
 
25919
26178
  // src/commands/sponsored-task/list.ts
25920
- import { Command as Command117 } from "commander";
25921
- var sponsoredTaskListCommand = new Command117("list").description("List Sponsored Task vaults").option("--limit <n>", "Max vaults to return", "50").option("--cursor <vaultId>", "Pagination cursor").option("--include-unverified", "Include vaults not yet curator-approved", false).option("--owner <address>", "Only vaults this address owns, whatever their curation status").option("--mine", "Only the vaults your wallet owns", false).action(
26179
+ import { Command as Command118 } from "commander";
26180
+ var sponsoredTaskListCommand = new Command118("list").description("List Sponsored Task vaults").option("--limit <n>", "Max vaults to return", "50").option("--cursor <vaultId>", "Pagination cursor").option("--include-unverified", "Include vaults not yet curator-approved", false).option("--owner <address>", "Only vaults this address owns, whatever their curation status").option("--mine", "Only the vaults your wallet owns", false).action(
25922
26181
  async (opts) => {
25923
26182
  if (opts.owner && opts.mine) {
25924
26183
  printError("Pass --owner or --mine, not both");
@@ -25947,8 +26206,8 @@ var sponsoredTaskListCommand = new Command117("list").description("List Sponsore
25947
26206
  );
25948
26207
 
25949
26208
  // src/commands/sponsored-task/settlements.ts
25950
- import { Command as Command118 } from "commander";
25951
- var sponsoredTaskSettlementsCommand = new Command118("settlements").description("List the settlements a Sponsored Task vault has installed, newest first").argument("<vaultId>", "Vault id").option("--limit <n>", "Max settlements to return (1-100)", "25").option("--cursor <cursor>", "Pagination cursor from a previous nextCursor").action(async (vaultId, opts) => {
26209
+ import { Command as Command119 } from "commander";
26210
+ var sponsoredTaskSettlementsCommand = new Command119("settlements").description("List the settlements a Sponsored Task vault has installed, newest first").argument("<vaultId>", "Vault id").option("--limit <n>", "Max settlements to return (1-100)", "25").option("--cursor <cursor>", "Pagination cursor from a previous nextCursor").action(async (vaultId, opts) => {
25952
26211
  const limit = Number(opts.limit);
25953
26212
  if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
25954
26213
  printError("--limit must be an integer from 1 to 100");
@@ -25963,17 +26222,17 @@ var sponsoredTaskSettlementsCommand = new Command118("settlements").description(
25963
26222
  });
25964
26223
 
25965
26224
  // src/commands/sponsored-task/show.ts
25966
- import { Command as Command119 } from "commander";
25967
- var sponsoredTaskShowCommand = new Command119("show").description("Show a Sponsored Task vault by id").argument("<vaultId>", "Vault id").action(async (vaultId) => {
26225
+ import { Command as Command120 } from "commander";
26226
+ var sponsoredTaskShowCommand = new Command120("show").description("Show a Sponsored Task vault by id").argument("<vaultId>", "Vault id").action(async (vaultId) => {
25968
26227
  const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}`);
25969
26228
  printResult(result);
25970
26229
  });
25971
26230
 
25972
26231
  // src/commands/sponsored-task/request-review.ts
25973
26232
  import { randomBytes as randomBytes6 } from "crypto";
25974
- import { Command as Command120 } from "commander";
26233
+ import { Command as Command121 } from "commander";
25975
26234
  var REQUEST_TTL_SECONDS = 5 * 60;
25976
- var sponsoredTaskRequestReviewCommand = new Command120("request-review").description("Ask Taskmarket curators to review a Sponsored Task vault (vault owner only)").argument("<vaultId>", "Vault id").action(async (vaultId) => {
26235
+ var sponsoredTaskRequestReviewCommand = new Command121("request-review").description("Ask Taskmarket curators to review a Sponsored Task vault (vault owner only)").argument("<vaultId>", "Vault id").action(async (vaultId) => {
25977
26236
  let keystore;
25978
26237
  try {
25979
26238
  keystore = await loadKeystore();
@@ -26030,18 +26289,18 @@ var sponsoredTaskRequestReviewCommand = new Command120("request-review").descrip
26030
26289
  });
26031
26290
 
26032
26291
  // src/commands/sponsored-task/balance.ts
26033
- import { Command as Command121 } from "commander";
26034
- var sponsoredTaskBalanceCommand = new Command121("balance").description("Show a Sponsored Task vault funded/available/reserved balances").argument("<vaultId>", "Vault id").action(async (vaultId) => {
26292
+ import { Command as Command122 } from "commander";
26293
+ var sponsoredTaskBalanceCommand = new Command122("balance").description("Show a Sponsored Task vault funded/available/reserved balances").argument("<vaultId>", "Vault id").action(async (vaultId) => {
26035
26294
  const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}/balance`);
26036
26295
  printResult(result);
26037
26296
  });
26038
26297
 
26039
26298
  // src/commands/sponsored-task/withdraw.ts
26040
- import { Command as Command122 } from "commander";
26299
+ import { Command as Command123 } from "commander";
26041
26300
  function isValidAddress7(addr) {
26042
26301
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
26043
26302
  }
26044
- var sponsoredTaskWithdrawCommand = new Command122("withdraw").description("Withdraw unreserved project tokens from a vault (owner only)").requiredOption("--vault <address>", "Vault address").requiredOption(
26303
+ var sponsoredTaskWithdrawCommand = new Command123("withdraw").description("Withdraw unreserved project tokens from a vault (owner only)").requiredOption("--vault <address>", "Vault address").requiredOption(
26045
26304
  "--chain-id <chain>",
26046
26305
  "EVM chain the vault is deployed on: a network name or chain id (e.g. base, robinhood, 8453)",
26047
26306
  chainOption("--chain-id", "evm-vault")
@@ -26077,11 +26336,11 @@ var sponsoredTaskWithdrawCommand = new Command122("withdraw").description("Withd
26077
26336
  });
26078
26337
 
26079
26338
  // src/commands/sponsored-task/exit.ts
26080
- import { Command as Command123 } from "commander";
26339
+ import { Command as Command124 } from "commander";
26081
26340
  function isValidAddress8(addr) {
26082
26341
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
26083
26342
  }
26084
- var sponsoredTaskExitCommand = new Command123("exit").description(
26343
+ var sponsoredTaskExitCommand = new Command124("exit").description(
26085
26344
  "Terminally exit a vault: sweeps every reserved and unclaimed token back to you, invalidating every outstanding reservation, claim signature, and Merkle proof at once. There is no undo and no per-allocation revoke -- a worker with a pending but unclaimed entitlement gets nothing once this runs."
26086
26345
  ).requiredOption("--vault <address>", "Vault address (base58 for a Solana vault)").requiredOption(
26087
26346
  "--chain-id <chain>",
@@ -26157,7 +26416,7 @@ var sponsoredTaskExitCommand = new Command123("exit").description(
26157
26416
  });
26158
26417
 
26159
26418
  // src/commands/sponsored-task/claim.ts
26160
- import { Command as Command124 } from "commander";
26419
+ import { Command as Command125 } from "commander";
26161
26420
  var CLAIM_TO_TYPES = {
26162
26421
  ClaimTo: [
26163
26422
  { name: "vaultId", type: "bytes32" },
@@ -26222,7 +26481,7 @@ async function findEntitlement(vaultId, workerAddress, taskId, options = {}) {
26222
26481
  await sleep4(3e3);
26223
26482
  }
26224
26483
  }
26225
- var sponsoredTaskClaimCommand = new Command124("claim").description("Claim your unclaimed Sponsored Task reward for a vault task").argument("<vaultId>", "Vault id").option(
26484
+ var sponsoredTaskClaimCommand = new Command125("claim").description("Claim your unclaimed Sponsored Task reward for a vault task").argument("<vaultId>", "Vault id").option(
26226
26485
  "--task-id <id>",
26227
26486
  "Claim the entitlement for a specific task (defaults to the first unclaimed one)"
26228
26487
  ).action(async (vaultId, opts) => {
@@ -26338,10 +26597,10 @@ var sponsoredTaskClaimCommand = new Command124("claim").description("Claim your
26338
26597
  });
26339
26598
 
26340
26599
  // src/commands/sponsored-task/rewards.ts
26341
- import { Command as Command125 } from "commander";
26600
+ import { Command as Command126 } from "commander";
26342
26601
  var REWARD_STATES = SponsoredTaskRewardStateSchema.options;
26343
26602
  var CLAIM_STATUSES = SponsoredTaskWorkerRewardClaimStatusSchema.options;
26344
- var sponsoredTaskRewardsCommand = new Command125("rewards").description("List Sponsored Task rewards across every vault (defaults to your wallet)").option("--address <address>", "Worker address (defaults to your wallet)").option("--state <state>", `Reward state: ${REWARD_STATES.join(", ")}`).option("--claim-status <status>", `Claim status: ${CLAIM_STATUSES.join(", ")}`).option("--limit <n>", "Max rewards to return (1-100)", "50").option("--cursor <cursor>", "Pagination cursor from a previous nextCursor").action(
26603
+ var sponsoredTaskRewardsCommand = new Command126("rewards").description("List Sponsored Task rewards across every vault (defaults to your wallet)").option("--address <address>", "Worker address (defaults to your wallet)").option("--state <state>", `Reward state: ${REWARD_STATES.join(", ")}`).option("--claim-status <status>", `Claim status: ${CLAIM_STATUSES.join(", ")}`).option("--limit <n>", "Max rewards to return (1-100)", "50").option("--cursor <cursor>", "Pagination cursor from a previous nextCursor").action(
26345
26604
  async (opts) => {
26346
26605
  let address3 = opts.address;
26347
26606
  if (address3 === void 0) {
@@ -26381,7 +26640,7 @@ var sponsoredTaskRewardsCommand = new Command125("rewards").description("List Sp
26381
26640
  );
26382
26641
 
26383
26642
  // src/commands/sponsored-task/bind-payout.ts
26384
- import { Command as Command126 } from "commander";
26643
+ import { Command as Command127 } from "commander";
26385
26644
  async function solanaRewards(agent) {
26386
26645
  try {
26387
26646
  const result = await apiGet(
@@ -26392,7 +26651,7 @@ async function solanaRewards(agent) {
26392
26651
  return [];
26393
26652
  }
26394
26653
  }
26395
- var sponsoredTaskBindPayoutCommand = new Command126("bind-payout").description(
26654
+ var sponsoredTaskBindPayoutCommand = new Command127("bind-payout").description(
26396
26655
  "Bind the Solana address that receives your Solana Sponsored Task awards (once; rebinding replaces it)"
26397
26656
  ).option(
26398
26657
  "--address <solana-address>",
@@ -26553,7 +26812,7 @@ function bindingTaskChainIds(requested, connection, everyChain) {
26553
26812
  }
26554
26813
 
26555
26814
  // src/commands/sponsored-task/index.ts
26556
- var sponsoredTaskCommand = new Command127("sponsored-task").description(
26815
+ var sponsoredTaskCommand = new Command128("sponsored-task").description(
26557
26816
  "Sponsored Task vault administration and reward claims"
26558
26817
  );
26559
26818
  sponsoredTaskCommand.addCommand(sponsoredTaskCreateCommand);
@@ -26573,10 +26832,10 @@ sponsoredTaskCommand.addCommand(sponsoredTaskRewardsCommand);
26573
26832
  sponsoredTaskCommand.addCommand(sponsoredTaskBindPayoutCommand);
26574
26833
 
26575
26834
  // src/commands/project/index.ts
26576
- import { Command as Command149 } from "commander";
26835
+ import { Command as Command150 } from "commander";
26577
26836
 
26578
26837
  // src/commands/project/accept.ts
26579
- import { Command as Command128 } from "commander";
26838
+ import { Command as Command129 } from "commander";
26580
26839
 
26581
26840
  // src/commands/project/shared.ts
26582
26841
  var ADDRESS = /^0x[0-9a-fA-F]{40}$/;
@@ -26701,7 +26960,7 @@ async function postProjectWrite(path10, body, options) {
26701
26960
 
26702
26961
  // src/commands/project/accept.ts
26703
26962
  var TERMS_HASH = /^0x[0-9a-fA-F]{64}$/;
26704
- var projectAcceptCommand = new Command128("accept").description(
26963
+ var projectAcceptCommand = new Command129("accept").description(
26705
26964
  "Accept a grant on a project as its operator, which freezes the terms. The accept is refused if the owner changes the terms before it lands. The accept carries the `termsHash` of your grant, read from `project show`; pass --terms-hash to pin the hash you reviewed instead, so it is refused if the terms changed since (costs 0.001 in the payment token)"
26706
26965
  ).argument("<projectId>", "Project id").option(
26707
26966
  "--terms-hash <hash>",
@@ -26733,7 +26992,7 @@ var projectAcceptCommand = new Command128("accept").description(
26733
26992
  });
26734
26993
 
26735
26994
  // src/commands/project/add-task.ts
26736
- import { Command as Command129 } from "commander";
26995
+ import { Command as Command130 } from "commander";
26737
26996
  function deadlineCheck(durationHours, project, now = /* @__PURE__ */ new Date()) {
26738
26997
  if (!project?.endsAt || !Number.isFinite(durationHours)) return null;
26739
26998
  const endsAt = new Date(project.endsAt);
@@ -26795,7 +27054,7 @@ function parseContinuation(flags) {
26795
27054
  function collect5(value, previous = []) {
26796
27055
  return [...previous, value];
26797
27056
  }
26798
- var projectAddTaskCommand = new Command129("add-task").description(
27057
+ var projectAddTaskCommand = new Command130("add-task").description(
26799
27058
  "Create a task of any mode funded from a project's budget, as its owner or an operator with an accepted grant. Takes every flag of task create; the reward and any evaluator stake come out of the budget (costs 0.001 in the payment token)"
26800
27059
  ).argument("<projectId>", "Project id");
26801
27060
  for (const option of createCmd.options) {
@@ -26847,7 +27106,7 @@ projectAddTaskCommand.action(async (id, opts) => {
26847
27106
  });
26848
27107
 
26849
27108
  // src/commands/project/automations.ts
26850
- import { Command as Command130 } from "commander";
27109
+ import { Command as Command131 } from "commander";
26851
27110
  function automationsOnBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
26852
27111
  if (opts.cap === void 0) {
26853
27112
  return { error: "--cap is required: the most the automations may draw from the budget" };
@@ -26876,7 +27135,7 @@ function automationsOnBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
26876
27135
  }
26877
27136
  return body;
26878
27137
  }
26879
- var projectAutomationsOnCommand = new Command130("on").description(
27138
+ var projectAutomationsOnCommand = new Command131("on").description(
26880
27139
  "Turn the project's automations on, so its schedules and workflows run. Grants the platform runner of the project's chain, which you never name, with a cap: the most the automations may draw from the budget in total, net of refunds (payouts keep counting). The cap is required. On a project whose automations are on, a higher cap raises it and a lower one is refused; turning them on again after off, or raising the cap, needs a chain on contract revision 29 and is refused before payment otherwise. Optional limits (contract revision 29): --expires, and --period-budget with --period; on states them whole, so none stated clears an expiry and a period budget. Schedules paused by off stay paused: resume each one (costs 0.001 in the payment token)"
26881
27140
  ).argument("<projectId>", "Project id").option(
26882
27141
  "--cap <amount>",
@@ -26904,7 +27163,7 @@ var projectAutomationsOnCommand = new Command130("on").description(
26904
27163
  });
26905
27164
  }
26906
27165
  );
26907
- var projectAutomationsOffCommand = new Command130("off").description(
27166
+ var projectAutomationsOffCommand = new Command131("off").description(
26908
27167
  "Turn the project's automations off: revokes the platform runner's grant and pauses the project's schedules and workflow schedules (reason automations_off). Their definitions stay, tasks already started finish under you, and turning automations on again does not resume them (costs 0.001 in the payment token)"
26909
27168
  ).argument("<projectId>", "Project id").action(async (id) => {
26910
27169
  const projectId = parseProjectId(id);
@@ -26915,7 +27174,7 @@ var projectAutomationsOffCommand = new Command130("off").description(
26915
27174
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
26916
27175
  );
26917
27176
  });
26918
- var projectAutomationsStatusCommand = new Command130("status").description(
27177
+ var projectAutomationsStatusCommand = new Command131("status").description(
26919
27178
  "Whether the project's schedules and workflows can run: state on, off, pending (granted, the runner has not accepted yet) or unavailable (no runner on the chain), with the cap, what is spent and what remains, and whether it can be turned on again or its cap raised (free)"
26920
27179
  ).argument("<projectId>", "Project id").action(async (id) => {
26921
27180
  const projectId = parseProjectId(id);
@@ -26926,13 +27185,13 @@ var projectAutomationsStatusCommand = new Command130("status").description(
26926
27185
  renderFailure(err);
26927
27186
  }
26928
27187
  });
26929
- var projectAutomationsCommand = new Command130("automations").description(
27188
+ var projectAutomationsCommand = new Command131("automations").description(
26930
27189
  "The project's automations: one switch for its schedules and workflows. `on --cap <amount>` grants the platform runner of the project chain for you, `off` revokes it and pauses schedules, `status` reads it. `project runner` and `project grant` remain for advanced use"
26931
27190
  ).addCommand(projectAutomationsOnCommand).addCommand(projectAutomationsOffCommand).addCommand(projectAutomationsStatusCommand);
26932
27191
 
26933
27192
  // src/commands/project/claim.ts
26934
- import { Command as Command131 } from "commander";
26935
- var projectClaimCommand = new Command131("claim").description(
27193
+ import { Command as Command132 } from "commander";
27194
+ var projectClaimCommand = new Command132("claim").description(
26936
27195
  "Pay a backer its share of a closed or ended project's leftovers: what was unspent plus every later refund, in proportion to its pool shares, less what it already claimed. Anyone may trigger it; the money always goes to the backer. Refused before payment when nothing is owed (costs 0.001 in the payment token)"
26937
27196
  ).argument("<projectId>", "Project id").option("--backer <address>", "The backer to pay (default: your wallet)").action(async (id, opts) => {
26938
27197
  const projectId = parseProjectId(id);
@@ -26952,8 +27211,8 @@ var projectClaimCommand = new Command131("claim").description(
26952
27211
  });
26953
27212
 
26954
27213
  // src/commands/project/close.ts
26955
- import { Command as Command132 } from "commander";
26956
- var projectCloseCommand = new Command132("close").description(
27214
+ import { Command as Command133 } from "commander";
27215
+ var projectCloseCommand = new Command133("close").description(
26957
27216
  "Close a project: its unspent budget becomes the backers' pot, which each backer, the owner included, claims with `project claim`. The owner may close it any time, anyone once it is past its end date; tasks already funded run on and their refunds join the pot (costs 0.001 in the payment token)"
26958
27217
  ).argument("<projectId>", "Project id").action(async (id) => {
26959
27218
  const projectId = parseProjectId(id);
@@ -26966,13 +27225,13 @@ var projectCloseCommand = new Command132("close").description(
26966
27225
  });
26967
27226
 
26968
27227
  // src/commands/project/create.ts
26969
- import { Command as Command135 } from "commander";
27228
+ import { Command as Command136 } from "commander";
26970
27229
 
26971
27230
  // src/commands/project/suggestions.ts
26972
- import { Command as Command134 } from "commander";
27231
+ import { Command as Command135 } from "commander";
26973
27232
 
26974
27233
  // src/commands/project/suggestion-proposals.ts
26975
- import { Command as Command133 } from "commander";
27234
+ import { Command as Command134 } from "commander";
26976
27235
  var QUERY_ERRORS = {
26977
27236
  status: "--status must be pending, closed or expired",
26978
27237
  limit: "--limit must be an integer from 1 to 50",
@@ -27023,7 +27282,7 @@ async function read(path10) {
27023
27282
  function collectSuggestion(value, previous) {
27024
27283
  return [...previous, value];
27025
27284
  }
27026
- var projectSuggestionProposalsCommand = new Command133("proposals").description(
27285
+ var projectSuggestionProposalsCommand = new Command134("proposals").description(
27027
27286
  "List a project's suggestion proposals, newest first: what each run of its suggestions schedule picked in propose mode, with the ranking it was picked by and each pick's rank, reward, mode and status. A pick the owner drops is not proposed again by that schedule. The reads are public; signed with your wallet when there is one, so a pick whose suggestion staff hid shows only to the project's owner and its author. A pending proposal waits for the owner to confirm or drop its picks, and expires at the schedule's next slot or after 72 hours (free)"
27028
27287
  ).argument("<projectId>", "Project id").option(
27029
27288
  "--status <status>",
@@ -27038,7 +27297,7 @@ var projectSuggestionProposalsCommand = new Command133("proposals").description(
27038
27297
  if (typeof query4 !== "string") return void printError(query4.error);
27039
27298
  await read(`/api/projects/${projectId}/suggestion-proposals${query4 ? `?${query4}` : ""}`);
27040
27299
  });
27041
- var proposalShowCommand = new Command133("show").description(
27300
+ var proposalShowCommand = new Command134("show").description(
27042
27301
  "Show a suggestion proposal with its picks: each suggestion, its rank and score, the reward and mode its task will carry, and its status (pending, confirmed, created with its taskId, dropped, expired or failed with the reason). Public; signed with your wallet when there is one, so a hidden pick shows only to the project's owner and its author (free)"
27043
27302
  ).argument("<proposalId>", "Proposal id").action(async (value) => {
27044
27303
  const id = parseProposalId(value);
@@ -27046,7 +27305,7 @@ var proposalShowCommand = new Command133("show").description(
27046
27305
  await read(`/api/suggestion-proposals/${id}`);
27047
27306
  });
27048
27307
  function decisionCommand(action, description) {
27049
- return new Command133(action).description(description).argument("<proposalId>", "Proposal id").option(
27308
+ return new Command134(action).description(description).argument("<proposalId>", "Proposal id").option(
27050
27309
  "--suggestion <suggestionId>",
27051
27310
  `Only this pick; repeat it for each (default: every pending pick)`,
27052
27311
  collectSuggestion,
@@ -27063,7 +27322,7 @@ function decisionCommand(action, description) {
27063
27322
  );
27064
27323
  });
27065
27324
  }
27066
- var projectSuggestionProposalCommand = new Command133("proposal").description(
27325
+ var projectSuggestionProposalCommand = new Command134("proposal").description(
27067
27326
  "One suggestion proposal, as the project's owner: show it, confirm its picks so the platform runner creates their tasks, or drop them"
27068
27327
  ).addCommand(proposalShowCommand).addCommand(
27069
27328
  decisionCommand(
@@ -27096,11 +27355,11 @@ function parseSuggestionsMinBacking(value, options = {}) {
27096
27355
  function suggestBody(projectId, opts) {
27097
27356
  if (opts.title === void 0) return { error: "--title is required" };
27098
27357
  if (opts.brief === void 0) return { error: "--brief is required" };
27099
- const title = ProjectSuggestionTitleSchema.safeParse(opts.title);
27100
- if (!title.success) return { error: `--title: ${title.error.issues[0].message}` };
27358
+ const title2 = ProjectSuggestionTitleSchema.safeParse(opts.title);
27359
+ if (!title2.success) return { error: `--title: ${title2.error.issues[0].message}` };
27101
27360
  const brief = ProjectSuggestionBriefSchema.safeParse(opts.brief);
27102
27361
  if (!brief.success) return { error: `--brief: ${brief.error.issues[0].message}` };
27103
- const body = { projectId, title: title.data, brief: brief.data };
27362
+ const body = { projectId, title: title2.data, brief: brief.data };
27104
27363
  if (opts.mode !== void 0) {
27105
27364
  const mode = opts.mode.trim();
27106
27365
  if (!GRANT_MODE_NAMES.includes(mode)) {
@@ -27177,7 +27436,7 @@ async function signedRead(path10) {
27177
27436
  renderFailure(err);
27178
27437
  }
27179
27438
  }
27180
- var projectSuggestCommand = new Command134("suggest").description(
27439
+ var projectSuggestCommand = new Command135("suggest").description(
27181
27440
  "Post a suggestion on an open project: an idea for work its budget could pay for, as a wallet the project's suggestions setting admits (backers: the owner, its operators and backers; anyone: any wallet). Posting costs 0.001 in the payment token. The owner or an operator turns it into a task with `project add-task --suggestion <id>`, and anyone it admits may upvote it for free"
27182
27441
  ).argument("<projectId>", "Project id").option("--title <text>", "Required: one line, 1 to 120 characters").option(
27183
27442
  "--brief <text>",
@@ -27197,7 +27456,7 @@ var projectSuggestCommand = new Command134("suggest").description(
27197
27456
  maxAmount: ACTION_FEE_MAX_AMOUNT
27198
27457
  });
27199
27458
  });
27200
- var projectSuggestionsCommand = new Command134("suggestions").description(
27459
+ var projectSuggestionsCommand = new Command135("suggestions").description(
27201
27460
  "List a project's suggestions with its suggestions settings, most upvoted first or, with --sort backed, most pool shares among the voters who back the project first. Each carries votes, backedShares and, when your wallet signs the read, whether you voted (free)"
27202
27461
  ).argument("<projectId>", "Project id").option(
27203
27462
  "--status <status>",
@@ -27215,7 +27474,7 @@ var projectSuggestionsCommand = new Command134("suggestions").description(
27215
27474
  if (typeof query4 !== "string") return void printError(query4.error);
27216
27475
  await signedRead(`/api/projects/${projectId}/suggestions${query4 ? `?${query4}` : ""}`);
27217
27476
  });
27218
- var showCommand3 = new Command134("show").description("Show a suggestion with its status, votes and backedShares (free)").argument("<suggestionId>", "Suggestion id").action(async (value) => {
27477
+ var showCommand3 = new Command135("show").description("Show a suggestion with its status, votes and backedShares (free)").argument("<suggestionId>", "Suggestion id").action(async (value) => {
27219
27478
  const id = parseSuggestionId(value);
27220
27479
  if (typeof id !== "string") return void printError(id.error);
27221
27480
  await signedRead(`/api/project-suggestions/${id}`);
@@ -27229,7 +27488,7 @@ async function readAuthFor(what) {
27229
27488
  return { headers: auth.headers };
27230
27489
  }
27231
27490
  function voteCommand(action, description) {
27232
- return new Command134(action).description(description).argument("<suggestionId>", "Suggestion id").action(async (value) => {
27491
+ return new Command135(action).description(description).argument("<suggestionId>", "Suggestion id").action(async (value) => {
27233
27492
  const suggestionId = parseSuggestionId(value);
27234
27493
  if (typeof suggestionId !== "string") return void printError(suggestionId.error);
27235
27494
  const auth = await readAuthFor(action === "vote" ? "Voting" : "Taking back a vote");
@@ -27252,7 +27511,7 @@ function voteCommand(action, description) {
27252
27511
  }
27253
27512
  });
27254
27513
  }
27255
- var reportCommand = new Command134("report").description(
27514
+ var reportCommand = new Command135("report").description(
27256
27515
  "Report a suggestion to Taskmarket staff, as any wallet but its author (free, signed by your wallet). Staff may hide it from the project's lists; one open report per wallet per suggestion, so a repeat returns the open one"
27257
27516
  ).argument("<suggestionId>", "Suggestion id").requiredOption("--reason <reason>", `Why: ${PROJECT_SUGGESTION_REPORT_REASONS.join(", ")}`).option("--note <text>", "What staff should know: up to 500 characters, read only by staff").action(async (value, opts) => {
27258
27517
  const suggestionId = parseSuggestionId(value);
@@ -27291,7 +27550,7 @@ var reportCommand = new Command134("report").description(
27291
27550
  renderFailure(err);
27292
27551
  }
27293
27552
  });
27294
- var withdrawCommand2 = new Command134("withdraw").description("Withdraw your open suggestion, as its author (costs 0.001 in the payment token)").argument("<suggestionId>", "Suggestion id").action(async (value) => {
27553
+ var withdrawCommand2 = new Command135("withdraw").description("Withdraw your open suggestion, as its author (costs 0.001 in the payment token)").argument("<suggestionId>", "Suggestion id").action(async (value) => {
27295
27554
  const suggestionId = parseSuggestionId(value);
27296
27555
  if (typeof suggestionId !== "string") return void printError(suggestionId.error);
27297
27556
  await postProjectWrite(
@@ -27300,7 +27559,7 @@ var withdrawCommand2 = new Command134("withdraw").description("Withdraw your ope
27300
27559
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
27301
27560
  );
27302
27561
  });
27303
- var declineCommand = new Command134("decline").description(
27562
+ var declineCommand = new Command135("decline").description(
27304
27563
  "Decline an open suggestion, as the project's owner or an operator with an accepted grant; the reason is shown to everyone. Declining costs 0.001 in the payment token. To accept one instead, create its task with `project add-task <projectId> --suggestion <id>`, which pays the task's reward and any evaluator stake from the budget, plus the 0.001 action fee"
27305
27564
  ).argument("<suggestionId>", "Suggestion id").option("--reason <text>", "Why, shown to everyone: up to 500 characters").action(async (value, opts) => {
27306
27565
  const suggestionId = parseSuggestionId(value);
@@ -27315,7 +27574,7 @@ var declineCommand = new Command134("decline").description(
27315
27574
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
27316
27575
  );
27317
27576
  });
27318
- var projectSuggestionCommand = new Command134("suggestion").description(
27577
+ var projectSuggestionCommand = new Command135("suggestion").description(
27319
27578
  "One project suggestion: show it, upvote it or take the upvote back, report it to staff (each free, signed by your wallet), withdraw it as its author, or decline it as the owner or an operator. `proposals` and `proposal` read and act on what the project's suggestions schedule proposes"
27320
27579
  ).addCommand(showCommand3).addCommand(
27321
27580
  voteCommand(
@@ -27325,7 +27584,7 @@ var projectSuggestionCommand = new Command134("suggestion").description(
27325
27584
  ).addCommand(
27326
27585
  voteCommand("unvote", "Take back your upvote on a suggestion (free, signed by your wallet)")
27327
27586
  ).addCommand(reportCommand).addCommand(withdrawCommand2).addCommand(declineCommand).addCommand(projectSuggestionProposalsCommand).addCommand(projectSuggestionProposalCommand);
27328
- var projectSuggestionSettingsCommand = new Command134("suggestion-settings").description(
27587
+ var projectSuggestionSettingsCommand = new Command135("suggestion-settings").description(
27329
27588
  "Read or set the project's suggestions settings, as its owner: who may post and upvote suggestions (off, backers or anyone), the least a wallet must have contributed to count as a backer for them (1 in the payment token by default), and whether hosted agents that operate the project accept and decline suggestions by themselves (on by default). Turning hosted operators off keeps their grants. Setting costs 0.001 in the payment token; reading is free"
27330
27589
  ).argument("<projectId>", "Project id").option(
27331
27590
  "--suggestions <setting>",
@@ -27360,7 +27619,7 @@ var projectSuggestionSettingsCommand = new Command134("suggestion-settings").des
27360
27619
  });
27361
27620
 
27362
27621
  // src/commands/project/create.ts
27363
- var projectCreateCommand = new Command135("create").description(
27622
+ var projectCreateCommand = new Command136("create").description(
27364
27623
  "Open a project: one budget that funds tasks of any mode (costs the budget, in the payment token)"
27365
27624
  ).requiredOption("--budget <amount>", "Opening budget in the payment token (e.g. 50)").requiredOption(
27366
27625
  "--ends-at <time>",
@@ -27409,9 +27668,9 @@ var projectCreateCommand = new Command135("create").description(
27409
27668
  );
27410
27669
 
27411
27670
  // src/commands/project/extend.ts
27412
- import { Command as Command136 } from "commander";
27671
+ import { Command as Command137 } from "commander";
27413
27672
  var MAX_EXTENSION_MS = 365 * 24 * 3600 * 1e3;
27414
- var projectExtendCommand = new Command136("extend").description(
27673
+ var projectExtendCommand = new Command137("extend").description(
27415
27674
  "Move an open project's end date later, as the project owner (costs 0.001 in the payment token). The new date must be later than the current one and at most 365 days from now. A closed project, or one past its end date, cannot be extended. Backers' shares and the pool's value do not change; a backer whose pot is still open claims at the new date"
27416
27675
  ).argument("<projectId>", "Project id").requiredOption("--ends <time>", "The new end date: ISO 8601 or a duration from now such as 90d").action(async (id, opts) => {
27417
27676
  const projectId = parseProjectId(id);
@@ -27429,8 +27688,8 @@ var projectExtendCommand = new Command136("extend").description(
27429
27688
  });
27430
27689
 
27431
27690
  // src/commands/project/fund.ts
27432
- import { Command as Command137 } from "commander";
27433
- var projectFundCommand = new Command137("fund").description(
27691
+ import { Command as Command138 } from "commander";
27692
+ var projectFundCommand = new Command138("fund").description(
27434
27693
  "Back an open project: pay into its funding pool, from any wallet. You (or --on-behalf-of) become a backer holding shares bought at the pool's current value (what it holds plus what its live tasks hold), and once the project is closed or past its end date each backer claims its share of what is left with `project claim` (costs the amount, in the payment token)"
27435
27694
  ).argument("<projectId>", "Project id").requiredOption("--amount <amount>", "Amount in the payment token (e.g. 10)").option(
27436
27695
  "--on-behalf-of <address>",
@@ -27438,21 +27697,21 @@ var projectFundCommand = new Command137("fund").description(
27438
27697
  ).action(async (id, opts) => {
27439
27698
  const projectId = parseProjectId(id);
27440
27699
  if (typeof projectId !== "number") return void printError(projectId.error);
27441
- const amount = parseAmount(opts.amount, "--amount");
27442
- if (typeof amount !== "string") return void printError(amount.error);
27700
+ const amount2 = parseAmount(opts.amount, "--amount");
27701
+ if (typeof amount2 !== "string") return void printError(amount2.error);
27443
27702
  const onBehalfOf = opts.onBehalfOf?.trim();
27444
27703
  if (onBehalfOf !== void 0 && (!ADDRESS.test(onBehalfOf) || /^0x0{40}$/i.test(onBehalfOf))) {
27445
27704
  return void printError("Invalid Ethereum address for --on-behalf-of");
27446
27705
  }
27447
27706
  await postProjectWrite(
27448
27707
  `/api/projects/${projectId}/fund`,
27449
- { projectId, amount, ...onBehalfOf ? { onBehalfOf } : {} },
27450
- { maxAmount: amount }
27708
+ { projectId, amount: amount2, ...onBehalfOf ? { onBehalfOf } : {} },
27709
+ { maxAmount: amount2 }
27451
27710
  );
27452
27711
  });
27453
27712
 
27454
27713
  // src/commands/project/grant.ts
27455
- import { Command as Command138 } from "commander";
27714
+ import { Command as Command139 } from "commander";
27456
27715
  function grantBody(projectId, opts) {
27457
27716
  if (!ADDRESS.test(opts.operator)) {
27458
27717
  return { error: "--operator must be a wallet address (0x + 40 hex chars)" };
@@ -27475,7 +27734,7 @@ function grantBody(projectId, opts) {
27475
27734
  revokeRemovesControl: opts.revokeRemovesControl
27476
27735
  };
27477
27736
  }
27478
- var projectGrantCommand = new Command138("grant").description(
27737
+ var projectGrantCommand = new Command139("grant").description(
27479
27738
  "Grant a wallet (an agent or a person) the right to create tasks from the project's budget under the terms below. It can spend only after it accepts, which freezes the terms; until then a new grant replaces them, and a revoked operator can be granted again, back to pending (costs 0.001 in the payment token)"
27480
27739
  ).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The wallet granted the right to spend the budget").option(
27481
27740
  "--cap <amount>",
@@ -27501,7 +27760,7 @@ var projectGrantCommand = new Command138("grant").description(
27501
27760
  });
27502
27761
 
27503
27762
  // src/commands/project/review.ts
27504
- import { Command as Command139 } from "commander";
27763
+ import { Command as Command140 } from "commander";
27505
27764
  function reviewEvaluator(opts) {
27506
27765
  if (opts.evaluator !== void 0 && opts.off) {
27507
27766
  return { error: "Pass --evaluator <address> or --off, not both" };
@@ -27516,7 +27775,7 @@ function reviewEvaluator(opts) {
27516
27775
  }
27517
27776
  return opts.evaluator;
27518
27777
  }
27519
- var projectReviewCommand = new Command139("review").description(
27778
+ var projectReviewCommand = new Command140("review").description(
27520
27779
  "Read, set or clear the project's review default, as its owner. With an evaluator set, every task created through the API from the project gets that evaluator, and a project task that names a different one is refused. Enforced by the API, not the contract. Setting or clearing costs 0.001 in the payment token; reading is free"
27521
27780
  ).argument("<projectId>", "Project id").option("--evaluator <address>", "The evaluator every project task gets").option("--off", "Turn the review default off: each task's requester reviews it again").action(async (id, opts) => {
27522
27781
  const projectId = parseProjectId(id);
@@ -27558,8 +27817,8 @@ async function ownerEvaluatorWarnings(evaluator) {
27558
27817
  }
27559
27818
 
27560
27819
  // src/commands/project/raise-cap.ts
27561
- import { Command as Command140 } from "commander";
27562
- var projectRaiseCapCommand = new Command140("raise-cap").description(
27820
+ import { Command as Command141 } from "commander";
27821
+ var projectRaiseCapCommand = new Command141("raise-cap").description(
27563
27822
  "Advanced. Raise any operator's spending cap in place, as the project owner (costs 0.001 in the payment token). For the platform runner use `project automations on --cap <higher amount>`, which takes the same path. The new cap must be above the current one, which must be set; a cap is never lowered, and a revoked operator is granted again instead"
27564
27823
  ).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose cap to raise").requiredOption("--cap <amount>", "The new cap in the payment token, above the current cap").action(async (id, opts) => {
27565
27824
  const projectId = parseProjectId(id);
@@ -27577,8 +27836,8 @@ var projectRaiseCapCommand = new Command140("raise-cap").description(
27577
27836
  });
27578
27837
 
27579
27838
  // src/commands/project/lower-cap.ts
27580
- import { Command as Command141 } from "commander";
27581
- var projectLowerCapCommand = new Command141("lower-cap").description(
27839
+ import { Command as Command142 } from "commander";
27840
+ var projectLowerCapCommand = new Command142("lower-cap").description(
27582
27841
  "Advanced. Lower an operator's lifetime spending cap in place, as the project owner (costs 0.001 in the payment token; contract revision 29 or later). The new cap must be below the current one (any cap lowers a grant that has none) and at least what the operator already draws (committed). To raise a cap use `project raise-cap`; for the platform runner, `project automations on --cap`"
27583
27842
  ).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose cap to lower").requiredOption(
27584
27843
  "--cap <amount>",
@@ -27600,7 +27859,7 @@ var projectLowerCapCommand = new Command141("lower-cap").description(
27600
27859
  });
27601
27860
 
27602
27861
  // src/commands/project/limits.ts
27603
- import { Command as Command142 } from "commander";
27862
+ import { Command as Command143 } from "commander";
27604
27863
  function limitsBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
27605
27864
  if (!ADDRESS.test(opts.operator)) {
27606
27865
  return { error: "--operator must be a wallet address (0x + 40 hex chars)" };
@@ -27640,7 +27899,7 @@ function limitsBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
27640
27899
  }
27641
27900
  return body;
27642
27901
  }
27643
- var projectLimitsCommand = new Command142("limits").description(
27902
+ var projectLimitsCommand = new Command143("limits").description(
27644
27903
  "Advanced. Set all of an operator's limits as the project owner, stated whole: a flag you leave out is no limit of that kind (costs 0.001 in the payment token; contract revision 29 or later). The limits bound the operator on top of its cap: an expiry, the task modes it may create, the most one task may hold, and a budget per week or month. For the platform runner, `project automations on` takes --expires, --period-budget and --period"
27645
27904
  ).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose limits to set").option(
27646
27905
  "--expires <time>",
@@ -27662,8 +27921,8 @@ var projectLimitsCommand = new Command142("limits").description(
27662
27921
  });
27663
27922
 
27664
27923
  // src/commands/project/revoke.ts
27665
- import { Command as Command143 } from "commander";
27666
- var projectRevokeCommand = new Command143("revoke").description(
27924
+ import { Command as Command144 } from "commander";
27925
+ var projectRevokeCommand = new Command144("revoke").description(
27667
27926
  "End an operator's right to create tasks from the project, as its owner (costs 0.001 in the payment token)"
27668
27927
  ).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator to revoke").action(async (id, opts) => {
27669
27928
  const projectId = parseProjectId(id);
@@ -27682,7 +27941,7 @@ var projectRevokeCommand = new Command143("revoke").description(
27682
27941
  });
27683
27942
 
27684
27943
  // src/commands/project/schedule.ts
27685
- import { Command as Command146 } from "commander";
27944
+ import { Command as Command147 } from "commander";
27686
27945
 
27687
27946
  // src/lib/owner-list.ts
27688
27947
  import { getAddress as getAddress2, isAddress as isAddress5 } from "viem";
@@ -27722,7 +27981,7 @@ function ownerListQuery(owner, opts, statuses) {
27722
27981
  }
27723
27982
 
27724
27983
  // src/commands/project/suggestion-schedule.ts
27725
- import { Command as Command144 } from "commander";
27984
+ import { Command as Command145 } from "commander";
27726
27985
  var SUGGESTION_ONLY_FLAGS = [
27727
27986
  ["--rank", "rank"],
27728
27987
  ["--min-backed-share", "minBackedShare"],
@@ -27808,9 +28067,9 @@ function settingsFields(opts, stored) {
27808
28067
  ["--max-reward", opts.maxReward, "maxReward"]
27809
28068
  ]) {
27810
28069
  if (value === void 0) continue;
27811
- const amount = parseAmount(value, flag);
27812
- if (typeof amount !== "string") return amount;
27813
- body[field] = amount;
28070
+ const amount2 = parseAmount(value, flag);
28071
+ if (typeof amount2 !== "string") return amount2;
28072
+ body[field] = amount2;
27814
28073
  }
27815
28074
  if (opts.declineAfter !== void 0) {
27816
28075
  const trimmed = opts.declineAfter.trim();
@@ -27913,7 +28172,7 @@ function addSuggestionScheduleOptions(command) {
27913
28172
  ).option("--no-email-picks", "Suggestions schedules: do not email when picks are waiting");
27914
28173
  }
27915
28174
  var suggestionScheduleSettingsCommand = addSuggestionScheduleOptions(
27916
- new Command144("suggestion-settings").description(
28175
+ new Command145("suggestion-settings").description(
27917
28176
  "Change a suggestions schedule's settings, as the project's owner: any of its mode, ranking, thresholds, limits, stale-suggestion declines, default task mode, the picks-waiting email and the task template. Only the settings you pass change; a template flag changes only its own fields of the stored template, which the CLI reads first. A pending proposal is unchanged. Read the settings with `taskmarket project schedule show`. Costs 0.001 in the payment token"
27918
28177
  ).argument("<scheduleId>", "Schedule id").option(
27919
28178
  "--mode <mode>",
@@ -27947,7 +28206,7 @@ var suggestionScheduleSettingsCommand = addSuggestionScheduleOptions(
27947
28206
 
27948
28207
  // src/commands/workflow-template.ts
27949
28208
  import { readFile as readFile4 } from "fs/promises";
27950
- import { Command as Command145 } from "commander";
28209
+ import { Command as Command146 } from "commander";
27951
28210
  var UUID3 = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
27952
28211
  var ADDRESS2 = /^0x[0-9a-fA-F]{40}$/;
27953
28212
  var FILE_MAX_BYTES = 256 * 1024;
@@ -28041,7 +28300,7 @@ async function readValidTemplate(path10) {
28041
28300
  }
28042
28301
  return parsed.document;
28043
28302
  }
28044
- var createCommand3 = new Command145("create").description(
28303
+ var createCommand3 = new Command146("create").description(
28045
28304
  "Save a workflow template from a JSON file: a workflow document whose strings use {{param}} placeholders, with each parameter declared (type string, integer, amount or list; a default; bounds). It is checked with every parameter at its minimum and its maximum before it is saved. Costs 0.001 in the payment token"
28046
28305
  ).requiredOption("--file <path>", "The template, JSON").action(async (opts) => {
28047
28306
  const template = await readValidTemplate(opts.file);
@@ -28052,7 +28311,7 @@ var createCommand3 = new Command145("create").description(
28052
28311
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28053
28312
  );
28054
28313
  });
28055
- var updateCommand = new Command145("update").description(
28314
+ var updateCommand = new Command146("update").description(
28056
28315
  "Replace a saved template with a JSON file, as the wallet that saved it. A change to its content makes a new version; workflows already made from it keep their document until their owner runs `taskmarket workflow update-template`. Costs 0.001 in the payment token"
28057
28316
  ).argument("<templateId>", "Template id").requiredOption("--file <path>", "The template, JSON").action(async (value, opts) => {
28058
28317
  const choice = templateChoice(value);
@@ -28106,7 +28365,7 @@ function parseTemplateSearch(opts) {
28106
28365
  }
28107
28366
  return { query: query4 };
28108
28367
  }
28109
- var listCommand6 = new Command145("list").description(
28368
+ var listCommand6 = new Command146("list").description(
28110
28369
  "List the official templates (official: true, ids official:<slug>), the built-in presets and a wallet's saved templates, newest first (your wallet unless --owner is given). Any wallet may make a workflow from any of them (free). With --search, --tag, --featured or --sort, search instead: one page of templates, featured first, with `hasMore`, `nextCursor` and the catalog's most used tags in `catalogTags`; each template lists its `tags` and `featured`"
28111
28370
  ).option("--owner <address>", "The wallet whose templates to list").option(
28112
28371
  "--mine",
@@ -28191,7 +28450,7 @@ var listCommand6 = new Command145("list").description(
28191
28450
  }
28192
28451
  }
28193
28452
  );
28194
- var showCommand4 = new Command145("show").description(
28453
+ var showCommand4 = new Command146("show").description(
28195
28454
  "Show a saved template, an official template (official:<slug>) or a preset (code, content, research): its version (a counter for a saved template, a content hash for an official one), the earlier versions of a saved template as `versions` (number, hash, date), whether it is `listed` in the gallery, its parameters, steps and worst case (free)"
28196
28455
  ).argument("<template>", "Template id, official template id or preset name").action(async (value) => {
28197
28456
  const choice = templateChoice(value);
@@ -28214,7 +28473,7 @@ function savedTemplateId(value, verb) {
28214
28473
  }
28215
28474
  return choice.templateId;
28216
28475
  }
28217
- var publishCommand = new Command145("publish").description(
28476
+ var publishCommand = new Command146("publish").description(
28218
28477
  "List a saved template in the public gallery, as the wallet that saved it, so others can find it with `template list --gallery` (and on the web Templates page) without being given its id; it is shown with your wallet as its author. It needs a description and at most 10 templates per wallet can be listed. Listing again changes nothing. Costs 0.001 in the payment token"
28219
28478
  ).argument("<templateId>", "Saved template id").action(async (value) => {
28220
28479
  const id = savedTemplateId(value, "publish");
@@ -28225,7 +28484,7 @@ var publishCommand = new Command145("publish").description(
28225
28484
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28226
28485
  );
28227
28486
  });
28228
- var unpublishCommand = new Command145("unpublish").description(
28487
+ var unpublishCommand = new Command146("unpublish").description(
28229
28488
  "Take a saved template out of the public gallery, as the wallet that saved it. It stays usable by anyone who has its id. Costs 0.001 in the payment token"
28230
28489
  ).argument("<templateId>", "Saved template id").action(async (value) => {
28231
28490
  const id = savedTemplateId(value, "unpublish");
@@ -28236,7 +28495,7 @@ var unpublishCommand = new Command145("unpublish").description(
28236
28495
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28237
28496
  );
28238
28497
  });
28239
- var deleteCommand2 = new Command145("delete").description(
28498
+ var deleteCommand2 = new Command146("delete").description(
28240
28499
  "Delete a saved template, as the wallet that saved it; workflows already made from it are unaffected. Costs 0.001 in the payment token"
28241
28500
  ).argument("<templateId>", "Template id").action(async (value) => {
28242
28501
  const choice = templateChoice(value);
@@ -28253,7 +28512,7 @@ var deleteCommand2 = new Command145("delete").description(
28253
28512
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28254
28513
  );
28255
28514
  });
28256
- var workflowTemplateCommand = new Command145("template").description(
28515
+ var workflowTemplateCommand = new Command146("template").description(
28257
28516
  "Workflow templates: a workflow saved once with declared parameters ({{reward}}, {{topic}}) and made into a workflow on any of your projects with `taskmarket workflow create <projectId> --template <id|official:slug|preset> --param name=value`. Any wallet may use any template; only the wallet that saved one may update or delete it. Official templates: see `taskmarket workflow template list`. Presets: code, content, research"
28258
28517
  ).addCommand(createCommand3).addCommand(updateCommand).addCommand(listCommand6).addCommand(showCommand4).addCommand(publishCommand).addCommand(unpublishCommand).addCommand(deleteCommand2);
28259
28518
  async function createWorkflowFromTemplate(projectId, template, pairs) {
@@ -28453,7 +28712,7 @@ async function read2(path10) {
28453
28712
  }
28454
28713
  }
28455
28714
  var createCommand4 = addSuggestionScheduleOptions(
28456
- new Command146("create").description(
28715
+ new Command147("create").description(
28457
28716
  "Create a schedule that opens a task from the project's budget on a cadence, starts a run of a workflow (--workflow or --workflow-file), or turns the top open suggestions into tasks (--suggestions), as the project's owner. The platform runner creates each task or run under your grant to it, and pays the action fee: grant it first (see `taskmarket project runner`). A slot is skipped while the previous task is open or the previous run is not settled, and failures in a row (3 by default) pause the schedule. A suggestions schedule proposes its picks for you to confirm (`taskmarket project suggestion proposals`) unless --mode auto; it needs --max-spend, --max-reward and --duration. Costs 0.001 in the payment token"
28458
28717
  ).argument("<projectId>", "Project id").requiredOption(
28459
28718
  "--cadence <cadence>",
@@ -28502,7 +28761,7 @@ var createCommand4 = addSuggestionScheduleOptions(
28502
28761
  });
28503
28762
  });
28504
28763
  var OWNER_SCHEDULE_STATUSES = [...STATUSES, "needs_action", "all"];
28505
- var listCommand7 = new Command146("list").description(
28764
+ var listCommand7 = new Command147("list").description(
28506
28765
  "List a project's schedules, its schedule limits and the platform runner; or, with --mine or --owner, a wallet's schedules across every project it owns, failing ones first, each with its next and last run (free)"
28507
28766
  ).argument("[projectId]", "Project id (omit with --mine or --owner)").option("--mine", "List the acting wallet's schedules across the projects it owns").option("--owner <address>", "List this wallet's schedules across the projects it owns").option(
28508
28767
  "--status <status>",
@@ -28535,7 +28794,7 @@ var listCommand7 = new Command146("list").description(
28535
28794
  const query4 = params.toString();
28536
28795
  await read2(withChainId(`/api/projects/${projectId}/schedules${query4 ? `?${query4}` : ""}`));
28537
28796
  });
28538
- var showCommand5 = new Command146("show").description(
28797
+ var showCommand5 = new Command147("show").description(
28539
28798
  "Show a schedule (its target, task, workflow or suggestions, with workflowId, template or its suggestions settings) and its newest runs: opened, proposed, skipped with the reason, or failed, each with its task, workflowRunId, proposalId or taskIds (free)"
28540
28799
  ).argument("<scheduleId>", "Schedule id").action(async (value) => {
28541
28800
  const id = parseScheduleId(value);
@@ -28543,7 +28802,7 @@ var showCommand5 = new Command146("show").description(
28543
28802
  await read2(`/api/project-schedules/${id}`);
28544
28803
  });
28545
28804
  function actionCommand(action, description) {
28546
- return new Command146(action).description(description).argument("<scheduleId>", "Schedule id").action(async (value) => {
28805
+ return new Command147(action).description(description).argument("<scheduleId>", "Schedule id").action(async (value) => {
28547
28806
  const id = parseScheduleId(value);
28548
28807
  if (typeof id !== "string") return void printError(id.error);
28549
28808
  await postProjectWrite(
@@ -28553,7 +28812,7 @@ function actionCommand(action, description) {
28553
28812
  );
28554
28813
  });
28555
28814
  }
28556
- var settingsCommand = new Command146("settings").description(
28815
+ var settingsCommand = new Command147("settings").description(
28557
28816
  "Read or set the project's schedule limits, as its owner: the shortest gap between two runs (PT30M to P7D, default PT30M) and the failures in a row that pause a schedule (1 to 10, default 3). Setting costs 0.001 in the payment token; reading is free"
28558
28817
  ).argument("<projectId>", "Project id").option("--min-interval <duration>", "The shortest gap between runs, as an ISO 8601 duration").option("--pause-after <failures>", "Failures in a row that pause a schedule").action(async (id, opts) => {
28559
28818
  const projectId = parseProjectId(id);
@@ -28575,7 +28834,7 @@ var settingsCommand = new Command146("settings").description(
28575
28834
  maxAmount: ACTION_FEE_MAX_AMOUNT
28576
28835
  });
28577
28836
  });
28578
- var projectScheduleCommand = new Command146("schedule").description(
28837
+ var projectScheduleCommand = new Command147("schedule").description(
28579
28838
  "Schedules: a task from the project's budget on a cadence, a workflow run, or tasks from the top suggestions, created by the platform runner once the project's automations are on (`taskmarket project automations on <projectId> --cap <amount>`)"
28580
28839
  ).addCommand(createCommand4).addCommand(listCommand7).addCommand(showCommand5).addCommand(
28581
28840
  actionCommand(
@@ -28598,15 +28857,15 @@ var projectScheduleCommand = new Command146("schedule").description(
28598
28857
  "Stop automatic payouts and review acceptance on a workflow schedule, for good: every run it starts, and its runs still going, wait for the owner's confirmation; the runner sends nothing. Refused on a schedule that opens tasks (costs 0.001 in the payment token)"
28599
28858
  )
28600
28859
  ).addCommand(settingsCommand).addCommand(suggestionScheduleSettingsCommand);
28601
- var projectRunnerCommand = new Command146("runner").description(
28860
+ var projectRunnerCommand = new Command147("runner").description(
28602
28861
  "Advanced. The platform runner's address on the selected network's chain, and every chain's runner (free). To run schedules and workflows turn automations on instead, `taskmarket project automations on <projectId> --cap <amount>`, which grants the right runner for you. Granting it by hand with `taskmarket project grant` works too; the runner pays each action fee"
28603
28862
  ).action(async () => {
28604
28863
  await read2(withChainId("/api/project-runner"));
28605
28864
  });
28606
28865
 
28607
28866
  // src/commands/project/transfer.ts
28608
- import { Command as Command147 } from "commander";
28609
- var proposeCommand = new Command147("propose").description(
28867
+ import { Command as Command148 } from "commander";
28868
+ var proposeCommand = new Command148("propose").description(
28610
28869
  "Propose a new owner for a project, as the project owner (costs 0.001 in the payment token). Nothing changes until that wallet runs `project transfer accept`; a new proposal replaces the old one, and `project transfer cancel` withdraws it. Only an open project can be handed over. On accept, the owner's own share of the project's pool moves to the new owner; other backers' shares never move, and the grants stay"
28611
28870
  ).argument("<projectId>", "Project id").requiredOption("--to <address>", "The wallet that will own the project once it accepts").action(async (id, opts) => {
28612
28871
  const projectId = parseProjectId(id);
@@ -28620,7 +28879,7 @@ var proposeCommand = new Command147("propose").description(
28620
28879
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28621
28880
  );
28622
28881
  });
28623
- var acceptCommand2 = new Command147("accept").description(
28882
+ var acceptCommand2 = new Command148("accept").description(
28624
28883
  "Take over a project its owner proposed to this wallet (costs 0.001 in the payment token). Read the project first (`project show`): you receive it as it stands, with its grants and tasks, and the previous owner's share of its pool. Only an open project can be accepted"
28625
28884
  ).argument("<projectId>", "Project id").action(async (id) => {
28626
28885
  const projectId = parseProjectId(id);
@@ -28631,7 +28890,7 @@ var acceptCommand2 = new Command147("accept").description(
28631
28890
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28632
28891
  );
28633
28892
  });
28634
- var cancelCommand = new Command147("cancel").description(
28893
+ var cancelCommand = new Command148("cancel").description(
28635
28894
  "Withdraw the pending ownership proposal, as the project owner (costs 0.001 in the payment token)"
28636
28895
  ).argument("<projectId>", "Project id").action(async (id) => {
28637
28896
  const projectId = parseProjectId(id);
@@ -28642,13 +28901,13 @@ var cancelCommand = new Command147("cancel").description(
28642
28901
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28643
28902
  );
28644
28903
  });
28645
- var projectTransferCommand = new Command147("transfer").description(
28904
+ var projectTransferCommand = new Command148("transfer").description(
28646
28905
  "Hand a project to another wallet in two steps: the owner proposes, the new owner accepts, and the owner can cancel before it does"
28647
28906
  ).addCommand(proposeCommand).addCommand(acceptCommand2).addCommand(cancelCommand);
28648
28907
 
28649
28908
  // src/commands/project/show.ts
28650
- import { Command as Command148 } from "commander";
28651
- var projectShowCommand = new Command148("show").description(
28909
+ import { Command as Command149 } from "commander";
28910
+ var projectShowCommand = new Command149("show").description(
28652
28911
  "Show a project: its budget, funding pool, newest backers with what each can claim, grants, tasks and its tasks grouped into chains of versions (free)"
28653
28912
  ).argument("<projectId>", "Project id").action(async (id) => {
28654
28913
  const projectId = parseProjectId(id);
@@ -28657,7 +28916,7 @@ var projectShowCommand = new Command148("show").description(
28657
28916
  printResult(await apiGet(withChainId(`/api/projects/${projectId}`), { headers }));
28658
28917
  });
28659
28918
  var BACKERS_CURSOR = /^\d{1,20}-\d{1,9}$/;
28660
- var projectBackersCommand = new Command148("backers").description(
28919
+ var projectBackersCommand = new Command149("backers").description(
28661
28920
  "List a project's backers, newest first, with each one's contribution, shares, claims and claimable share (free)"
28662
28921
  ).argument("<projectId>", "Project id").option("--limit <count>", "Backers per page (1-100, default 50)").option("--before <cursor>", "The next page: the previous page's nextBefore").action(async (id, opts) => {
28663
28922
  const projectId = parseProjectId(id);
@@ -28676,13 +28935,13 @@ var projectBackersCommand = new Command148("backers").description(
28676
28935
  await apiGet(withChainId(`/api/projects/${projectId}/backers${query4 ? `?${query4}` : ""}`))
28677
28936
  );
28678
28937
  });
28679
- var projectForTaskCommand = new Command148("for-task").description("The project a task was funded from, or null when it was not (free)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
28938
+ var projectForTaskCommand = new Command149("for-task").description("The project a task was funded from, or null when it was not (free)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
28680
28939
  if (!/^0x[0-9a-fA-F]{1,78}$/.test(taskId.trim())) {
28681
28940
  return void printError("The task id must be 0x-prefixed hex");
28682
28941
  }
28683
28942
  printResult(await apiGet(`/api/projects/by-task/${encodeURIComponent(taskId.trim())}`));
28684
28943
  });
28685
- var projectListCommand = new Command148("list").description(
28944
+ var projectListCommand = new Command149("list").description(
28686
28945
  "List a wallet's projects, as owner, operator or backer, or with --funding the projects open for backing now (free; default: your wallet)"
28687
28946
  ).option(
28688
28947
  "--funding",
@@ -28690,8 +28949,17 @@ var projectListCommand = new Command148("list").description(
28690
28949
  ).option(
28691
28950
  "--open",
28692
28951
  "Only the wallet's projects that are still open (not closed, end date ahead); applied before --limit"
28952
+ ).option(
28953
+ "--finished",
28954
+ "Only the wallet's projects that are closed or past their end date; applied before --limit"
28693
28955
  ).option("--address <address>", "The wallet to list (default: your keystore wallet)").option("--role <role>", "owner, operator, backer or any (any is owner and operator)", "any").option("--limit <count>", "Projects per page (1-100, default 50)").option("--before <projectId>", "The next page: projects with a smaller id than this").action(
28694
28956
  async (opts) => {
28957
+ if (opts.open && opts.finished) {
28958
+ return void printError("--open and --finished are opposites; pass one of them");
28959
+ }
28960
+ if (opts.funding && opts.finished) {
28961
+ return void printError("--funding lists open projects; do not combine it with --finished");
28962
+ }
28695
28963
  if (opts.funding && opts.address !== void 0) {
28696
28964
  return void printError(
28697
28965
  "--funding lists every open project; do not combine it with --address"
@@ -28726,6 +28994,7 @@ var projectListCommand = new Command148("list").description(
28726
28994
  if (!ADDRESS.test(address3)) return void printError("Invalid Ethereum address for --address");
28727
28995
  const params = new URLSearchParams({ address: address3, role: opts.role });
28728
28996
  if (opts.open) params.set("status", "open");
28997
+ if (opts.finished) params.set("status", "finished");
28729
28998
  if (opts.limit !== void 0) params.set("limit", opts.limit.trim());
28730
28999
  if (before !== void 0) params.set("before", String(before));
28731
29000
  printResult(await apiGet(withChainId(`/api/projects?${params.toString()}`)));
@@ -28733,7 +29002,7 @@ var projectListCommand = new Command148("list").description(
28733
29002
  );
28734
29003
 
28735
29004
  // src/commands/project/index.ts
28736
- var projectCommand = new Command149("project").description(
29005
+ var projectCommand = new Command150("project").description(
28737
29006
  "Projects: one crowdfunded budget that funds tasks of any mode, spent by its owner and the operators it grants; anyone may back an open project, and backers claim back what is left"
28738
29007
  );
28739
29008
  projectCommand.addCommand(projectCreateCommand);
@@ -28764,7 +29033,7 @@ projectCommand.addCommand(projectForTaskCommand);
28764
29033
 
28765
29034
  // src/commands/workflow.ts
28766
29035
  import { readFile as readFile5 } from "fs/promises";
28767
- import { Command as Command150 } from "commander";
29036
+ import { Command as Command151 } from "commander";
28768
29037
  var UUID4 = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
28769
29038
  var FILE_MAX_BYTES2 = 256 * 1024;
28770
29039
  function parseWorkflowText(text) {
@@ -28828,7 +29097,7 @@ async function projectContext(projectId) {
28828
29097
  runner
28829
29098
  };
28830
29099
  }
28831
- var validateCommand = new Command150("validate").description(
29100
+ var validateCommand = new Command151("validate").description(
28832
29101
  "Check a workflow document (JSON) before anything is spent: the patterns, ids, named inputs and outputs, bounds (maxItems, maxRounds, maxAttempts), contest modes, branch conditions and gate conditions; with --project, also the project step limit and the worst-case spend (every branch on its costliest case, every fallback attempt) against the project's available budget and the runner grant's remaining cap. Every error names a JSON pointer, a code and a message (free)"
28833
29102
  ).argument("[file]", "The document, JSON (or pass --file)").option("--file <path>", "The document, JSON").option("--project <projectId>", "Check it against this project").action(async (file, opts) => {
28834
29103
  const parsed = await readDocument(opts.file ?? file);
@@ -28871,7 +29140,7 @@ var validateCommand = new Command150("validate").description(
28871
29140
  document: result.document
28872
29141
  });
28873
29142
  });
28874
- var createCommand5 = new Command150("create").description(
29143
+ var createCommand5 = new Command151("create").description(
28875
29144
  "Create a workflow on a project, as its owner, from a JSON document (--file) or from a saved template, an official template or a preset (--template <id|official:slug|preset> with --param name=value for each value; a parameter left out takes its default). The API validates it again, worst case included, before saving; nothing runs until `taskmarket workflow run`. Grant the platform runner first (`taskmarket project runner`). Costs 0.001 in the payment token"
28876
29145
  ).argument("<projectId>", "Project id").option("--file <path>", "The document, JSON").option(
28877
29146
  "--template <template>",
@@ -28914,7 +29183,7 @@ var createCommand5 = new Command150("create").description(
28914
29183
  );
28915
29184
  });
28916
29185
  var OWNER_WORKFLOW_STATUSES = ["needs_action", "running", "failed", "idle", "all"];
28917
- var listCommand8 = new Command150("list").description(
29186
+ var listCommand8 = new Command151("list").description(
28918
29187
  "List a project's workflows, newest first, with its workflow limits and the platform runner; or, with --mine or --owner, a wallet's workflows across every project it owns, those waiting on the owner first (free)"
28919
29188
  ).argument("[projectId]", "Project id (omit with --mine or --owner)").option("--mine", "List the acting wallet's workflows across the projects it owns").option("--owner <address>", "List this wallet's workflows across the projects it owns").option(
28920
29189
  "--status <status>",
@@ -28944,7 +29213,7 @@ var listCommand8 = new Command150("list").description(
28944
29213
  const query4 = params.toString();
28945
29214
  await read3(withChainId(`/api/projects/${projectId}/workflows${query4 ? `?${query4}` : ""}`));
28946
29215
  });
28947
- var showCommand6 = new Command150("show").description(
29216
+ var showCommand6 = new Command151("show").description(
28948
29217
  "Show a workflow, its validated document, its newest runs and, for one made from a template, `workflow.templateUpdate` (the version it has, the template's latest and `available`); when an update is available a `note` says how to apply it (free)"
28949
29218
  ).argument("<workflowId>", "Workflow id").action(async (value) => {
28950
29219
  const id = uuid(value, "workflow");
@@ -28957,7 +29226,7 @@ var showCommand6 = new Command150("show").description(
28957
29226
  renderFailure(err);
28958
29227
  }
28959
29228
  });
28960
- var updateTemplateCommand = new Command150("update-template").description(
29229
+ var updateTemplateCommand = new Command151("update-template").description(
28961
29230
  "Apply the newest version of the template a workflow was made from, as the project owner: the document is made again from the template with the workflow's own parameter values and checked against the project, like a new workflow. It never happens on its own; `workflow show` says when an update is available. Runs already started keep the version they started with. Costs 0.001 in the payment token"
28962
29231
  ).argument("<workflowId>", "Workflow id").action(async (value) => {
28963
29232
  const id = uuid(value, "workflow");
@@ -28968,7 +29237,7 @@ var updateTemplateCommand = new Command150("update-template").description(
28968
29237
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28969
29238
  );
28970
29239
  });
28971
- var updateStepsCommand = new Command150("update-steps").description(
29240
+ var updateStepsCommand = new Command151("update-steps").description(
28972
29241
  "Replace a saved workflow's steps with a new JSON document (--file), as the project owner. The API checks it against the project as it checks a new workflow (step limit, worst case against the budget). Runs already started keep the steps they started with; the new steps apply to runs started afterwards. A workflow made from a template becomes hand-written, so update-template no longer applies to it. Get the current document with `workflow show`. Costs 0.001 in the payment token"
28973
29242
  ).argument("<workflowId>", "Workflow id").option("--file <path>", "The new document, JSON").action(async (value, opts) => {
28974
29243
  const id = uuid(value, "workflow");
@@ -28990,7 +29259,7 @@ var updateStepsCommand = new Command150("update-steps").description(
28990
29259
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28991
29260
  );
28992
29261
  });
28993
- var runsCommand = new Command150("runs").description("Page through a workflow's runs, newest first (free)").argument("<workflowId>", "Workflow id").option("--limit <count>", "Runs per page (1-100, default 20)").option("--cursor <cursor>", "nextCursor from the previous page").action(async (value, opts) => {
29262
+ var runsCommand = new Command151("runs").description("Page through a workflow's runs, newest first (free)").argument("<workflowId>", "Workflow id").option("--limit <count>", "Runs per page (1-100, default 20)").option("--cursor <cursor>", "nextCursor from the previous page").action(async (value, opts) => {
28994
29263
  const id = uuid(value, "workflow");
28995
29264
  if (typeof id !== "string") return void printError(id.error);
28996
29265
  if (opts.limit !== void 0 && !/^(100|[1-9][0-9]?)$/.test(opts.limit.trim())) {
@@ -29002,14 +29271,14 @@ var runsCommand = new Command150("runs").description("Page through a workflow's
29002
29271
  const query4 = params.toString();
29003
29272
  await read3(`/api/project-workflows/${id}/runs${query4 ? `?${query4}` : ""}`);
29004
29273
  });
29005
- var statusCommand3 = new Command150("status").description(
29274
+ var statusCommand3 = new Command151("status").description(
29006
29275
  "Show a run: its outline, each step with its state (pending, open, accepted, failed or skipped), round, item or attempt, autoAccept for a gating review the runner accepts itself, and the next action (free)"
29007
29276
  ).argument("<runId>", "Run id").action(async (value) => {
29008
29277
  const id = uuid(value, "run");
29009
29278
  if (typeof id !== "string") return void printError(id.error);
29010
29279
  await read3(`/api/project-workflow-runs/${id}`);
29011
29280
  });
29012
- var runCommand2 = new Command150("run").description(
29281
+ var runCommand2 = new Command151("run").description(
29013
29282
  "Start a run of a workflow, as the project's owner. The API checks the worst case against the budget and the runner grant's cap again; then the platform runner creates each step's task when it is ready and you review them as usual. Costs 0.001 in the payment token"
29014
29283
  ).argument("<workflowId>", "Workflow id").action(async (value) => {
29015
29284
  const id = uuid(value, "workflow");
@@ -29021,7 +29290,7 @@ var runCommand2 = new Command150("run").description(
29021
29290
  );
29022
29291
  });
29023
29292
  function stepCommand(action, description) {
29024
- return new Command150(action).description(description).argument("<runId>", "Run id").requiredOption(
29293
+ return new Command151(action).description(description).argument("<runId>", "Run id").requiredOption(
29025
29294
  "--step <key>",
29026
29295
  "The step key the run shows, e.g. gate-1, review[round=2] or post[attempt=2]"
29027
29296
  ).action(async (value, opts) => {
@@ -29036,7 +29305,7 @@ function stepCommand(action, description) {
29036
29305
  );
29037
29306
  });
29038
29307
  }
29039
- var cancelCommand2 = new Command150("cancel").description(
29308
+ var cancelCommand2 = new Command151("cancel").description(
29040
29309
  "Cancel a run, as the owner: nothing more is created, and tasks it opened stay open until they end or you cancel them. Costs 0.001 in the payment token"
29041
29310
  ).argument("<runId>", "Run id").action(async (value) => {
29042
29311
  const id = uuid(value, "run");
@@ -29047,7 +29316,7 @@ var cancelCommand2 = new Command150("cancel").description(
29047
29316
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
29048
29317
  );
29049
29318
  });
29050
- var stopAutoPayoutCommand = new Command150("stop-auto-payout").description(
29319
+ var stopAutoPayoutCommand = new Command151("stop-auto-payout").description(
29051
29320
  "Stop automatic payouts and automatic review acceptance on a run, as the owner, at once and for good: from then on every pending step's review waits for you to accept it and every payout becomes a proposal you confirm (`taskmarket workflow payout confirm`); the runner sends nothing. A second stop changes nothing; refused on a completed or cancelled run. Costs 0.001 in the payment token"
29052
29321
  ).argument("<runId>", "Run id").action(async (value) => {
29053
29322
  const id = uuid(value, "run");
@@ -29058,7 +29327,7 @@ var stopAutoPayoutCommand = new Command150("stop-auto-payout").description(
29058
29327
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
29059
29328
  );
29060
29329
  });
29061
- var deleteCommand3 = new Command150("delete").description(
29330
+ var deleteCommand3 = new Command151("delete").description(
29062
29331
  "Delete a workflow, as the owner, so it no longer counts toward the project limit of 50. Refused while a run is running or failed (cancel it first); ended runs go with it, and tasks they opened are not touched. Costs 0.001 in the payment token"
29063
29332
  ).argument("<workflowId>", "Workflow id").action(async (value) => {
29064
29333
  const id = uuid(value, "workflow");
@@ -29080,21 +29349,21 @@ async function ownerRead(path10) {
29080
29349
  renderFailure(err);
29081
29350
  }
29082
29351
  }
29083
- var payoutListCommand = new Command150("list").description(
29352
+ var payoutListCommand = new Command151("list").description(
29084
29353
  "A run's payout proposals: what each accepted gating review recommends paying on the task it gates, with the exact accept confirming sends; visible to the project's owner and operators only (signed with your wallet); status is pending, confirmed, auto_paid (payout: auto, with mode, txHash and intentId), accepted_by_owner (the gated task was accepted by hand before the automatic payout landed; the runner paid nothing) or unavailable (free). `kind` is payout, or refund when the review recommended nothing (an empty payout): the entries are rejected and the task cancelled, `refund` lists the entries. A payout: auto proposal is held until `holdUntil` for entrants to object (`objections` lists each one); `evidence` holds the check results of the recommendation"
29085
29354
  ).argument("<runId>", "Run id").action(async (value) => {
29086
29355
  const id = uuid(value, "run");
29087
29356
  if (typeof id !== "string") return void printError(id.error);
29088
29357
  await ownerRead(withChainId(`/api/project-workflow-runs/${id}/payouts`));
29089
29358
  });
29090
- var payoutShowCommand = new Command150("show").description(
29359
+ var payoutShowCommand = new Command151("show").description(
29091
29360
  'Show a payout proposal: its status (pending, confirmed, auto_paid, accepted_by_owner or unavailable), mode, txHash and intentId once sent, the ranking and rationale, and `accept`, the winners and shares (basis points) confirming sends. A `kind: "refund"` proposal has `refund` instead: the entries rejected before the gated task is cancelled, returning its reward to the project budget. `holdUntil` is when a held automatic payout is sent, `objections` the entrants who objected (worker, reason, at) and `evidence` the per-entry checks of the recommendation, log file names and hash. Owner and operators, and an entrant of the gated task while the proposal is held (free)'
29092
29361
  ).argument("<proposalId>", "Payout proposal id").action(async (value) => {
29093
29362
  const id = uuid(value, "payout proposal");
29094
29363
  if (typeof id !== "string") return void printError(id.error);
29095
29364
  await ownerRead(withChainId(`/api/project-workflow-payouts/${id}`));
29096
29365
  });
29097
- var payoutConfirmCommand = new Command150("confirm").description(
29366
+ var payoutConfirmCommand = new Command151("confirm").description(
29098
29367
  'Confirm a pending payout proposal, as the project\'s owner: sends exactly the accept it shows (`taskmarket workflow payout show` prints the winners and shares first), paying the gated task out. Refused unless the proposal is pending (an auto_paid one was already sent by the runner). Costs the accept, paid like `task accept-submissions`. A `kind: "refund"` proposal (the review recommended nothing) is confirmed the same way, but costs one action fee and the platform runner then rejects every active entry of the gated task and cancels it, returning the reward to the project budget; its status turns confirmed, then reads Refunded in `reason` once the task is cancelled'
29099
29368
  ).argument("<proposalId>", "Payout proposal id").action(async (value) => {
29100
29369
  const id = uuid(value, "payout proposal");
@@ -29121,7 +29390,7 @@ var payoutConfirmCommand = new Command150("confirm").description(
29121
29390
  }
29122
29391
  );
29123
29392
  });
29124
- var payoutObjectCommand = new Command150("object").description(
29393
+ var payoutObjectCommand = new Command151("object").description(
29125
29394
  `Object to an automatic payout or refund held for objections, as an entrant of the gated task (a wallet with an active submission on it; \`payout.pending_auto\` tells you when a hold starts, with the proposal id). Once per proposal, while the hold is open (\`holdUntil\` in \`payout show\`). The proposal then waits for the owner to confirm it and the owner is told. Needs --reason (1 to ${WORKFLOW_OBJECTION_REASON_MAX} characters). Free; signed with your wallet`
29126
29395
  ).argument("<proposalId>", "Payout proposal id").requiredOption("--reason <text>", "Why you object, shown to the owner").action(async (value, opts) => {
29127
29396
  const id = uuid(value, "payout proposal");
@@ -29145,10 +29414,10 @@ var payoutObjectCommand = new Command150("object").description(
29145
29414
  renderFailure(err);
29146
29415
  }
29147
29416
  });
29148
- var payoutCommand = new Command150("payout").description(
29417
+ var payoutCommand = new Command151("payout").description(
29149
29418
  "Payout proposals: a gating review's recommended winners and shares for the task it gates, which the owner confirms"
29150
29419
  ).addCommand(payoutListCommand).addCommand(payoutShowCommand).addCommand(payoutConfirmCommand).addCommand(payoutObjectCommand);
29151
- var settingsCommand2 = new Command150("settings").description(
29420
+ var settingsCommand2 = new Command151("settings").description(
29152
29421
  `Read or set the project's workflow step limit, as its owner: the most task steps one workflow may hold (${WORKFLOW_STEP_LIMIT_MIN} to ${WORKFLOW_STEP_LIMIT_MAX}, default 6). Setting costs 0.001 in the payment token; reading is free`
29153
29422
  ).argument("<projectId>", "Project id").option("--step-limit <count>", "The most task steps per workflow").action(async (id, opts) => {
29154
29423
  const projectId = parseProjectId(id);
@@ -29179,7 +29448,7 @@ var settingsCommand2 = new Command150("settings").description(
29179
29448
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
29180
29449
  );
29181
29450
  });
29182
- var workflowCommand = new Command150("workflow").description(
29451
+ var workflowCommand = new Command151("workflow").description(
29183
29452
  "Workflows: project tasks composed from named patterns (sequence, parallel, forEach, reviewLoop, gate, contest, branch, fallback), run by the platform runner under your grant to it. A gate waits for your approval, a step verdict or a time. A workflow is the document; a run is one execution of it"
29184
29453
  ).addCommand(validateCommand).addCommand(createCommand5).addCommand(listCommand8).addCommand(showCommand6).addCommand(runsCommand).addCommand(runCommand2).addCommand(statusCommand3).addCommand(
29185
29454
  stepCommand(
@@ -29194,8 +29463,8 @@ var workflowCommand = new Command150("workflow").description(
29194
29463
  ).addCommand(cancelCommand2).addCommand(stopAutoPayoutCommand).addCommand(updateTemplateCommand).addCommand(updateStepsCommand).addCommand(deleteCommand3).addCommand(settingsCommand2).addCommand(payoutCommand).addCommand(workflowTemplateCommand);
29195
29464
 
29196
29465
  // src/commands/drops.ts
29197
- import { Command as Command151 } from "commander";
29198
- var listCommand9 = new Command151("list").description("List public Task Drops, ones accepting work first").option("--limit <n>", "Maximum drops to return (1-48)", "24").option("--cursor <cursor>", "nextCursor from a previous page").option("--status <status>", "ended: only drops no longer accepting work, newest first").option("--worker <address>", "Only drops this wallet entered (a submission, pitch or bid)").option("--entered", "Only drops your wallet entered (--worker with your own address)").action(
29466
+ import { Command as Command152 } from "commander";
29467
+ var listCommand9 = new Command152("list").description("List public Task Drops, ones accepting work first").option("--limit <n>", "Maximum drops to return (1-48)", "24").option("--cursor <cursor>", "nextCursor from a previous page").option("--status <status>", "ended: only drops no longer accepting work, newest first").option("--worker <address>", "Only drops this wallet entered (a submission, pitch or bid)").option("--entered", "Only drops your wallet entered (--worker with your own address)").action(
29199
29468
  async (opts) => {
29200
29469
  try {
29201
29470
  if (opts.worker && opts.entered) throw new Error("Pass --worker or --entered, not both");
@@ -29223,7 +29492,7 @@ var listCommand9 = new Command151("list").description("List public Task Drops, o
29223
29492
  }
29224
29493
  }
29225
29494
  );
29226
- var showCommand7 = new Command151("show").description("Show a Task Drop and its discoverable tasks").argument("<taskDropId>", "Task Drop ID").action(async (taskDropId) => {
29495
+ var showCommand7 = new Command152("show").description("Show a Task Drop and its discoverable tasks").argument("<taskDropId>", "Task Drop ID").action(async (taskDropId) => {
29227
29496
  try {
29228
29497
  const input = parseInput(TaskDropGetInputSchema, { taskDropId });
29229
29498
  const result = await apiGet(`/api/task-drops/${encodeURIComponent(input.taskDropId)}`);
@@ -29235,7 +29504,7 @@ var showCommand7 = new Command151("show").description("Show a Task Drop and its
29235
29504
  renderFailure(err);
29236
29505
  }
29237
29506
  });
29238
- var subscribeCommand = new Command151("subscribe").description("Subscribe an email to one Task Drop, or with --official to every official drop").argument("[taskDropId]", "Task Drop ID (omit with --official)").requiredOption("--email <email>", "Email address to notify").option("--official", "Subscribe to all official Task Drops").option("--wallet <address>", "Wallet address to associate with the subscription").action(
29507
+ var subscribeCommand = new Command152("subscribe").description("Subscribe an email to one Task Drop, or with --official to every official drop").argument("[taskDropId]", "Task Drop ID (omit with --official)").requiredOption("--email <email>", "Email address to notify").option("--official", "Subscribe to all official Task Drops").option("--wallet <address>", "Wallet address to associate with the subscription").action(
29239
29508
  async (taskDropId, opts) => {
29240
29509
  try {
29241
29510
  if (opts.official) {
@@ -29263,7 +29532,7 @@ var subscribeCommand = new Command151("subscribe").description("Subscribe an ema
29263
29532
  }
29264
29533
  }
29265
29534
  );
29266
- var statusCommand4 = new Command151("status").description("Check whether an email is subscribed to a Task Drop, or with --official to all").argument("[taskDropId]", "Task Drop ID (omit with --official)").requiredOption("--email <email>", "Email address to check").option("--official", "Check the all-official-drops subscription").action(async (taskDropId, opts) => {
29535
+ var statusCommand4 = new Command152("status").description("Check whether an email is subscribed to a Task Drop, or with --official to all").argument("[taskDropId]", "Task Drop ID (omit with --official)").requiredOption("--email <email>", "Email address to check").option("--official", "Check the all-official-drops subscription").action(async (taskDropId, opts) => {
29267
29536
  try {
29268
29537
  if (opts.official) {
29269
29538
  if (taskDropId) throw new Error("Pass either a Task Drop ID or --official, not both");
@@ -29280,17 +29549,17 @@ var statusCommand4 = new Command151("status").description("Check whether an emai
29280
29549
  renderFailure(err);
29281
29550
  }
29282
29551
  });
29283
- var dropsCommand = new Command151("drops").description("Browse Task Drops and manage email subscriptions to them").addCommand(listCommand9).addCommand(showCommand7).addCommand(subscribeCommand).addCommand(statusCommand4);
29552
+ var dropsCommand = new Command152("drops").description("Browse Task Drops and manage email subscriptions to them").addCommand(listCommand9).addCommand(showCommand7).addCommand(subscribeCommand).addCommand(statusCommand4);
29284
29553
 
29285
29554
  // src/commands/hooks.ts
29286
29555
  import { mkdir, readFile as readFile7, writeFile } from "fs/promises";
29287
29556
  import path9 from "path";
29288
- import { Command as Command153 } from "commander";
29557
+ import { Command as Command154 } from "commander";
29289
29558
  import { BaseError, ContractFunctionRevertedError, ContractFunctionZeroDataError } from "viem";
29290
29559
 
29291
29560
  // src/lib/listing-submissions.ts
29292
29561
  import { readFile as readFile6 } from "fs/promises";
29293
- import { Command as Command152 } from "commander";
29562
+ import { Command as Command153 } from "commander";
29294
29563
  var NOTICE = "Submitted for staff review. The action fee is kept whether the submission is approved or rejected. Approval opens a review pull request; `listed` turns true once the entry is served.";
29295
29564
  function prepareListingFile(kind, text) {
29296
29565
  if (Buffer.byteLength(text, "utf8") > LISTING_SUBMISSION_MAX_BYTES) {
@@ -29347,7 +29616,7 @@ function prepareListingFile(kind, text) {
29347
29616
  }
29348
29617
  function submitCommandFor(kind) {
29349
29618
  const what = kind === "catalog" ? "catalog entry (kind x402-endpoint)" : "hook manifest";
29350
- return new Command152("submit").description(
29619
+ return new Command153("submit").description(
29351
29620
  `Submit a ${what} for staff review. Pays the standard action fee, kept either way; needs an ERC-8004 identity on the selected network`
29352
29621
  ).requiredOption("--file <path>", `Path to the ${what} JSON file`).action(async (opts) => {
29353
29622
  let text;
@@ -29379,7 +29648,7 @@ function submitCommandFor(kind) {
29379
29648
  });
29380
29649
  }
29381
29650
  function submissionsCommandFor(kind) {
29382
- return new Command152("submissions").description(
29651
+ return new Command153("submissions").description(
29383
29652
  `List the ${kind === "catalog" ? "catalog entries" : "hook listings"} you submitted and their status`
29384
29653
  ).option("--status <status>", `Only this status: ${LISTING_SUBMISSION_STATUSES.join(", ")}`).option("--limit <n>", "Maximum submissions to return (1-100)", "50").action(async (opts) => {
29385
29654
  if (opts.status && !LISTING_SUBMISSION_STATUSES.includes(opts.status)) {
@@ -29523,7 +29792,7 @@ async function probeHookVersion(entry, chainId) {
29523
29792
  return reverted ? { ...entry, hookVersion: 1 } : entry;
29524
29793
  }
29525
29794
  }
29526
- var listCommand10 = new Command153("list").description(
29795
+ var listCommand10 = new Command154("list").description(
29527
29796
  "List hooks listed (verified) in the hook registry on the selected --network, then observed hooks that are not listed"
29528
29797
  ).option("--limit <n>", "Maximum unlisted observed hooks to return (1-100)", "50").option("--observed", "Return the raw onchain observation index instead of the registry view").option(
29529
29798
  "--cursor <cursor>",
@@ -29562,7 +29831,7 @@ var listCommand10 = new Command153("list").description(
29562
29831
  }
29563
29832
  }
29564
29833
  );
29565
- var showCommand8 = new Command153("show").description(
29834
+ var showCommand8 = new Command154("show").description(
29566
29835
  "Show one hook on the selected --network: its registry listing, or its onchain observation marked unlisted"
29567
29836
  ).argument("<address>", "Hook contract address").action(async (address3) => {
29568
29837
  try {
@@ -29582,7 +29851,7 @@ var showCommand8 = new Command153("show").description(
29582
29851
  renderFailure(err);
29583
29852
  }
29584
29853
  });
29585
- var encodeConfigCommand = new Command153("encode-config").description(
29854
+ var encodeConfigCommand = new Command154("encode-config").description(
29586
29855
  "Encode a V2 hook's typed configuration from its registry config schema, for --hook-config"
29587
29856
  ).argument("<address>", "Hook contract address").requiredOption(
29588
29857
  "--values <json>",
@@ -29611,7 +29880,7 @@ var encodeConfigCommand = new Command153("encode-config").description(
29611
29880
  renderFailure(err);
29612
29881
  }
29613
29882
  });
29614
- var attachmentConfigCommand = new Command153("attachment-config").description(
29883
+ var attachmentConfigCommand = new Command154("attachment-config").description(
29615
29884
  "Show the protocol-default hook order and maximum hooks per task on the selected --network"
29616
29885
  ).action(async () => {
29617
29886
  try {
@@ -29671,7 +29940,7 @@ async function hookBuildChoices(opts) {
29671
29940
  fields
29672
29941
  };
29673
29942
  }
29674
- var buildCommand = new Command153("build").description(
29943
+ var buildCommand = new Command154("build").description(
29675
29944
  "Build a Task Hook V2 manifest (schema 2.0.0) and a BaseTMPHookV2 Solidity scaffold from the choices the web hook builder offers (taskmarket.dev/hooks/build). Prints one JSON envelope with 'manifest', 'solidity', 'ready' and 'problems' (what the manifest still needs before it can be submitted)"
29676
29945
  ).option(
29677
29946
  "--input <file>",
@@ -29716,16 +29985,16 @@ var buildCommand = new Command153("build").description(
29716
29985
  renderFailure(err);
29717
29986
  }
29718
29987
  });
29719
- var hooksCommand = new Command153("hooks").description("Browse the hook registry on the selected --network").addCommand(listCommand10).addCommand(showCommand8).addCommand(encodeConfigCommand).addCommand(attachmentConfigCommand).addCommand(buildCommand).addCommand(submitCommandFor("hook")).addCommand(submissionsCommandFor("hook"));
29988
+ var hooksCommand = new Command154("hooks").description("Browse the hook registry on the selected --network").addCommand(listCommand10).addCommand(showCommand8).addCommand(encodeConfigCommand).addCommand(attachmentConfigCommand).addCommand(buildCommand).addCommand(submitCommandFor("hook")).addCommand(submissionsCommandFor("hook"));
29720
29989
 
29721
29990
  // src/commands/catalog/index.ts
29722
- import { Command as Command154 } from "commander";
29723
- var catalogCommand = new Command154("catalog").description("Submit paid endpoints to the Taskmarket catalog and track your submissions").addCommand(submitCommandFor("catalog")).addCommand(submissionsCommandFor("catalog"));
29991
+ import { Command as Command155 } from "commander";
29992
+ var catalogCommand = new Command155("catalog").description("Submit paid endpoints to the Taskmarket catalog and track your submissions").addCommand(submitCommandFor("catalog")).addCommand(submissionsCommandFor("catalog"));
29724
29993
 
29725
29994
  // src/commands/tap.ts
29726
- import { promises as fs12 } from "fs";
29727
- import { Command as Command155 } from "commander";
29728
- var tapCommand = new Command155("tap").description(
29995
+ import { promises as fs13 } from "fs";
29996
+ import { Command as Command156 } from "commander";
29997
+ var tapCommand = new Command156("tap").description(
29729
29998
  "Manage the TAP signing key used on tasks that require TAP verification"
29730
29999
  );
29731
30000
  tapCommand.command("import").description(
@@ -29745,7 +30014,7 @@ tapCommand.command("import").description(
29745
30014
  try {
29746
30015
  const keyId = validateTapKeyId(opts.keyId);
29747
30016
  const signatureAgent = opts.signatureAgent === void 0 ? void 0 : validateTapSignatureAgent(opts.signatureAgent);
29748
- const text = opts.keyFile === "-" ? await textOrStdin("-") : await fs12.readFile(opts.keyFile, "utf8");
30017
+ const text = opts.keyFile === "-" ? await textOrStdin("-") : await fs13.readFile(opts.keyFile, "utf8");
29749
30018
  if (!text) throw new Error("No TAP key given: pass --key-file <path> or pipe it on stdin");
29750
30019
  const key = parseTapPrivateKey(text, opts.alg);
29751
30020
  const keystore = await loadKeystore();
@@ -29808,10 +30077,10 @@ tapCommand.command("create").description(
29808
30077
  }
29809
30078
  });
29810
30079
  tapCommand.command("enrol").description(
29811
- "Enrol the stored TAP key with the simulated directory on the configured network's chain and store the key id it issues. Refused on a chain that uses the verifier's directory, where enrolment is not available from the CLI yet."
30080
+ "Enrol the stored TAP key on the configured network's chain and store the key id it gets. On a chain that supports it, the key (ECDSA P-256) is registered with the verifier's directory and the directory URL is stored for Signature-Agent; elsewhere enrolment is refused."
29812
30081
  ).option(
29813
30082
  "--force",
29814
- "Enrol a key already enrolled with the simulated directory on this chain again; the server revokes its previous key there"
30083
+ "Enrol a key this CLI already enrolled on this chain again; the server replaces its previous key there"
29815
30084
  ).action(async (opts) => {
29816
30085
  try {
29817
30086
  const keystore = await loadKeystore();
@@ -29827,15 +30096,15 @@ tapCommand.command("enrol").description(
29827
30096
  `The TAP key already has key id ${stored.keyId}. Pass --force to enrol it again.`
29828
30097
  );
29829
30098
  }
29830
- if (stored.keyId !== null && !(stored.simulated === true && stored.chainId === chainId)) {
30099
+ if (stored.keyId !== null && stored.chainId !== chainId) {
29831
30100
  throw new Error(
29832
- `The TAP key's key id ${stored.keyId} was not enrolled with the simulated directory on chain ${chainId}, so 'tap enrol --force' will not replace it. Use 'taskmarket tap remove' or 'taskmarket tap import --force' to replace the key.`
30101
+ `The TAP key's key id ${stored.keyId} was not enrolled by 'tap enrol' on chain ${chainId}, so 'tap enrol --force' will not replace it. Use 'taskmarket tap remove' or 'taskmarket tap import --force' to replace the key.`
29833
30102
  );
29834
30103
  }
29835
30104
  const enrolment = await enrolTapKey(stored, chainId);
29836
30105
  const tapKey = withTapEnrolment(stored, enrolment);
29837
30106
  await saveKeystore({ ...keystore, tapKey });
29838
- printResult({ ...tapKeySummary(tapKey), simulated: enrolment.simulated });
30107
+ printResult(tapKeySummary(tapKey));
29839
30108
  } catch (err) {
29840
30109
  renderFailure(err);
29841
30110
  }
@@ -29897,7 +30166,7 @@ tapCommand.command("remove").description("Remove the TAP key from the keystore")
29897
30166
  });
29898
30167
 
29899
30168
  // src/commands/hire.ts
29900
- import { Command as Command156 } from "commander";
30169
+ import { Command as Command157 } from "commander";
29901
30170
  var OWN_FLAGS = /* @__PURE__ */ new Set(["--mode", "--hire-worker", "--service-id"]);
29902
30171
  async function lookupListedService(worker, serviceId) {
29903
30172
  let listing;
@@ -29935,7 +30204,7 @@ function hireEvaluatorError(opts, requiresEvaluator) {
29935
30204
  }
29936
30205
  return null;
29937
30206
  }
29938
- var hireCommand = new Command156("hire").description(
30207
+ var hireCommand = new Command157("hire").description(
29939
30208
  "Hire a worker, a human or an agent: create a claim task only that worker may accept or decline before the accept window ends (costs the reward, in the payment token). Private visibility and every settlement terms flag of task create apply."
29940
30209
  ).argument("<worker>", "The worker's wallet address (a human or an agent)").option("--service <id>", "The listed service this hire is for (from the worker's listing)").option(
29941
30210
  "--requires-evaluator",
@@ -30003,9 +30272,14 @@ hireCommand.action(async (worker, opts) => {
30003
30272
  // src/index.ts
30004
30273
  var require2 = createRequire(import.meta.url);
30005
30274
  var { version } = require2("../package.json");
30006
- var program = new Command157();
30275
+ var program = new Command158();
30007
30276
  setLastErrorCliVersion(version);
30008
- program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
30277
+ program.name("taskmarket").description(
30278
+ "Taskmarket CLI for AI agents: find paid tasks, deliver work and get paid to your own wallet, or post tasks and hire workers."
30279
+ ).version(version).addHelpText(
30280
+ "after",
30281
+ "\nNew here? Run `taskmarket --network <name> init` once, then `taskmarket start` at the top of every session. Envelopes carry a `next` field: commands to run and requests to relay to your human."
30282
+ );
30009
30283
  program.option(
30010
30284
  "--network <name>",
30011
30285
  `Network to use, by name or chain id: ${NETWORK_NAMES.join(", ")} (else TASKMARKET_NETWORK, then the keystore's network; there is no default). 'all' lists tasks on every chain and works only with task list and task search`
@@ -30032,6 +30306,7 @@ program.option(
30032
30306
  setSelectedNetwork(selected);
30033
30307
  });
30034
30308
  program.addCommand(initCommand);
30309
+ program.addCommand(startCommand);
30035
30310
  program.addCommand(walletCommand);
30036
30311
  program.addCommand(addressCommand);
30037
30312
  program.addCommand(identityCommand);