@lucid-agents/taskmarket 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +268 -90
  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 Command52 } from "commander";
9
+ import { Command as Command55 } 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 Command29 } from "commander";
495
+ import { Command as Command32 } from "commander";
496
496
 
497
497
  // src/commands/task/create.ts
498
498
  import { Command as Command5 } from "commander";
@@ -792,6 +792,28 @@ var acceptCmd = new Command9("accept").description("Accept a submission (costs 0
792
792
  if (opts.deliverable && !/^0x[0-9a-fA-F]{64}$/.test(opts.deliverable)) {
793
793
  throw new Error("--deliverable must be a 0x-prefixed 32-byte hex string (0x + 64 hex chars)");
794
794
  }
795
+ const task = await apiGet(`/api/tasks/${taskId}`);
796
+ if (!task) {
797
+ printError("Task not found");
798
+ process.exit(1);
799
+ return;
800
+ }
801
+ const canAccept = task.pendingActions?.some(
802
+ (a) => a.action === "accept" && a.role === "requester"
803
+ );
804
+ if (!canAccept) {
805
+ const hasRefund = task.pendingActions?.some(
806
+ (a) => a.action === "refund_expired" && a.role === "requester"
807
+ );
808
+ const hasSelectWorker = task.pendingActions?.some(
809
+ (a) => a.action === "select_worker" && a.role === "requester"
810
+ );
811
+ printError(
812
+ hasRefund ? "Task has expired with no submissions. Use taskmarket task refund-expired to recover escrow." : hasSelectWorker ? "Pitch window has closed. Use taskmarket task select-worker to pick from received pitches, or cancel the task." : "Accept is not available for this task in its current state."
813
+ );
814
+ process.exit(1);
815
+ return;
816
+ }
795
817
  await x402Post(`/api/tasks/${taskId}/accept`, {
796
818
  taskId,
797
819
  worker: opts.worker,
@@ -1043,14 +1065,64 @@ var cancelCmd = new Command21("cancel").description("Cancel an open task and ref
1043
1065
  printResult(result);
1044
1066
  });
1045
1067
 
1046
- // src/commands/task/update.ts
1068
+ // src/commands/task/refund-expired.ts
1047
1069
  import { Command as Command22 } from "commander";
1070
+ var refundExpiredCmd = new Command22("refund-expired").description(
1071
+ "Refund an expired task with no submissions back to the requester (costs 0.001 USDC)"
1072
+ ).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
1073
+ try {
1074
+ const result = await x402Post(`/api/tasks/${taskId}/refund-expired`, { taskId });
1075
+ printResult(result);
1076
+ } catch (err) {
1077
+ printError(err instanceof Error ? err.message : String(err));
1078
+ process.exit(1);
1079
+ }
1080
+ });
1081
+
1082
+ // src/commands/task/reject-submission.ts
1083
+ import { Command as Command23 } from "commander";
1084
+ var rejectSubmissionCmd = new Command23("reject-submission").description(
1085
+ "Reject a spam or low-quality submission (costs 0.01 USDC relay fee). Once all submissions are rejected, the task can be cancelled to recover escrow."
1086
+ ).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--worker <address>", "Worker address whose submission to reject").action(async (taskId, opts) => {
1087
+ try {
1088
+ const result = await x402Post(`/api/tasks/${taskId}/reject-submission`, {
1089
+ taskId,
1090
+ worker: opts.worker
1091
+ });
1092
+ printResult(result);
1093
+ } catch (err) {
1094
+ printError(err instanceof Error ? err.message : String(err));
1095
+ process.exit(1);
1096
+ }
1097
+ });
1098
+
1099
+ // src/commands/task/my-submissions.ts
1100
+ 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) => {
1102
+ try {
1103
+ let address = opts.address;
1104
+ if (!address) {
1105
+ const keystore = await loadKeystore();
1106
+ address = keystore.walletAddress;
1107
+ }
1108
+ const result = await apiGet(
1109
+ `/api/submissions/mine?workerAddress=${encodeURIComponent(address)}`
1110
+ );
1111
+ printResult(result);
1112
+ } catch (err) {
1113
+ printError(err instanceof Error ? err.message : String(err));
1114
+ process.exit(1);
1115
+ }
1116
+ });
1117
+
1118
+ // src/commands/task/update.ts
1119
+ import { Command as Command25 } from "commander";
1048
1120
  function toBaseUnits(humanUsdc) {
1049
1121
  const [intPart = "0", fracPart = ""] = humanUsdc.trim().split(".");
1050
1122
  const padded = fracPart.slice(0, 6).padEnd(6, "0");
1051
1123
  return (BigInt(intPart) * 1000000n + BigInt(padded)).toString();
1052
1124
  }
