@lucid-agents/taskmarket 1.18.0 → 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-JJUF3KZY.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-W7CXEYST.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-S4A6V3J3.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-75LS6XS6.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 });
@@ -3006,6 +3103,7 @@ async function confirmSettlementAction(name, confirm2, taskId, yes) {
3006
3103
  );
3007
3104
  return false;
3008
3105
  }
3106
+ if (detail.amounts.enforcedStakeAmount === "0") return true;
3009
3107
  const cost = detail.amounts.releaseCostNow;
3010
3108
  if (!cost || BigInt(cost) <= 0n) return true;
3011
3109
  renderFailure(
@@ -3027,7 +3125,7 @@ async function confirmSettlementAction(name, confirm2, taskId, yes) {
3027
3125
  return false;
3028
3126
  }
3029
3127
  function settlementActionCommand(spec) {
3030
- 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)");
3031
3129
  if (spec.confirm === "release-cost") {
3032
3130
  command.option("--yes", "Accept the stake forfeited by releasing now (releaseCostNow)");
3033
3131
  } else if (spec.confirm === "always") {
@@ -3086,7 +3184,7 @@ var settleCmd = settlementActionCommand({
3086
3184
  });
3087
3185
 
3088
3186
  // src/commands/task/index.ts
3089
- var taskCommand2 = new Command45("task").description("Manage tasks");
3187
+ var taskCommand2 = new Command46("task").description("Manage tasks");
3090
3188
  taskCommand2.addCommand(createCmd);
3091
3189
  taskCommand2.addCommand(listCmd);
3092
3190
  taskCommand2.addCommand(getCmd);
@@ -3131,10 +3229,10 @@ taskCommand2.addCommand(reviewCmd);
3131
3229
  taskCommand2.addCommand(startReviewCmd);
3132
3230
 
3133
3231
  // src/commands/agent/index.ts
3134
- import { Command as Command48, Option as Option3 } from "commander";
3232
+ import { Command as Command49, Option as Option3 } from "commander";
3135
3233
 
3136
3234
  // src/commands/agent/credits.ts
3137
- import { Command as Command46 } from "commander";
3235
+ import { Command as Command47 } from "commander";
3138
3236
 
3139
3237
  // src/lib/tty-confirm.ts
3140
3238
  import { createInterface as createInterface2 } from "readline";
@@ -3187,7 +3285,7 @@ function setupLines(plan, pricing) {
3187
3285
  ...rateLines(pricing)
3188
3286
  ];
3189
3287
  }
3190
- var setupCommand = new Command46("setup").description(
3288
+ var setupCommand = new Command47("setup").description(
3191
3289
  "Approve the compute allocation that pays for sandboxes: daily and monthly caps, and optional auto-top-up"
3192
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(
3193
3291
  "--auto-top-up-below <credits>",
@@ -3224,7 +3322,7 @@ var setupCommand = new Command46("setup").description(
3224
3322
  printResult({ config, caps: plan.caps, autoTopUp: plan.autoTopUp ?? null });
3225
3323
  }
3226
3324
  );
3227
- 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) => {
3228
3326
  const config = await loadComputeCreditConfig();
3229
3327
  if (!config) {
3230
3328
  throw new ComputeCreditError(
@@ -3254,17 +3352,17 @@ var buyCommand = new Command46("buy").description("Buy compute credit over x402
3254
3352
  rate: { rateCardVersion: pricing.rateCardVersion, usdPerCredit: pricing.usdPerCredit }
3255
3353
  });
3256
3354
  });
3257
- var statusCommand2 = new Command46("status").description(
3355
+ var statusCommand2 = new Command47("status").description(
3258
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"
3259
3357
  ).action(async () => {
3260
3358
  printResult(await computeCreditStatus());
3261
3359
  });
3262
- var checkCommand = new Command46("check").description(
3360
+ var checkCommand = new Command47("check").description(
3263
3361
  "Check the compute credit balance and, when auto-top-up was approved and the balance is low, buy one chunk"
3264
3362
  ).action(async () => {
3265
3363
  printResult(await checkComputeBalance());
3266
3364
  });
3267
- var reconcileCommand = new Command46("reconcile").description(
3365
+ var reconcileCommand = new Command47("reconcile").description(
3268
3366
  "Settle purchases whose outcome was lost, by their idempotency key; never pays again"
3269
3367
  ).option(
3270
3368
  "--release <key>",
@@ -3311,10 +3409,10 @@ var reconcileCommand = new Command46("reconcile").description(
3311
3409
  ...recoveryError === void 0 ? {} : { recoveryError }
3312
3410
  });
3313
3411
  });
3314
- 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 () => {
3315
3413
  printResult({ config: await disableComputeAutoTopUp() });
3316
3414
  });
3317
- 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);
3318
3416
 
3319
3417
  // src/commands/agent/launch.ts
3320
3418
  var EXPERIMENTAL_AGENT_ENV = "TASKMARKET_EXPERIMENTAL_AGENT";
@@ -3336,7 +3434,7 @@ async function runAgentCommand(options) {
3336
3434
  try {
3337
3435
  const { assertAgentCompatibility } = await import("./compatibility-KUYGZSUC.js");
3338
3436
  const pi = assertAgentCompatibility();
3339
- const { runAgent } = await import("./launch-C5HUFUU2.js");
3437
+ const { runAgent } = await import("./launch-I3NCB5FV.js");
3340
3438
  result = await runAgent({
3341
3439
  model: options.model,
3342
3440
  pi,
@@ -3367,7 +3465,7 @@ async function runAgentCommand(options) {
3367
3465
  }
3368
3466
 
3369
3467
  // src/commands/agent/manage.ts
3370
- import { Command as Command47 } from "commander";
3468
+ import { Command as Command48 } from "commander";
3371
3469
  async function run(options, work, lines) {
3372
3470
  try {
3373
3471
  const value = await work();
@@ -3392,27 +3490,27 @@ async function requireExperimental() {
3392
3490
  );
3393
3491
  }
3394
3492
  function agentManagementCommands() {
3395
- const status = new Command47("status").description(
3493
+ const status = new Command48("status").description(
3396
3494
  "Show the agent channels (locked, charged, refundable), purchases with an unknown outcome, the sandbox and compute credit. Reads only."
3397
3495
  ).option("--json", "Print the versioned JSON envelope").action(async (options) => {
3398
- const { collectAgentStatus, statusLines } = await import("./status-SDLSTJIA.js");
3496
+ const { collectAgentStatus, statusLines } = await import("./status-GNY7YXPE.js");
3399
3497
  await run(options, () => collectAgentStatus(), statusLines);
3400
3498
  });
3401
- const doctor = new Command47("doctor").description(
3499
+ const doctor = new Command48("doctor").description(
3402
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."
3403
3501
  ).option("--json", "Print the versioned JSON envelope").action(async (options) => {
3404
- const { runDoctor, doctorLines } = await import("./doctor-5FUGI42V.js");
3502
+ const { runDoctor, doctorLines } = await import("./doctor-LDSADHSQ.js");
3405
3503
  const report = await run(options, () => runDoctor(), doctorLines);
3406
3504
  if (report && !report.ok) process.exitCode = 1;
3407
3505
  });
3408
- const reconcile = new Command47("reconcile").description(
3506
+ const reconcile = new Command48("reconcile").description(
3409
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."
3410
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(
3411
3509
  "--channel <channel-id>",
3412
3510
  "Reconcile the open purchases of this channel, as status lists it; also reaches retired channels"
3413
3511
  ).option("--json", "Print the versioned JSON envelope").action(
3414
3512
  async (invocationId, options) => {
3415
- const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-Q7XFHDQQ.js");
3513
+ const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-UHDI4QCY.js");
3416
3514
  const choice = { rail: options.rail, channel: options.channel };
3417
3515
  if (invocationId !== void 0) {
3418
3516
  await run(
@@ -3454,7 +3552,7 @@ function agentManagementCommands() {
3454
3552
  );
3455
3553
  }
3456
3554
  );
3457
- const topup = new Command47("topup").description(
3555
+ const topup = new Command48("topup").description(
3458
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"
3459
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) => {
3460
3558
  await run(
@@ -3470,7 +3568,7 @@ function agentManagementCommands() {
3470
3568
  `Not a USDC amount: ${options.amount} (digits, at most 6 decimals)`
3471
3569
  );
3472
3570
  }
3473
- const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-544VRSKF.js");
3571
+ const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-ZMYXFZ72.js");
3474
3572
  const { rails } = await openAgentChannels();
3475
3573
  const result = await requestTopUp(selectRail(rails, options.rail), amount);
3476
3574
  return {
@@ -3483,7 +3581,7 @@ function agentManagementCommands() {
3483
3581
  (view) => [view.note, ...channelLines(view.channel)]
3484
3582
  );
3485
3583
  });
3486
- const close = new Command47("close").description(
3584
+ const close = new Command48("close").description(
3487
3585
  "Close the agent's channel and refund its unused balance cooperatively; checks an earlier close instead of sending it again"
3488
3586
  ).option("--rail <id>", "The rail to close (required when the policy has more than one)").option(
3489
3587
  "--channel <channel-id>",
@@ -3494,8 +3592,8 @@ function agentManagementCommands() {
3494
3592
  async () => {
3495
3593
  await requireExperimental();
3496
3594
  const { AGENT_VIEW_VERSION } = await import("./budget-view-JPZ7HWR2.js");
3497
- const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-544VRSKF.js");
3498
- const { reconcileLeasedPurchase } = await import("./reconcile-Q7XFHDQQ.js");
3595
+ const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-ZMYXFZ72.js");
3596
+ const { reconcileLeasedPurchase } = await import("./reconcile-UHDI4QCY.js");
3499
3597
  const opened = await openAgentChannels();
3500
3598
  const { rail, retired } = selectChannel(opened, options);
3501
3599
  const result = await closeChannel(
@@ -3541,7 +3639,7 @@ function agentManagementCommands() {
3541
3639
  ]
3542
3640
  );
3543
3641
  });
3544
- const pull = new Command47("pull").description(
3642
+ const pull = new Command48("pull").description(
3545
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."
3546
3644
  ).option("--diff", "Print the full diff").option("--apply", "Apply the clean changes without asking").option(
3547
3645
  "--overwrite <path>",
@@ -3566,7 +3664,7 @@ function agentManagementCommands() {
3566
3664
  options,
3567
3665
  async () => {
3568
3666
  await requireExperimental();
3569
- const { runPull } = await import("./sync-pull-TKM4EDGH.js");
3667
+ const { runPull } = await import("./sync-pull-6PWR6CJS.js");
3570
3668
  const { terminalPrompter } = await import("./prompter-LSICEYSQ.js");
3571
3669
  return runPull(options, {
3572
3670
  interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY) && !options.json,
@@ -3594,7 +3692,7 @@ function agentManagementCommands() {
3594
3692
 
3595
3693
  // src/commands/agent/index.ts
3596
3694
  var experimental = agentCommandEnabled();
3597
- var agentCommand = new Command48("agent").description(
3695
+ var agentCommand = new Command49("agent").description(
3598
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"
3599
3697
  ).addOption(
3600
3698
  new Option3("--model <id>", "Start on one model from your approved spending policy").hideHelp(
@@ -3628,8 +3726,8 @@ for (const command of agentManagementCommands()) {
3628
3726
  }
3629
3727
 
3630
3728
  // src/commands/agents.ts
3631
- import { Command as Command49 } from "commander";
3632
- 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) => {
3633
3731
  const params = new URLSearchParams();
3634
3732
  if (opts.sort) params.set("sort", opts.sort);
3635
3733
  if (opts.skill) params.set("skill", opts.skill);
@@ -3640,8 +3738,8 @@ var agentsCommand = new Command49("agents").description("Browse the agent direct
3640
3738
  });
3641
3739
 
3642
3740
  // src/commands/inbox.ts
3643
- import { Command as Command50 } from "commander";
3644
- 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 () => {
3645
3743
  const auth = await signReadAuth();
3646
3744
  if (!auth) {
3647
3745
  printError("No keystore found. Run `taskmarket init` first.");
@@ -3662,8 +3760,8 @@ var inboxCommand = new Command50("inbox").description("Show tasks you created an
3662
3760
  });
3663
3761
 
3664
3762
  // src/commands/actions.ts
3665
- import { Command as Command51 } from "commander";
3666
- 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 () => {
3667
3765
  const auth = await signReadAuth();
3668
3766
  if (!auth) {
3669
3767
  printError("No keystore found. Run `taskmarket init` first.");
@@ -3677,8 +3775,8 @@ var actionsCommand = new Command51("actions").description("Show lifecycle action
3677
3775
  });
3678
3776
 
3679
3777
  // src/commands/deposit.ts
3680
- import { Command as Command52 } from "commander";
3681
- 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 () => {
3682
3780
  let address;
3683
3781
  try {
3684
3782
  address = await getWalletAddress();
@@ -3710,11 +3808,11 @@ var depositCommand = new Command52("deposit").description("Show wallet address a
3710
3808
  });
3711
3809
 
3712
3810
  // src/commands/wallet/index.ts
3713
- import { Command as Command63 } from "commander";
3811
+ import { Command as Command64 } from "commander";
3714
3812
 
3715
3813
  // src/commands/wallet/balance.ts
3716
- import { Command as Command53 } from "commander";
3717
- 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) => {
3718
3816
  let address = opts.address;
3719
3817
  if (!address) {
3720
3818
  const keystore = await loadKeystore();
@@ -3727,7 +3825,7 @@ var walletBalanceCommand = new Command53("balance").description("Show the wallet
3727
3825
  });
3728
3826
 
3729
3827
  // src/commands/wallet/import.ts
3730
- import { Command as Command54 } from "commander";
3828
+ import { Command as Command55 } from "commander";
3731
3829
  import { createInterface as createInterface3 } from "readline";
3732
3830
  import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
3733
3831
  function normalizePrivateKey(raw) {
@@ -3762,7 +3860,7 @@ function promptHiddenInput(prompt) {
3762
3860
  });
3763
3861
  });
3764
3862
  }
3765
- 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(
3766
3864
  "--yes",
3767
3865
  "Confirm legal acceptance non-interactively after reviewing every current policy"
3768
3866
  ).action(async (opts) => {
@@ -3843,7 +3941,7 @@ var walletImportCommand = new Command54("import").description("Import an existin
3843
3941
 
3844
3942
  // src/commands/wallet/set-withdrawal-address.ts
3845
3943
  import { randomBytes as randomBytes2 } from "crypto";
3846
- import { Command as Command55 } from "commander";
3944
+ import { Command as Command56 } from "commander";
3847
3945
 
3848
3946
  // src/lib/withdrawal-pin.ts
3849
3947
  var WithdrawalAddressMismatchError = class extends Error {
@@ -3892,7 +3990,7 @@ var SIGNATURE_TTL_SECONDS = 5 * 60;
3892
3990
  function isValidAddress(addr) {
3893
3991
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
3894
3992
  }
3895
- 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) => {
3896
3994
  if (!isValidAddress(address)) {
3897
3995
  printError("Invalid Ethereum address: must be 0x followed by 40 hex characters");
3898
3996
  return;
@@ -3936,8 +4034,8 @@ var setWithdrawalAddressCommand = new Command55("set-withdrawal-address").descri
3936
4034
  });
3937
4035
 
3938
4036
  // src/commands/wallet/get-withdrawal-address.ts
3939
- import { Command as Command56 } from "commander";
3940
- 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) => {
3941
4039
  let address = opts.address;
3942
4040
  if (!address) {
3943
4041
  const keystore = await loadKeystore();
@@ -3948,14 +4046,14 @@ var getWithdrawalAddressCommand = new Command56("get-withdrawal-address").descri
3948
4046
  });
3949
4047
 
3950
4048
  // src/commands/wallet/change-withdrawal-address.ts
3951
- import { Command as Command57 } from "commander";
4049
+ import { Command as Command58 } from "commander";
3952
4050
  function isValidAddress2(addr) {
3953
4051
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
3954
4052
  }
3955
4053
  function isValidRecoveryCode(code) {
3956
4054
  return /^\d{8}$/.test(code);
3957
4055
  }
3958
- 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) => {
3959
4057
  if (!isValidRecoveryCode(recoveryCode)) {
3960
4058
  printError("Invalid account recovery code: must be 8 digits");
3961
4059
  return;
@@ -3988,8 +4086,8 @@ var changeWithdrawalAddressCommand = new Command57("change-withdrawal-address").
3988
4086
  });
3989
4087
 
3990
4088
  // src/commands/wallet/sync-withdrawal-address.ts
3991
- import { Command as Command58 } from "commander";
3992
- var syncWithdrawalAddressCommand = new Command58("sync-withdrawal-address").description(
4089
+ import { Command as Command59 } from "commander";
4090
+ var syncWithdrawalAddressCommand = new Command59("sync-withdrawal-address").description(
3993
4091
  "Accept the withdrawal address registered on the server as the locally pinned one (after a change made elsewhere, e.g. on the web)"
3994
4092
  ).action(async () => {
3995
4093
  let keystore;
@@ -4018,8 +4116,8 @@ var syncWithdrawalAddressCommand = new Command58("sync-withdrawal-address").desc
4018
4116
  });
4019
4117
 
4020
4118
  // src/commands/wallet/reveal-recovery-code.ts
4021
- import { Command as Command59 } from "commander";
4022
- 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 () => {
4023
4121
  let keystore;
4024
4122
  try {
4025
4123
  keystore = await loadKeystore();
@@ -4044,8 +4142,8 @@ var revealRecoveryCodeCommand = new Command59("reveal-recovery-code").descriptio
4044
4142
  });
4045
4143
 
4046
4144
  // src/commands/wallet/publish-key.ts
4047
- import { Command as Command60 } from "commander";
4048
- 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 () => {
4049
4147
  let keystore;
4050
4148
  try {
4051
4149
  keystore = await loadKeystore();
@@ -4065,13 +4163,13 @@ var publishKeyCommand = new Command60("publish-key").description("Publish your s
4065
4163
  });
4066
4164
 
4067
4165
  // src/commands/wallet/withdraw-dreams.ts
4068
- import { Command as Command61 } from "commander";
4166
+ import { Command as Command62 } from "commander";
4069
4167
  import { toHex } from "viem";
4070
4168
  var AUTHORIZATION_VALIDITY_SECONDS = 300;
4071
4169
  function isValidAddress3(addr) {
4072
4170
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
4073
4171
  }
4074
- 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) => {
4075
4173
  let keystore;
4076
4174
  try {
4077
4175
  keystore = await loadKeystore();
@@ -4102,9 +4200,23 @@ var withdrawDreamsCommand = new Command61("withdraw-dreams").description("Withdr
4102
4200
  return;
4103
4201
  }
4104
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
+ }
4105
4210
  const nonce = toHex(crypto.getRandomValues(new Uint8Array(32)));
4106
4211
  const validBefore = String(Math.floor(Date.now() / 1e3) + AUTHORIZATION_VALIDITY_SECONDS);
4107
- 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
+ });
4108
4220
  const signature = await signMessage(message, keystore);
4109
4221
  const { data: result, idempotencyKey } = await apiPost(
4110
4222
  "/api/wallet/withdraw-dreams",
@@ -4130,7 +4242,7 @@ var withdrawDreamsCommand = new Command61("withdraw-dreams").description("Withdr
4130
4242
  });
4131
4243
 
4132
4244
  // src/commands/wallet/bridge.ts
4133
- import { Command as Command62 } from "commander";
4245
+ import { Command as Command63 } from "commander";
4134
4246
  import { toHex as toHex2 } from "viem";
4135
4247
  var USDC_TYPES = {
4136
4248
  TransferWithAuthorization: [
@@ -4174,7 +4286,7 @@ async function pollBridgeStatus(requestId) {
4174
4286
  await sleep(bridgeTiming.intervalMs);
4175
4287
  }
4176
4288
  }
4177
- var walletBridgeCommand = new Command62("bridge").description(
4289
+ var walletBridgeCommand = new Command63("bridge").description(
4178
4290
  "Move free USDC on Base to OUSD at the same address on Tempo (gasless, through Relay)"
4179
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) => {
4180
4292
  if (opts.to !== "tempo") {
@@ -4304,7 +4416,7 @@ var walletBridgeCommand = new Command62("bridge").description(
4304
4416
  });
4305
4417
 
4306
4418
  // src/commands/wallet/index.ts
4307
- var walletCommand = new Command63("wallet").description("Wallet management commands");
4419
+ var walletCommand = new Command64("wallet").description("Wallet management commands");
4308
4420
  walletCommand.addCommand(walletBalanceCommand);
4309
4421
  walletCommand.addCommand(walletImportCommand);
4310
4422
  walletCommand.addCommand(setWithdrawalAddressCommand);
@@ -4317,7 +4429,7 @@ walletCommand.addCommand(withdrawDreamsCommand);
4317
4429
  walletCommand.addCommand(walletBridgeCommand);
4318
4430
 
4319
4431
  // src/commands/withdraw.ts
4320
- import { Command as Command64 } from "commander";
4432
+ import { Command as Command65 } from "commander";
4321
4433
  import { toHex as toHex3 } from "viem";
4322
4434
  var RECEIVE_POLICY_BLOCKED = "recipient_receive_policy_blocked";
4323
4435
  async function withdrawOnTempo(input) {
@@ -4373,7 +4485,7 @@ var USDC_TYPES2 = {
4373
4485
  { name: "nonce", type: "bytes32" }
4374
4486
  ]
4375
4487
  };
4376
- var withdrawCommand = new Command64("withdraw").description(
4488
+ var withdrawCommand = new Command65("withdraw").description(
4377
4489
  "Withdraw the payment token (USDC on Base, OUSD on Tempo) to the registered withdrawal address"
4378
4490
  ).argument("<amount>", "Amount in whole tokens (e.g. 5 for 5 USDC or 5 OUSD)").action(async (amount) => {
4379
4491
  const parsed = parseFloat(amount);
@@ -4458,9 +4570,9 @@ var withdrawCommand = new Command64("withdraw").description(
4458
4570
  });
4459
4571
 
4460
4572
  // src/commands/encrypt.ts
4461
- import { Command as Command65 } from "commander";
4573
+ import { Command as Command66 } from "commander";
4462
4574
  import { promises as fs2 } from "fs";
4463
- 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) => {
4464
4576
  let plaintext;
4465
4577
  try {
4466
4578
  plaintext = await fs2.readFile(file);
@@ -4508,9 +4620,9 @@ var encryptCommand = new Command65("encrypt").description("Encrypt a file with E
4508
4620
  });
4509
4621
 
4510
4622
  // src/commands/decrypt.ts
4511
- import { Command as Command66 } from "commander";
4623
+ import { Command as Command67 } from "commander";
4512
4624
  import { promises as fs3 } from "fs";
4513
- 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) => {
4514
4626
  let ciphertext;
4515
4627
  try {
4516
4628
  ciphertext = await fs3.readFile(file);
@@ -4550,7 +4662,7 @@ var decryptCommand = new Command66("decrypt").description("Decrypt a file using
4550
4662
  });
4551
4663
 
4552
4664
  // src/commands/xmtp.ts
4553
- import { Command as Command67 } from "commander";
4665
+ import { Command as Command68 } from "commander";
4554
4666
 
4555
4667
  // src/lib/xmtp-client.ts
4556
4668
  import path2 from "path";
@@ -5313,7 +5425,7 @@ function getDefaultQueryTimeoutMs() {
5313
5425
  }
5314
5426
  return Math.floor(parsed);
5315
5427
  }
5316
- 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");
5317
5429
  xmtpCommand.command("init").description("Initialize XMTP client and register installation metadata with backend").action(async () => {
5318
5430
  const keystore = await loadKeystore();
5319
5431
  const client = await createXmtpClient({
@@ -5550,7 +5662,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
5550
5662
  });
5551
5663
 
5552
5664
  // src/commands/daemon.ts
5553
- import { Command as Command68 } from "commander";
5665
+ import { Command as Command69 } from "commander";
5554
5666
  function diffTaskStatuses(prev, next) {
5555
5667
  const changes = [];
5556
5668
  for (const [taskId, newStatus] of next) {
@@ -5578,7 +5690,7 @@ function sleepOrAbort(ms, signal) {
5578
5690
  });
5579
5691
  }
5580
5692
  var MAX_SEEN_TASK_IDS = 2e3;
5581
- 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(
5582
5694
  "--auction-poll-interval <ms>",
5583
5695
  "Poll interval for clock-based auction tasks (dutch/reverse_dutch) in milliseconds",
5584
5696
  "15000"
@@ -5911,11 +6023,11 @@ var daemonCommand = new Command68("daemon").description("Long-running agent daem
5911
6023
  );
5912
6024
 
5913
6025
  // src/commands/email/index.ts
5914
- import { Command as Command77 } from "commander";
6026
+ import { Command as Command78 } from "commander";
5915
6027
 
5916
6028
  // src/commands/email/register.ts
5917
- import { Command as Command69 } from "commander";
5918
- 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) => {
5919
6031
  const check = await apiGet(
5920
6032
  `/api/emails/check-username?username=${encodeURIComponent(opts.username)}`
5921
6033
  );
@@ -5936,8 +6048,8 @@ var registerCommand = new Command69("register").description("Register an email a
5936
6048
  });
5937
6049
 
5938
6050
  // src/commands/email/inbox.ts
5939
- import { Command as Command70 } from "commander";
5940
- 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) => {
5941
6053
  const keystore = await loadKeystore();
5942
6054
  const params = new URLSearchParams({
5943
6055
  deviceId: keystore.deviceId,
@@ -5952,8 +6064,8 @@ var inboxCommand2 = new Command70("inbox").description("List emails in your inbo
5952
6064
  });
5953
6065
 
5954
6066
  // src/commands/email/read.ts
5955
- import { Command as Command71 } from "commander";
5956
- 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) => {
5957
6069
  const keystore = await loadKeystore();
5958
6070
  const params = new URLSearchParams({
5959
6071
  deviceId: keystore.deviceId,
@@ -5965,8 +6077,8 @@ var readCommand = new Command71("read").description("Read an email by ID (marks
5965
6077
  });
5966
6078
 
5967
6079
  // src/commands/email/send.ts
5968
- import { Command as Command72 } from "commander";
5969
- 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) => {
5970
6082
  const keystore = await loadKeystore();
5971
6083
  const { data: result, idempotencyKey } = await apiPost("/api/emails/send", {
5972
6084
  deviceId: keystore.deviceId,
@@ -5979,8 +6091,8 @@ var sendCommand = new Command72("send").description("Send an email").requiredOpt
5979
6091
  });
5980
6092
 
5981
6093
  // src/commands/email/reply.ts
5982
- import { Command as Command73 } from "commander";
5983
- 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) => {
5984
6096
  const keystore = await loadKeystore();
5985
6097
  const params = new URLSearchParams({
5986
6098
  deviceId: keystore.deviceId,
@@ -6002,8 +6114,8 @@ var replyCommand = new Command73("reply").description("Reply to an email").argum
6002
6114
  });
6003
6115
 
6004
6116
  // src/commands/email/delete.ts
6005
- import { Command as Command74 } from "commander";
6006
- 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) => {
6007
6119
  const keystore = await loadKeystore();
6008
6120
  const { data: result, idempotencyKey } = await apiPost(
6009
6121
  "/api/emails/delete",
@@ -6017,15 +6129,15 @@ var deleteCommand = new Command74("delete").description("Delete an email by ID")
6017
6129
  });
6018
6130
 
6019
6131
  // src/commands/email/address.ts
6020
- import { Command as Command75 } from "commander";
6021
- 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 () => {
6022
6134
  const keystore = await loadKeystore();
6023
6135
  const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
6024
6136
  printResult({ emailAddress: result.emailAddress ?? null });
6025
6137
  });
6026
6138
 
6027
6139
  // src/commands/email/mark-read.ts
6028
- import { Command as Command76 } from "commander";
6140
+ import { Command as Command77 } from "commander";
6029
6141
  async function setReadStatus(id, read) {
6030
6142
  const keystore = await loadKeystore();
6031
6143
  const { data: result, idempotencyKey } = await apiPost(
@@ -6039,12 +6151,12 @@ async function setReadStatus(id, read) {
6039
6151
  );
6040
6152
  printResult({ id: result.id, isRead: result.isRead }, { idempotencyKey });
6041
6153
  }
6042
- 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) => {
6043
6155
  await setReadStatus(id, !opts.unread);
6044
6156
  });
6045
6157
 
6046
6158
  // src/commands/email/index.ts
6047
- var emailCommand = new Command77("email").description("Email management commands");
6159
+ var emailCommand = new Command78("email").description("Email management commands");
6048
6160
  emailCommand.addCommand(registerCommand);
6049
6161
  emailCommand.addCommand(inboxCommand2);
6050
6162
  emailCommand.addCommand(readCommand);
@@ -6055,11 +6167,11 @@ emailCommand.addCommand(addressCommand2);
6055
6167
  emailCommand.addCommand(markReadCommand);
6056
6168
 
6057
6169
  // src/commands/bug/index.ts
6058
- import { Command as Command81 } from "commander";
6170
+ import { Command as Command82 } from "commander";
6059
6171
 
6060
6172
  // src/commands/bug/list.ts
6061
- import { Command as Command78 } from "commander";
6062
- 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) => {
6063
6175
  if (opts.status && !BUG_REPORT_STATUSES.includes(opts.status)) {
6064
6176
  printError(`--status must be one of ${BUG_REPORT_STATUSES.join(", ")}`);
6065
6177
  return;
@@ -6086,10 +6198,9 @@ var listCommand = new Command78("list").description("List the bug reports you su
6086
6198
  });
6087
6199
 
6088
6200
  // src/commands/bug/show.ts
6089
- import { Command as Command79 } from "commander";
6090
- var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
6091
- 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) => {
6092
- 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) {
6093
6204
  printError("Bug report id must be a UUID");
6094
6205
  return;
6095
6206
  }
@@ -6106,7 +6217,7 @@ var showCommand = new Command79("show").description("Show one of your bug report
6106
6217
  });
6107
6218
 
6108
6219
  // src/commands/bug/submit.ts
6109
- import { Command as Command80 } from "commander";
6220
+ import { Command as Command81 } from "commander";
6110
6221
 
6111
6222
  // src/commands/bug/context.ts
6112
6223
  import os from "os";
@@ -6127,12 +6238,31 @@ function cliVersionOf(command) {
6127
6238
  }
6128
6239
 
6129
6240
  // src/commands/bug/submit.ts
6130
- 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) {
6131
6245
  const chunks = [];
6132
- 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
+ }
6133
6263
  return Buffer.concat(chunks).toString("utf8");
6134
6264
  }
6135
- 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(
6136
6266
  "--description <text>",
6137
6267
  'What happened and how to reproduce it; read from stdin when omitted or "-"'
6138
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(
@@ -6145,7 +6275,12 @@ var submitCommand = new Command80("submit").description("Report a Taskmarket bug
6145
6275
  printError("Pass --description or pipe the description on stdin");
6146
6276
  return;
6147
6277
  }
6148
- 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;
6149
6284
  }
6150
6285
  const context = collectBugContext(cliVersionOf(this), { taskId: opts.task, txHash: opts.tx });
6151
6286
  if (opts.includeLastError) {
@@ -6154,14 +6289,19 @@ var submitCommand = new Command80("submit").description("Report a Taskmarket bug
6154
6289
  printError("No failed command is recorded yet; run without --include-last-error");
6155
6290
  return;
6156
6291
  }
6157
- context.command = lastError.command;
6158
- context.error = JSON.stringify({
6159
- message: lastError.message,
6292
+ context.command = lastError.command.slice(0, LAST_COMMAND_MAX_CHARS);
6293
+ const errorJson = (message2) => JSON.stringify({
6294
+ message: message2,
6160
6295
  code: lastError.code,
6161
6296
  status: lastError.status,
6162
6297
  at: lastError.at,
6163
6298
  cliVersion: lastError.cliVersion
6164
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);
6165
6305
  }
6166
6306
  const parsed = SubmitBugReportInputSchema.safeParse({
6167
6307
  title: opts.title,
@@ -6193,7 +6333,7 @@ var submitCommand = new Command80("submit").description("Report a Taskmarket bug
6193
6333
  });
6194
6334
 
6195
6335
  // src/commands/bug/index.ts
6196
- var bugCommand = new Command81("bug").description(
6336
+ var bugCommand = new Command82("bug").description(
6197
6337
  "Report Taskmarket bugs and follow their status"
6198
6338
  );
6199
6339
  bugCommand.addCommand(submitCommand);
@@ -6201,11 +6341,11 @@ bugCommand.addCommand(listCommand);
6201
6341
  bugCommand.addCommand(showCommand);
6202
6342
 
6203
6343
  // src/commands/requester/index.ts
6204
- import { Command as Command83 } from "commander";
6344
+ import { Command as Command84 } from "commander";
6205
6345
 
6206
6346
  // src/commands/requester/stats.ts
6207
- import { Command as Command82 } from "commander";
6208
- 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) => {
6209
6349
  if (!/^0x[0-9a-fA-F]{40}$/.test(address)) {
6210
6350
  printError("Address must be a 0x-prefixed 20-byte hex string");
6211
6351
  return;
@@ -6219,13 +6359,13 @@ var requesterStatsCmd = new Command82("stats").description("Get requester reputa
6219
6359
  });
6220
6360
 
6221
6361
  // src/commands/requester/index.ts
6222
- var requesterCmd = new Command83("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
6362
+ var requesterCmd = new Command84("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
6223
6363
 
6224
6364
  // src/commands/x402/index.ts
6225
- import { Command as Command87 } from "commander";
6365
+ import { Command as Command88 } from "commander";
6226
6366
 
6227
6367
  // src/commands/x402/payments.ts
6228
- import { Command as Command84, Option as Option4 } from "commander";
6368
+ import { Command as Command85, Option as Option4 } from "commander";
6229
6369
  import { createInterface as createInterface4 } from "readline";
6230
6370
  var PAYMENT_STATES = [
6231
6371
  "reserved",
@@ -6251,7 +6391,7 @@ async function confirmManualResolution() {
6251
6391
  readline.close();
6252
6392
  return answer.trim().toLowerCase() === "resolve";
6253
6393
  }
6254
- var x402PaymentsCommand = new Command84("payments").description(
6394
+ var x402PaymentsCommand = new Command85("payments").description(
6255
6395
  "Inspect and reconcile X402 Pay payment records"
6256
6396
  );
6257
6397
  x402PaymentsCommand.command("list").description("List current payment records").addOption(new Option4("--state <state>", "Filter by state").choices(PAYMENT_STATES)).action(async (options) => {
@@ -6280,7 +6420,7 @@ x402PaymentsCommand.command("resolve").description("Manually record an externall
6280
6420
 
6281
6421
  // src/commands/x402/policy.ts
6282
6422
  import { promises as fs4 } from "fs";
6283
- import { Command as Command85 } from "commander";
6423
+ import { Command as Command86 } from "commander";
6284
6424
  import { createInterface as createInterface5 } from "readline";
6285
6425
  async function confirmUnattendedRule(rule) {
6286
6426
  if (!process.stdin.isTTY) {
@@ -6306,7 +6446,7 @@ async function confirmUnattendedRule(rule) {
6306
6446
  readline.close();
6307
6447
  return answer.trim().toLowerCase() === "authorize";
6308
6448
  }
6309
- var x402PolicyCommand = new Command85("policy").description(
6449
+ var x402PolicyCommand = new Command86("policy").description(
6310
6450
  "Manage local X402 Pay spending policy"
6311
6451
  );
6312
6452
  x402PolicyCommand.command("init").description("Create a deny-all policy file").action(async () => {
@@ -6342,14 +6482,14 @@ for (const enabled of [true, false]) {
6342
6482
  }
6343
6483
 
6344
6484
  // src/commands/x402/request.ts
6345
- import { Command as Command86, Option as Option5 } from "commander";
6485
+ import { Command as Command87, Option as Option5 } from "commander";
6346
6486
  function collect3(value, previous) {
6347
6487
  return [...previous, value];
6348
6488
  }
6349
6489
  function confirm(lines) {
6350
6490
  return confirmAtTerminal(lines, "use --non-interactive with policy");
6351
6491
  }
6352
- 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(
6353
6493
  "--header-env <header=ENV_VAR>",
6354
6494
  "Read one request header from an environment variable (repeatable)",
6355
6495
  collect3,
@@ -6397,7 +6537,7 @@ var x402RequestCommand = new Command86("request").description("Request and pay f
6397
6537
  );
6398
6538
 
6399
6539
  // src/commands/x402/index.ts
6400
- var x402Command = new Command87("x402").description(
6540
+ var x402Command = new Command88("x402").description(
6401
6541
  "Pay x402 services with local spending policies (X402 Pay)"
6402
6542
  );
6403
6543
  x402Command.addCommand(x402RequestCommand);
@@ -6405,10 +6545,10 @@ x402Command.addCommand(x402PolicyCommand);
6405
6545
  x402Command.addCommand(x402PaymentsCommand);
6406
6546
 
6407
6547
  // src/commands/sponsored-task/index.ts
6408
- import { Command as Command102 } from "commander";
6548
+ import { Command as Command103 } from "commander";
6409
6549
 
6410
6550
  // src/commands/sponsored-task/create.ts
6411
- import { Command as Command88 } from "commander";
6551
+ import { Command as Command89 } from "commander";
6412
6552
  import { toHex as toHex4 } from "viem";
6413
6553
 
6414
6554
  // ../../packages/contracts/abi/generated/SponsoredTasksVault.ts
@@ -9630,7 +9770,7 @@ async function approveSponsoredTaskSpend(input) {
9630
9770
  function isValidAddress4(addr) {
9631
9771
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
9632
9772
  }
9633
- 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) => {
9634
9774
  if (!isValidAddress4(opts.factory) || !isValidAddress4(opts.token)) {
9635
9775
  printError("Invalid Ethereum address for --factory or --token");
9636
9776
  return;
@@ -9667,11 +9807,11 @@ var sponsoredTaskCreateCommand = new Command88("create").description("Create a n
9667
9807
  });
9668
9808
 
9669
9809
  // src/commands/sponsored-task/fund.ts
9670
- import { Command as Command89 } from "commander";
9810
+ import { Command as Command90 } from "commander";
9671
9811
  function isValidAddress5(addr) {
9672
9812
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
9673
9813
  }
9674
- 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) => {
9675
9815
  if (!isValidAddress5(opts.vault) || !isValidAddress5(opts.token)) {
9676
9816
  printError("Invalid Ethereum address for --vault or --token");
9677
9817
  return;
@@ -9710,7 +9850,7 @@ var sponsoredTaskFundCommand = new Command89("fund").description("Fund a Sponsor
9710
9850
  });
9711
9851
 
9712
9852
  // src/commands/sponsored-task/managers.ts
9713
- import { Command as Command90 } from "commander";
9853
+ import { Command as Command91 } from "commander";
9714
9854
  function isValidAddress6(addr) {
9715
9855
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
9716
9856
  }
@@ -9756,7 +9896,7 @@ async function configure(opts) {
9756
9896
  });
9757
9897
  printResult({ txHash, manager: opts.manager, spendCap: cap.toString(), active: opts.active });
9758
9898
  }
9759
- var sponsoredTaskManagersCommand = new Command90("managers").description(
9899
+ var sponsoredTaskManagersCommand = new Command91("managers").description(
9760
9900
  "Manage authorized managers for a Sponsored Task vault"
9761
9901
  );
9762
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 }));
@@ -9767,8 +9907,8 @@ sponsoredTaskManagersCommand.command("list").description("List a vault authorize
9767
9907
  });
9768
9908
 
9769
9909
  // src/commands/sponsored-task/managed.ts
9770
- import { Command as Command91 } from "commander";
9771
- var sponsoredTaskManagedCommand = new Command91("managed").description(
9910
+ import { Command as Command92 } from "commander";
9911
+ var sponsoredTaskManagedCommand = new Command92("managed").description(
9772
9912
  "List the active Sponsored Task vaults an address can fund tasks from as an active manager (defaults to your wallet)"
9773
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) => {
9774
9914
  let address = opts.address;
@@ -9798,7 +9938,7 @@ var sponsoredTaskManagedCommand = new Command91("managed").description(
9798
9938
  });
9799
9939
 
9800
9940
  // src/commands/sponsored-task/fee-bank.ts
9801
- import { Command as Command92 } from "commander";
9941
+ import { Command as Command93 } from "commander";
9802
9942
  function isValidAddress7(addr) {
9803
9943
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
9804
9944
  }
@@ -9810,7 +9950,7 @@ async function requireKeystore2() {
9810
9950
  return null;
9811
9951
  }
9812
9952
  }
9813
- var sponsoredTaskFeeBankCommand = new Command92("fee-bank").description(
9953
+ var sponsoredTaskFeeBankCommand = new Command93("fee-bank").description(
9814
9954
  "Manage a manager USDC credit balance, charged by the Sponsored Task hook at task creation"
9815
9955
  );
9816
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) => {
@@ -9894,8 +10034,8 @@ sponsoredTaskFeeBankCommand.command("withdraw").description("Withdraw unused USD
9894
10034
  );
9895
10035
 
9896
10036
  // src/commands/sponsored-task/list.ts
9897
- import { Command as Command93 } from "commander";
9898
- 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) => {
9899
10039
  const params = new URLSearchParams({ limit: opts.limit });
9900
10040
  if (opts.cursor) params.set("cursor", opts.cursor);
9901
10041
  if (opts.includeUnverified) params.set("includeUnverified", "true");
@@ -9904,8 +10044,8 @@ var sponsoredTaskListCommand = new Command93("list").description("List Sponsored
9904
10044
  });
9905
10045
 
9906
10046
  // src/commands/sponsored-task/settlements.ts
9907
- import { Command as Command94 } from "commander";
9908
- 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) => {
9909
10049
  const limit = Number(opts.limit);
9910
10050
  if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
9911
10051
  printError("--limit must be an integer from 1 to 100");
@@ -9920,17 +10060,17 @@ var sponsoredTaskSettlementsCommand = new Command94("settlements").description("
9920
10060
  });
9921
10061
 
9922
10062
  // src/commands/sponsored-task/show.ts
9923
- import { Command as Command95 } from "commander";
9924
- 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) => {
9925
10065
  const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}`);
9926
10066
  printResult(result);
9927
10067
  });
9928
10068
 
9929
10069
  // src/commands/sponsored-task/request-review.ts
9930
10070
  import { randomBytes as randomBytes3 } from "crypto";
9931
- import { Command as Command96 } from "commander";
10071
+ import { Command as Command97 } from "commander";
9932
10072
  var REQUEST_TTL_SECONDS = 5 * 60;
9933
- 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) => {
9934
10074
  let keystore;
9935
10075
  try {
9936
10076
  keystore = await loadKeystore();
@@ -9987,18 +10127,18 @@ var sponsoredTaskRequestReviewCommand = new Command96("request-review").descript
9987
10127
  });
9988
10128
 
9989
10129
  // src/commands/sponsored-task/balance.ts
9990
- import { Command as Command97 } from "commander";
9991
- 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) => {
9992
10132
  const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}/balance`);
9993
10133
  printResult(result);
9994
10134
  });
9995
10135
 
9996
10136
  // src/commands/sponsored-task/withdraw.ts
9997
- import { Command as Command98 } from "commander";
10137
+ import { Command as Command99 } from "commander";
9998
10138
  function isValidAddress8(addr) {
9999
10139
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
10000
10140
  }
10001
- 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) => {
10002
10142
  if (!isValidAddress8(opts.vault) || opts.recipient && !isValidAddress8(opts.recipient)) {
10003
10143
  printError("Invalid Ethereum address for --vault or --recipient");
10004
10144
  return;
@@ -10028,11 +10168,11 @@ var sponsoredTaskWithdrawCommand = new Command98("withdraw").description("Withdr
10028
10168
  });
10029
10169
 
10030
10170
  // src/commands/sponsored-task/exit.ts
10031
- import { Command as Command99 } from "commander";
10171
+ import { Command as Command100 } from "commander";
10032
10172
  function isValidAddress9(addr) {
10033
10173
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
10034
10174
  }
10035
- var sponsoredTaskExitCommand = new Command99("exit").description(
10175
+ var sponsoredTaskExitCommand = new Command100("exit").description(
10036
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."
10037
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) => {
10038
10178
  if (!isValidAddress9(opts.vault) || opts.recipient && !isValidAddress9(opts.recipient)) {
@@ -10068,7 +10208,7 @@ var sponsoredTaskExitCommand = new Command99("exit").description(
10068
10208
  });
10069
10209
 
10070
10210
  // src/commands/sponsored-task/claim.ts
10071
- import { Command as Command100 } from "commander";
10211
+ import { Command as Command101 } from "commander";
10072
10212
  var CLAIM_TO_TYPES = {
10073
10213
  ClaimTo: [
10074
10214
  { name: "vaultId", type: "bytes32" },
@@ -10103,7 +10243,7 @@ async function postClaimWithRetry(path3, body, options = {}) {
10103
10243
  }
10104
10244
  }
10105
10245
  }
10106
- 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(
10107
10247
  "--task-id <id>",
10108
10248
  "Claim the entitlement for a specific task (defaults to the first unclaimed one)"
10109
10249
  ).action(async (vaultId, opts) => {
@@ -10189,10 +10329,10 @@ var sponsoredTaskClaimCommand = new Command100("claim").description("Claim your
10189
10329
  });
10190
10330
 
10191
10331
  // src/commands/sponsored-task/rewards.ts
10192
- import { Command as Command101 } from "commander";
10332
+ import { Command as Command102 } from "commander";
10193
10333
  var REWARD_STATES = SponsoredTaskRewardStateSchema.options;
10194
10334
  var CLAIM_STATUSES = SponsoredTaskWorkerRewardClaimStatusSchema.options;
10195
- 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(
10196
10336
  async (opts) => {
10197
10337
  let address = opts.address;
10198
10338
  if (address === void 0) {
@@ -10232,7 +10372,7 @@ var sponsoredTaskRewardsCommand = new Command101("rewards").description("List Sp
10232
10372
  );
10233
10373
 
10234
10374
  // src/commands/sponsored-task/index.ts
10235
- var sponsoredTaskCommand = new Command102("sponsored-task").description(
10375
+ var sponsoredTaskCommand = new Command103("sponsored-task").description(
10236
10376
  "Sponsored Task vault administration and reward claims"
10237
10377
  );
10238
10378
  sponsoredTaskCommand.addCommand(sponsoredTaskCreateCommand);
@@ -10253,7 +10393,7 @@ sponsoredTaskCommand.addCommand(sponsoredTaskRewardsCommand);
10253
10393
  // src/index.ts
10254
10394
  var require2 = createRequire(import.meta.url);
10255
10395
  var { version } = require2("../package.json");
10256
- var program = new Command103();
10396
+ var program = new Command104();
10257
10397
  setLastErrorCliVersion(version);
10258
10398
  program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
10259
10399
  program.option(
@@ -10273,6 +10413,7 @@ program.addCommand(initCommand);
10273
10413
  program.addCommand(walletCommand);
10274
10414
  program.addCommand(addressCommand);
10275
10415
  program.addCommand(identityCommand);
10416
+ program.addCommand(whoamiCommand);
10276
10417
  program.addCommand(statsCommand);
10277
10418
  program.addCommand(taskCommand2);
10278
10419
  program.addCommand(agentCommand);