@lucid-agents/taskmarket 1.18.1 → 1.19.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.
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  signReadAuth,
15
15
  submitTaskFiles,
16
16
  taskAccessGrantHeaders
17
- } from "./chunk-HEGWADBV.js";
17
+ } from "./chunk-F2SZG7TC.js";
18
18
  import {
19
19
  ComputeCreditError,
20
20
  applyComputeCreditSetup,
@@ -36,7 +36,7 @@ import {
36
36
  refusedPaidWrite,
37
37
  releasePendingComputePurchase,
38
38
  resolvePendingComputePurchases
39
- } from "./chunk-3LNZ766H.js";
39
+ } from "./chunk-6KJ5EFBN.js";
40
40
  import {
41
41
  MPP_TEMPO_DEFAULT_VALIDITY_SECONDS,
42
42
  X402PayError,
@@ -58,18 +58,21 @@ import {
58
58
  signSponsoredTempoTransfer,
59
59
  signTaskmarketFeePayment,
60
60
  signTypedData
61
- } from "./chunk-5VMWXDNO.js";
61
+ } from "./chunk-VMSV4EYS.js";
62
62
  import {
63
63
  AgentMessageEnvelopeSchema,
64
64
  ApiError,
65
65
  BUG_REPORT_SEVERITIES,
66
66
  BUG_REPORT_STATUSES,
67
+ DEFAULT_EVALUATION_WINDOW_HOURS,
67
68
  DEFAULT_TERMS_BOUNDS,
69
+ GetBugReportInputSchema,
68
70
  IntentStatusResponseSchema,
69
71
  LegalAcceptanceResponseSchema,
70
72
  LegalBundleSchema,
71
73
  LegalChallengeResponseSchema,
72
74
  LegalStatusResponseSchema,
75
+ NETWORKS,
73
76
  NETWORK_NAMES,
74
77
  PenaltyTo,
75
78
  READ_AUTH_ADDRESS_HEADER,
@@ -127,6 +130,7 @@ import {
127
130
  decryptPrivateKey,
128
131
  dreamsToUsd,
129
132
  encryptPrivateKey,
133
+ evaluationWindowError,
130
134
  formatDreams,
131
135
  formatPaymentAmount,
132
136
  formatUsdcBaseUnits,
@@ -157,14 +161,14 @@ import {
157
161
  usdcToBaseUnits,
158
162
  withErrorContext,
159
163
  withIdempotentWrite
160
- } from "./chunk-YB2B5DPR.js";
164
+ } from "./chunk-PGXPZFVY.js";
161
165
  import {
162
166
  channelLines
163
167
  } from "./chunk-EB6OJBF5.js";
164
168
  import "./chunk-S7SJMJ2I.js";
165
169
 
166
170
  // src/index.ts
167
- import { Command as Command103 } from "commander";
171
+ import { Command as Command104 } from "commander";
168
172
  import { createRequire } from "module";
169
173
 
170
174
  // src/commands/init.ts
@@ -202,8 +206,20 @@ function redactArgv(argv) {
202
206
  function currentArgs() {
203
207
  return process.argv.slice(2);
204
208
  }
209
+ var ROOT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["--network"]);
210
+ function subcommandOf(argv) {
211
+ for (let i = 0; i < argv.length; i++) {
212
+ const arg = argv[i];
213
+ if (ROOT_VALUE_OPTIONS.has(arg)) {
214
+ i++;
215
+ continue;
216
+ }
217
+ if (!arg.startsWith("-")) return arg;
218
+ }
219
+ return void 0;
220
+ }
205
221
  function recordLastError(error, argv = currentArgs()) {
206
- if (argv[0] === "bug") return false;
222
+ if (subcommandOf(argv) === "bug") return false;
207
223
  const record = {
208
224
  command: ["taskmarket", ...redactArgv(argv)].join(" "),
209
225
  message: redactSecrets(error.message),
@@ -786,10 +802,55 @@ identityCommand.command("status").description("Check identity registration statu
786
802
  );
787
803
  printResult({ registered: result.registered, agentId: result.agentId });
788
804
  });
805
+ identityCommand.command("feedback").description(
806
+ "Show the agent your requester feedback is bound to and the protocol reputation feedback values"
807
+ ).option("--address <address>", "Wallet to read (defaults to this wallet)").action(async (options) => {
808
+ const address = options.address ?? (await loadKeystore()).walletAddress;
809
+ const result = await apiGet(
810
+ `/api/identity/requester-feedback?address=${address}&chainId=${selectedNetwork().chainId}`
811
+ );
812
+ printResult(result);
813
+ });
789
814
 
790
- // src/commands/stats.ts
815
+ // src/commands/whoami.ts
791
816
  import { Command as Command5 } from "commander";
792
- var statsCommand = new Command5("stats").description("View agent statistics").option("--address <addr>", "Wallet address (defaults to own wallet)").option("--agent <agentId>", "Agent ID (alternative to --address)").action(async (opts) => {
817
+ var NOT_LINKED_YET = "not linked yet (links on your next accept or cancel)";
818
+ var LINK_UNAVAILABLE = "unavailable (this chain does not report requester links yet)";
819
+ function siblingNetworks(selected) {
820
+ return NETWORK_NAMES.map((name) => NETWORKS[name]).filter(
821
+ (network) => network.available && network.apiUrl === selected.apiUrl
822
+ );
823
+ }
824
+ function describeReputationLink(link) {
825
+ if (!link || !link.linkAvailable) return LINK_UNAVAILABLE;
826
+ return link.linkedAgentId ? `linked to agent #${link.linkedAgentId}` : NOT_LINKED_YET;
827
+ }
828
+ var whoamiCommand = new Command5("whoami").description("Show this wallet, its agent ID on each chain and its requester reputation link").action(async () => {
829
+ const keystore = await loadKeystore();
830
+ const selected = selectedNetwork();
831
+ const chains = await Promise.all(
832
+ siblingNetworks(selected).map(async (network) => {
833
+ let link = null;
834
+ try {
835
+ link = await apiGet(
836
+ `/api/identity/requester-link?address=${keystore.walletAddress}&chainId=${network.chainId}`
837
+ );
838
+ } catch {
839
+ }
840
+ return {
841
+ network: network.name,
842
+ chainId: network.chainId,
843
+ agentId: link?.agentId ?? null,
844
+ reputationLink: describeReputationLink(link)
845
+ };
846
+ })
847
+ );
848
+ printResult({ wallet: keystore.walletAddress, network: selected.name, chains });
849
+ });
850
+
851
+ // src/commands/stats.ts
852
+ import { Command as Command6 } from "commander";
853
+ var statsCommand = new Command6("stats").description("View agent statistics").option("--address <addr>", "Wallet address (defaults to own wallet)").option("--agent <agentId>", "Agent ID (alternative to --address)").action(async (opts) => {
793
854
  let address = opts.address;
794
855
  if (!address) {
795
856
  const keystore = await loadKeystore();
@@ -838,11 +899,11 @@ var statsCommand = new Command5("stats").description("View agent statistics").op
838
899
  });
839
900
 
840
901
  // src/commands/task/index.ts
841
- import { Command as Command45 } from "commander";
902
+ import { Command as Command46 } from "commander";
842
903
 
843
904
  // src/commands/task/review.ts
844
905
  import { readFile, stat } from "fs/promises";
845
- import { Command as Command6, Option } from "commander";
906
+ import { Command as Command7, Option } from "commander";
846
907
  import { z as z2 } from "zod";
847
908
 
848
909
  // src/lib/submission-reviews.ts
@@ -1080,10 +1141,10 @@ function cliSubmissionReviewClient() {
1080
1141
  // src/commands/task/review.ts
1081
1142
  var integer = (value) => z2.coerce.number().int().positive().safe().parse(value);
1082
1143
  var collect = (value, values) => [...values, value];
1083
- var taskCommand = (name, description) => new Command6(name).description(description).argument("<taskId>", "Task ID").option("--chain-id <id>", "Require this task chain", integer);
1084
- var runCommand = (name, description) => new Command6(name).description(description).argument("<runId>", "Private review run ID").requiredOption("--chain-id <id>", "Chain recorded on the review run", integer);
1144
+ var taskCommand = (name, description) => new Command7(name).description(description).argument("<taskId>", "Task ID").option("--chain-id <id>", "Require this task chain", integer);
1145
+ var runCommand = (name, description) => new Command7(name).description(description).argument("<runId>", "Private review run ID").requiredOption("--chain-id <id>", "Chain recorded on the review run", integer);
1085
1146
  function createReviewCommand() {
1086
- const group = new Command6("review").description(
1147
+ const group = new Command7("review").description(
1087
1148
  "Requester-private advisory brief review and experimental taste scoring; never awards or rejects work"
1088
1149
  );
1089
1150
  group.addCommand(
@@ -1116,7 +1177,7 @@ function createReviewCommand() {
1116
1177
  )
1117
1178
  );
1118
1179
  group.addCommand(
1119
- new Command6("start").description(
1180
+ new Command7("start").description(
1120
1181
  "Sign and start the exact saved preview; obtain a fresh preview if sources changed"
1121
1182
  ).argument("<taskId>", "Task ID").requiredOption("--preview-file <path>", "JSON output from task review preview").action(async (taskId, options) => {
1122
1183
  const info = await stat(options.previewFile);
@@ -1151,7 +1212,7 @@ function createReviewCommand() {
1151
1212
  )
1152
1213
  );
1153
1214
  group.addCommand(
1154
- new Command6("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("--chain-id <id>", "Chain from the saved preview", integer).action(async (idempotencyKey, options) => {
1215
+ new Command7("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("--chain-id <id>", "Chain from the saved preview", integer).action(async (idempotencyKey, options) => {
1155
1216
  printResult(
1156
1217
  await cliSubmissionReviewClient().lookup({ idempotencyKey, chainId: options.chainId })
1157
1218
  );
@@ -1256,7 +1317,7 @@ function createReviewCommand() {
1256
1317
  var reviewCmd = createReviewCommand();
1257
1318
 
1258
1319
  // src/commands/task/create.ts
1259
- import { Command as Command7 } from "commander";
1320
+ import { Command as Command8 } from "commander";
1260
1321
  import { parseUnits } from "viem";
1261
1322
 
1262
1323
  // src/lib/settlement-terms.ts
@@ -1345,14 +1406,27 @@ function parseTermsFlags(opts) {
1345
1406
  }
1346
1407
  return { ...termsPreset ? { termsPreset } : {}, terms };
1347
1408
  }
1348
- async function fetchTermsBounds() {
1409
+ async function fetchTermsBoundsInfo() {
1349
1410
  try {
1350
1411
  const response = await apiGet("/api/tasks/terms-bounds");
1351
- return response?.bounds ?? DEFAULT_TERMS_BOUNDS;
1412
+ return {
1413
+ // Spread over the defaults so a server that predates a field still yields a full record.
1414
+ bounds: { ...DEFAULT_TERMS_BOUNDS, ...response?.bounds ?? {} },
1415
+ chainSupportsTerms: response?.chainSupportsTerms === true && Boolean(response.bounds)
1416
+ };
1352
1417
  } catch {
1353
- return DEFAULT_TERMS_BOUNDS;
1418
+ return { bounds: DEFAULT_TERMS_BOUNDS, chainSupportsTerms: false };
1354
1419
  }
1355
1420
  }
1421
+ function evaluationWindowFlagError(value, info) {
1422
+ const hours = value === void 0 ? DEFAULT_EVALUATION_WINDOW_HOURS : Number(value);
1423
+ if (!Number.isFinite(hours) || hours <= 0) {
1424
+ return `--evaluation-window must be a positive number of hours, got: ${value}`;
1425
+ }
1426
+ if (!info.chainSupportsTerms) return null;
1427
+ const error = evaluationWindowError(Math.round(hours * 3600), info.bounds);
1428
+ return error ? `--evaluation-window: ${error}` : null;
1429
+ }
1356
1430
  function resolveTermsForCreate(args) {
1357
1431
  try {
1358
1432
  return resolveTaskTerms({
@@ -1375,6 +1449,8 @@ function termsPresetLabel(terms) {
1375
1449
  }
1376
1450
 
1377
1451
  // src/commands/task/create.ts
1452
+ var TAG_MAX_BYTES = 64;
1453
+ var DEFAULT_MAX_HOOKS = 8;
1378
1454
  function parseStakeOptions(opts) {
1379
1455
  if (!opts.stakeRequired && opts.stakeBps === void 0) {
1380
1456
  return { stakeRequired: false, stakeBps: 0 };
@@ -1397,7 +1473,7 @@ function parseStakeOptions(opts) {
1397
1473
  }
1398
1474
  return { stakeRequired: true, stakeBps };
1399
1475
  }
1400
- var createCmd = new Command7("create").description("Create a new task (costs the reward, in the payment token)").requiredOption("--description <text>", "Task description").requiredOption("--reward <amount>", "Reward in the payment token (e.g. 5)").requiredOption("--duration <hours>", "Task duration in hours").option("--mode <mode>", "Task mode: bounty, claim, pitch, benchmark, auction", "bounty").option(
1476
+ var createCmd = new Command8("create").description("Create a new task (costs the reward, in the payment token)").requiredOption("--description <text>", "Task description").requiredOption("--reward <amount>", "Reward in the payment token (e.g. 5)").requiredOption("--duration <hours>", "Task duration in hours").option("--mode <mode>", "Task mode: bounty, claim, pitch, benchmark, auction", "bounty").option(
1401
1477
  "--task-visibility <mode>",
1402
1478
  "Task visibility: public (default), unlisted, or private. Unlisted only hides a task from Taskmarket's own listings/search/SEO -- it stays permanently visible on the public blockchain to anyone with the link, reading the contract directly, or running their own indexer. private is genuinely access-controlled: only the requester and invited/assigned workers can view it via listings, get, or the gated reads -- see --allowed-viewers and --access-password. Even private, the on-chain existence, reward, and participation stay publicly observable regardless.",
1403
1479
  "public"
@@ -1580,6 +1656,10 @@ var createCmd = new Command7("create").description("Create a new task (costs the
1580
1656
  return void printError(stakeFlags.error);
1581
1657
  }
1582
1658
  const tags = opts.tags ? opts.tags.split(",").map((t) => t.trim()) : [];
1659
+ const longTag = tags.find((tag) => new TextEncoder().encode(tag).length > TAG_MAX_BYTES);
1660
+ if (longTag !== void 0) {
1661
+ return void printError(`Each tag must be at most ${TAG_MAX_BYTES} bytes: "${longTag}"`);
1662
+ }
1583
1663
  const body = {
1584
1664
  description: opts.description,
1585
1665
  reward: rewardBaseUnits,
@@ -1648,15 +1728,20 @@ var createCmd = new Command7("create").description("Create a new task (costs the
1648
1728
  if ("error" in termsFlags) {
1649
1729
  return void printError(termsFlags.error);
1650
1730
  }
1731
+ const boundsInfo = await fetchTermsBoundsInfo();
1651
1732
  const resolvedTerms = resolveTermsForCreate({
1652
1733
  mode: opts.mode,
1653
1734
  hasEvaluator: Boolean(opts.evaluator),
1654
1735
  parsed: termsFlags,
1655
- bounds: await fetchTermsBounds()
1736
+ bounds: boundsInfo.bounds
1656
1737
  });
1657
1738
  if ("error" in resolvedTerms) {
1658
1739
  return void printError(resolvedTerms.error);
1659
1740
  }
1741
+ if (opts.evaluator) {
1742
+ const windowError = evaluationWindowFlagError(opts.evaluationWindow, boundsInfo);
1743
+ if (windowError) return void printError(windowError);
1744
+ }
1660
1745
  const stake = {
1661
1746
  stakeRequired: resolvedTerms.stakeRequired,
1662
1747
  stakeBps: resolvedTerms.stakeBps
@@ -1742,9 +1827,22 @@ var createCmd = new Command7("create").description("Create a new task (costs the
1742
1827
  sponsoredTaskHookData = built.data.hookData;
1743
1828
  hooks.push(sponsoredTaskHookAddress);
1744
1829
  }
1745
- if (hooks.length > 8) {
1830
+ let taskLimits;
1831
+ try {
1832
+ const limits = await apiGet("/api/tasks/limits");
1833
+ const { maxTags, maxHooks: maxHooks2 } = limits ?? {};
1834
+ if (typeof maxTags === "number" && Number.isInteger(maxTags) && maxTags > 0 && typeof maxHooks2 === "number" && Number.isInteger(maxHooks2) && maxHooks2 > 0) {
1835
+ taskLimits = { maxTags, maxHooks: maxHooks2 };
1836
+ }
1837
+ } catch {
1838
+ }
1839
+ if (taskLimits && tags.length > taskLimits.maxTags) {
1840
+ return void printError(`At most ${taskLimits.maxTags} tags are allowed on this chain.`);
1841
+ }
1842
+ const maxHooks = taskLimits?.maxHooks ?? DEFAULT_MAX_HOOKS;
1843
+ if (hooks.length > maxHooks) {
1746
1844
  return void printError(
1747
- "--hook accepts at most 8 custom addresses; current protocol defaults count toward the on-chain maximum of 8"
1845
+ `--hook accepts at most ${maxHooks} custom addresses; current protocol defaults count toward the on-chain maximum of ${maxHooks}`
1748
1846
  );
1749
1847
  }
1750
1848
  if (hooks.length > 0) {
@@ -1753,8 +1851,8 @@ var createCmd = new Command7("create").description("Create a new task (costs the
1753
1851
  "/api/hooks/attachment-configuration"
1754
1852
  );
1755
1853
  if (attachmentConfiguration !== null && typeof attachmentConfiguration === "object" && !Array.isArray(attachmentConfiguration)) {
1756
- const { defaultHooks, maxHooks } = attachmentConfiguration;
1757
- if (Array.isArray(defaultHooks) && typeof maxHooks === "number" && Number.isInteger(maxHooks) && maxHooks > 0 && defaultHooks.every(
1854
+ const { defaultHooks, maxHooks: maxHooks2 } = attachmentConfiguration;
1855
+ if (Array.isArray(defaultHooks) && typeof maxHooks2 === "number" && Number.isInteger(maxHooks2) && maxHooks2 > 0 && defaultHooks.every(
1758
1856
  (hook) => typeof hook === "string" && defaultHookAddressRe.test(hook) && !/^0x0{40}$/i.test(hook)
1759
1857
  )) {
1760
1858
  if (hooks.some(
@@ -1764,9 +1862,9 @@ var createCmd = new Command7("create").description("Create a new task (costs the
1764
1862
  )) {
1765
1863
  return void printError("Custom hooks cannot duplicate protocol default hooks.");
1766
1864
  }
1767
- if (hooks.length + defaultHooks.length > maxHooks) {
1865
+ if (hooks.length + defaultHooks.length > maxHooks2) {
1768
1866
  return void printError(
1769
- `Default and custom hooks together cannot exceed ${maxHooks}.`
1867
+ `Default and custom hooks together cannot exceed ${maxHooks2}.`
1770
1868
  );
1771
1869
  }
1772
1870
  }
@@ -1820,8 +1918,8 @@ var createCmd = new Command7("create").description("Create a new task (costs the
1820
1918
  );
1821
1919
 
1822
1920
  // src/commands/task/search.ts
1823
- import { Command as Command8 } from "commander";
1824
- var listCmd = new Command8("list").alias("search").description("List available tasks").option("--status <status>", "Filter by status (e.g. open)", "open").option(
1921
+ import { Command as Command9 } from "commander";
1922
+ var listCmd = new Command9("list").alias("search").description("List available tasks").option("--status <status>", "Filter by status (e.g. open)", "open").option(
1825
1923
  "--phase <phase>",
1826
1924
  "Filter by derived lifecycle phase (active, in_review, awaiting_settlement, resolved) -- independent of --status, e.g. --phase awaiting_settlement finds tasks whose deadline has passed but are still open/claimed/worker_selected"
1827
1925
  ).option("--mode <mode>", "Filter by mode (bounty, claim, pitch, benchmark, auction)").option(
@@ -1847,8 +1945,8 @@ var listCmd = new Command8("list").alias("search").description("List available t
1847
1945
  );
1848
1946
 
1849
1947
  // src/commands/task/get.ts
1850
- import { Command as Command9 } from "commander";
1851
- var getCmd = new Command9("get").description("Get task details").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
1948
+ import { Command as Command10 } from "commander";
1949
+ var getCmd = new Command10("get").description("Get task details").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
1852
1950
  const task = await getTask(cliTaskReadContext(), { taskId });
1853
1951
  if (!task) {
1854
1952
  printError(
@@ -1868,11 +1966,11 @@ async function termsAmountsAndDeadlines(taskId) {
1868
1966
  }
1869
1967
 
1870
1968
  // src/commands/task/submit.ts
1871
- import { Command as Command10, Option as Option2 } from "commander";
1969
+ import { Command as Command11, Option as Option2 } from "commander";
1872
1970
  function collectFile(value, previous) {
1873
1971
  return [...previous, value];
1874
1972
  }
1875
- var submitCmd = new Command10("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(
1973
+ var submitCmd = new Command11("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(
1876
1974
  new Option2("--role <role>", "Artifact role applied to all files").choices(["preview", "source", "final", "attachment"]).default("attachment")
1877
1975
  ).action(async (taskId, opts) => {
1878
1976
  try {
@@ -1895,7 +1993,7 @@ var submitCmd = new Command10("submit").description("Submit work for a task").ar
1895
1993
  });
1896
1994
 
1897
1995
  // src/commands/task/accept.ts
1898
- import { Command as Command11 } from "commander";
1996
+ import { Command as Command12 } from "commander";
1899
1997
 
1900
1998
  // src/lib/recording.ts
1901
1999
  var RECORDING_POLL_INTERVAL_MS = 3e3;
@@ -1941,7 +2039,7 @@ async function settleRecording(data, idempotencyKey, options = {}) {
1941
2039
  }
1942
2040
 
1943
2041
  // src/commands/task/accept.ts
1944
- var acceptCmd = new Command11("accept").description("Accept a submission (costs 0.001 in the payment token)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--worker <addr>", "Worker wallet address").action(async (taskId, opts) => {
2042
+ var acceptCmd = new Command12("accept").description("Accept a submission (costs 0.001 in the payment token)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--worker <addr>", "Worker wallet address").action(async (taskId, opts) => {
1945
2043
  const task = await getTask(cliTaskReadContext(), { taskId });
1946
2044
  if (!task) {
1947
2045
  printError(
@@ -1975,7 +2073,7 @@ var acceptCmd = new Command11("accept").description("Accept a submission (costs
1975
2073
  });
1976
2074
 
1977
2075
  // src/commands/task/accept-submissions.ts
1978
- import { Command as Command12 } from "commander";
2076
+ import { Command as Command13 } from "commander";
1979
2077
  function parseWinner(spec) {
1980
2078
  const parts = spec.split(":");
1981
2079
  if (parts.length < 2 || parts.length > 3) {
@@ -1994,7 +2092,7 @@ function parseWinner(spec) {
1994
2092
  const submissionId = submissionIdStr ? submissionIdStr : void 0;
1995
2093
  return { worker, share, ...submissionId !== void 0 && { submissionId } };
1996
2094
  }
1997
- var acceptSubmissionsCmd = new Command12("accept-submissions").description(
2095
+ var acceptSubmissionsCmd = new Command13("accept-submissions").description(
1998
2096
  "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 on-chain 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"
1999
2097
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption(
2000
2098
  "--winner <spec...>",
@@ -2027,8 +2125,8 @@ var acceptSubmissionsCmd = new Command12("accept-submissions").description(
2027
2125
  });
2028
2126
 
2029
2127
  // src/commands/task/rate.ts
2030
- import { Command as Command13 } from "commander";
2031
- var rateCmd = new Command13("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) => {
2128
+ import { Command as Command14 } from "commander";
2129
+ var rateCmd = new Command14("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) => {
2032
2130
  const rating = parseInt(opts.rating, 10);
2033
2131
  if (rating < 0 || rating > 100) {
2034
2132
  printError("Rating must be between 0 and 100");
@@ -2047,7 +2145,7 @@ var rateCmd = new Command13("rate").description("Rate a worker (costs 0.001 in t
2047
2145
  });
2048
2146
 
2049
2147
  // src/commands/task/claim.ts
2050
- import { Command as Command14 } from "commander";
2148
+ import { Command as Command15 } from "commander";
2051
2149
 
2052
2150
  // src/lib/stake-confirmation.ts
2053
2151
  async function confirmStakeTerms(action, taskId, yes) {
@@ -2105,7 +2203,7 @@ async function confirmStakeAffordable(address, stake) {
2105
2203
  }
2106
2204
 
2107
2205
  // src/commands/task/claim.ts
2108
- var claimCmd = new Command14("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").action(async (taskId, opts) => {
2206
+ var claimCmd = new Command15("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").action(async (taskId, opts) => {
2109
2207
  if (!await confirmStakeTerms("claim", taskId, opts.yes)) return;
2110
2208
  const task = await getTask(cliTaskReadContext(), { taskId });
2111
2209
  const stake = task ? claimStakeToPost(task) : 0n;
@@ -2119,8 +2217,8 @@ var claimCmd = new Command14("claim").description("Claim a task as a worker").ar
2119
2217
  });
2120
2218
 
2121
2219
  // src/commands/task/pitch.ts
2122
- import { Command as Command15 } from "commander";
2123
- var pitchCmd = new Command15("pitch").description(
2220
+ import { Command as Command16 } from "commander";
2221
+ var pitchCmd = new Command16("pitch").description(
2124
2222
  "Submit a pitch for a task (costs 0.001 in the payment token, anchors hash on-chain)"
2125
2223
  ).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").action(async (taskId, opts) => {
2126
2224
  if (!await confirmStakeTerms("pitch", taskId, opts.yes)) return;
@@ -2140,8 +2238,8 @@ var pitchCmd = new Command15("pitch").description(
2140
2238
  });
2141
2239
 
2142
2240
  // src/commands/task/pitches.ts
2143
- import { Command as Command16 } from "commander";
2144
- var pitchesCmd = new Command16("pitches").description("List pitches for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2241
+ import { Command as Command17 } from "commander";
2242
+ var pitchesCmd = new Command17("pitches").description("List pitches for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2145
2243
  try {
2146
2244
  const auth = await signReadAuth();
2147
2245
  const headers = { ...auth?.headers ?? {}, ...await taskAccessGrantHeaders(taskId) };
@@ -2152,8 +2250,8 @@ var pitchesCmd = new Command16("pitches").description("List pitches for a task")
2152
2250
  });
2153
2251
 
2154
2252
  // src/commands/task/select-worker.ts
2155
- import { Command as Command17 } from "commander";
2156
- var selectWorkerCmd = new Command17("select-worker").description("Select a worker from pitches (requester only)").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) => {
2253
+ import { Command as Command18 } from "commander";
2254
+ var selectWorkerCmd = new Command18("select-worker").description("Select a worker from pitches (requester only)").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) => {
2157
2255
  const keystore = await loadKeystore();
2158
2256
  const message = buildSelectWorkerMessage(taskId, opts.pitch, opts.worker);
2159
2257
  const signature = await signMessage(message, keystore);
@@ -2170,8 +2268,8 @@ var selectWorkerCmd = new Command17("select-worker").description("Select a worke
2170
2268
  });
2171
2269
 
2172
2270
  // src/commands/task/proof.ts
2173
- import { Command as Command18 } from "commander";
2174
- var proofCmd = new Command18("proof").description("Submit a benchmark proof (costs 0.001 in the payment token, anchors hash on-chain)").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) => {
2271
+ import { Command as Command19 } from "commander";
2272
+ var proofCmd = new Command19("proof").description("Submit a benchmark proof (costs 0.001 in the payment token, anchors hash on-chain)").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) => {
2175
2273
  const keystore = await loadKeystore();
2176
2274
  const signature = await signMessage(buildProofMessage(taskId), keystore);
2177
2275
  const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/proofs`, {
@@ -2186,8 +2284,8 @@ var proofCmd = new Command18("proof").description("Submit a benchmark proof (cos
2186
2284
  });
2187
2285
 
2188
2286
  // src/commands/task/proofs.ts
2189
- import { Command as Command19 } from "commander";
2190
- var proofsCmd = new Command19("proofs").description("List proofs for a benchmark task").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2287
+ import { Command as Command20 } from "commander";
2288
+ var proofsCmd = new Command20("proofs").description("List proofs for a benchmark task").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2191
2289
  try {
2192
2290
  const auth = await signReadAuth();
2193
2291
  const headers = { ...auth?.headers ?? {}, ...await taskAccessGrantHeaders(taskId) };
@@ -2198,8 +2296,8 @@ var proofsCmd = new Command19("proofs").description("List proofs for a benchmark
2198
2296
  });
2199
2297
 
2200
2298
  // src/commands/task/bid.ts
2201
- import { Command as Command20 } from "commander";
2202
- var bidCmd = new Command20("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").action(async (taskId, opts) => {
2299
+ import { Command as Command21 } from "commander";
2300
+ var bidCmd = new Command21("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").action(async (taskId, opts) => {
2203
2301
  let priceBaseUnits;
2204
2302
  try {
2205
2303
  priceBaseUnits = usdcToBaseUnits(opts.price);
@@ -2219,8 +2317,8 @@ var bidCmd = new Command20("bid").description("Submit a bid on an auction task")
2219
2317
  });
2220
2318
 
2221
2319
  // src/commands/task/auction-accept.ts
2222
- import { Command as Command21 } from "commander";
2223
- var auctionAcceptCmd = new Command21("auction-accept").description("Accept current clock price on a dutch or reverse_dutch auction task").argument("<taskId>", "Task ID (0x-prefixed hex)").option(
2320
+ import { Command as Command22 } from "commander";
2321
+ var auctionAcceptCmd = new Command22("auction-accept").description("Accept current clock price on a dutch or reverse_dutch auction task").argument("<taskId>", "Task ID (0x-prefixed hex)").option(
2224
2322
  "--min-price <amount>",
2225
2323
  "Reject if current clock price is below this value (price floor guard)"
2226
2324
  ).action(async (taskId, opts) => {
@@ -2250,8 +2348,8 @@ var auctionAcceptCmd = new Command21("auction-accept").description("Accept curre
2250
2348
  });
2251
2349
 
2252
2350
  // src/commands/task/submissions.ts
2253
- import { Command as Command22 } from "commander";
2254
- var submissionsCmd = new Command22("submissions").description("List submissions for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2351
+ import { Command as Command23 } from "commander";
2352
+ var submissionsCmd = new Command23("submissions").description("List submissions for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2255
2353
  let subs;
2256
2354
  try {
2257
2355
  subs = await listTaskSubmissions(cliTaskReadContext(), { taskId });
@@ -2263,8 +2361,8 @@ var submissionsCmd = new Command22("submissions").description("List submissions
2263
2361
  });
2264
2362
 
2265
2363
  // src/commands/task/select-winner.ts
2266
- import { Command as Command23 } from "commander";
2267
- var selectWinnerCmd = new Command23("select-winner").description("Permissionlessly finalize the lowest bidder after the auction deadline").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2364
+ import { Command as Command24 } from "commander";
2365
+ var selectWinnerCmd = new Command24("select-winner").description("Permissionlessly finalize the lowest bidder after the auction deadline").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2268
2366
  let result;
2269
2367
  let idempotencyKey;
2270
2368
  try {
@@ -2280,8 +2378,8 @@ var selectWinnerCmd = new Command23("select-winner").description("Permissionless
2280
2378
  });
2281
2379
 
2282
2380
  // src/commands/task/start-review.ts
2283
- import { Command as Command24 } from "commander";
2284
- var startReviewCmd = new Command24("start-review").description(
2381
+ import { Command as Command25 } from "commander";
2382
+ var startReviewCmd = new Command25("start-review").description(
2285
2383
  "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."
2286
2384
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2287
2385
  try {
@@ -2299,12 +2397,12 @@ var startReviewCmd = new Command24("start-review").description(
2299
2397
  });
2300
2398
 
2301
2399
  // src/commands/task/download.ts
2302
- import { Command as Command25 } from "commander";
2400
+ import { Command as Command26 } from "commander";
2303
2401
  import { writeFileSync } from "fs";
2304
2402
  function sanitizeForTerminal(text) {
2305
2403
  return text.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, "");
2306
2404
  }
2307
- var downloadCmd = new Command25("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 file instead of printing to stdout").action(
2405
+ var downloadCmd = new Command26("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 file instead of printing to stdout").action(
2308
2406
  async (taskId, opts) => {
2309
2407
  const keystore = await loadKeystore();
2310
2408
  let presignedUrl;
@@ -2352,7 +2450,7 @@ var downloadCmd = new Command25("download").description("Download a submission f
2352
2450
  );
2353
2451
 
2354
2452
  // src/commands/task/cancel.ts
2355
- import { Command as Command26 } from "commander";
2453
+ import { Command as Command27 } from "commander";
2356
2454
 
2357
2455
  // src/lib/decision-window.ts
2358
2456
  var DECISION_WINDOW_LAPSED_CODE = "decision_window_lapsed";
@@ -2384,7 +2482,7 @@ function renderDecisionWindowLapsed(action, lapse) {
2384
2482
  }
2385
2483
 
2386
2484
  // src/commands/task/cancel.ts
2387
- var cancelCmd = new Command26("cancel").description(
2485
+ var cancelCmd = new Command27("cancel").description(
2388
2486
  "Cancel an open task and refund the escrowed reward (costs 0.001 in the payment token)"
2389
2487
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2390
2488
  const lapse = await decisionWindowLapse(taskId, { requireLiveSubmissions: true });
@@ -2403,8 +2501,8 @@ var cancelCmd = new Command26("cancel").description(
2403
2501
  });
2404
2502
 
2405
2503
  // src/commands/task/refund-expired.ts
2406
- import { Command as Command27 } from "commander";
2407
- var refundExpiredCmd = new Command27("refund-expired").description(
2504
+ import { Command as Command28 } from "commander";
2505
+ var refundExpiredCmd = new Command28("refund-expired").description(
2408
2506
  "Refund an expired task back to the requester; bounty and benchmark tasks need every submission rejected first (costs 0.001 in the payment token)"
2409
2507
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2410
2508
  const lapse = await decisionWindowLapse(taskId, { requireLiveSubmissions: true });
@@ -2427,8 +2525,8 @@ var refundExpiredCmd = new Command27("refund-expired").description(
2427
2525
  });
2428
2526
 
2429
2527
  // src/commands/task/reject-submission.ts
2430
- import { Command as Command28 } from "commander";
2431
- var rejectSubmissionCmd = new Command28("reject-submission").description(
2528
+ import { Command as Command29 } from "commander";
2529
+ var rejectSubmissionCmd = new Command29("reject-submission").description(
2432
2530
  "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."
2433
2531
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--worker <address>", "Worker address whose submission to reject").action(async (taskId, opts) => {
2434
2532
  const lapse = await decisionWindowLapse(taskId, { requireLiveSubmissions: false });
@@ -2454,7 +2552,7 @@ var rejectSubmissionCmd = new Command28("reject-submission").description(
2454
2552
  });
2455
2553
 
2456
2554
  // src/commands/task/reject-all-submissions.ts
2457
- import { Command as Command29 } from "commander";
2555
+ import { Command as Command30 } from "commander";
2458
2556
  function activeSubmissionWorkers(submissions) {
2459
2557
  const workers = /* @__PURE__ */ new Map();
2460
2558
  for (const submission of submissions) {
@@ -2464,7 +2562,7 @@ function activeSubmissionWorkers(submissions) {
2464
2562
  }
2465
2563
  return [...workers.values()];
2466
2564
  }
2467
- var rejectAllSubmissionsCmd = new Command29("reject-all-submissions").description(
2565
+ var rejectAllSubmissionsCmd = new Command30("reject-all-submissions").description(
2468
2566
  "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."
2469
2567
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").option("--no-cancel", "Reject all submissions but do not cancel the task afterward").action(async (taskId, opts) => {
2470
2568
  let submissions;
@@ -2542,8 +2640,8 @@ var rejectAllSubmissionsCmd = new Command29("reject-all-submissions").descriptio
2542
2640
  });
2543
2641
 
2544
2642
  // src/commands/task/my-submissions.ts
2545
- import { Command as Command30 } from "commander";
2546
- var mySubmissionsCmd = new Command30("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) => {
2643
+ import { Command as Command31 } from "commander";
2644
+ var mySubmissionsCmd = new Command31("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) => {
2547
2645
  try {
2548
2646
  const result = await listWorkerSubmissions(cliTaskReadContext(), { address: opts.address });
2549
2647
  printResult(result);
@@ -2555,8 +2653,8 @@ var mySubmissionsCmd = new Command30("my-submissions").description("List all sub
2555
2653
  });
2556
2654
 
2557
2655
  // src/commands/task/update.ts
2558
- import { Command as Command31 } from "commander";
2559
- var updateCmd = new Command31("update").description("Update an open task (costs 0.001 plus any reward increase, in the payment token)").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").action(
2656
+ import { Command as Command32 } from "commander";
2657
+ var updateCmd = new Command32("update").description("Update an open task (costs 0.001 plus any reward increase, in the payment token)").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").action(
2560
2658
  async (taskId, opts) => {
2561
2659
  const body = { taskId };
2562
2660
  if (opts.reward !== void 0) {
@@ -2644,8 +2742,8 @@ var updateCmd = new Command31("update").description("Update an open task (costs
2644
2742
  );
2645
2743
 
2646
2744
  // src/commands/task/forfeit.ts
2647
- import { Command as Command32 } from "commander";
2648
- var forfeitCmd = new Command32("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) => {
2745
+ import { Command as Command33 } from "commander";
2746
+ var forfeitCmd = new Command33("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) => {
2649
2747
  try {
2650
2748
  const keystore = await loadKeystore();
2651
2749
  const message = buildForfeitMessage(taskId);
@@ -2668,9 +2766,9 @@ var forfeitCmd = new Command32("forfeit").description("Reclaim a claim-mode task
2668
2766
  });
2669
2767
 
2670
2768
  // src/commands/task/assign-evaluator.ts
2671
- import { Command as Command33 } from "commander";
2769
+ import { Command as Command34 } from "commander";
2672
2770
  var ADDRESS_PATTERN = /^0x[0-9a-fA-F]{40}$/;
2673
- var assignEvaluatorCmd = new Command33("assign-evaluator").description(
2771
+ var assignEvaluatorCmd = new Command34("assign-evaluator").description(
2674
2772
  "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."
2675
2773
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--evaluator <address>", "Evaluator wallet address").option("--evaluator-fee-bps <bps>", "Evaluator fee in basis points, 0-10000 (default: 0)").option("--evaluation-window <hours>", "Hours the evaluator has to issue a verdict (default: 24)").option("--appeal-window <hours>", "Hours the worker has to appeal a verdict (default: 24)").option("--dispute-resolver <address>", "Address allowed to resolve an appealed verdict").option(
2676
2774
  "--evaluator-stake <amount>",
@@ -2711,14 +2809,13 @@ var assignEvaluatorCmd = new Command33("assign-evaluator").description(
2711
2809
  }
2712
2810
  body.evaluatorFeeBps = bps;
2713
2811
  }
2812
+ const windowError = evaluationWindowFlagError(
2813
+ opts.evaluationWindow,
2814
+ await fetchTermsBoundsInfo()
2815
+ );
2816
+ if (windowError) return void printError(windowError);
2714
2817
  if (opts.evaluationWindow !== void 0) {
2715
- const hours = Number(opts.evaluationWindow);
2716
- if (!Number.isFinite(hours) || hours <= 0) {
2717
- return void printError(
2718
- `--evaluation-window must be a positive number of hours, got: ${opts.evaluationWindow}`
2719
- );
2720
- }
2721
- body.evaluationWindowHours = hours;
2818
+ body.evaluationWindowHours = Number(opts.evaluationWindow);
2722
2819
  }
2723
2820
  if (opts.appealWindow !== void 0) {
2724
2821
  const hours = Number(opts.appealWindow);
@@ -2744,8 +2841,8 @@ var assignEvaluatorCmd = new Command33("assign-evaluator").description(
2744
2841
  );
2745
2842
 
2746
2843
  // src/commands/task/evaluate.ts
2747
- import { Command as Command34 } from "commander";
2748
- var evaluateCmd = new Command34("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(
2844
+ import { Command as Command35 } from "commander";
2845
+ var evaluateCmd = new Command35("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(
2749
2846
  "--award <worker:amount:rank>",
2750
2847
  "Award entry (repeatable): worker:amount:rank",
2751
2848
  collect2,
@@ -2811,8 +2908,8 @@ function collect2(val, prev) {
2811
2908
  }
2812
2909
 
2813
2910
  // src/commands/task/appeal.ts
2814
- import { Command as Command35 } from "commander";
2815
- var appealCmd = new Command35("appeal").description("Appeal an evaluator verdict while in Appealing state").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2911
+ import { Command as Command36 } from "commander";
2912
+ var appealCmd = new Command36("appeal").description("Appeal an evaluator verdict while in Appealing state").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2816
2913
  const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/appeal`, { taskId });
2817
2914
  printResult(
2818
2915
  { txHash: result.txHash, ...await settleRecording(result, idempotencyKey) },
@@ -2821,8 +2918,8 @@ var appealCmd = new Command35("appeal").description("Appeal an evaluator verdict
2821
2918
  });
2822
2919
 
2823
2920
  // src/commands/task/evaluator-timeout.ts
2824
- import { Command as Command36 } from "commander";
2825
- var evaluatorTimeoutCmd = new Command36("evaluator-timeout").description("Trigger evaluator timeout after the evaluation window expires (anyone)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2921
+ import { Command as Command37 } from "commander";
2922
+ var evaluatorTimeoutCmd = new Command37("evaluator-timeout").description("Trigger evaluator timeout after the evaluation window expires (anyone)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2826
2923
  const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/evaluator-timeout`, { taskId });
2827
2924
  printResult(
2828
2925
  { txHash: result.txHash, ...await settleRecording(result, idempotencyKey) },
@@ -2831,8 +2928,8 @@ var evaluatorTimeoutCmd = new Command36("evaluator-timeout").description("Trigge
2831
2928
  });
2832
2929
 
2833
2930
  // src/commands/task/finalize-verdict.ts
2834
- import { Command as Command37 } from "commander";
2835
- var finalizeVerdictCmd = new Command37("finalize-verdict").description("Finalize an evaluator verdict after the appeal window expires (permissionless)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2931
+ import { Command as Command38 } from "commander";
2932
+ var finalizeVerdictCmd = new Command38("finalize-verdict").description("Finalize an evaluator verdict after the appeal window expires (permissionless)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2836
2933
  const { data: result, idempotencyKey } = await apiPost(`/api/tasks/${taskId}/finalize-verdict`, { taskId });
2837
2934
  printResult(
2838
2935
  { txHash: result.txHash, ...await settleRecording(result, idempotencyKey) },
@@ -2841,7 +2938,7 @@ var finalizeVerdictCmd = new Command37("finalize-verdict").description("Finalize
2841
2938
  });
2842
2939
 
2843
2940
  // src/commands/task/resolve-dispute.ts
2844
- import { Command as Command38 } from "commander";
2941
+ import { Command as Command39 } from "commander";
2845
2942
  function parseAward(spec) {
2846
2943
  const parts = spec.split(":");
2847
2944
  if (parts.length !== 3) {
@@ -2862,7 +2959,7 @@ function parseAward(spec) {
2862
2959
  rank
2863
2960
  };
2864
2961
  }
2865
- var resolveDisputeCmd = new Command38("resolve-dispute").description(
2962
+ var resolveDisputeCmd = new Command39("resolve-dispute").description(
2866
2963
  "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"
2867
2964
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--verdict <type>", "Verdict type: approve or partial").requiredOption(
2868
2965
  "--award <spec...>",
@@ -2894,8 +2991,8 @@ var resolveDisputeCmd = new Command38("resolve-dispute").description(
2894
2991
  });
2895
2992
 
2896
2993
  // src/commands/task/unlock.ts
2897
- import { Command as Command39 } from "commander";
2898
- var unlockCmd = new Command39("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) => {
2994
+ import { Command as Command40 } from "commander";
2995
+ var unlockCmd = new Command40("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) => {
2899
2996
  let result;
2900
2997
  let idempotencyKey;
2901
2998
  try {
@@ -2912,8 +3009,8 @@ var unlockCmd = new Command39("unlock").description("Unlock a private task with
2912
3009
  });
2913
3010
 
2914
3011
  // src/commands/task/invite.ts
2915
- import { Command as Command40 } from "commander";
2916
- var inviteCmd = new Command40("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, address) => {
3012
+ import { Command as Command41 } from "commander";
3013
+ var inviteCmd = new Command41("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, address) => {
2917
3014
  const auth = await signReadAuth();
2918
3015
  if (!auth || Object.keys(auth.headers).length === 0) {
2919
3016
  printError("No keystore found. Run `taskmarket init` first.");
@@ -2932,8 +3029,8 @@ var inviteCmd = new Command40("invite").description("Invite a wallet to view a p
2932
3029
  });
2933
3030
 
2934
3031
  // src/commands/task/uninvite.ts
2935
- import { Command as Command41 } from "commander";
2936
- var uninviteCmd = new Command41("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, address) => {
3032
+ import { Command as Command42 } from "commander";
3033
+ var uninviteCmd = new Command42("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, address) => {
2937
3034
  const auth = await signReadAuth();
2938
3035
  if (!auth || Object.keys(auth.headers).length === 0) {
2939
3036
  printError("No keystore found. Run `taskmarket init` first.");
@@ -2951,8 +3048,8 @@ var uninviteCmd = new Command41("uninvite").description("Remove a wallet from a
2951
3048
  });
2952
3049
 
2953
3050
  // src/commands/task/viewers.ts
2954
- import { Command as Command42 } from "commander";
2955
- var viewersCmd = new Command42("viewers").description("List a private task's wallet allowlist (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
3051
+ import { Command as Command43 } from "commander";
3052
+ var viewersCmd = new Command43("viewers").description("List a private task's wallet allowlist (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2956
3053
  const auth = await signReadAuth();
2957
3054
  if (!auth || Object.keys(auth.headers).length === 0) {
2958
3055
  printError("No keystore found. Run `taskmarket init` first.");
@@ -2969,8 +3066,8 @@ var viewersCmd = new Command42("viewers").description("List a private task's wal
2969
3066
  });
2970
3067
 
2971
3068
  // src/commands/task/terms.ts
2972
- import { Command as Command43 } from "commander";
2973
- var termsCmd = new Command43("terms").description(
3069
+ import { Command as Command44 } from "commander";
3070
+ var termsCmd = new Command44("terms").description(
2974
3071
  "Show a task's settlement terms: stake, review window, reject fee and outcome, revisions, release cost now and deadlines"
2975
3072
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
2976
3073
  const detail = await getTaskTerms(cliTaskReadContext(), { taskId });
@@ -2984,7 +3081,7 @@ var termsCmd = new Command43("terms").description(
2984
3081
  });
2985
3082
 
2986
3083
  // src/lib/settlement-action.ts
2987
- import { Command as Command44 } from "commander";
3084
+ import { Command as Command45 } from "commander";
2988
3085
  async function readTerms(taskId) {
2989
3086
  try {
2990
3087
  return await getTaskTerms(cliTaskReadContext(), { taskId });
@@ -3028,7 +3125,7 @@ async function confirmSettlementAction(name, confirm2, taskId, yes) {
3028
3125
  return false;
3029
3126
  }
3030
3127
  function settlementActionCommand(spec) {
3031
- const command = new Command44(spec.name).description(spec.description).argument("<taskId>", "Task ID (0x-prefixed hex)");
3128
+ const command = new Command45(spec.name).description(spec.description).argument("<taskId>", "Task ID (0x-prefixed hex)");
3032
3129
  if (spec.confirm === "release-cost") {
3033
3130
  command.option("--yes", "Accept the stake forfeited by releasing now (releaseCostNow)");
3034
3131
  } else if (spec.confirm === "always") {
@@ -3087,7 +3184,7 @@ var settleCmd = settlementActionCommand({
3087
3184
  });
3088
3185
 
3089
3186
  // src/commands/task/index.ts
3090
- var taskCommand2 = new Command45("task").description("Manage tasks");
3187
+ var taskCommand2 = new Command46("task").description("Manage tasks");
3091
3188
  taskCommand2.addCommand(createCmd);
3092
3189
  taskCommand2.addCommand(listCmd);
3093
3190
  taskCommand2.addCommand(getCmd);
@@ -3132,10 +3229,10 @@ taskCommand2.addCommand(reviewCmd);
3132
3229
  taskCommand2.addCommand(startReviewCmd);
3133
3230
 
3134
3231
  // src/commands/agent/index.ts
3135
- import { Command as Command48, Option as Option3 } from "commander";
3232
+ import { Command as Command49, Option as Option3 } from "commander";
3136
3233
 
3137
3234
  // src/commands/agent/credits.ts
3138
- import { Command as Command46 } from "commander";
3235
+ import { Command as Command47 } from "commander";
3139
3236
 
3140
3237
  // src/lib/tty-confirm.ts
3141
3238
  import { createInterface as createInterface2 } from "readline";
@@ -3188,7 +3285,7 @@ function setupLines(plan, pricing) {
3188
3285
  ...rateLines(pricing)
3189
3286
  ];
3190
3287
  }
3191
- var setupCommand = new Command46("setup").description(
3288
+ var setupCommand = new Command47("setup").description(
3192
3289
  "Approve the compute allocation that pays for sandboxes: daily and monthly caps, and optional auto-top-up"
3193
3290
  ).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(
3194
3291
  "--auto-top-up-below <credits>",
@@ -3225,7 +3322,7 @@ var setupCommand = new Command46("setup").description(
3225
3322
  printResult({ config, caps: plan.caps, autoTopUp: plan.autoTopUp ?? null });
3226
3323
  }
3227
3324
  );
3228
- var buyCommand = new Command46("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) => {
3325
+ var buyCommand = new Command47("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) => {
3229
3326
  const config = await loadComputeCreditConfig();
3230
3327
  if (!config) {
3231
3328
  throw new ComputeCreditError(
@@ -3255,17 +3352,17 @@ var buyCommand = new Command46("buy").description("Buy compute credit over x402
3255
3352
  rate: { rateCardVersion: pricing.rateCardVersion, usdPerCredit: pricing.usdPerCredit }
3256
3353
  });
3257
3354
  });
3258
- var statusCommand2 = new Command46("status").description(
3355
+ var statusCommand2 = new Command47("status").description(
3259
3356
  "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"
3260
3357
  ).action(async () => {
3261
3358
  printResult(await computeCreditStatus());
3262
3359
  });
3263
- var checkCommand = new Command46("check").description(
3360
+ var checkCommand = new Command47("check").description(
3264
3361
  "Check the compute credit balance and, when auto-top-up was approved and the balance is low, buy one chunk"
3265
3362
  ).action(async () => {
3266
3363
  printResult(await checkComputeBalance());
3267
3364
  });
3268
- var reconcileCommand = new Command46("reconcile").description(
3365
+ var reconcileCommand = new Command47("reconcile").description(
3269
3366
  "Settle purchases whose outcome was lost, by their idempotency key; never pays again"
3270
3367
  ).option(
3271
3368
  "--release <key>",
@@ -3312,10 +3409,10 @@ var reconcileCommand = new Command46("reconcile").description(
3312
3409
  ...recoveryError === void 0 ? {} : { recoveryError }
3313
3410
  });
3314
3411
  });
3315
- var disableAutoTopUpCommand = new Command46("disable-auto-top-up").description("Turn off auto-top-up and close its allocation").action(async () => {
3412
+ var disableAutoTopUpCommand = new Command47("disable-auto-top-up").description("Turn off auto-top-up and close its allocation").action(async () => {
3316
3413
  printResult({ config: await disableComputeAutoTopUp() });
3317
3414
  });
3318
- var agentCreditsCommand = new Command46("credits").description("Prepaid compute credit for agent sandboxes, bought over x402").addCommand(setupCommand).addCommand(buyCommand).addCommand(statusCommand2).addCommand(checkCommand).addCommand(reconcileCommand).addCommand(disableAutoTopUpCommand);
3415
+ var agentCreditsCommand = new Command47("credits").description("Prepaid compute credit for agent sandboxes, bought over x402").addCommand(setupCommand).addCommand(buyCommand).addCommand(statusCommand2).addCommand(checkCommand).addCommand(reconcileCommand).addCommand(disableAutoTopUpCommand);
3319
3416
 
3320
3417
  // src/commands/agent/launch.ts
3321
3418
  var EXPERIMENTAL_AGENT_ENV = "TASKMARKET_EXPERIMENTAL_AGENT";
@@ -3337,7 +3434,7 @@ async function runAgentCommand(options) {
3337
3434
  try {
3338
3435
  const { assertAgentCompatibility } = await import("./compatibility-KUYGZSUC.js");
3339
3436
  const pi = assertAgentCompatibility();
3340
- const { runAgent } = await import("./launch-ZV6OLBFM.js");
3437
+ const { runAgent } = await import("./launch-I3NCB5FV.js");
3341
3438
  result = await runAgent({
3342
3439
  model: options.model,
3343
3440
  pi,
@@ -3368,7 +3465,7 @@ async function runAgentCommand(options) {
3368
3465
  }
3369
3466
 
3370
3467
  // src/commands/agent/manage.ts
3371
- import { Command as Command47 } from "commander";
3468
+ import { Command as Command48 } from "commander";
3372
3469
  async function run(options, work, lines) {
3373
3470
  try {
3374
3471
  const value = await work();
@@ -3393,27 +3490,27 @@ async function requireExperimental() {
3393
3490
  );
3394
3491
  }
3395
3492
  function agentManagementCommands() {
3396
- const status = new Command47("status").description(
3493
+ const status = new Command48("status").description(
3397
3494
  "Show the agent channels (locked, charged, refundable), purchases with an unknown outcome, the sandbox and compute credit. Reads only."
3398
3495
  ).option("--json", "Print the versioned JSON envelope").action(async (options) => {
3399
- const { collectAgentStatus, statusLines } = await import("./status-FHZ3UGEB.js");
3496
+ const { collectAgentStatus, statusLines } = await import("./status-GNY7YXPE.js");
3400
3497
  await run(options, () => collectAgentStatus(), statusLines);
3401
3498
  });
3402
- const doctor = new Command47("doctor").description(
3499
+ const doctor = new Command48("doctor").description(
3403
3500
  "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."
3404
3501
  ).option("--json", "Print the versioned JSON envelope").action(async (options) => {
3405
- const { runDoctor, doctorLines } = await import("./doctor-TB3KKAZB.js");
3502
+ const { runDoctor, doctorLines } = await import("./doctor-LDSADHSQ.js");
3406
3503
  const report = await run(options, () => runDoctor(), doctorLines);
3407
3504
  if (report && !report.ok) process.exitCode = 1;
3408
3505
  });
3409
- const reconcile = new Command47("reconcile").description(
3506
+ const reconcile = new Command48("reconcile").description(
3410
3507
  "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."
3411
3508
  ).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(
3412
3509
  "--channel <channel-id>",
3413
3510
  "Reconcile the open purchases of this channel, as status lists it; also reaches retired channels"
3414
3511
  ).option("--json", "Print the versioned JSON envelope").action(
3415
3512
  async (invocationId, options) => {
3416
- const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-UXL65RRT.js");
3513
+ const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-UHDI4QCY.js");
3417
3514
  const choice = { rail: options.rail, channel: options.channel };
3418
3515
  if (invocationId !== void 0) {
3419
3516
  await run(
@@ -3455,7 +3552,7 @@ function agentManagementCommands() {
3455
3552
  );
3456
3553
  }
3457
3554
  );
3458
- const topup = new Command47("topup").description(
3555
+ const topup = new Command48("topup").description(
3459
3556
  "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"
3460
3557
  ).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)").option("--json", "Print the versioned JSON envelope").action(async (options) => {
3461
3558
  await run(
@@ -3471,7 +3568,7 @@ function agentManagementCommands() {
3471
3568
  `Not a USDC amount: ${options.amount} (digits, at most 6 decimals)`
3472
3569
  );
3473
3570
  }
3474
- const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-KCDZ5REF.js");
3571
+ const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-ZMYXFZ72.js");
3475
3572
  const { rails } = await openAgentChannels();
3476
3573
  const result = await requestTopUp(selectRail(rails, options.rail), amount);
3477
3574
  return {
@@ -3484,7 +3581,7 @@ function agentManagementCommands() {
3484
3581
  (view) => [view.note, ...channelLines(view.channel)]
3485
3582
  );
3486
3583
  });
3487
- const close = new Command47("close").description(
3584
+ const close = new Command48("close").description(
3488
3585
  "Close the agent's channel and refund its unused balance cooperatively; checks an earlier close instead of sending it again"
3489
3586
  ).option("--rail <id>", "The rail to close (required when the policy has more than one)").option(
3490
3587
  "--channel <channel-id>",
@@ -3495,8 +3592,8 @@ function agentManagementCommands() {
3495
3592
  async () => {
3496
3593
  await requireExperimental();
3497
3594
  const { AGENT_VIEW_VERSION } = await import("./budget-view-JPZ7HWR2.js");
3498
- const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-KCDZ5REF.js");
3499
- const { reconcileLeasedPurchase } = await import("./reconcile-UXL65RRT.js");
3595
+ const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-ZMYXFZ72.js");
3596
+ const { reconcileLeasedPurchase } = await import("./reconcile-UHDI4QCY.js");
3500
3597
  const opened = await openAgentChannels();
3501
3598
  const { rail, retired } = selectChannel(opened, options);
3502
3599
  const result = await closeChannel(
@@ -3542,7 +3639,7 @@ function agentManagementCommands() {
3542
3639
  ]
3543
3640
  );
3544
3641
  });
3545
- const pull = new Command47("pull").description(
3642
+ const pull = new Command48("pull").description(
3546
3643
  "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."
3547
3644
  ).option("--diff", "Print the full diff").option("--apply", "Apply the clean changes without asking").option(
3548
3645
  "--overwrite <path>",
@@ -3567,7 +3664,7 @@ function agentManagementCommands() {
3567
3664
  options,
3568
3665
  async () => {
3569
3666
  await requireExperimental();
3570
- const { runPull } = await import("./sync-pull-YECZ4PJA.js");
3667
+ const { runPull } = await import("./sync-pull-6PWR6CJS.js");
3571
3668
  const { terminalPrompter } = await import("./prompter-LSICEYSQ.js");
3572
3669
  return runPull(options, {
3573
3670
  interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY) && !options.json,
@@ -3595,7 +3692,7 @@ function agentManagementCommands() {
3595
3692
 
3596
3693
  // src/commands/agent/index.ts
3597
3694
  var experimental = agentCommandEnabled();
3598
- var agentCommand = new Command48("agent").description(
3695
+ var agentCommand = new Command49("agent").description(
3599
3696
  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"
3600
3697
  ).addOption(
3601
3698
  new Option3("--model <id>", "Start on one model from your approved spending policy").hideHelp(
@@ -3629,8 +3726,8 @@ for (const command of agentManagementCommands()) {
3629
3726
  }
3630
3727
 
3631
3728
  // src/commands/agents.ts
3632
- import { Command as Command49 } from "commander";
3633
- var agentsCommand = new Command49("agents").description("Browse the agent directory").option("--sort <order>", "Sort order: reputation or tasks", "reputation").option("--skill <tag>", "Filter by skill tag").option("--search <query>", "Search by agentId or wallet address").option("--limit <n>", "Maximum results to return", "20").action(async (opts) => {
3729
+ import { Command as Command50 } from "commander";
3730
+ var agentsCommand = new Command50("agents").description("Browse the agent directory").option("--sort <order>", "Sort order: reputation or tasks", "reputation").option("--skill <tag>", "Filter by skill tag").option("--search <query>", "Search by agentId or wallet address").option("--limit <n>", "Maximum results to return", "20").action(async (opts) => {
3634
3731
  const params = new URLSearchParams();
3635
3732
  if (opts.sort) params.set("sort", opts.sort);
3636
3733
  if (opts.skill) params.set("skill", opts.skill);
@@ -3641,8 +3738,8 @@ var agentsCommand = new Command49("agents").description("Browse the agent direct
3641
3738
  });
3642
3739
 
3643
3740
  // src/commands/inbox.ts
3644
- import { Command as Command50 } from "commander";
3645
- var inboxCommand = new Command50("inbox").description("Show tasks you created and tasks you are working on").action(async () => {
3741
+ import { Command as Command51 } from "commander";
3742
+ var inboxCommand = new Command51("inbox").description("Show tasks you created and tasks you are working on").action(async () => {
3646
3743
  const auth = await signReadAuth();
3647
3744
  if (!auth) {
3648
3745
  printError("No keystore found. Run `taskmarket init` first.");
@@ -3663,8 +3760,8 @@ var inboxCommand = new Command50("inbox").description("Show tasks you created an
3663
3760
  });
3664
3761
 
3665
3762
  // src/commands/actions.ts
3666
- import { Command as Command51 } from "commander";
3667
- var actionsCommand = new Command51("actions").description("Show lifecycle actions awaiting you, grouped and prioritized by the server").action(async () => {
3763
+ import { Command as Command52 } from "commander";
3764
+ var actionsCommand = new Command52("actions").description("Show lifecycle actions awaiting you, grouped and prioritized by the server").action(async () => {
3668
3765
  const auth = await signReadAuth();
3669
3766
  if (!auth) {
3670
3767
  printError("No keystore found. Run `taskmarket init` first.");
@@ -3678,8 +3775,8 @@ var actionsCommand = new Command51("actions").description("Show lifecycle action
3678
3775
  });
3679
3776
 
3680
3777
  // src/commands/deposit.ts
3681
- import { Command as Command52 } from "commander";
3682
- var depositCommand = new Command52("deposit").description("Show wallet address and network info for funding").action(async () => {
3778
+ import { Command as Command53 } from "commander";
3779
+ var depositCommand = new Command53("deposit").description("Show wallet address and network info for funding").action(async () => {
3683
3780
  let address;
3684
3781
  try {
3685
3782
  address = await getWalletAddress();
@@ -3711,11 +3808,11 @@ var depositCommand = new Command52("deposit").description("Show wallet address a
3711
3808
  });
3712
3809
 
3713
3810
  // src/commands/wallet/index.ts
3714
- import { Command as Command63 } from "commander";
3811
+ import { Command as Command64 } from "commander";
3715
3812
 
3716
3813
  // src/commands/wallet/balance.ts
3717
- import { Command as Command53 } from "commander";
3718
- var walletBalanceCommand = new Command53("balance").description("Show the wallet's payment-token balance on the selected network").option("--address <addr>", "Address to check (defaults to own wallet)").action(async (opts) => {
3814
+ import { Command as Command54 } from "commander";
3815
+ var walletBalanceCommand = new Command54("balance").description("Show the wallet's payment-token balance on the selected network").option("--address <addr>", "Address to check (defaults to own wallet)").action(async (opts) => {
3719
3816
  let address = opts.address;
3720
3817
  if (!address) {
3721
3818
  const keystore = await loadKeystore();
@@ -3728,7 +3825,7 @@ var walletBalanceCommand = new Command53("balance").description("Show the wallet
3728
3825
  });
3729
3826
 
3730
3827
  // src/commands/wallet/import.ts
3731
- import { Command as Command54 } from "commander";
3828
+ import { Command as Command55 } from "commander";
3732
3829
  import { createInterface as createInterface3 } from "readline";
3733
3830
  import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
3734
3831
  function normalizePrivateKey(raw) {
@@ -3763,7 +3860,7 @@ function promptHiddenInput(prompt) {
3763
3860
  });
3764
3861
  });
3765
3862
  }
3766
- var walletImportCommand = new Command54("import").description("Import an existing private key as the agent wallet").option("--key <privateKey>", "Private key to import (64 hex chars, with or without 0x prefix)").option(
3863
+ var walletImportCommand = new Command55("import").description("Import an existing private key as the agent wallet").option("--key <privateKey>", "Private key to import (64 hex chars, with or without 0x prefix)").option(
3767
3864
  "--yes",
3768
3865
  "Confirm legal acceptance non-interactively after reviewing every current policy"
3769
3866
  ).action(async (opts) => {
@@ -3844,7 +3941,7 @@ var walletImportCommand = new Command54("import").description("Import an existin
3844
3941
 
3845
3942
  // src/commands/wallet/set-withdrawal-address.ts
3846
3943
  import { randomBytes as randomBytes2 } from "crypto";
3847
- import { Command as Command55 } from "commander";
3944
+ import { Command as Command56 } from "commander";
3848
3945
 
3849
3946
  // src/lib/withdrawal-pin.ts
3850
3947
  var WithdrawalAddressMismatchError = class extends Error {
@@ -3893,7 +3990,7 @@ var SIGNATURE_TTL_SECONDS = 5 * 60;
3893
3990
  function isValidAddress(addr) {
3894
3991
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
3895
3992
  }
3896
- var setWithdrawalAddressCommand = new Command55("set-withdrawal-address").description("Set a withdrawal address for payment-token withdrawals (one-time, free)").argument("<address>", "Ethereum address to receive withdrawals").action(async (address) => {
3993
+ var setWithdrawalAddressCommand = new Command56("set-withdrawal-address").description("Set a withdrawal address for payment-token withdrawals (one-time, free)").argument("<address>", "Ethereum address to receive withdrawals").action(async (address) => {
3897
3994
  if (!isValidAddress(address)) {
3898
3995
  printError("Invalid Ethereum address: must be 0x followed by 40 hex characters");
3899
3996
  return;
@@ -3937,8 +4034,8 @@ var setWithdrawalAddressCommand = new Command55("set-withdrawal-address").descri
3937
4034
  });
3938
4035
 
3939
4036
  // src/commands/wallet/get-withdrawal-address.ts
3940
- import { Command as Command56 } from "commander";
3941
- var getWithdrawalAddressCommand = new Command56("get-withdrawal-address").description("Show the currently registered withdrawal address, if any").option("--address <addr>", "Wallet address to check (defaults to own wallet)").action(async (opts) => {
4037
+ import { Command as Command57 } from "commander";
4038
+ var getWithdrawalAddressCommand = new Command57("get-withdrawal-address").description("Show the currently registered withdrawal address, if any").option("--address <addr>", "Wallet address to check (defaults to own wallet)").action(async (opts) => {
3942
4039
  let address = opts.address;
3943
4040
  if (!address) {
3944
4041
  const keystore = await loadKeystore();
@@ -3949,14 +4046,14 @@ var getWithdrawalAddressCommand = new Command56("get-withdrawal-address").descri
3949
4046
  });
3950
4047
 
3951
4048
  // src/commands/wallet/change-withdrawal-address.ts
3952
- import { Command as Command57 } from "commander";
4049
+ import { Command as Command58 } from "commander";
3953
4050
  function isValidAddress2(addr) {
3954
4051
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
3955
4052
  }
3956
4053
  function isValidRecoveryCode(code) {
3957
4054
  return /^\d{8}$/.test(code);
3958
4055
  }
3959
- var changeWithdrawalAddressCommand = new Command57("change-withdrawal-address").description("Change the withdrawal address using the account recovery code (RFC-0012)").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) => {
4056
+ var changeWithdrawalAddressCommand = new Command58("change-withdrawal-address").description("Change the withdrawal address using the account recovery code (RFC-0012)").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) => {
3960
4057
  if (!isValidRecoveryCode(recoveryCode)) {
3961
4058
  printError("Invalid account recovery code: must be 8 digits");
3962
4059
  return;
@@ -3989,8 +4086,8 @@ var changeWithdrawalAddressCommand = new Command57("change-withdrawal-address").
3989
4086
  });
3990
4087
 
3991
4088
  // src/commands/wallet/sync-withdrawal-address.ts
3992
- import { Command as Command58 } from "commander";
3993
- var syncWithdrawalAddressCommand = new Command58("sync-withdrawal-address").description(
4089
+ import { Command as Command59 } from "commander";
4090
+ var syncWithdrawalAddressCommand = new Command59("sync-withdrawal-address").description(
3994
4091
  "Accept the withdrawal address registered on the server as the locally pinned one (after a change made elsewhere, e.g. on the web)"
3995
4092
  ).action(async () => {
3996
4093
  let keystore;
@@ -4019,8 +4116,8 @@ var syncWithdrawalAddressCommand = new Command58("sync-withdrawal-address").desc
4019
4116
  });
4020
4117
 
4021
4118
  // src/commands/wallet/reveal-recovery-code.ts
4022
- import { Command as Command59 } from "commander";
4023
- var revealRecoveryCodeCommand = new Command59("reveal-recovery-code").description("One-time reveal of your account recovery code, if one has not been generated yet").action(async () => {
4119
+ import { Command as Command60 } from "commander";
4120
+ var revealRecoveryCodeCommand = new Command60("reveal-recovery-code").description("One-time reveal of your account recovery code, if one has not been generated yet").action(async () => {
4024
4121
  let keystore;
4025
4122
  try {
4026
4123
  keystore = await loadKeystore();
@@ -4045,8 +4142,8 @@ var revealRecoveryCodeCommand = new Command59("reveal-recovery-code").descriptio
4045
4142
  });
4046
4143
 
4047
4144
  // src/commands/wallet/publish-key.ts
4048
- import { Command as Command60 } from "commander";
4049
- var publishKeyCommand = new Command60("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
4145
+ import { Command as Command61 } from "commander";
4146
+ var publishKeyCommand = new Command61("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
4050
4147
  let keystore;
4051
4148
  try {
4052
4149
  keystore = await loadKeystore();
@@ -4066,13 +4163,13 @@ var publishKeyCommand = new Command60("publish-key").description("Publish your s
4066
4163
  });
4067
4164
 
4068
4165
  // src/commands/wallet/withdraw-dreams.ts
4069
- import { Command as Command61 } from "commander";
4166
+ import { Command as Command62 } from "commander";
4070
4167
  import { toHex } from "viem";
4071
4168
  var AUTHORIZATION_VALIDITY_SECONDS = 300;
4072
4169
  function isValidAddress3(addr) {
4073
4170
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
4074
4171
  }
4075
- var withdrawDreamsCommand = new Command61("withdraw-dreams").description("Withdraw accumulated DREAMS rewards to the withdrawal address").option("--destination <addr>", "Destination address (defaults to registered withdrawal address)").action(async (opts) => {
4172
+ var withdrawDreamsCommand = new Command62("withdraw-dreams").description("Withdraw accumulated DREAMS rewards to the withdrawal address").option("--destination <addr>", "Destination address (defaults to registered withdrawal address)").action(async (opts) => {
4076
4173
  let keystore;
4077
4174
  try {
4078
4175
  keystore = await loadKeystore();
@@ -4103,9 +4200,23 @@ var withdrawDreamsCommand = new Command61("withdraw-dreams").description("Withdr
4103
4200
  return;
4104
4201
  }
4105
4202
  }
4203
+ const balance = await apiGet(
4204
+ `/api/wallet/dreams-balance?address=${workerAddress}`
4205
+ );
4206
+ if (!balance.hookAddress || balance.chainId === void 0) {
4207
+ printError("DREAMS rewards are not configured on this server");
4208
+ return;
4209
+ }
4106
4210
  const nonce = toHex(crypto.getRandomValues(new Uint8Array(32)));
4107
4211
  const validBefore = String(Math.floor(Date.now() / 1e3) + AUTHORIZATION_VALIDITY_SECONDS);
4108
- const message = buildWithdrawDreamsMessage(destination, nonce, validBefore);
4212
+ const message = buildWithdrawDreamsMessage({
4213
+ wallet: workerAddress,
4214
+ destination,
4215
+ nonce,
4216
+ validBefore,
4217
+ chainId: balance.chainId,
4218
+ hookAddress: balance.hookAddress
4219
+ });
4109
4220
  const signature = await signMessage(message, keystore);
4110
4221
  const { data: result, idempotencyKey } = await apiPost(
4111
4222
  "/api/wallet/withdraw-dreams",
@@ -4131,7 +4242,7 @@ var withdrawDreamsCommand = new Command61("withdraw-dreams").description("Withdr
4131
4242
  });
4132
4243
 
4133
4244
  // src/commands/wallet/bridge.ts
4134
- import { Command as Command62 } from "commander";
4245
+ import { Command as Command63 } from "commander";
4135
4246
  import { toHex as toHex2 } from "viem";
4136
4247
  var USDC_TYPES = {
4137
4248
  TransferWithAuthorization: [
@@ -4175,7 +4286,7 @@ async function pollBridgeStatus(requestId) {
4175
4286
  await sleep(bridgeTiming.intervalMs);
4176
4287
  }
4177
4288
  }
4178
- var walletBridgeCommand = new Command62("bridge").description(
4289
+ var walletBridgeCommand = new Command63("bridge").description(
4179
4290
  "Move free USDC on Base to OUSD at the same address on Tempo (gasless, through Relay)"
4180
4291
  ).requiredOption("--to <chain>", 'Destination chain (only "tempo")').argument("<amount>", "Amount of USDC in whole tokens (minimum 1, e.g. 25)").action(async (amount, opts) => {
4181
4292
  if (opts.to !== "tempo") {
@@ -4305,7 +4416,7 @@ var walletBridgeCommand = new Command62("bridge").description(
4305
4416
  });
4306
4417
 
4307
4418
  // src/commands/wallet/index.ts
4308
- var walletCommand = new Command63("wallet").description("Wallet management commands");
4419
+ var walletCommand = new Command64("wallet").description("Wallet management commands");
4309
4420
  walletCommand.addCommand(walletBalanceCommand);
4310
4421
  walletCommand.addCommand(walletImportCommand);
4311
4422
  walletCommand.addCommand(setWithdrawalAddressCommand);
@@ -4318,7 +4429,7 @@ walletCommand.addCommand(withdrawDreamsCommand);
4318
4429
  walletCommand.addCommand(walletBridgeCommand);
4319
4430
 
4320
4431
  // src/commands/withdraw.ts
4321
- import { Command as Command64 } from "commander";
4432
+ import { Command as Command65 } from "commander";
4322
4433
  import { toHex as toHex3 } from "viem";
4323
4434
  var RECEIVE_POLICY_BLOCKED = "recipient_receive_policy_blocked";
4324
4435
  async function withdrawOnTempo(input) {
@@ -4374,7 +4485,7 @@ var USDC_TYPES2 = {
4374
4485
  { name: "nonce", type: "bytes32" }
4375
4486
  ]
4376
4487
  };
4377
- var withdrawCommand = new Command64("withdraw").description(
4488
+ var withdrawCommand = new Command65("withdraw").description(
4378
4489
  "Withdraw the payment token (USDC on Base, OUSD on Tempo) to the registered withdrawal address"
4379
4490
  ).argument("<amount>", "Amount in whole tokens (e.g. 5 for 5 USDC or 5 OUSD)").action(async (amount) => {
4380
4491
  const parsed = parseFloat(amount);
@@ -4459,9 +4570,9 @@ var withdrawCommand = new Command64("withdraw").description(
4459
4570
  });
4460
4571
 
4461
4572
  // src/commands/encrypt.ts
4462
- import { Command as Command65 } from "commander";
4573
+ import { Command as Command66 } from "commander";
4463
4574
  import { promises as fs2 } from "fs";
4464
- var encryptCommand = new Command65("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) => {
4575
+ var encryptCommand = new Command66("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) => {
4465
4576
  let plaintext;
4466
4577
  try {
4467
4578
  plaintext = await fs2.readFile(file);
@@ -4509,9 +4620,9 @@ var encryptCommand = new Command65("encrypt").description("Encrypt a file with E
4509
4620
  });
4510
4621
 
4511
4622
  // src/commands/decrypt.ts
4512
- import { Command as Command66 } from "commander";
4623
+ import { Command as Command67 } from "commander";
4513
4624
  import { promises as fs3 } from "fs";
4514
- var decryptCommand = new Command66("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) => {
4625
+ var decryptCommand = new Command67("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) => {
4515
4626
  let ciphertext;
4516
4627
  try {
4517
4628
  ciphertext = await fs3.readFile(file);
@@ -4551,7 +4662,7 @@ var decryptCommand = new Command66("decrypt").description("Decrypt a file using
4551
4662
  });
4552
4663
 
4553
4664
  // src/commands/xmtp.ts
4554
- import { Command as Command67 } from "commander";
4665
+ import { Command as Command68 } from "commander";
4555
4666
 
4556
4667
  // src/lib/xmtp-client.ts
4557
4668
  import path2 from "path";
@@ -5314,7 +5425,7 @@ function getDefaultQueryTimeoutMs() {
5314
5425
  }
5315
5426
  return Math.floor(parsed);
5316
5427
  }
5317
- var xmtpCommand = new Command67("xmtp").description("Manage XMTP messaging for this agent");
5428
+ var xmtpCommand = new Command68("xmtp").description("Manage XMTP messaging for this agent");
5318
5429
  xmtpCommand.command("init").description("Initialize XMTP client and register installation metadata with backend").action(async () => {
5319
5430
  const keystore = await loadKeystore();
5320
5431
  const client = await createXmtpClient({
@@ -5551,7 +5662,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
5551
5662
  });
5552
5663
 
5553
5664
  // src/commands/daemon.ts
5554
- import { Command as Command68 } from "commander";
5665
+ import { Command as Command69 } from "commander";
5555
5666
  function diffTaskStatuses(prev, next) {
5556
5667
  const changes = [];
5557
5668
  for (const [taskId, newStatus] of next) {
@@ -5579,7 +5690,7 @@ function sleepOrAbort(ms, signal) {
5579
5690
  });
5580
5691
  }
5581
5692
  var MAX_SEEN_TASK_IDS = 2e3;
5582
- var daemonCommand = new Command68("daemon").description("Long-running agent daemon: XMTP stream, heartbeats, and task polling").option("--heartbeat-interval <ms>", "Heartbeat interval in milliseconds", "1800000").option("--inbox-interval <ms>", "Inbox poll interval in milliseconds", "15000").option("--task-interval <ms>", "New task poll interval in milliseconds", "15000").option(
5693
+ var daemonCommand = new Command69("daemon").description("Long-running agent daemon: XMTP stream, heartbeats, and task polling").option("--heartbeat-interval <ms>", "Heartbeat interval in milliseconds", "1800000").option("--inbox-interval <ms>", "Inbox poll interval in milliseconds", "15000").option("--task-interval <ms>", "New task poll interval in milliseconds", "15000").option(
5583
5694
  "--auction-poll-interval <ms>",
5584
5695
  "Poll interval for clock-based auction tasks (dutch/reverse_dutch) in milliseconds",
5585
5696
  "15000"
@@ -5912,11 +6023,11 @@ var daemonCommand = new Command68("daemon").description("Long-running agent daem
5912
6023
  );
5913
6024
 
5914
6025
  // src/commands/email/index.ts
5915
- import { Command as Command77 } from "commander";
6026
+ import { Command as Command78 } from "commander";
5916
6027
 
5917
6028
  // src/commands/email/register.ts
5918
- import { Command as Command69 } from "commander";
5919
- var registerCommand = new Command69("register").description("Register an email address for this agent").requiredOption("--username <name>", "Desired username (e.g. myagent)").action(async (opts) => {
6029
+ import { Command as Command70 } from "commander";
6030
+ var registerCommand = new Command70("register").description("Register an email address for this agent").requiredOption("--username <name>", "Desired username (e.g. myagent)").action(async (opts) => {
5920
6031
  const check = await apiGet(
5921
6032
  `/api/emails/check-username?username=${encodeURIComponent(opts.username)}`
5922
6033
  );
@@ -5937,8 +6048,8 @@ var registerCommand = new Command69("register").description("Register an email a
5937
6048
  });
5938
6049
 
5939
6050
  // src/commands/email/inbox.ts
5940
- import { Command as Command70 } from "commander";
5941
- var inboxCommand2 = new Command70("inbox").description("List emails in your inbox").option("--limit <n>", "Number of emails to return", "20").option("--unread", "Show only unread emails").action(async (opts) => {
6051
+ import { Command as Command71 } from "commander";
6052
+ var inboxCommand2 = new Command71("inbox").description("List emails in your inbox").option("--limit <n>", "Number of emails to return", "20").option("--unread", "Show only unread emails").action(async (opts) => {
5942
6053
  const keystore = await loadKeystore();
5943
6054
  const params = new URLSearchParams({
5944
6055
  deviceId: keystore.deviceId,
@@ -5953,8 +6064,8 @@ var inboxCommand2 = new Command70("inbox").description("List emails in your inbo
5953
6064
  });
5954
6065
 
5955
6066
  // src/commands/email/read.ts
5956
- import { Command as Command71 } from "commander";
5957
- var readCommand = new Command71("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
6067
+ import { Command as Command72 } from "commander";
6068
+ var readCommand = new Command72("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
5958
6069
  const keystore = await loadKeystore();
5959
6070
  const params = new URLSearchParams({
5960
6071
  deviceId: keystore.deviceId,
@@ -5966,8 +6077,8 @@ var readCommand = new Command71("read").description("Read an email by ID (marks
5966
6077
  });
5967
6078
 
5968
6079
  // src/commands/email/send.ts
5969
- import { Command as Command72 } from "commander";
5970
- var sendCommand = new Command72("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) => {
6080
+ import { Command as Command73 } from "commander";
6081
+ var sendCommand = new Command73("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) => {
5971
6082
  const keystore = await loadKeystore();
5972
6083
  const { data: result, idempotencyKey } = await apiPost("/api/emails/send", {
5973
6084
  deviceId: keystore.deviceId,
@@ -5980,8 +6091,8 @@ var sendCommand = new Command72("send").description("Send an email").requiredOpt
5980
6091
  });
5981
6092
 
5982
6093
  // src/commands/email/reply.ts
5983
- import { Command as Command73 } from "commander";
5984
- var replyCommand = new Command73("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").action(async (id, opts) => {
6094
+ import { Command as Command74 } from "commander";
6095
+ var replyCommand = new Command74("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").action(async (id, opts) => {
5985
6096
  const keystore = await loadKeystore();
5986
6097
  const params = new URLSearchParams({
5987
6098
  deviceId: keystore.deviceId,
@@ -6003,8 +6114,8 @@ var replyCommand = new Command73("reply").description("Reply to an email").argum
6003
6114
  });
6004
6115
 
6005
6116
  // src/commands/email/delete.ts
6006
- import { Command as Command74 } from "commander";
6007
- var deleteCommand = new Command74("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
6117
+ import { Command as Command75 } from "commander";
6118
+ var deleteCommand = new Command75("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
6008
6119
  const keystore = await loadKeystore();
6009
6120
  const { data: result, idempotencyKey } = await apiPost(
6010
6121
  "/api/emails/delete",
@@ -6018,15 +6129,15 @@ var deleteCommand = new Command74("delete").description("Delete an email by ID")
6018
6129
  });
6019
6130
 
6020
6131
  // src/commands/email/address.ts
6021
- import { Command as Command75 } from "commander";
6022
- var addressCommand2 = new Command75("address").description("Show your registered email address").action(async () => {
6132
+ import { Command as Command76 } from "commander";
6133
+ var addressCommand2 = new Command76("address").description("Show your registered email address").action(async () => {
6023
6134
  const keystore = await loadKeystore();
6024
6135
  const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
6025
6136
  printResult({ emailAddress: result.emailAddress ?? null });
6026
6137
  });
6027
6138
 
6028
6139
  // src/commands/email/mark-read.ts
6029
- import { Command as Command76 } from "commander";
6140
+ import { Command as Command77 } from "commander";
6030
6141
  async function setReadStatus(id, read) {
6031
6142
  const keystore = await loadKeystore();
6032
6143
  const { data: result, idempotencyKey } = await apiPost(
@@ -6040,12 +6151,12 @@ async function setReadStatus(id, read) {
6040
6151
  );
6041
6152
  printResult({ id: result.id, isRead: result.isRead }, { idempotencyKey });
6042
6153
  }
6043
- var markReadCommand = new Command76("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) => {
6154
+ var markReadCommand = new Command77("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) => {
6044
6155
  await setReadStatus(id, !opts.unread);
6045
6156
  });
6046
6157
 
6047
6158
  // src/commands/email/index.ts
6048
- var emailCommand = new Command77("email").description("Email management commands");
6159
+ var emailCommand = new Command78("email").description("Email management commands");
6049
6160
  emailCommand.addCommand(registerCommand);
6050
6161
  emailCommand.addCommand(inboxCommand2);
6051
6162
  emailCommand.addCommand(readCommand);
@@ -6056,11 +6167,11 @@ emailCommand.addCommand(addressCommand2);
6056
6167
  emailCommand.addCommand(markReadCommand);
6057
6168
 
6058
6169
  // src/commands/bug/index.ts
6059
- import { Command as Command81 } from "commander";
6170
+ import { Command as Command82 } from "commander";
6060
6171
 
6061
6172
  // src/commands/bug/list.ts
6062
- import { Command as Command78 } from "commander";
6063
- var listCommand = new Command78("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) => {
6173
+ import { Command as Command79 } from "commander";
6174
+ var listCommand = new Command79("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) => {
6064
6175
  if (opts.status && !BUG_REPORT_STATUSES.includes(opts.status)) {
6065
6176
  printError(`--status must be one of ${BUG_REPORT_STATUSES.join(", ")}`);
6066
6177
  return;
@@ -6087,10 +6198,9 @@ var listCommand = new Command78("list").description("List the bug reports you su
6087
6198
  });
6088
6199
 
6089
6200
  // src/commands/bug/show.ts
6090
- import { Command as Command79 } from "commander";
6091
- var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
6092
- var showCommand = new Command79("show").description("Show one of your bug reports, its status and any linked GitHub issue").argument("<id>", "Bug report id").action(async (id) => {
6093
- if (!UUID.test(id)) {
6201
+ import { Command as Command80 } from "commander";
6202
+ var showCommand = new Command80("show").description("Show one of your bug reports, its status and any linked GitHub issue").argument("<id>", "Bug report id").action(async (id) => {
6203
+ if (!GetBugReportInputSchema.safeParse({ id }).success) {
6094
6204
  printError("Bug report id must be a UUID");
6095
6205
  return;
6096
6206
  }
@@ -6107,7 +6217,7 @@ var showCommand = new Command79("show").description("Show one of your bug report
6107
6217
  });
6108
6218
 
6109
6219
  // src/commands/bug/submit.ts
6110
- import { Command as Command80 } from "commander";
6220
+ import { Command as Command81 } from "commander";
6111
6221
 
6112
6222
  // src/commands/bug/context.ts
6113
6223
  import os from "os";
@@ -6128,12 +6238,31 @@ function cliVersionOf(command) {
6128
6238
  }
6129
6239
 
6130
6240
  // src/commands/bug/submit.ts
6131
- async function readStdin() {
6241
+ var LAST_COMMAND_MAX_CHARS = 2048;
6242
+ var LAST_ERROR_MAX_CHARS = 16 * 1024;
6243
+ var STDIN_FIRST_BYTE_MS = 5e3;
6244
+ async function readStdin(firstByteMs) {
6132
6245
  const chunks = [];
6133
- for await (const chunk of process.stdin) chunks.push(Buffer.from(chunk));
6246
+ const iterator = process.stdin[Symbol.asyncIterator]();
6247
+ let timer;
6248
+ const first = await Promise.race([
6249
+ iterator.next(),
6250
+ ...firstByteMs === void 0 ? [] : [new Promise((resolve) => timer = setTimeout(() => resolve(null), firstByteMs))]
6251
+ ]);
6252
+ clearTimeout(timer);
6253
+ if (first === null) {
6254
+ process.stdin.destroy();
6255
+ return null;
6256
+ }
6257
+ if (!first.done) {
6258
+ chunks.push(Buffer.from(first.value));
6259
+ for await (const chunk of { [Symbol.asyncIterator]: () => iterator }) {
6260
+ chunks.push(Buffer.from(chunk));
6261
+ }
6262
+ }
6134
6263
  return Buffer.concat(chunks).toString("utf8");
6135
6264
  }
6136
- var submitCommand = new Command80("submit").description("Report a Taskmarket bug; CLI version, OS, Node version and network are attached").requiredOption("--title <text>", "Short summary (at most 200 characters)").option(
6265
+ var submitCommand = new Command81("submit").description("Report a Taskmarket bug; CLI version, OS, Node version and network are attached").requiredOption("--title <text>", "Short summary (at most 200 characters)").option(
6137
6266
  "--description <text>",
6138
6267
  'What happened and how to reproduce it; read from stdin when omitted or "-"'
6139
6268
  ).option("--severity <level>", `How bad it is: ${BUG_REPORT_SEVERITIES.join(", ")}`, "medium").option("--task <id>", "Task the bug happened on").option("--tx <hash>", "Transaction hash involved").option(
@@ -6146,7 +6275,12 @@ var submitCommand = new Command80("submit").description("Report a Taskmarket bug
6146
6275
  printError("Pass --description or pipe the description on stdin");
6147
6276
  return;
6148
6277
  }
6149
- description = await readStdin();
6278
+ const read = await readStdin(description === "-" ? void 0 : STDIN_FIRST_BYTE_MS);
6279
+ if (read === null) {
6280
+ printError("Pass --description, or pipe the description on stdin");
6281
+ return;
6282
+ }
6283
+ description = read;
6150
6284
  }
6151
6285
  const context = collectBugContext(cliVersionOf(this), { taskId: opts.task, txHash: opts.tx });
6152
6286
  if (opts.includeLastError) {
@@ -6155,14 +6289,19 @@ var submitCommand = new Command80("submit").description("Report a Taskmarket bug
6155
6289
  printError("No failed command is recorded yet; run without --include-last-error");
6156
6290
  return;
6157
6291
  }
6158
- context.command = lastError.command;
6159
- context.error = JSON.stringify({
6160
- message: lastError.message,
6292
+ context.command = lastError.command.slice(0, LAST_COMMAND_MAX_CHARS);
6293
+ const errorJson = (message2) => JSON.stringify({
6294
+ message: message2,
6161
6295
  code: lastError.code,
6162
6296
  status: lastError.status,
6163
6297
  at: lastError.at,
6164
6298
  cliVersion: lastError.cliVersion
6165
6299
  });
6300
+ let message = lastError.message;
6301
+ while (message.length > 0 && errorJson(message).length > LAST_ERROR_MAX_CHARS) {
6302
+ message = message.slice(0, Math.floor(message.length / 2));
6303
+ }
6304
+ context.error = errorJson(message);
6166
6305
  }
6167
6306
  const parsed = SubmitBugReportInputSchema.safeParse({
6168
6307
  title: opts.title,
@@ -6194,7 +6333,7 @@ var submitCommand = new Command80("submit").description("Report a Taskmarket bug
6194
6333
  });
6195
6334
 
6196
6335
  // src/commands/bug/index.ts
6197
- var bugCommand = new Command81("bug").description(
6336
+ var bugCommand = new Command82("bug").description(
6198
6337
  "Report Taskmarket bugs and follow their status"
6199
6338
  );
6200
6339
  bugCommand.addCommand(submitCommand);
@@ -6202,11 +6341,11 @@ bugCommand.addCommand(listCommand);
6202
6341
  bugCommand.addCommand(showCommand);
6203
6342
 
6204
6343
  // src/commands/requester/index.ts
6205
- import { Command as Command83 } from "commander";
6344
+ import { Command as Command84 } from "commander";
6206
6345
 
6207
6346
  // src/commands/requester/stats.ts
6208
- import { Command as Command82 } from "commander";
6209
- var requesterStatsCmd = new Command82("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address) => {
6347
+ import { Command as Command83 } from "commander";
6348
+ var requesterStatsCmd = new Command83("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address) => {
6210
6349
  if (!/^0x[0-9a-fA-F]{40}$/.test(address)) {
6211
6350
  printError("Address must be a 0x-prefixed 20-byte hex string");
6212
6351
  return;
@@ -6220,13 +6359,13 @@ var requesterStatsCmd = new Command82("stats").description("Get requester reputa
6220
6359
  });
6221
6360
 
6222
6361
  // src/commands/requester/index.ts
6223
- var requesterCmd = new Command83("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
6362
+ var requesterCmd = new Command84("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
6224
6363
 
6225
6364
  // src/commands/x402/index.ts
6226
- import { Command as Command87 } from "commander";
6365
+ import { Command as Command88 } from "commander";
6227
6366
 
6228
6367
  // src/commands/x402/payments.ts
6229
- import { Command as Command84, Option as Option4 } from "commander";
6368
+ import { Command as Command85, Option as Option4 } from "commander";
6230
6369
  import { createInterface as createInterface4 } from "readline";
6231
6370
  var PAYMENT_STATES = [
6232
6371
  "reserved",
@@ -6252,7 +6391,7 @@ async function confirmManualResolution() {
6252
6391
  readline.close();
6253
6392
  return answer.trim().toLowerCase() === "resolve";
6254
6393
  }
6255
- var x402PaymentsCommand = new Command84("payments").description(
6394
+ var x402PaymentsCommand = new Command85("payments").description(
6256
6395
  "Inspect and reconcile X402 Pay payment records"
6257
6396
  );
6258
6397
  x402PaymentsCommand.command("list").description("List current payment records").addOption(new Option4("--state <state>", "Filter by state").choices(PAYMENT_STATES)).action(async (options) => {
@@ -6281,7 +6420,7 @@ x402PaymentsCommand.command("resolve").description("Manually record an externall
6281
6420
 
6282
6421
  // src/commands/x402/policy.ts
6283
6422
  import { promises as fs4 } from "fs";
6284
- import { Command as Command85 } from "commander";
6423
+ import { Command as Command86 } from "commander";
6285
6424
  import { createInterface as createInterface5 } from "readline";
6286
6425
  async function confirmUnattendedRule(rule) {
6287
6426
  if (!process.stdin.isTTY) {
@@ -6307,7 +6446,7 @@ async function confirmUnattendedRule(rule) {
6307
6446
  readline.close();
6308
6447
  return answer.trim().toLowerCase() === "authorize";
6309
6448
  }
6310
- var x402PolicyCommand = new Command85("policy").description(
6449
+ var x402PolicyCommand = new Command86("policy").description(
6311
6450
  "Manage local X402 Pay spending policy"
6312
6451
  );
6313
6452
  x402PolicyCommand.command("init").description("Create a deny-all policy file").action(async () => {
@@ -6343,14 +6482,14 @@ for (const enabled of [true, false]) {
6343
6482
  }
6344
6483
 
6345
6484
  // src/commands/x402/request.ts
6346
- import { Command as Command86, Option as Option5 } from "commander";
6485
+ import { Command as Command87, Option as Option5 } from "commander";
6347
6486
  function collect3(value, previous) {
6348
6487
  return [...previous, value];
6349
6488
  }
6350
6489
  function confirm(lines) {
6351
6490
  return confirmAtTerminal(lines, "use --non-interactive with policy");
6352
6491
  }
6353
- var x402RequestCommand = new Command86("request").description("Request and pay for a direct x402 HTTP resource (X402 Pay)").argument("<url>", "HTTPS resource URL").addOption(new Option5("--method <method>", "HTTP method").choices(["GET", "POST"]).default("GET")).option("--json <json>", "Inline JSON POST body").option("--body-file <path>", "Read JSON POST body from a file").option("--headers-file <path>", "Read request headers from an owner-only JSON file").option(
6492
+ var x402RequestCommand = new Command87("request").description("Request and pay for a direct x402 HTTP resource (X402 Pay)").argument("<url>", "HTTPS resource URL").addOption(new Option5("--method <method>", "HTTP method").choices(["GET", "POST"]).default("GET")).option("--json <json>", "Inline JSON POST body").option("--body-file <path>", "Read JSON POST body from a file").option("--headers-file <path>", "Read request headers from an owner-only JSON file").option(
6354
6493
  "--header-env <header=ENV_VAR>",
6355
6494
  "Read one request header from an environment variable (repeatable)",
6356
6495
  collect3,
@@ -6398,7 +6537,7 @@ var x402RequestCommand = new Command86("request").description("Request and pay f
6398
6537
  );
6399
6538
 
6400
6539
  // src/commands/x402/index.ts
6401
- var x402Command = new Command87("x402").description(
6540
+ var x402Command = new Command88("x402").description(
6402
6541
  "Pay x402 services with local spending policies (X402 Pay)"
6403
6542
  );
6404
6543
  x402Command.addCommand(x402RequestCommand);
@@ -6406,10 +6545,10 @@ x402Command.addCommand(x402PolicyCommand);
6406
6545
  x402Command.addCommand(x402PaymentsCommand);
6407
6546
 
6408
6547
  // src/commands/sponsored-task/index.ts
6409
- import { Command as Command102 } from "commander";
6548
+ import { Command as Command103 } from "commander";
6410
6549
 
6411
6550
  // src/commands/sponsored-task/create.ts
6412
- import { Command as Command88 } from "commander";
6551
+ import { Command as Command89 } from "commander";
6413
6552
  import { toHex as toHex4 } from "viem";
6414
6553
 
6415
6554
  // ../../packages/contracts/abi/generated/SponsoredTasksVault.ts
@@ -9631,7 +9770,7 @@ async function approveSponsoredTaskSpend(input) {
9631
9770
  function isValidAddress4(addr) {
9632
9771
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
9633
9772
  }
9634
- var sponsoredTaskCreateCommand = new Command88("create").description("Create a new Sponsored Task vault for a project token").requiredOption("--factory <address>", "SponsoredTaskFactory contract address").requiredOption("--chain-id <id>", "Chain id the factory is deployed on").requiredOption("--token <address>", "Project ERC-20 token address to fund the vault with").option("--owner <address>", "Vault owner (defaults to your own wallet)").action(async (opts) => {
9773
+ var sponsoredTaskCreateCommand = new Command89("create").description("Create a new Sponsored Task vault for a project token").requiredOption("--factory <address>", "SponsoredTaskFactory contract address").requiredOption("--chain-id <id>", "Chain id the factory is deployed on").requiredOption("--token <address>", "Project ERC-20 token address to fund the vault with").option("--owner <address>", "Vault owner (defaults to your own wallet)").action(async (opts) => {
9635
9774
  if (!isValidAddress4(opts.factory) || !isValidAddress4(opts.token)) {
9636
9775
  printError("Invalid Ethereum address for --factory or --token");
9637
9776
  return;
@@ -9668,11 +9807,11 @@ var sponsoredTaskCreateCommand = new Command88("create").description("Create a n
9668
9807
  });
9669
9808
 
9670
9809
  // src/commands/sponsored-task/fund.ts
9671
- import { Command as Command89 } from "commander";
9810
+ import { Command as Command90 } from "commander";
9672
9811
  function isValidAddress5(addr) {
9673
9812
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
9674
9813
  }
9675
- var sponsoredTaskFundCommand = new Command89("fund").description("Fund a Sponsored Task vault with its project token (base units)").requiredOption("--vault <address>", "Vault address").requiredOption("--token <address>", "Project ERC-20 token address").requiredOption("--chain-id <id>", "Chain id the vault is deployed on").requiredOption("--amount <baseUnits>", "Amount to fund, in the token base units").action(async (opts) => {
9814
+ var sponsoredTaskFundCommand = new Command90("fund").description("Fund a Sponsored Task vault with its project token (base units)").requiredOption("--vault <address>", "Vault address").requiredOption("--token <address>", "Project ERC-20 token address").requiredOption("--chain-id <id>", "Chain id the vault is deployed on").requiredOption("--amount <baseUnits>", "Amount to fund, in the token base units").action(async (opts) => {
9676
9815
  if (!isValidAddress5(opts.vault) || !isValidAddress5(opts.token)) {
9677
9816
  printError("Invalid Ethereum address for --vault or --token");
9678
9817
  return;
@@ -9711,7 +9850,7 @@ var sponsoredTaskFundCommand = new Command89("fund").description("Fund a Sponsor
9711
9850
  });
9712
9851
 
9713
9852
  // src/commands/sponsored-task/managers.ts
9714
- import { Command as Command90 } from "commander";
9853
+ import { Command as Command91 } from "commander";
9715
9854
  function isValidAddress6(addr) {
9716
9855
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
9717
9856
  }
@@ -9757,7 +9896,7 @@ async function configure(opts) {
9757
9896
  });
9758
9897
  printResult({ txHash, manager: opts.manager, spendCap: cap.toString(), active: opts.active });
9759
9898
  }
9760
- var sponsoredTaskManagersCommand = new Command90("managers").description(
9899
+ var sponsoredTaskManagersCommand = new Command91("managers").description(
9761
9900
  "Manage authorized managers for a Sponsored Task vault"
9762
9901
  );
9763
9902
  sponsoredTaskManagersCommand.command("add").description("Authorize a manager with a token-denominated spend cap").requiredOption("--vault <address>", "Vault address").requiredOption("--chain-id <id>", "Chain id the vault is deployed on").requiredOption("--manager <address>", "Manager address to authorize").requiredOption("--cap <baseUnits>", "Spend cap, in the project token base units").action((opts) => configure({ ...opts, active: true }));
@@ -9768,8 +9907,8 @@ sponsoredTaskManagersCommand.command("list").description("List a vault authorize
9768
9907
  });
9769
9908
 
9770
9909
  // src/commands/sponsored-task/managed.ts
9771
- import { Command as Command91 } from "commander";
9772
- var sponsoredTaskManagedCommand = new Command91("managed").description(
9910
+ import { Command as Command92 } from "commander";
9911
+ var sponsoredTaskManagedCommand = new Command92("managed").description(
9773
9912
  "List the active Sponsored Task vaults an address can fund tasks from as an active manager (defaults to your wallet)"
9774
9913
  ).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) => {
9775
9914
  let address = opts.address;
@@ -9799,7 +9938,7 @@ var sponsoredTaskManagedCommand = new Command91("managed").description(
9799
9938
  });
9800
9939
 
9801
9940
  // src/commands/sponsored-task/fee-bank.ts
9802
- import { Command as Command92 } from "commander";
9941
+ import { Command as Command93 } from "commander";
9803
9942
  function isValidAddress7(addr) {
9804
9943
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
9805
9944
  }
@@ -9811,7 +9950,7 @@ async function requireKeystore2() {
9811
9950
  return null;
9812
9951
  }
9813
9952
  }
9814
- var sponsoredTaskFeeBankCommand = new Command92("fee-bank").description(
9953
+ var sponsoredTaskFeeBankCommand = new Command93("fee-bank").description(
9815
9954
  "Manage a manager USDC credit balance, charged by the Sponsored Task hook at task creation"
9816
9955
  );
9817
9956
  sponsoredTaskFeeBankCommand.command("deposit").description("Deposit USDC credit for creating sponsored tasks").requiredOption("--fee-bank <address>", "SponsoredTaskFeeBank contract address").requiredOption("--usdc <address>", "USDC token address").requiredOption("--chain-id <id>", "Chain id the fee bank is deployed on").requiredOption("--amount <baseUnits>", "Amount to deposit, in USDC base units (6 decimals)").action(async (opts) => {
@@ -9895,8 +10034,8 @@ sponsoredTaskFeeBankCommand.command("withdraw").description("Withdraw unused USD
9895
10034
  );
9896
10035
 
9897
10036
  // src/commands/sponsored-task/list.ts
9898
- import { Command as Command93 } from "commander";
9899
- var sponsoredTaskListCommand = new Command93("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).action(async (opts) => {
10037
+ import { Command as Command94 } from "commander";
10038
+ var sponsoredTaskListCommand = new Command94("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).action(async (opts) => {
9900
10039
  const params = new URLSearchParams({ limit: opts.limit });
9901
10040
  if (opts.cursor) params.set("cursor", opts.cursor);
9902
10041
  if (opts.includeUnverified) params.set("includeUnverified", "true");
@@ -9905,8 +10044,8 @@ var sponsoredTaskListCommand = new Command93("list").description("List Sponsored
9905
10044
  });
9906
10045
 
9907
10046
  // src/commands/sponsored-task/settlements.ts
9908
- import { Command as Command94 } from "commander";
9909
- var sponsoredTaskSettlementsCommand = new Command94("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) => {
10047
+ import { Command as Command95 } from "commander";
10048
+ var sponsoredTaskSettlementsCommand = new Command95("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) => {
9910
10049
  const limit = Number(opts.limit);
9911
10050
  if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
9912
10051
  printError("--limit must be an integer from 1 to 100");
@@ -9921,17 +10060,17 @@ var sponsoredTaskSettlementsCommand = new Command94("settlements").description("
9921
10060
  });
9922
10061
 
9923
10062
  // src/commands/sponsored-task/show.ts
9924
- import { Command as Command95 } from "commander";
9925
- var sponsoredTaskShowCommand = new Command95("show").description("Show a Sponsored Task vault by id").argument("<vaultId>", "Vault id").action(async (vaultId) => {
10063
+ import { Command as Command96 } from "commander";
10064
+ var sponsoredTaskShowCommand = new Command96("show").description("Show a Sponsored Task vault by id").argument("<vaultId>", "Vault id").action(async (vaultId) => {
9926
10065
  const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}`);
9927
10066
  printResult(result);
9928
10067
  });
9929
10068
 
9930
10069
  // src/commands/sponsored-task/request-review.ts
9931
10070
  import { randomBytes as randomBytes3 } from "crypto";
9932
- import { Command as Command96 } from "commander";
10071
+ import { Command as Command97 } from "commander";
9933
10072
  var REQUEST_TTL_SECONDS = 5 * 60;
9934
- var sponsoredTaskRequestReviewCommand = new Command96("request-review").description("Ask Taskmarket curators to review a Sponsored Task vault (vault owner only)").argument("<vaultId>", "Vault id").action(async (vaultId) => {
10073
+ var sponsoredTaskRequestReviewCommand = new Command97("request-review").description("Ask Taskmarket curators to review a Sponsored Task vault (vault owner only)").argument("<vaultId>", "Vault id").action(async (vaultId) => {
9935
10074
  let keystore;
9936
10075
  try {
9937
10076
  keystore = await loadKeystore();
@@ -9988,18 +10127,18 @@ var sponsoredTaskRequestReviewCommand = new Command96("request-review").descript
9988
10127
  });
9989
10128
 
9990
10129
  // src/commands/sponsored-task/balance.ts
9991
- import { Command as Command97 } from "commander";
9992
- var sponsoredTaskBalanceCommand = new Command97("balance").description("Show a Sponsored Task vault funded/available/reserved balances").argument("<vaultId>", "Vault id").action(async (vaultId) => {
10130
+ import { Command as Command98 } from "commander";
10131
+ var sponsoredTaskBalanceCommand = new Command98("balance").description("Show a Sponsored Task vault funded/available/reserved balances").argument("<vaultId>", "Vault id").action(async (vaultId) => {
9993
10132
  const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}/balance`);
9994
10133
  printResult(result);
9995
10134
  });
9996
10135
 
9997
10136
  // src/commands/sponsored-task/withdraw.ts
9998
- import { Command as Command98 } from "commander";
10137
+ import { Command as Command99 } from "commander";
9999
10138
  function isValidAddress8(addr) {
10000
10139
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
10001
10140
  }
10002
- var sponsoredTaskWithdrawCommand = new Command98("withdraw").description("Withdraw unreserved project tokens from a vault (owner only)").requiredOption("--vault <address>", "Vault address").requiredOption("--chain-id <id>", "Chain id the vault is deployed on").requiredOption("--amount <baseUnits>", "Amount to withdraw, in the project token base units").option("--recipient <address>", "Recipient (defaults to your own wallet)").action(async (opts) => {
10141
+ var sponsoredTaskWithdrawCommand = new Command99("withdraw").description("Withdraw unreserved project tokens from a vault (owner only)").requiredOption("--vault <address>", "Vault address").requiredOption("--chain-id <id>", "Chain id the vault is deployed on").requiredOption("--amount <baseUnits>", "Amount to withdraw, in the project token base units").option("--recipient <address>", "Recipient (defaults to your own wallet)").action(async (opts) => {
10003
10142
  if (!isValidAddress8(opts.vault) || opts.recipient && !isValidAddress8(opts.recipient)) {
10004
10143
  printError("Invalid Ethereum address for --vault or --recipient");
10005
10144
  return;
@@ -10029,11 +10168,11 @@ var sponsoredTaskWithdrawCommand = new Command98("withdraw").description("Withdr
10029
10168
  });
10030
10169
 
10031
10170
  // src/commands/sponsored-task/exit.ts
10032
- import { Command as Command99 } from "commander";
10171
+ import { Command as Command100 } from "commander";
10033
10172
  function isValidAddress9(addr) {
10034
10173
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
10035
10174
  }
10036
- var sponsoredTaskExitCommand = new Command99("exit").description(
10175
+ var sponsoredTaskExitCommand = new Command100("exit").description(
10037
10176
  "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."
10038
10177
  ).requiredOption("--vault <address>", "Vault address").requiredOption("--chain-id <id>", "Chain id the vault is deployed on").option("--recipient <address>", "Recipient (defaults to your own wallet)").option("--yes", "Skip the confirmation prompt", false).action(async (opts) => {
10039
10178
  if (!isValidAddress9(opts.vault) || opts.recipient && !isValidAddress9(opts.recipient)) {
@@ -10069,7 +10208,7 @@ var sponsoredTaskExitCommand = new Command99("exit").description(
10069
10208
  });
10070
10209
 
10071
10210
  // src/commands/sponsored-task/claim.ts
10072
- import { Command as Command100 } from "commander";
10211
+ import { Command as Command101 } from "commander";
10073
10212
  var CLAIM_TO_TYPES = {
10074
10213
  ClaimTo: [
10075
10214
  { name: "vaultId", type: "bytes32" },
@@ -10104,7 +10243,7 @@ async function postClaimWithRetry(path3, body, options = {}) {
10104
10243
  }
10105
10244
  }
10106
10245
  }
10107
- var sponsoredTaskClaimCommand = new Command100("claim").description("Claim your unclaimed Sponsored Task reward for a vault task").argument("<vaultId>", "Vault id").option(
10246
+ var sponsoredTaskClaimCommand = new Command101("claim").description("Claim your unclaimed Sponsored Task reward for a vault task").argument("<vaultId>", "Vault id").option(
10108
10247
  "--task-id <id>",
10109
10248
  "Claim the entitlement for a specific task (defaults to the first unclaimed one)"
10110
10249
  ).action(async (vaultId, opts) => {
@@ -10190,10 +10329,10 @@ var sponsoredTaskClaimCommand = new Command100("claim").description("Claim your
10190
10329
  });
10191
10330
 
10192
10331
  // src/commands/sponsored-task/rewards.ts
10193
- import { Command as Command101 } from "commander";
10332
+ import { Command as Command102 } from "commander";
10194
10333
  var REWARD_STATES = SponsoredTaskRewardStateSchema.options;
10195
10334
  var CLAIM_STATUSES = SponsoredTaskWorkerRewardClaimStatusSchema.options;
10196
- var sponsoredTaskRewardsCommand = new Command101("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(
10335
+ var sponsoredTaskRewardsCommand = new Command102("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(
10197
10336
  async (opts) => {
10198
10337
  let address = opts.address;
10199
10338
  if (address === void 0) {
@@ -10233,7 +10372,7 @@ var sponsoredTaskRewardsCommand = new Command101("rewards").description("List Sp
10233
10372
  );
10234
10373
 
10235
10374
  // src/commands/sponsored-task/index.ts
10236
- var sponsoredTaskCommand = new Command102("sponsored-task").description(
10375
+ var sponsoredTaskCommand = new Command103("sponsored-task").description(
10237
10376
  "Sponsored Task vault administration and reward claims"
10238
10377
  );
10239
10378
  sponsoredTaskCommand.addCommand(sponsoredTaskCreateCommand);
@@ -10254,7 +10393,7 @@ sponsoredTaskCommand.addCommand(sponsoredTaskRewardsCommand);
10254
10393
  // src/index.ts
10255
10394
  var require2 = createRequire(import.meta.url);
10256
10395
  var { version } = require2("../package.json");
10257
- var program = new Command103();
10396
+ var program = new Command104();
10258
10397
  setLastErrorCliVersion(version);
10259
10398
  program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
10260
10399
  program.option(
@@ -10274,6 +10413,7 @@ program.addCommand(initCommand);
10274
10413
  program.addCommand(walletCommand);
10275
10414
  program.addCommand(addressCommand);
10276
10415
  program.addCommand(identityCommand);
10416
+ program.addCommand(whoamiCommand);
10277
10417
  program.addCommand(statsCommand);
10278
10418
  program.addCommand(taskCommand2);
10279
10419
  program.addCommand(agentCommand);