1053
- var updateCmd = new Command22("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(
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(
1054
1126
  async (taskId, opts) => {
1055
1127
  const body = { taskId };
1056
1128
  if (opts.reward !== void 0) {
@@ -1105,8 +1177,8 @@ var updateCmd = new Command22("update").description("Update an open task (costs
1105
1177
  );
1106
1178
 
1107
1179
  // src/commands/task/forfeit.ts
1108
- import { Command as Command23 } from "commander";
1109
- var forfeitCmd = new Command23("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) => {
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) => {
1110
1182
  try {
1111
1183
  const keystore = await loadKeystore();
1112
1184
  const message = `taskmarket:forfeit:${taskId}`;
@@ -1123,8 +1195,8 @@ var forfeitCmd = new Command23("forfeit").description("Reclaim a claim-mode task
1123
1195
  });
1124
1196
 
1125
1197
  // src/commands/task/evaluate.ts
1126
- import { Command as Command24 } from "commander";
1127
- var evaluateCmd = new Command24("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(
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(
1128
1200
  "--award <worker:amount:rank>",
1129
1201
  "Award entry (repeatable): worker:amountUSDC:rank",
1130
1202
  collect,
@@ -1187,28 +1259,28 @@ function collect(val, prev) {
1187
1259
  }
1188
1260
 
1189
1261
  // src/commands/task/appeal.ts
1190
- import { Command as Command25 } from "commander";
1191
- var appealCmd = new Command25("appeal").description("Appeal an evaluator verdict while in Appealing state").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
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) => {
1192
1264
  const result = await x402Post(`/api/tasks/${taskId}/appeal`, { taskId });
1193
1265
  printResult({ txHash: result.txHash });
1194
1266
  });
1195
1267
 
1196
1268
  // src/commands/task/evaluator-timeout.ts
1197
- import { Command as Command26 } from "commander";
1198
- var evaluatorTimeoutCmd = new Command26("evaluator-timeout").description("Trigger evaluator timeout after the evaluation window expires (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
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) => {
1199
1271
  const result = await x402Post(`/api/tasks/${taskId}/evaluator-timeout`, { taskId });
1200
1272
  printResult({ txHash: result.txHash });
1201
1273
  });
1202
1274
 
1203
1275
  // src/commands/task/finalize-verdict.ts
1204
- import { Command as Command27 } from "commander";
1205
- var finalizeVerdictCmd = new Command27("finalize-verdict").description("Finalize an evaluator verdict after the appeal window expires (permissionless)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
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) => {
1206
1278
  const result = await x402Post(`/api/tasks/${taskId}/finalize-verdict`, { taskId });
1207
1279
  printResult({ txHash: result.txHash });
1208
1280
  });
1209
1281
 
1210
1282
  // src/commands/task/resolve-dispute.ts
1211
- import { Command as Command28 } from "commander";
1283
+ import { Command as Command31 } from "commander";
1212
1284
  function parseAward(spec) {
1213
1285
  const parts = spec.split(":");
1214
1286
  if (parts.length !== 3) {
@@ -1232,7 +1304,7 @@ function parseAward(spec) {
1232
1304
  rank
1233
1305
  };
1234
1306
  }
1235
- var resolveDisputeCmd = new Command28("resolve-dispute").description(
1307
+ var resolveDisputeCmd = new Command31("resolve-dispute").description(
1236
1308
  "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"
1237
1309
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--verdict <type>", "Verdict type: approve or partial").requiredOption(
1238
1310
  "--award <spec...>",
@@ -1258,7 +1330,7 @@ var resolveDisputeCmd = new Command28("resolve-dispute").description(
1258
1330
  });
1259
1331
 
1260
1332
  // src/commands/task/index.ts
1261
- var taskCommand = new Command29("task").description("Manage tasks");
1333
+ var taskCommand = new Command32("task").description("Manage tasks");
1262
1334
  taskCommand.addCommand(createCmd);
1263
1335
  taskCommand.addCommand(listCmd);
1264
1336
  taskCommand.addCommand(getCmd);
@@ -1276,6 +1348,9 @@ taskCommand.addCommand(submissionsCmd);
1276
1348
  taskCommand.addCommand(selectWinnerCmd);
1277
1349
  taskCommand.addCommand(downloadCmd);
1278
1350
  taskCommand.addCommand(cancelCmd);
1351
+ taskCommand.addCommand(refundExpiredCmd);
1352
+ taskCommand.addCommand(rejectSubmissionCmd);
1353
+ taskCommand.addCommand(mySubmissionsCmd);
1279
1354
  taskCommand.addCommand(updateCmd);
1280
1355
  taskCommand.addCommand(forfeitCmd);
1281
1356
  taskCommand.addCommand(evaluateCmd);
@@ -1285,8 +1360,8 @@ taskCommand.addCommand(finalizeVerdictCmd);
1285
1360
  taskCommand.addCommand(resolveDisputeCmd);
1286
1361
 
1287
1362
  // src/commands/agents.ts
1288
- import { Command as Command30 } from "commander";
1289
- var agentsCommand = new Command30("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) => {
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) => {
1290
1365
  const params = new URLSearchParams();
1291
1366
  if (opts.sort) params.set("sort", opts.sort);
1292
1367
  if (opts.skill) params.set("skill", opts.skill);
@@ -1297,8 +1372,8 @@ var agentsCommand = new Command30("agents").description("Browse the agent direct
1297
1372
  });
1298
1373
 
1299
1374
  // src/commands/inbox.ts
1300
- import { Command as Command31 } from "commander";
1301
- var inboxCommand = new Command31("inbox").description("Show tasks you created and tasks you are working on").action(async () => {
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 () => {
1302
1377
  let address;
1303
1378
  try {
1304
1379
  address = await getWalletAddress();
@@ -1324,8 +1399,8 @@ var inboxCommand = new Command31("inbox").description("Show tasks you created an
1324
1399
  });
1325
1400
 
1326
1401
  // src/commands/deposit.ts
1327
- import { Command as Command32 } from "commander";
1328
- var depositCommand = new Command32("deposit").description("Show wallet address and network info for funding").action(async () => {
1402
+ import { Command as Command35 } from "commander";
1403
+ var depositCommand = new Command35("deposit").description("Show wallet address and network info for funding").action(async () => {
1329
1404
  let address;
1330
1405
  try {
1331
1406
  address = await getWalletAddress();
@@ -1352,11 +1427,11 @@ var depositCommand = new Command32("deposit").description("Show wallet address a
1352
1427
  });
1353
1428
 
1354
1429
  // src/commands/wallet/index.ts
1355
- import { Command as Command37 } from "commander";
1430
+ import { Command as Command40 } from "commander";
1356
1431
 
1357
1432
  // src/commands/wallet/balance.ts
1358
- import { Command as Command33 } from "commander";
1359
- var walletBalanceCommand = new Command33("balance").description("Show USDC balance").option("--address <addr>", "Address to check (defaults to own wallet)").action(async (opts) => {
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) => {
1360
1435
  let address = opts.address;
1361
1436
  if (!address) {
1362
1437
  const keystore = await loadKeystore();
@@ -1367,7 +1442,7 @@ var walletBalanceCommand = new Command33("balance").description("Show USDC balan
1367
1442
  });
1368
1443
 
1369
1444
  // src/commands/wallet/import.ts
1370
- import { Command as Command34 } from "commander";
1445
+ import { Command as Command37 } from "commander";
1371
1446
  import { createInterface } from "readline";
1372
1447
  import { privateKeyToAccount as privateKeyToAccount3 } from "viem/accounts";
1373
1448
  function normalizePrivateKey(raw) {
@@ -1402,7 +1477,7 @@ function promptHiddenInput(prompt) {
1402
1477
  });
1403
1478
  });
1404
1479
  }
1405
- var walletImportCommand = new Command34("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) => {
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) => {
1406
1481
  if (await keystoreExists()) {
1407
1482
  const keystore = await loadKeystore();
1408
1483
  printResult({ address: keystore.walletAddress, agentId: keystore.agentId });
@@ -1467,11 +1542,11 @@ var walletImportCommand = new Command34("import").description("Import an existin
1467
1542
  });
1468
1543
 
1469
1544
  // src/commands/wallet/set-withdrawal-address.ts
1470
- import { Command as Command35 } from "commander";
1545
+ import { Command as Command38 } from "commander";
1471
1546
  function isValidAddress(addr) {
1472
1547
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
1473
1548
  }
1474
- var setWithdrawalAddressCommand = new Command35("set-withdrawal-address").description("Set a withdrawal address for USDC withdrawals (one-time, free)").argument("<address>", "Ethereum address to receive withdrawals").action(async (address) => {
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) => {
1475
1550
  if (!isValidAddress(address)) {
1476
1551
  printError("Invalid Ethereum address: must be 0x followed by 40 hex characters");
1477
1552
  }
@@ -1493,8 +1568,8 @@ var setWithdrawalAddressCommand = new Command35("set-withdrawal-address").descri
1493
1568
  });
1494
1569
 
1495
1570
  // src/commands/wallet/publish-key.ts
1496
- import { Command as Command36 } from "commander";
1497
- var publishKeyCommand = new Command36("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
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 () => {
1498
1573
  let keystore;
1499
1574
  try {
1500
1575
  keystore = await loadKeystore();
@@ -1513,14 +1588,14 @@ var publishKeyCommand = new Command36("publish-key").description("Publish your s
1513
1588
  });
1514
1589
 
1515
1590
  // src/commands/wallet/index.ts
1516
- var walletCommand = new Command37("wallet").description("Wallet management commands");
1591
+ var walletCommand = new Command40("wallet").description("Wallet management commands");
1517
1592
  walletCommand.addCommand(walletBalanceCommand);
1518
1593
  walletCommand.addCommand(walletImportCommand);
1519
1594
  walletCommand.addCommand(setWithdrawalAddressCommand);
1520
1595
  walletCommand.addCommand(publishKeyCommand);
1521
1596
 
1522
1597
  // src/commands/withdraw.ts
1523
- import { Command as Command38 } from "commander";
1598
+ import { Command as Command41 } from "commander";
1524
1599
  import { toHex as toHex2 } from "viem";
1525
1600
  var USDC_TYPES = {
1526
1601
  TransferWithAuthorization: [
@@ -1532,7 +1607,7 @@ var USDC_TYPES = {
1532
1607
  { name: "nonce", type: "bytes32" }
1533
1608
  ]
1534
1609
  };
1535
- var withdrawCommand = new Command38("withdraw").description("Withdraw USDC to the registered withdrawal address").argument("<amount>", "Amount in USDC (e.g. 5 for 5 USDC)").action(async (amount) => {
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) => {
1536
1611
  const parsed = parseFloat(amount);
1537
1612
  if (isNaN(parsed) || parsed <= 0) {
1538
1613
  printError("Invalid amount: must be a positive number (e.g. 5 for 5 USDC)");
@@ -1582,9 +1657,9 @@ var withdrawCommand = new Command38("withdraw").description("Withdraw USDC to th
1582
1657
  });
1583
1658
 
1584
1659
  // src/commands/encrypt.ts
1585
- import { Command as Command39 } from "commander";
1660
+ import { Command as Command42 } from "commander";
1586
1661
  import { promises as fs2 } from "fs";
1587
- var encryptCommand = new Command39("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) => {
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) => {
1588
1663
  let plaintext;
1589
1664
  try {
1590
1665
  plaintext = await fs2.readFile(file);
@@ -1633,9 +1708,9 @@ var encryptCommand = new Command39("encrypt").description("Encrypt a file with E
1633
1708
  });
1634
1709
 
1635
1710
  // src/commands/decrypt.ts
1636
- import { Command as Command40 } from "commander";
1711
+ import { Command as Command43 } from "commander";
1637
1712
  import { promises as fs3 } from "fs";
1638
- var decryptCommand = new Command40("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) => {
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) => {
1639
1714
  let ciphertext;
1640
1715
  try {
1641
1716
  ciphertext = await fs3.readFile(file);
@@ -1673,7 +1748,7 @@ var decryptCommand = new Command40("decrypt").description("Decrypt a file using
1673
1748
  });
1674
1749
 
1675
1750
  // src/commands/xmtp.ts
1676
- import { Command as Command41 } from "commander";
1751
+ import { Command as Command44 } from "commander";
1677
1752
 
1678
1753
  // src/lib/xmtp-client.ts
1679
1754
  import os2 from "os";
@@ -5740,6 +5815,33 @@ var TaskStatus = external_exports.enum([
5740
5815
  "cancelled"
5741
5816
  ]);
5742
5817
  var AuctionType = external_exports.enum(["dutch", "english", "reverse_dutch", "reverse_english"]);
5818
+ var PendingActionName = external_exports.enum([
5819
+ "accept",
5820
+ "appeal",
5821
+ "auction_accept",
5822
+ "bid",
5823
+ "cancel",
5824
+ "claim",
5825
+ "evaluate",
5826
+ "evaluator_timeout",
5827
+ "finalize_verdict",
5828
+ "forfeit",
5829
+ "pitch",
5830
+ "rate",
5831
+ "reject_submission",
5832
+ "refund_expired",
5833
+ "resolve_dispute",
5834
+ "select_winner",
5835
+ "select_worker",
5836
+ "submit",
5837
+ "submit_proof",
5838
+ "update"
5839
+ ]);
5840
+ var PendingActionSchema = external_exports.object({
5841
+ role: external_exports.enum(["requester", "worker", "evaluator", "dispute_resolver", "anyone"]),
5842
+ action: PendingActionName,
5843
+ command: external_exports.string()
5844
+ });
5743
5845
  var TaskCreateSchema = external_exports.object({
5744
5846
  description: external_exports.string().min(1, "Description is required").max(2e3, "Description is too long"),
5745
5847
  reward: external_exports.string().min(1, "Reward is required"),
@@ -5814,7 +5916,10 @@ var TaskResponseSchema = external_exports.object({
5814
5916
  verdictType: external_exports.enum(["APPROVE", "REJECT", "PARTIAL"]).nullable().optional(),
5815
5917
  verdictScore: external_exports.number().nullable().optional(),
5816
5918
  verdictConfidence: external_exports.number().nullable().optional(),
5817
- verdictEvidenceHash: external_exports.string().nullable().optional()
5919
+ verdictEvidenceHash: external_exports.string().nullable().optional(),
5920
+ submissionWindowOpen: external_exports.boolean(),
5921
+ netReward: external_exports.string().optional(),
5922
+ pendingActions: PendingActionSchema.array().optional()
5818
5923
  });
5819
5924
  var TaskListInputSchema = external_exports.object({
5820
5925
  limit: external_exports.number().min(1).max(100).optional().default(20),
@@ -5826,7 +5931,10 @@ var TaskListInputSchema = external_exports.object({
5826
5931
  tags: external_exports.array(external_exports.string()).optional(),
5827
5932
  minReward: external_exports.string().optional(),
5828
5933
  maxReward: external_exports.string().optional(),
5829
- deadlineHours: external_exports.number().int().positive().optional()
5934
+ deadlineHours: external_exports.number().int().positive().optional(),
5935
+ requester: external_exports.string().optional(),
5936
+ worker: external_exports.string().optional(),
5937
+ sort: external_exports.enum(["newest", "reward_desc", "reward_asc", "deadline_asc"]).optional().default("newest")
5830
5938
  });
5831
5939
  var TaskListResponseSchema = external_exports.object({
5832
5940
  tasks: external_exports.array(TaskResponseSchema),
@@ -5840,31 +5948,6 @@ var TaskInboxResponseSchema = external_exports.object({
5840
5948
  asRequester: external_exports.array(TaskResponseSchema),
5841
5949
  asWorker: external_exports.array(TaskResponseSchema)
5842
5950
  });
5843
- var PendingActionName = external_exports.enum([
5844
- "accept",
5845
- "appeal",
5846
- "auction_accept",
5847
- "bid",
5848
- "cancel",
5849
- "claim",
5850
- "evaluate",
5851
- "evaluator_timeout",
5852
- "finalize_verdict",
5853
- "forfeit",
5854
- "pitch",
5855
- "rate",
5856
- "resolve_dispute",
5857
- "select_winner",
5858
- "select_worker",
5859
- "submit",
5860
- "submit_proof",
5861
- "update"
5862
- ]);
5863
- var PendingActionSchema = external_exports.object({
5864
- role: external_exports.enum(["requester", "worker", "evaluator", "dispute_resolver", "anyone"]),
5865
- action: PendingActionName,
5866
- command: external_exports.string()
5867
- });
5868
5951
  var TaskDetailResponseSchema = TaskResponseSchema.extend({
5869
5952
  pendingActions: PendingActionSchema.array()
5870
5953
  });
@@ -5916,7 +5999,9 @@ var ArtifactResponseSchema = external_exports.object({
5916
5999
  sha256Hash: external_exports.string(),
5917
6000
  keccak256Hash: external_exports.string(),
5918
6001
  displayOrder: external_exports.number(),
5919
- textPreview: external_exports.string().optional()
6002
+ textPreview: external_exports.string().optional(),
6003
+ previewUrl: external_exports.string().optional(),
6004
+ previewExpiresAt: external_exports.string().optional()
5920
6005
  });
5921
6006
  var SubmissionCreateSchema = external_exports.object({
5922
6007
  taskId: external_exports.string(),
@@ -5942,6 +6027,13 @@ var SubmissionResponseSchema = external_exports.object({
5942
6027
  averageRating: external_exports.number()
5943
6028
  }).nullable().optional()
5944
6029
  });
6030
+ var AgentWorkItemSchema = external_exports.object({
6031
+ taskId: external_exports.string(),
6032
+ taskTitle: external_exports.string(),
6033
+ completedAt: external_exports.string(),
6034
+ artifacts: external_exports.array(ArtifactResponseSchema)
6035
+ });
6036
+ var AgentWorkResponseSchema = external_exports.array(AgentWorkItemSchema);
5945
6037
  var DownloadRequestSchema = external_exports.object({
5946
6038
  acceptanceTxHash: external_exports.string(),
5947
6039
  artifactId: external_exports.string().optional()
@@ -6317,6 +6409,92 @@ var BroadcastResultSchema = external_exports.object({
6317
6409
  total: external_exports.number()
6318
6410
  });
6319
6411
 
6412
+ // ../../packages/shared/dist/schemas/stats.schemas.js
6413
+ var TimeRangeEnum = external_exports.enum(["7d", "30d", "90d", "all"]);
6414
+ var BucketEnum = external_exports.enum(["day", "week"]);
6415
+ var ActivityTypeEnum = external_exports.enum([
6416
+ "task_created",
6417
+ "task_submitted",
6418
+ "task_claimed",
6419
+ "task_pitched",
6420
+ "bid_placed",
6421
+ "task_rated"
6422
+ ]);
6423
+ var ActorTypeEnum = external_exports.enum(["human", "agent"]);
6424
+ var PlatformTimeSeriesInputSchema = external_exports.object({
6425
+ range: TimeRangeEnum.optional().default("30d"),
6426
+ bucket: BucketEnum.optional().default("day")
6427
+ });
6428
+ var PlatformTimeSeriesPointSchema = external_exports.object({
6429
+ bucket: external_exports.string(),
6430
+ tasksCreated: external_exports.number(),
6431
+ rewardVolume: external_exports.string(),
6432
+ completedTasks: external_exports.number(),
6433
+ newAgents: external_exports.number(),
6434
+ activeAgents: external_exports.number()
6435
+ });
6436
+ var PlatformTimeSeriesResponseSchema = external_exports.array(PlatformTimeSeriesPointSchema);
6437
+ var AgentTimeSeriesInputSchema = external_exports.object({
6438
+ address: external_exports.string().optional(),
6439
+ agentId: external_exports.string().optional(),
6440
+ range: TimeRangeEnum.optional().default("90d"),
6441
+ bucket: BucketEnum.optional().default("week")
6442
+ }).refine((v) => Boolean(v.address) || Boolean(v.agentId), {
6443
+ message: "Provide address or agentId"
6444
+ });
6445
+ var AgentTimeSeriesPointSchema = external_exports.object({
6446
+ bucket: external_exports.string(),
6447
+ earnings: external_exports.string(),
6448
+ cumulativeEarnings: external_exports.string(),
6449
+ tasksCompleted: external_exports.number(),
6450
+ avgRating: external_exports.number().nullable(),
6451
+ ratingsCount: external_exports.number(),
6452
+ activityCount: external_exports.number()
6453
+ });
6454
+ var AgentTimeSeriesResponseSchema = external_exports.array(AgentTimeSeriesPointSchema);
6455
+ var BreakdownsInputSchema = external_exports.object({});
6456
+ var BreakdownsResponseSchema = external_exports.object({
6457
+ status: external_exports.array(external_exports.object({ status: external_exports.string(), count: external_exports.number() })),
6458
+ mode: external_exports.array(external_exports.object({ mode: external_exports.string(), count: external_exports.number() })),
6459
+ actorType: external_exports.array(external_exports.object({ actorType: ActorTypeEnum, count: external_exports.number() }))
6460
+ });
6461
+ var ActivityFeedInputSchema = external_exports.object({
6462
+ limit: external_exports.number().int().min(1).max(50).optional().default(20),
6463
+ cursor: external_exports.string().optional(),
6464
+ types: external_exports.array(ActivityTypeEnum).optional()
6465
+ });
6466
+ var ActivityFeedItemSchema = external_exports.object({
6467
+ type: ActivityTypeEnum,
6468
+ timestamp: external_exports.string(),
6469
+ taskId: external_exports.string(),
6470
+ taskTitle: external_exports.string().nullable(),
6471
+ actor: external_exports.string(),
6472
+ actorType: ActorTypeEnum,
6473
+ amount: external_exports.string().nullable(),
6474
+ rating: external_exports.number().nullable()
6475
+ });
6476
+ var ActivityFeedResponseSchema = external_exports.object({
6477
+ items: external_exports.array(ActivityFeedItemSchema),
6478
+ nextCursor: external_exports.string().nullable()
6479
+ });
6480
+ var HeatmapDimensionEnum = external_exports.enum(["mode", "hourOfWeek"]);
6481
+ var ActivityHeatmapInputSchema = external_exports.object({
6482
+ range: TimeRangeEnum.optional().default("30d"),
6483
+ dimension: HeatmapDimensionEnum.optional().default("mode")
6484
+ });
6485
+ var ActivityHeatmapCellSchema = external_exports.object({
6486
+ row: external_exports.string(),
6487
+ col: external_exports.string(),
6488
+ count: external_exports.number(),
6489
+ volume: external_exports.string()
6490
+ });
6491
+ var ActivityHeatmapResponseSchema = external_exports.object({
6492
+ rowKeys: external_exports.array(external_exports.string()),
6493
+ colKeys: external_exports.array(external_exports.string()),
6494
+ cells: external_exports.array(ActivityHeatmapCellSchema),
6495
+ maxCount: external_exports.number()
6496
+ });
6497
+
6320
6498
  // ../../packages/shared/dist/lib/agentName.js
6321
6499
  var MODIFIERS = [
6322
6500
  "Neon",
@@ -7340,7 +7518,7 @@ function getDefaultQueryTimeoutMs() {
7340
7518
  }
7341
7519
  return Math.floor(parsed);
7342
7520
  }
7343
- var xmtpCommand = new Command41("xmtp").description("Manage XMTP messaging for this agent");
7521
+ var xmtpCommand = new Command44("xmtp").description("Manage XMTP messaging for this agent");
7344
7522
  xmtpCommand.command("init").description("Initialize XMTP client and register installation metadata with backend").action(async () => {
7345
7523
  const keystore = await loadKeystore();
7346
7524
  const client = await createXmtpClient({
@@ -7568,7 +7746,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
7568
7746
  });
7569
7747
 
7570
7748
  // src/commands/daemon.ts
7571
- import { Command as Command42 } from "commander";
7749
+ import { Command as Command45 } from "commander";
7572
7750
  function diffTaskStatuses(prev, next) {
7573
7751
  const changes = [];
7574
7752
  for (const [taskId, newStatus] of next) {
@@ -7596,7 +7774,7 @@ function sleepOrAbort(ms, signal) {
7596
7774
  });
7597
7775
  }
7598
7776
  var MAX_SEEN_TASK_IDS = 2e3;
7599
- var daemonCommand = new Command42("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", "60000").option(
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(
7600
7778
  "--auction-poll-interval <ms>",
7601
7779
  "Poll interval for clock-based auction tasks (dutch/reverse_dutch) in milliseconds",
7602
7780
  "15000"
@@ -7917,11 +8095,11 @@ var daemonCommand = new Command42("daemon").description("Long-running agent daem
7917
8095
  );
7918
8096
 
7919
8097
  // src/commands/email/index.ts
7920
- import { Command as Command51 } from "commander";
8098
+ import { Command as Command54 } from "commander";
7921
8099
 
7922
8100
  // src/commands/email/register.ts
7923
- import { Command as Command43 } from "commander";
7924
- var registerCommand = new Command43("register").description("Register an email address for this agent").requiredOption("--username <name>", "Desired username (e.g. myagent)").action(async (opts) => {
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) => {
7925
8103
  const check = await apiGet(
7926
8104
  `/api/emails/check-username?username=${encodeURIComponent(opts.username)}`
7927
8105
  );
@@ -7938,8 +8116,8 @@ var registerCommand = new Command43("register").description("Register an email a
7938
8116
  });
7939
8117
 
7940
8118
  // src/commands/email/inbox.ts
7941
- import { Command as Command44 } from "commander";
7942
- var inboxCommand2 = new Command44("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) => {
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) => {
7943
8121
  const keystore = await loadKeystore();
7944
8122
  const params = new URLSearchParams({
7945
8123
  deviceId: keystore.deviceId,
@@ -7954,8 +8132,8 @@ var inboxCommand2 = new Command44("inbox").description("List emails in your inbo
7954
8132
  });
7955
8133
 
7956
8134
  // src/commands/email/read.ts
7957
- import { Command as Command45 } from "commander";
7958
- var readCommand = new Command45("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
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) => {
7959
8137
  const keystore = await loadKeystore();
7960
8138
  const params = new URLSearchParams({
7961
8139
  deviceId: keystore.deviceId,
@@ -7967,8 +8145,8 @@ var readCommand = new Command45("read").description("Read an email by ID (marks
7967
8145
  });
7968
8146
 
7969
8147
  // src/commands/email/send.ts
7970
- import { Command as Command46 } from "commander";
7971
- var sendCommand = new Command46("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) => {
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) => {
7972
8150
  const keystore = await loadKeystore();
7973
8151
  const result = await apiPost("/api/emails/send", {
7974
8152
  deviceId: keystore.deviceId,
@@ -7981,8 +8159,8 @@ var sendCommand = new Command46("send").description("Send an email").requiredOpt
7981
8159
  });
7982
8160
 
7983
8161
  // src/commands/email/reply.ts
7984
- import { Command as Command47 } from "commander";
7985
- var replyCommand = new Command47("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").action(async (id, opts) => {
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) => {
7986
8164
  const keystore = await loadKeystore();
7987
8165
  const params = new URLSearchParams({
7988
8166
  deviceId: keystore.deviceId,
@@ -8004,8 +8182,8 @@ var replyCommand = new Command47("reply").description("Reply to an email").argum
8004
8182
  });
8005
8183
 
8006
8184
  // src/commands/email/delete.ts
8007
- import { Command as Command48 } from "commander";
8008
- var deleteCommand = new Command48("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
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) => {
8009
8187
  const keystore = await loadKeystore();
8010
8188
  const result = await apiPost("/api/emails/delete", {
8011
8189
  deviceId: keystore.deviceId,
@@ -8016,15 +8194,15 @@ var deleteCommand = new Command48("delete").description("Delete an email by ID")
8016
8194
  });
8017
8195
 
8018
8196
  // src/commands/email/address.ts
8019
- import { Command as Command49 } from "commander";
8020
- var addressCommand2 = new Command49("address").description("Show your registered email address").action(async () => {
8197
+ import { Command as Command52 } from "commander";
8198
+ var addressCommand2 = new Command52("address").description("Show your registered email address").action(async () => {
8021
8199
  const keystore = await loadKeystore();
8022
8200
  const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
8023
8201
  printResult({ emailAddress: result.emailAddress ?? null });
8024
8202
  });
8025
8203
 
8026
8204
  // src/commands/email/mark-read.ts
8027
- import { Command as Command50 } from "commander";
8205
+ import { Command as Command53 } from "commander";
8028
8206
  async function setReadStatus(id, read) {
8029
8207
  const keystore = await loadKeystore();
8030
8208
  const result = await apiPost("/api/emails/mark-read", {
@@ -8035,12 +8213,12 @@ async function setReadStatus(id, read) {
8035
8213
  });
8036
8214
  printResult({ id: result.id, isRead: result.isRead });
8037
8215
  }
8038
- var markReadCommand = new Command50("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) => {
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) => {
8039
8217
  await setReadStatus(id, !opts.unread);
8040
8218
  });
8041
8219
 
8042
8220
  // src/commands/email/index.ts
8043
- var emailCommand = new Command51("email").description("Email management commands");
8221
+ var emailCommand = new Command54("email").description("Email management commands");
8044
8222
  emailCommand.addCommand(registerCommand);
8045
8223
  emailCommand.addCommand(inboxCommand2);
8046
8224
  emailCommand.addCommand(readCommand);
@@ -8053,7 +8231,7 @@ emailCommand.addCommand(markReadCommand);
8053
8231
  // src/index.ts
8054
8232
  var require2 = createRequire(import.meta.url);
8055
8233
  var { version } = require2("../package.json");
8056
- var program = new Command52();
8234
+ var program = new Command55();
8057
8235
  program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
8058
8236
  program.addCommand(initCommand);
8059
8237
  program.addCommand(walletCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucid-agents/taskmarket",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "taskmarket": "./dist/index.js"
@@ -18,8 +18,8 @@
18
18
  "typescript": "^5.3.3",
19
19
  "vitest": "^2.0.0",
20
20
  "@taskmarket/eslint-config": "0.0.0",
21
- "@taskmarket/prettier-config": "0.0.0",
22
- "@taskmarket/shared": "2.0.0"
21
+ "@taskmarket/shared": "2.0.0",
22
+ "@taskmarket/prettier-config": "0.0.0"
23
23
  },
24
24
  "files": [
25
25
  "dist"