@lucid-agents/taskmarket 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +161 -93
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ var __export = (target, all) => {
6
6
  };
7
7
 
8
8
  // src/index.ts
9
- import { Command as Command55 } from "commander";
9
+ import { Command as Command58 } from "commander";
10
10
  import { createRequire } from "module";
11
11
 
12
12
  // src/commands/init.ts
@@ -492,7 +492,7 @@ var statsCommand = new Command4("stats").description("View agent statistics").op
492
492
  });
493
493
 
494
494
  // src/commands/task/index.ts
495
- import { Command as Command32 } from "commander";
495
+ import { Command as Command33 } from "commander";
496
496
 
497
497
  // src/commands/task/create.ts
498
498
  import { Command as Command5 } from "commander";
@@ -785,13 +785,7 @@ var submitCmd = new Command8("submit").description("Submit work for a task").arg
785
785
 
786
786
  // src/commands/task/accept.ts
787
787
  import { Command as Command9 } from "commander";
788
- var acceptCmd = new Command9("accept").description("Accept a submission (costs 0.001 USDC)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--worker <addr>", "Worker wallet address").option(
789
- "--deliverable <hash>",
790
- "Deliverable hash to commit on-chain (32-byte hex). Backend will look it up from the submission if omitted."
791
- ).action(async (taskId, opts) => {
792
- if (opts.deliverable && !/^0x[0-9a-fA-F]{64}$/.test(opts.deliverable)) {
793
- throw new Error("--deliverable must be a 0x-prefixed 32-byte hex string (0x + 64 hex chars)");
794
- }
788
+ var acceptCmd = new Command9("accept").description("Accept a submission (costs 0.001 USDC)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--worker <addr>", "Worker wallet address").action(async (taskId, opts) => {
795
789
  const task = await apiGet(`/api/tasks/${taskId}`);
796
790
  if (!task) {
797
791
  printError("Task not found");
@@ -816,8 +810,7 @@ var acceptCmd = new Command9("accept").description("Accept a submission (costs 0
816
810
  }
817
811
  await x402Post(`/api/tasks/${taskId}/accept`, {
818
812
  taskId,
819
- worker: opts.worker,
820
- ...opts.deliverable ? { deliverable: opts.deliverable } : {}
813
+ worker: opts.worker
821
814
  });
822
815
  printResult({ accepted: true });
823
816
  });
@@ -826,12 +819,10 @@ var acceptCmd = new Command9("accept").description("Accept a submission (costs 0
826
819
  import { Command as Command10 } from "commander";
827
820
  function parseWinner(spec) {
828
821
  const parts = spec.split(":");
829
- if (parts.length < 2 || parts.length > 4) {
830
- throw new Error(
831
- `Invalid --winner value "${spec}". Expected <addr>:<share>[:<submissionId>][:<deliverable>]`
832
- );
822
+ if (parts.length !== 2) {
823
+ throw new Error(`Invalid --winner value "${spec}". Expected <addr>:<share>`);
833
824
  }
834
- const [worker, shareStr, submissionId, deliverable] = parts;
825
+ const [worker, shareStr] = parts;
835
826
  if (!/^0x[0-9a-fA-F]{40}$/.test(worker)) {
836
827
  throw new Error(`Invalid worker address in "${spec}"`);
837
828
  }
@@ -839,22 +830,11 @@ function parseWinner(spec) {
839
830
  if (Number.isNaN(share) || share < 1 || share > 1e4) {
840
831
  throw new Error(`Invalid share in "${spec}" \u2014 must be integer 1..10000 (basis points)`);
841
832
  }
842
- if (deliverable && !/^0x[0-9a-fA-F]{64}$/.test(deliverable)) {
843
- throw new Error(`Invalid deliverable hash in "${spec}" \u2014 must be 0x + 64 hex chars`);
844
- }
845
- return {
846
- worker,
847
- share,
848
- ...submissionId ? { submissionId } : {},
849
- ...deliverable ? { deliverable } : {}
850
- };
833
+ return { worker, share };
851
834
  }
852
835
  var acceptSubmissionsCmd = new Command10("accept-submissions").description(
853
- "Accept N submissions for a Bounty/Benchmark task with explicit share basis points (costs 0.001 USDC).\nShares must sum to 10000. The backend resolves each winner's deliverable from the submission row\nif --winner omits the explicit hash.\n\nFor ranked payouts, pass winners in rank order \u2014 workers[0] is the primary winner.\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-uuid --winner 0xBob:5000:sub-uuid2"
854
- ).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption(
855
- "--winner <spec...>",
856
- "Winner spec <addr>:<share>[:<submissionId>][:<deliverable>]. Pass multiple times."
857
- ).action(async (taskId, opts) => {
836
+ "Accept N submissions for a Bounty/Benchmark task with explicit share basis points (costs 0.001 USDC).\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\nExample:\n task accept-submissions 0x\u2026 --winner 0xAlice:5000 --winner 0xBob:3000 --winner 0xCarol:2000"
837
+ ).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--winner <spec...>", "Winner spec <addr>:<share>. Pass multiple times.").action(async (taskId, opts) => {
858
838
  let winners;
859
839
  try {
860
840
  winners = opts.winner.map(parseWinner);
@@ -1096,9 +1076,61 @@ var rejectSubmissionCmd = new Command23("reject-submission").description(
1096
1076
  }
1097
1077
  });
1098
1078
 
1099
- // src/commands/task/my-submissions.ts
1079
+ // src/commands/task/reject-all-submissions.ts
1100
1080
  import { Command as Command24 } from "commander";
1101
- var mySubmissionsCmd = new Command24("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) => {
1081
+ var rejectAllSubmissionsCmd = new Command24("reject-all-submissions").description(
1082
+ "Reject every active submission on a bounty or benchmark task in one go. Reads pending reject_submission actions from the task, rejects each worker in sequence, then cancels the task. Use this to recover escrow when all submitted work is unsuitable."
1083
+ ).argument("<taskId>", "Task ID (0x-prefixed hex)").option("--no-cancel", "Reject all submissions but do not cancel the task afterward").action(async (taskId, opts) => {
1084
+ let task;
1085
+ try {
1086
+ task = await apiGet(`/api/tasks/${taskId}`);
1087
+ } catch (err) {
1088
+ return printError(err instanceof Error ? err.message : String(err));
1089
+ }
1090
+ const rejectActions = (task.pendingActions ?? []).filter(
1091
+ (a) => a.action === "reject_submission" && a.worker
1092
+ );
1093
+ if (rejectActions.length === 0) {
1094
+ printResult({ rejected: 0, message: "no active submissions to reject" });
1095
+ return;
1096
+ }
1097
+ const results = [];
1098
+ for (const action of rejectActions) {
1099
+ const worker = action.worker;
1100
+ try {
1101
+ const res = await x402Post(`/api/tasks/${taskId}/reject-submission`, {
1102
+ taskId,
1103
+ worker
1104
+ });
1105
+ results.push({ worker, txHash: res.txHash });
1106
+ } catch (err) {
1107
+ results.push({ worker, error: err instanceof Error ? err.message : String(err) });
1108
+ }
1109
+ }
1110
+ const failed = results.filter((r) => r.error);
1111
+ if (failed.length > 0) {
1112
+ return printError(
1113
+ `${failed.length} of ${results.length} rejection(s) failed: ` + failed.map((r) => `${r.worker}: ${r.error}`).join("; ")
1114
+ );
1115
+ }
1116
+ if (!opts.cancel) {
1117
+ printResult({ rejected: results.length, results });
1118
+ return;
1119
+ }
1120
+ let cancelRes;
1121
+ try {
1122
+ cancelRes = await x402Post(`/api/tasks/${taskId}/cancel`, { taskId });
1123
+ } catch (err) {
1124
+ return printError(
1125
+ `All ${results.length} submission(s) rejected but cancel failed: ${err instanceof Error ? err.message : String(err)}`
1126
+ );
1127
+ }
1128
+ printResult({ rejected: results.length, results, cancelTxHash: cancelRes.txHash });
1129
+ });
1130
+
1131
+ // src/commands/task/my-submissions.ts
1132
+ import { Command as Command25 } from "commander";
1133
+ var mySubmissionsCmd = new Command25("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) => {
1102
1134
  try {
1103
1135
  let address = opts.address;
1104
1136
  if (!address) {
@@ -1116,13 +1148,13 @@ var mySubmissionsCmd = new Command24("my-submissions").description("List all sub
1116
1148
  });
1117
1149
 
1118
1150
  // src/commands/task/update.ts
1119
- import { Command as Command25 } from "commander";
1151
+ import { Command as Command26 } from "commander";
1120
1152
  function toBaseUnits(humanUsdc) {
1121
1153
  const [intPart = "0", fracPart = ""] = humanUsdc.trim().split(".");
1122
1154
  const padded = fracPart.slice(0, 6).padEnd(6, "0");
1123
1155
  return (BigInt(intPart) * 1000000n + BigInt(padded)).toString();
1124
1156
  }
1125
- var updateCmd = new Command25("update").description("Update an open task (costs 0.001 USDC)").argument("<taskId>", "Task ID (0x-prefixed hex)").option("--reward <usdc>", 'New reward in USDC (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 <usdc>", "New auction floor price in USDC").option("--auction-start-price <usdc>", "New auction start price in USDC").option("--description <text>", "New description").option("--tags <csv>", "New tags (comma-separated)").option("--metric-description <text>", "New metric description").action(
1157
+ var updateCmd = new Command26("update").description("Update an open task (costs 0.001 USDC)").argument("<taskId>", "Task ID (0x-prefixed hex)").option("--reward <usdc>", 'New reward in USDC (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 <usdc>", "New auction floor price in USDC").option("--auction-start-price <usdc>", "New auction start price in USDC").option("--description <text>", "New description").option("--tags <csv>", "New tags (comma-separated)").option("--metric-description <text>", "New metric description").action(
1126
1158
  async (taskId, opts) => {
1127
1159
  const body = { taskId };
1128
1160
  if (opts.reward !== void 0) {
@@ -1177,8 +1209,8 @@ var updateCmd = new Command25("update").description("Update an open task (costs
1177
1209
  );
1178
1210
 
1179
1211
  // src/commands/task/forfeit.ts
1180
- import { Command as Command26 } from "commander";
1181
- var forfeitCmd = new Command26("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) => {
1212
+ import { Command as Command27 } from "commander";
1213
+ var forfeitCmd = new Command27("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) => {
1182
1214
  try {
1183
1215
  const keystore = await loadKeystore();
1184
1216
  const message = `taskmarket:forfeit:${taskId}`;
@@ -1195,8 +1227,8 @@ var forfeitCmd = new Command26("forfeit").description("Reclaim a claim-mode task
1195
1227
  });
1196
1228
 
1197
1229
  // src/commands/task/evaluate.ts
1198
- import { Command as Command27 } from "commander";
1199
- var evaluateCmd = new Command27("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(
1230
+ import { Command as Command28 } from "commander";
1231
+ var evaluateCmd = new Command28("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(
1200
1232
  "--award <worker:amount:rank>",
1201
1233
  "Award entry (repeatable): worker:amountUSDC:rank",
1202
1234
  collect,
@@ -1259,28 +1291,28 @@ function collect(val, prev) {
1259
1291
  }
1260
1292
 
1261
1293
  // src/commands/task/appeal.ts
1262
- import { Command as Command28 } from "commander";
1263
- var appealCmd = new Command28("appeal").description("Appeal an evaluator verdict while in Appealing state").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
1294
+ import { Command as Command29 } from "commander";
1295
+ var appealCmd = new Command29("appeal").description("Appeal an evaluator verdict while in Appealing state").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
1264
1296
  const result = await x402Post(`/api/tasks/${taskId}/appeal`, { taskId });
1265
1297
  printResult({ txHash: result.txHash });
1266
1298
  });
1267
1299
 
1268
1300
  // src/commands/task/evaluator-timeout.ts
1269
- import { Command as Command29 } from "commander";
1270
- var evaluatorTimeoutCmd = new Command29("evaluator-timeout").description("Trigger evaluator timeout after the evaluation window expires (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
1301
+ import { Command as Command30 } from "commander";
1302
+ var evaluatorTimeoutCmd = new Command30("evaluator-timeout").description("Trigger evaluator timeout after the evaluation window expires (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
1271
1303
  const result = await x402Post(`/api/tasks/${taskId}/evaluator-timeout`, { taskId });
1272
1304
  printResult({ txHash: result.txHash });
1273
1305
  });
1274
1306
 
1275
1307
  // src/commands/task/finalize-verdict.ts
1276
- import { Command as Command30 } from "commander";
1277
- var finalizeVerdictCmd = new Command30("finalize-verdict").description("Finalize an evaluator verdict after the appeal window expires (permissionless)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
1308
+ import { Command as Command31 } from "commander";
1309
+ var finalizeVerdictCmd = new Command31("finalize-verdict").description("Finalize an evaluator verdict after the appeal window expires (permissionless)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
1278
1310
  const result = await x402Post(`/api/tasks/${taskId}/finalize-verdict`, { taskId });
1279
1311
  printResult({ txHash: result.txHash });
1280
1312
  });
1281
1313
 
1282
1314
  // src/commands/task/resolve-dispute.ts
1283
- import { Command as Command31 } from "commander";
1315
+ import { Command as Command32 } from "commander";
1284
1316
  function parseAward(spec) {
1285
1317
  const parts = spec.split(":");
1286
1318
  if (parts.length !== 3) {
@@ -1304,7 +1336,7 @@ function parseAward(spec) {
1304
1336
  rank
1305
1337
  };
1306
1338
  }
1307
- var resolveDisputeCmd = new Command31("resolve-dispute").description(
1339
+ var resolveDisputeCmd = new Command32("resolve-dispute").description(
1308
1340
  "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"
1309
1341
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--verdict <type>", "Verdict type: approve or partial").requiredOption(
1310
1342
  "--award <spec...>",
@@ -1330,7 +1362,7 @@ var resolveDisputeCmd = new Command31("resolve-dispute").description(
1330
1362
  });
1331
1363
 
1332
1364
  // src/commands/task/index.ts
1333
- var taskCommand = new Command32("task").description("Manage tasks");
1365
+ var taskCommand = new Command33("task").description("Manage tasks");
1334
1366
  taskCommand.addCommand(createCmd);
1335
1367
  taskCommand.addCommand(listCmd);
1336
1368
  taskCommand.addCommand(getCmd);
@@ -1350,6 +1382,7 @@ taskCommand.addCommand(downloadCmd);
1350
1382
  taskCommand.addCommand(cancelCmd);
1351
1383
  taskCommand.addCommand(refundExpiredCmd);
1352
1384
  taskCommand.addCommand(rejectSubmissionCmd);
1385
+ taskCommand.addCommand(rejectAllSubmissionsCmd);
1353
1386
  taskCommand.addCommand(mySubmissionsCmd);
1354
1387
  taskCommand.addCommand(updateCmd);
1355
1388
  taskCommand.addCommand(forfeitCmd);
@@ -1360,8 +1393,8 @@ taskCommand.addCommand(finalizeVerdictCmd);
1360
1393
  taskCommand.addCommand(resolveDisputeCmd);
1361
1394
 
1362
1395
  // src/commands/agents.ts
1363
- import { Command as Command33 } from "commander";
1364
- var agentsCommand = new Command33("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) => {
1396
+ import { Command as Command34 } from "commander";
1397
+ var agentsCommand = new Command34("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) => {
1365
1398
  const params = new URLSearchParams();
1366
1399
  if (opts.sort) params.set("sort", opts.sort);
1367
1400
  if (opts.skill) params.set("skill", opts.skill);
@@ -1372,8 +1405,8 @@ var agentsCommand = new Command33("agents").description("Browse the agent direct
1372
1405
  });
1373
1406
 
1374
1407
  // src/commands/inbox.ts
1375
- import { Command as Command34 } from "commander";
1376
- var inboxCommand = new Command34("inbox").description("Show tasks you created and tasks you are working on").action(async () => {
1408
+ import { Command as Command35 } from "commander";
1409
+ var inboxCommand = new Command35("inbox").description("Show tasks you created and tasks you are working on").action(async () => {
1377
1410
  let address;
1378
1411
  try {
1379
1412
  address = await getWalletAddress();
@@ -1399,8 +1432,8 @@ var inboxCommand = new Command34("inbox").description("Show tasks you created an
1399
1432
  });
1400
1433
 
1401
1434
  // src/commands/deposit.ts
1402
- import { Command as Command35 } from "commander";
1403
- var depositCommand = new Command35("deposit").description("Show wallet address and network info for funding").action(async () => {
1435
+ import { Command as Command36 } from "commander";
1436
+ var depositCommand = new Command36("deposit").description("Show wallet address and network info for funding").action(async () => {
1404
1437
  let address;
1405
1438
  try {
1406
1439
  address = await getWalletAddress();
@@ -1427,11 +1460,11 @@ var depositCommand = new Command35("deposit").description("Show wallet address a
1427
1460
  });
1428
1461
 
1429
1462
  // src/commands/wallet/index.ts
1430
- import { Command as Command40 } from "commander";
1463
+ import { Command as Command41 } from "commander";
1431
1464
 
1432
1465
  // src/commands/wallet/balance.ts
1433
- import { Command as Command36 } from "commander";
1434
- var walletBalanceCommand = new Command36("balance").description("Show USDC balance").option("--address <addr>", "Address to check (defaults to own wallet)").action(async (opts) => {
1466
+ import { Command as Command37 } from "commander";
1467
+ var walletBalanceCommand = new Command37("balance").description("Show USDC balance").option("--address <addr>", "Address to check (defaults to own wallet)").action(async (opts) => {
1435
1468
  let address = opts.address;
1436
1469
  if (!address) {
1437
1470
  const keystore = await loadKeystore();
@@ -1442,7 +1475,7 @@ var walletBalanceCommand = new Command36("balance").description("Show USDC balan
1442
1475
  });
1443
1476
 
1444
1477
  // src/commands/wallet/import.ts
1445
- import { Command as Command37 } from "commander";
1478
+ import { Command as Command38 } from "commander";
1446
1479
  import { createInterface } from "readline";
1447
1480
  import { privateKeyToAccount as privateKeyToAccount3 } from "viem/accounts";
1448
1481
  function normalizePrivateKey(raw) {
@@ -1477,7 +1510,7 @@ function promptHiddenInput(prompt) {
1477
1510
  });
1478
1511
  });
1479
1512
  }
1480
- var walletImportCommand = new Command37("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)").action(async (opts) => {
1513
+ var walletImportCommand = new Command38("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)").action(async (opts) => {
1481
1514
  if (await keystoreExists()) {
1482
1515
  const keystore = await loadKeystore();
1483
1516
  printResult({ address: keystore.walletAddress, agentId: keystore.agentId });
@@ -1542,11 +1575,11 @@ var walletImportCommand = new Command37("import").description("Import an existin
1542
1575
  });
1543
1576
 
1544
1577
  // src/commands/wallet/set-withdrawal-address.ts
1545
- import { Command as Command38 } from "commander";
1578
+ import { Command as Command39 } from "commander";
1546
1579
  function isValidAddress(addr) {
1547
1580
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
1548
1581
  }
1549
- var setWithdrawalAddressCommand = new Command38("set-withdrawal-address").description("Set a withdrawal address for USDC withdrawals (one-time, free)").argument("<address>", "Ethereum address to receive withdrawals").action(async (address) => {
1582
+ var setWithdrawalAddressCommand = new Command39("set-withdrawal-address").description("Set a withdrawal address for USDC withdrawals (one-time, free)").argument("<address>", "Ethereum address to receive withdrawals").action(async (address) => {
1550
1583
  if (!isValidAddress(address)) {
1551
1584
  printError("Invalid Ethereum address: must be 0x followed by 40 hex characters");
1552
1585
  }
@@ -1568,8 +1601,8 @@ var setWithdrawalAddressCommand = new Command38("set-withdrawal-address").descri
1568
1601
  });
1569
1602
 
1570
1603
  // src/commands/wallet/publish-key.ts
1571
- import { Command as Command39 } from "commander";
1572
- var publishKeyCommand = new Command39("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
1604
+ import { Command as Command40 } from "commander";
1605
+ var publishKeyCommand = new Command40("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
1573
1606
  let keystore;
1574
1607
  try {
1575
1608
  keystore = await loadKeystore();
@@ -1588,14 +1621,14 @@ var publishKeyCommand = new Command39("publish-key").description("Publish your s
1588
1621
  });
1589
1622
 
1590
1623
  // src/commands/wallet/index.ts
1591
- var walletCommand = new Command40("wallet").description("Wallet management commands");
1624
+ var walletCommand = new Command41("wallet").description("Wallet management commands");
1592
1625
  walletCommand.addCommand(walletBalanceCommand);
1593
1626
  walletCommand.addCommand(walletImportCommand);
1594
1627
  walletCommand.addCommand(setWithdrawalAddressCommand);
1595
1628
  walletCommand.addCommand(publishKeyCommand);
1596
1629
 
1597
1630
  // src/commands/withdraw.ts
1598
- import { Command as Command41 } from "commander";
1631
+ import { Command as Command42 } from "commander";
1599
1632
  import { toHex as toHex2 } from "viem";
1600
1633
  var USDC_TYPES = {
1601
1634
  TransferWithAuthorization: [
@@ -1607,7 +1640,7 @@ var USDC_TYPES = {
1607
1640
  { name: "nonce", type: "bytes32" }
1608
1641
  ]
1609
1642
  };
1610
- var withdrawCommand = new Command41("withdraw").description("Withdraw USDC to the registered withdrawal address").argument("<amount>", "Amount in USDC (e.g. 5 for 5 USDC)").action(async (amount) => {
1643
+ var withdrawCommand = new Command42("withdraw").description("Withdraw USDC to the registered withdrawal address").argument("<amount>", "Amount in USDC (e.g. 5 for 5 USDC)").action(async (amount) => {
1611
1644
  const parsed = parseFloat(amount);
1612
1645
  if (isNaN(parsed) || parsed <= 0) {
1613
1646
  printError("Invalid amount: must be a positive number (e.g. 5 for 5 USDC)");
@@ -1657,9 +1690,9 @@ var withdrawCommand = new Command41("withdraw").description("Withdraw USDC to th
1657
1690
  });
1658
1691
 
1659
1692
  // src/commands/encrypt.ts
1660
- import { Command as Command42 } from "commander";
1693
+ import { Command as Command43 } from "commander";
1661
1694
  import { promises as fs2 } from "fs";
1662
- var encryptCommand = new Command42("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) => {
1695
+ var encryptCommand = new Command43("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) => {
1663
1696
  let plaintext;
1664
1697
  try {
1665
1698
  plaintext = await fs2.readFile(file);
@@ -1708,9 +1741,9 @@ var encryptCommand = new Command42("encrypt").description("Encrypt a file with E
1708
1741
  });
1709
1742
 
1710
1743
  // src/commands/decrypt.ts
1711
- import { Command as Command43 } from "commander";
1744
+ import { Command as Command44 } from "commander";
1712
1745
  import { promises as fs3 } from "fs";
1713
- var decryptCommand = new Command43("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) => {
1746
+ var decryptCommand = new Command44("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) => {
1714
1747
  let ciphertext;
1715
1748
  try {
1716
1749
  ciphertext = await fs3.readFile(file);
@@ -1748,7 +1781,7 @@ var decryptCommand = new Command43("decrypt").description("Decrypt a file using
1748
1781
  });
1749
1782
 
1750
1783
  // src/commands/xmtp.ts
1751
- import { Command as Command44 } from "commander";
1784
+ import { Command as Command45 } from "commander";
1752
1785
 
1753
1786
  // src/lib/xmtp-client.ts
1754
1787
  import os2 from "os";
@@ -5919,7 +5952,8 @@ var TaskResponseSchema = external_exports.object({
5919
5952
  verdictEvidenceHash: external_exports.string().nullable().optional(),
5920
5953
  submissionWindowOpen: external_exports.boolean(),
5921
5954
  netReward: external_exports.string().optional(),
5922
- pendingActions: PendingActionSchema.array().optional()
5955
+ pendingActions: PendingActionSchema.array().optional(),
5956
+ selfAward: external_exports.boolean().nullable().optional()
5923
5957
  });
5924
5958
  var TaskListInputSchema = external_exports.object({
5925
5959
  limit: external_exports.number().min(1).max(100).optional().default(20),
@@ -5966,6 +6000,16 @@ var UpdateTaskInputSchema = external_exports.object({
5966
6000
  tags: external_exports.array(external_exports.string()).max(10, "Maximum 10 tags allowed").optional(),
5967
6001
  metricDescription: external_exports.string().max(500).optional()
5968
6002
  });
6003
+ var RequesterStatsSchema = external_exports.object({
6004
+ completedCount: external_exports.number(),
6005
+ selfAwardCount: external_exports.number(),
6006
+ cancelledAfterSubmissionsCount: external_exports.number(),
6007
+ expiredNoActionCount: external_exports.number(),
6008
+ expiredAfterRejectionsCount: external_exports.number(),
6009
+ totalTasksCreated: external_exports.number(),
6010
+ totalSubmissionAttempts: external_exports.number(),
6011
+ totalUniqueWorkers: external_exports.number()
6012
+ });
5969
6013
 
5970
6014
  // ../../packages/shared/dist/schemas/submission.schemas.js
5971
6015
  var ArtifactRole = external_exports.enum(["preview", "source", "final", "attachment"]);
@@ -7518,7 +7562,7 @@ function getDefaultQueryTimeoutMs() {
7518
7562
  }
7519
7563
  return Math.floor(parsed);
7520
7564
  }
7521
- var xmtpCommand = new Command44("xmtp").description("Manage XMTP messaging for this agent");
7565
+ var xmtpCommand = new Command45("xmtp").description("Manage XMTP messaging for this agent");
7522
7566
  xmtpCommand.command("init").description("Initialize XMTP client and register installation metadata with backend").action(async () => {
7523
7567
  const keystore = await loadKeystore();
7524
7568
  const client = await createXmtpClient({
@@ -7746,7 +7790,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
7746
7790
  });
7747
7791
 
7748
7792
  // src/commands/daemon.ts
7749
- import { Command as Command45 } from "commander";
7793
+ import { Command as Command46 } from "commander";
7750
7794
  function diffTaskStatuses(prev, next) {
7751
7795
  const changes = [];
7752
7796
  for (const [taskId, newStatus] of next) {
@@ -7774,7 +7818,7 @@ function sleepOrAbort(ms, signal) {
7774
7818
  });
7775
7819
  }
7776
7820
  var MAX_SEEN_TASK_IDS = 2e3;
7777
- var daemonCommand = new Command45("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(
7821
+ var daemonCommand = new Command46("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(
7778
7822
  "--auction-poll-interval <ms>",
7779
7823
  "Poll interval for clock-based auction tasks (dutch/reverse_dutch) in milliseconds",
7780
7824
  "15000"
@@ -8095,11 +8139,11 @@ var daemonCommand = new Command45("daemon").description("Long-running agent daem
8095
8139
  );
8096
8140
 
8097
8141
  // src/commands/email/index.ts
8098
- import { Command as Command54 } from "commander";
8142
+ import { Command as Command55 } from "commander";
8099
8143
 
8100
8144
  // src/commands/email/register.ts
8101
- import { Command as Command46 } from "commander";
8102
- var registerCommand = new Command46("register").description("Register an email address for this agent").requiredOption("--username <name>", "Desired username (e.g. myagent)").action(async (opts) => {
8145
+ import { Command as Command47 } from "commander";
8146
+ var registerCommand = new Command47("register").description("Register an email address for this agent").requiredOption("--username <name>", "Desired username (e.g. myagent)").action(async (opts) => {
8103
8147
  const check = await apiGet(
8104
8148
  `/api/emails/check-username?username=${encodeURIComponent(opts.username)}`
8105
8149
  );
@@ -8116,8 +8160,8 @@ var registerCommand = new Command46("register").description("Register an email a
8116
8160
  });
8117
8161
 
8118
8162
  // src/commands/email/inbox.ts
8119
- import { Command as Command47 } from "commander";
8120
- var inboxCommand2 = new Command47("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) => {
8163
+ import { Command as Command48 } from "commander";
8164
+ var inboxCommand2 = new Command48("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) => {
8121
8165
  const keystore = await loadKeystore();
8122
8166
  const params = new URLSearchParams({
8123
8167
  deviceId: keystore.deviceId,
@@ -8132,8 +8176,8 @@ var inboxCommand2 = new Command47("inbox").description("List emails in your inbo
8132
8176
  });
8133
8177
 
8134
8178
  // src/commands/email/read.ts
8135
- import { Command as Command48 } from "commander";
8136
- var readCommand = new Command48("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
8179
+ import { Command as Command49 } from "commander";
8180
+ var readCommand = new Command49("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
8137
8181
  const keystore = await loadKeystore();
8138
8182
  const params = new URLSearchParams({
8139
8183
  deviceId: keystore.deviceId,
@@ -8145,8 +8189,8 @@ var readCommand = new Command48("read").description("Read an email by ID (marks
8145
8189
  });
8146
8190
 
8147
8191
  // src/commands/email/send.ts
8148
- import { Command as Command49 } from "commander";
8149
- var sendCommand = new Command49("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) => {
8192
+ import { Command as Command50 } from "commander";
8193
+ var sendCommand = new Command50("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) => {
8150
8194
  const keystore = await loadKeystore();
8151
8195
  const result = await apiPost("/api/emails/send", {
8152
8196
  deviceId: keystore.deviceId,
@@ -8159,8 +8203,8 @@ var sendCommand = new Command49("send").description("Send an email").requiredOpt
8159
8203
  });
8160
8204
 
8161
8205
  // src/commands/email/reply.ts
8162
- import { Command as Command50 } from "commander";
8163
- var replyCommand = new Command50("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").action(async (id, opts) => {
8206
+ import { Command as Command51 } from "commander";
8207
+ var replyCommand = new Command51("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").action(async (id, opts) => {
8164
8208
  const keystore = await loadKeystore();
8165
8209
  const params = new URLSearchParams({
8166
8210
  deviceId: keystore.deviceId,
@@ -8182,8 +8226,8 @@ var replyCommand = new Command50("reply").description("Reply to an email").argum
8182
8226
  });
8183
8227
 
8184
8228
  // src/commands/email/delete.ts
8185
- import { Command as Command51 } from "commander";
8186
- var deleteCommand = new Command51("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
8229
+ import { Command as Command52 } from "commander";
8230
+ var deleteCommand = new Command52("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
8187
8231
  const keystore = await loadKeystore();
8188
8232
  const result = await apiPost("/api/emails/delete", {
8189
8233
  deviceId: keystore.deviceId,
@@ -8194,15 +8238,15 @@ var deleteCommand = new Command51("delete").description("Delete an email by ID")
8194
8238
  });
8195
8239
 
8196
8240
  // src/commands/email/address.ts
8197
- import { Command as Command52 } from "commander";
8198
- var addressCommand2 = new Command52("address").description("Show your registered email address").action(async () => {
8241
+ import { Command as Command53 } from "commander";
8242
+ var addressCommand2 = new Command53("address").description("Show your registered email address").action(async () => {
8199
8243
  const keystore = await loadKeystore();
8200
8244
  const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
8201
8245
  printResult({ emailAddress: result.emailAddress ?? null });
8202
8246
  });
8203
8247
 
8204
8248
  // src/commands/email/mark-read.ts
8205
- import { Command as Command53 } from "commander";
8249
+ import { Command as Command54 } from "commander";
8206
8250
  async function setReadStatus(id, read) {
8207
8251
  const keystore = await loadKeystore();
8208
8252
  const result = await apiPost("/api/emails/mark-read", {
@@ -8213,12 +8257,12 @@ async function setReadStatus(id, read) {
8213
8257
  });
8214
8258
  printResult({ id: result.id, isRead: result.isRead });
8215
8259
  }
8216
- var markReadCommand = new Command53("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) => {
8260
+ var markReadCommand = new Command54("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) => {
8217
8261
  await setReadStatus(id, !opts.unread);
8218
8262
  });
8219
8263
 
8220
8264
  // src/commands/email/index.ts
8221
- var emailCommand = new Command54("email").description("Email management commands");
8265
+ var emailCommand = new Command55("email").description("Email management commands");
8222
8266
  emailCommand.addCommand(registerCommand);
8223
8267
  emailCommand.addCommand(inboxCommand2);
8224
8268
  emailCommand.addCommand(readCommand);
@@ -8228,10 +8272,33 @@ emailCommand.addCommand(deleteCommand);
8228
8272
  emailCommand.addCommand(addressCommand2);
8229
8273
  emailCommand.addCommand(markReadCommand);
8230
8274
 
8275
+ // src/commands/requester/index.ts
8276
+ import { Command as Command57 } from "commander";
8277
+
8278
+ // src/commands/requester/stats.ts
8279
+ import { Command as Command56 } from "commander";
8280
+ var requesterStatsCmd = new Command56("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address) => {
8281
+ if (!/^0x[0-9a-fA-F]{40}$/.test(address)) {
8282
+ printError("Address must be a 0x-prefixed 20-byte hex string");
8283
+ process.exit(1);
8284
+ return;
8285
+ }
8286
+ const data = await apiGet(`/api/requester/${address}/stats`);
8287
+ if (!data) {
8288
+ printError("No stats found for address");
8289
+ process.exit(1);
8290
+ return;
8291
+ }
8292
+ printResult(data);
8293
+ });
8294
+
8295
+ // src/commands/requester/index.ts
8296
+ var requesterCmd = new Command57("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
8297
+
8231
8298
  // src/index.ts
8232
8299
  var require2 = createRequire(import.meta.url);
8233
8300
  var { version } = require2("../package.json");
8234
- var program = new Command55();
8301
+ var program = new Command58();
8235
8302
  program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
8236
8303
  program.addCommand(initCommand);
8237
8304
  program.addCommand(walletCommand);
@@ -8248,6 +8315,7 @@ program.addCommand(decryptCommand);
8248
8315
  program.addCommand(xmtpCommand);
8249
8316
  program.addCommand(daemonCommand);
8250
8317
  program.addCommand(emailCommand);
8318
+ program.addCommand(requesterCmd);
8251
8319
  program.parseAsync(process.argv).catch((err) => {
8252
8320
  process.stderr.write(JSON.stringify({ ok: false, error: err.message }) + "\n");
8253
8321
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucid-agents/taskmarket",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "taskmarket": "./dist/index.js"
@@ -17,9 +17,9 @@
17
17
  "tsx": "^4.7.0",
18
18
  "typescript": "^5.3.3",
19
19
  "vitest": "^2.0.0",
20
- "@taskmarket/eslint-config": "0.0.0",
20
+ "@taskmarket/prettier-config": "0.0.0",
21
21
  "@taskmarket/shared": "2.0.0",
22
- "@taskmarket/prettier-config": "0.0.0"
22
+ "@taskmarket/eslint-config": "0.0.0"
23
23
  },
24
24
  "files": [
25
25
  "dist"