@lucid-agents/taskmarket 1.1.0 → 1.1.1

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 +202 -65
  2. package/package.json +1 -1
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 Command53 } 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 Command30 } 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,28 @@ 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/update.ts
1083
+ import { Command as Command23 } from "commander";
1048
1084
  function toBaseUnits(humanUsdc) {
1049
1085
  const [intPart = "0", fracPart = ""] = humanUsdc.trim().split(".");
1050
1086
  const padded = fracPart.slice(0, 6).padEnd(6, "0");
1051
1087
  return (BigInt(intPart) * 1000000n + BigInt(padded)).toString();
1052
1088
  }
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(
1089
+ var updateCmd = new Command23("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
1090
  async (taskId, opts) => {
1055
1091
  const body = { taskId };
1056
1092
  if (opts.reward !== void 0) {
@@ -1105,8 +1141,8 @@ var updateCmd = new Command22("update").description("Update an open task (costs
1105
1141
  );
1106
1142
 
1107
1143
  // 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) => {
1144
+ import { Command as Command24 } from "commander";
1145
+ var forfeitCmd = new Command24("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
1146
  try {
1111
1147
  const keystore = await loadKeystore();
1112
1148
  const message = `taskmarket:forfeit:${taskId}`;
@@ -1123,8 +1159,8 @@ var forfeitCmd = new Command23("forfeit").description("Reclaim a claim-mode task
1123
1159
  });
1124
1160
 
1125
1161
  // 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(
1162
+ import { Command as Command25 } from "commander";
1163
+ var evaluateCmd = new Command25("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
1164
  "--award <worker:amount:rank>",
1129
1165
  "Award entry (repeatable): worker:amountUSDC:rank",
1130
1166
  collect,
@@ -1187,28 +1223,28 @@ function collect(val, prev) {
1187
1223
  }
1188
1224
 
1189
1225
  // 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) => {
1226
+ import { Command as Command26 } from "commander";
1227
+ var appealCmd = new Command26("appeal").description("Appeal an evaluator verdict while in Appealing state").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
1192
1228
  const result = await x402Post(`/api/tasks/${taskId}/appeal`, { taskId });
1193
1229
  printResult({ txHash: result.txHash });
1194
1230
  });
1195
1231
 
1196
1232
  // 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) => {
1233
+ import { Command as Command27 } from "commander";
1234
+ var evaluatorTimeoutCmd = new Command27("evaluator-timeout").description("Trigger evaluator timeout after the evaluation window expires (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
1199
1235
  const result = await x402Post(`/api/tasks/${taskId}/evaluator-timeout`, { taskId });
1200
1236
  printResult({ txHash: result.txHash });
1201
1237
  });
1202
1238
 
1203
1239
  // 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) => {
1240
+ import { Command as Command28 } from "commander";
1241
+ var finalizeVerdictCmd = new Command28("finalize-verdict").description("Finalize an evaluator verdict after the appeal window expires (permissionless)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
1206
1242
  const result = await x402Post(`/api/tasks/${taskId}/finalize-verdict`, { taskId });
1207
1243
  printResult({ txHash: result.txHash });
1208
1244
  });
1209
1245
 
1210
1246
  // src/commands/task/resolve-dispute.ts
1211
- import { Command as Command28 } from "commander";
1247
+ import { Command as Command29 } from "commander";
1212
1248
  function parseAward(spec) {
1213
1249
  const parts = spec.split(":");
1214
1250
  if (parts.length !== 3) {
@@ -1232,7 +1268,7 @@ function parseAward(spec) {
1232
1268
  rank
1233
1269
  };
1234
1270
  }
1235
- var resolveDisputeCmd = new Command28("resolve-dispute").description(
1271
+ var resolveDisputeCmd = new Command29("resolve-dispute").description(
1236
1272
  "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
1273
  ).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--verdict <type>", "Verdict type: approve or partial").requiredOption(
1238
1274
  "--award <spec...>",
@@ -1258,7 +1294,7 @@ var resolveDisputeCmd = new Command28("resolve-dispute").description(
1258
1294
  });
1259
1295
 
1260
1296
  // src/commands/task/index.ts
1261
- var taskCommand = new Command29("task").description("Manage tasks");
1297
+ var taskCommand = new Command30("task").description("Manage tasks");
1262
1298
  taskCommand.addCommand(createCmd);
1263
1299
  taskCommand.addCommand(listCmd);
1264
1300
  taskCommand.addCommand(getCmd);
@@ -1276,6 +1312,7 @@ taskCommand.addCommand(submissionsCmd);
1276
1312
  taskCommand.addCommand(selectWinnerCmd);
1277
1313
  taskCommand.addCommand(downloadCmd);
1278
1314
  taskCommand.addCommand(cancelCmd);
1315
+ taskCommand.addCommand(refundExpiredCmd);
1279
1316
  taskCommand.addCommand(updateCmd);
1280
1317
  taskCommand.addCommand(forfeitCmd);
1281
1318
  taskCommand.addCommand(evaluateCmd);
@@ -1285,8 +1322,8 @@ taskCommand.addCommand(finalizeVerdictCmd);
1285
1322
  taskCommand.addCommand(resolveDisputeCmd);
1286
1323
 
1287
1324
  // 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) => {
1325
+ import { Command as Command31 } from "commander";
1326
+ var agentsCommand = new Command31("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
1327
  const params = new URLSearchParams();
1291
1328
  if (opts.sort) params.set("sort", opts.sort);
1292
1329
  if (opts.skill) params.set("skill", opts.skill);
@@ -1297,8 +1334,8 @@ var agentsCommand = new Command30("agents").description("Browse the agent direct
1297
1334
  });
1298
1335
 
1299
1336
  // 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 () => {
1337
+ import { Command as Command32 } from "commander";
1338
+ var inboxCommand = new Command32("inbox").description("Show tasks you created and tasks you are working on").action(async () => {
1302
1339
  let address;
1303
1340
  try {
1304
1341
  address = await getWalletAddress();
@@ -1324,8 +1361,8 @@ var inboxCommand = new Command31("inbox").description("Show tasks you created an
1324
1361
  });
1325
1362
 
1326
1363
  // 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 () => {
1364
+ import { Command as Command33 } from "commander";
1365
+ var depositCommand = new Command33("deposit").description("Show wallet address and network info for funding").action(async () => {
1329
1366
  let address;
1330
1367
  try {
1331
1368
  address = await getWalletAddress();
@@ -1352,11 +1389,11 @@ var depositCommand = new Command32("deposit").description("Show wallet address a
1352
1389
  });
1353
1390
 
1354
1391
  // src/commands/wallet/index.ts
1355
- import { Command as Command37 } from "commander";
1392
+ import { Command as Command38 } from "commander";
1356
1393
 
1357
1394
  // 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) => {
1395
+ import { Command as Command34 } from "commander";
1396
+ var walletBalanceCommand = new Command34("balance").description("Show USDC balance").option("--address <addr>", "Address to check (defaults to own wallet)").action(async (opts) => {
1360
1397
  let address = opts.address;
1361
1398
  if (!address) {
1362
1399
  const keystore = await loadKeystore();
@@ -1367,7 +1404,7 @@ var walletBalanceCommand = new Command33("balance").description("Show USDC balan
1367
1404
  });
1368
1405
 
1369
1406
  // src/commands/wallet/import.ts
1370
- import { Command as Command34 } from "commander";
1407
+ import { Command as Command35 } from "commander";
1371
1408
  import { createInterface } from "readline";
1372
1409
  import { privateKeyToAccount as privateKeyToAccount3 } from "viem/accounts";
1373
1410
  function normalizePrivateKey(raw) {
@@ -1402,7 +1439,7 @@ function promptHiddenInput(prompt) {
1402
1439
  });
1403
1440
  });
1404
1441
  }
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) => {
1442
+ var walletImportCommand = new Command35("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
1443
  if (await keystoreExists()) {
1407
1444
  const keystore = await loadKeystore();
1408
1445
  printResult({ address: keystore.walletAddress, agentId: keystore.agentId });
@@ -1467,11 +1504,11 @@ var walletImportCommand = new Command34("import").description("Import an existin
1467
1504
  });
1468
1505
 
1469
1506
  // src/commands/wallet/set-withdrawal-address.ts
1470
- import { Command as Command35 } from "commander";
1507
+ import { Command as Command36 } from "commander";
1471
1508
  function isValidAddress(addr) {
1472
1509
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
1473
1510
  }
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) => {
1511
+ var setWithdrawalAddressCommand = new Command36("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
1512
  if (!isValidAddress(address)) {
1476
1513
  printError("Invalid Ethereum address: must be 0x followed by 40 hex characters");
1477
1514
  }
@@ -1493,8 +1530,8 @@ var setWithdrawalAddressCommand = new Command35("set-withdrawal-address").descri
1493
1530
  });
1494
1531
 
1495
1532
  // 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 () => {
1533
+ import { Command as Command37 } from "commander";
1534
+ var publishKeyCommand = new Command37("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
1498
1535
  let keystore;
1499
1536
  try {
1500
1537
  keystore = await loadKeystore();
@@ -1513,14 +1550,14 @@ var publishKeyCommand = new Command36("publish-key").description("Publish your s
1513
1550
  });
1514
1551
 
1515
1552
  // src/commands/wallet/index.ts
1516
- var walletCommand = new Command37("wallet").description("Wallet management commands");
1553
+ var walletCommand = new Command38("wallet").description("Wallet management commands");
1517
1554
  walletCommand.addCommand(walletBalanceCommand);
1518
1555
  walletCommand.addCommand(walletImportCommand);
1519
1556
  walletCommand.addCommand(setWithdrawalAddressCommand);
1520
1557
  walletCommand.addCommand(publishKeyCommand);
1521
1558
 
1522
1559
  // src/commands/withdraw.ts
1523
- import { Command as Command38 } from "commander";
1560
+ import { Command as Command39 } from "commander";
1524
1561
  import { toHex as toHex2 } from "viem";
1525
1562
  var USDC_TYPES = {
1526
1563
  TransferWithAuthorization: [
@@ -1532,7 +1569,7 @@ var USDC_TYPES = {
1532
1569
  { name: "nonce", type: "bytes32" }
1533
1570
  ]
1534
1571
  };
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) => {
1572
+ var withdrawCommand = new Command39("withdraw").description("Withdraw USDC to the registered withdrawal address").argument("<amount>", "Amount in USDC (e.g. 5 for 5 USDC)").action(async (amount) => {
1536
1573
  const parsed = parseFloat(amount);
1537
1574
  if (isNaN(parsed) || parsed <= 0) {
1538
1575
  printError("Invalid amount: must be a positive number (e.g. 5 for 5 USDC)");
@@ -1582,9 +1619,9 @@ var withdrawCommand = new Command38("withdraw").description("Withdraw USDC to th
1582
1619
  });
1583
1620
 
1584
1621
  // src/commands/encrypt.ts
1585
- import { Command as Command39 } from "commander";
1622
+ import { Command as Command40 } from "commander";
1586
1623
  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) => {
1624
+ var encryptCommand = new Command40("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
1625
  let plaintext;
1589
1626
  try {
1590
1627
  plaintext = await fs2.readFile(file);
@@ -1633,9 +1670,9 @@ var encryptCommand = new Command39("encrypt").description("Encrypt a file with E
1633
1670
  });
1634
1671
 
1635
1672
  // src/commands/decrypt.ts
1636
- import { Command as Command40 } from "commander";
1673
+ import { Command as Command41 } from "commander";
1637
1674
  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) => {
1675
+ var decryptCommand = new Command41("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
1676
  let ciphertext;
1640
1677
  try {
1641
1678
  ciphertext = await fs3.readFile(file);
@@ -1673,7 +1710,7 @@ var decryptCommand = new Command40("decrypt").description("Decrypt a file using
1673
1710
  });
1674
1711
 
1675
1712
  // src/commands/xmtp.ts
1676
- import { Command as Command41 } from "commander";
1713
+ import { Command as Command42 } from "commander";
1677
1714
 
1678
1715
  // src/lib/xmtp-client.ts
1679
1716
  import os2 from "os";
@@ -5814,7 +5851,8 @@ var TaskResponseSchema = external_exports.object({
5814
5851
  verdictType: external_exports.enum(["APPROVE", "REJECT", "PARTIAL"]).nullable().optional(),
5815
5852
  verdictScore: external_exports.number().nullable().optional(),
5816
5853
  verdictConfidence: external_exports.number().nullable().optional(),
5817
- verdictEvidenceHash: external_exports.string().nullable().optional()
5854
+ verdictEvidenceHash: external_exports.string().nullable().optional(),
5855
+ submissionWindowOpen: external_exports.boolean()
5818
5856
  });
5819
5857
  var TaskListInputSchema = external_exports.object({
5820
5858
  limit: external_exports.number().min(1).max(100).optional().default(20),
@@ -5826,7 +5864,10 @@ var TaskListInputSchema = external_exports.object({
5826
5864
  tags: external_exports.array(external_exports.string()).optional(),
5827
5865
  minReward: external_exports.string().optional(),
5828
5866
  maxReward: external_exports.string().optional(),
5829
- deadlineHours: external_exports.number().int().positive().optional()
5867
+ deadlineHours: external_exports.number().int().positive().optional(),
5868
+ requester: external_exports.string().optional(),
5869
+ worker: external_exports.string().optional(),
5870
+ sort: external_exports.enum(["newest", "reward_desc", "reward_asc", "deadline_asc"]).optional().default("newest")
5830
5871
  });
5831
5872
  var TaskListResponseSchema = external_exports.object({
5832
5873
  tasks: external_exports.array(TaskResponseSchema),
@@ -5853,6 +5894,7 @@ var PendingActionName = external_exports.enum([
5853
5894
  "forfeit",
5854
5895
  "pitch",
5855
5896
  "rate",
5897
+ "refund_expired",
5856
5898
  "resolve_dispute",
5857
5899
  "select_winner",
5858
5900
  "select_worker",
@@ -5916,7 +5958,9 @@ var ArtifactResponseSchema = external_exports.object({
5916
5958
  sha256Hash: external_exports.string(),
5917
5959
  keccak256Hash: external_exports.string(),
5918
5960
  displayOrder: external_exports.number(),
5919
- textPreview: external_exports.string().optional()
5961
+ textPreview: external_exports.string().optional(),
5962
+ previewUrl: external_exports.string().optional(),
5963
+ previewExpiresAt: external_exports.string().optional()
5920
5964
  });
5921
5965
  var SubmissionCreateSchema = external_exports.object({
5922
5966
  taskId: external_exports.string(),
@@ -5942,6 +5986,13 @@ var SubmissionResponseSchema = external_exports.object({
5942
5986
  averageRating: external_exports.number()
5943
5987
  }).nullable().optional()
5944
5988
  });
5989
+ var AgentWorkItemSchema = external_exports.object({
5990
+ taskId: external_exports.string(),
5991
+ taskTitle: external_exports.string(),
5992
+ completedAt: external_exports.string(),
5993
+ artifacts: external_exports.array(ArtifactResponseSchema)
5994
+ });
5995
+ var AgentWorkResponseSchema = external_exports.array(AgentWorkItemSchema);
5945
5996
  var DownloadRequestSchema = external_exports.object({
5946
5997
  acceptanceTxHash: external_exports.string(),
5947
5998
  artifactId: external_exports.string().optional()
@@ -6317,6 +6368,92 @@ var BroadcastResultSchema = external_exports.object({
6317
6368
  total: external_exports.number()
6318
6369
  });
6319
6370
 
6371
+ // ../../packages/shared/dist/schemas/stats.schemas.js
6372
+ var TimeRangeEnum = external_exports.enum(["7d", "30d", "90d", "all"]);
6373
+ var BucketEnum = external_exports.enum(["day", "week"]);
6374
+ var ActivityTypeEnum = external_exports.enum([
6375
+ "task_created",
6376
+ "task_submitted",
6377
+ "task_claimed",
6378
+ "task_pitched",
6379
+ "bid_placed",
6380
+ "task_rated"
6381
+ ]);
6382
+ var ActorTypeEnum = external_exports.enum(["human", "agent"]);
6383
+ var PlatformTimeSeriesInputSchema = external_exports.object({
6384
+ range: TimeRangeEnum.optional().default("30d"),
6385
+ bucket: BucketEnum.optional().default("day")
6386
+ });
6387
+ var PlatformTimeSeriesPointSchema = external_exports.object({
6388
+ bucket: external_exports.string(),
6389
+ tasksCreated: external_exports.number(),
6390
+ rewardVolume: external_exports.string(),
6391
+ completedTasks: external_exports.number(),
6392
+ newAgents: external_exports.number(),
6393
+ activeAgents: external_exports.number()
6394
+ });
6395
+ var PlatformTimeSeriesResponseSchema = external_exports.array(PlatformTimeSeriesPointSchema);
6396
+ var AgentTimeSeriesInputSchema = external_exports.object({
6397
+ address: external_exports.string().optional(),
6398
+ agentId: external_exports.string().optional(),
6399
+ range: TimeRangeEnum.optional().default("90d"),
6400
+ bucket: BucketEnum.optional().default("week")
6401
+ }).refine((v) => Boolean(v.address) || Boolean(v.agentId), {
6402
+ message: "Provide address or agentId"
6403
+ });
6404
+ var AgentTimeSeriesPointSchema = external_exports.object({
6405
+ bucket: external_exports.string(),
6406
+ earnings: external_exports.string(),
6407
+ cumulativeEarnings: external_exports.string(),
6408
+ tasksCompleted: external_exports.number(),
6409
+ avgRating: external_exports.number().nullable(),
6410
+ ratingsCount: external_exports.number(),
6411
+ activityCount: external_exports.number()
6412
+ });
6413
+ var AgentTimeSeriesResponseSchema = external_exports.array(AgentTimeSeriesPointSchema);
6414
+ var BreakdownsInputSchema = external_exports.object({});
6415
+ var BreakdownsResponseSchema = external_exports.object({
6416
+ status: external_exports.array(external_exports.object({ status: external_exports.string(), count: external_exports.number() })),
6417
+ mode: external_exports.array(external_exports.object({ mode: external_exports.string(), count: external_exports.number() })),
6418
+ actorType: external_exports.array(external_exports.object({ actorType: ActorTypeEnum, count: external_exports.number() }))
6419
+ });
6420
+ var ActivityFeedInputSchema = external_exports.object({
6421
+ limit: external_exports.number().int().min(1).max(50).optional().default(20),
6422
+ cursor: external_exports.string().optional(),
6423
+ types: external_exports.array(ActivityTypeEnum).optional()
6424
+ });
6425
+ var ActivityFeedItemSchema = external_exports.object({
6426
+ type: ActivityTypeEnum,
6427
+ timestamp: external_exports.string(),
6428
+ taskId: external_exports.string(),
6429
+ taskTitle: external_exports.string().nullable(),
6430
+ actor: external_exports.string(),
6431
+ actorType: ActorTypeEnum,
6432
+ amount: external_exports.string().nullable(),
6433
+ rating: external_exports.number().nullable()
6434
+ });
6435
+ var ActivityFeedResponseSchema = external_exports.object({
6436
+ items: external_exports.array(ActivityFeedItemSchema),
6437
+ nextCursor: external_exports.string().nullable()
6438
+ });
6439
+ var HeatmapDimensionEnum = external_exports.enum(["mode", "hourOfWeek"]);
6440
+ var ActivityHeatmapInputSchema = external_exports.object({
6441
+ range: TimeRangeEnum.optional().default("30d"),
6442
+ dimension: HeatmapDimensionEnum.optional().default("mode")
6443
+ });
6444
+ var ActivityHeatmapCellSchema = external_exports.object({
6445
+ row: external_exports.string(),
6446
+ col: external_exports.string(),
6447
+ count: external_exports.number(),
6448
+ volume: external_exports.string()
6449
+ });
6450
+ var ActivityHeatmapResponseSchema = external_exports.object({
6451
+ rowKeys: external_exports.array(external_exports.string()),
6452
+ colKeys: external_exports.array(external_exports.string()),
6453
+ cells: external_exports.array(ActivityHeatmapCellSchema),
6454
+ maxCount: external_exports.number()
6455
+ });
6456
+
6320
6457
  // ../../packages/shared/dist/lib/agentName.js
6321
6458
  var MODIFIERS = [
6322
6459
  "Neon",
@@ -7340,7 +7477,7 @@ function getDefaultQueryTimeoutMs() {
7340
7477
  }
7341
7478
  return Math.floor(parsed);
7342
7479
  }
7343
- var xmtpCommand = new Command41("xmtp").description("Manage XMTP messaging for this agent");
7480
+ var xmtpCommand = new Command42("xmtp").description("Manage XMTP messaging for this agent");
7344
7481
  xmtpCommand.command("init").description("Initialize XMTP client and register installation metadata with backend").action(async () => {
7345
7482
  const keystore = await loadKeystore();
7346
7483
  const client = await createXmtpClient({
@@ -7568,7 +7705,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
7568
7705
  });
7569
7706
 
7570
7707
  // src/commands/daemon.ts
7571
- import { Command as Command42 } from "commander";
7708
+ import { Command as Command43 } from "commander";
7572
7709
  function diffTaskStatuses(prev, next) {
7573
7710
  const changes = [];
7574
7711
  for (const [taskId, newStatus] of next) {
@@ -7596,7 +7733,7 @@ function sleepOrAbort(ms, signal) {
7596
7733
  });
7597
7734
  }
7598
7735
  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(
7736
+ var daemonCommand = new Command43("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
7737
  "--auction-poll-interval <ms>",
7601
7738
  "Poll interval for clock-based auction tasks (dutch/reverse_dutch) in milliseconds",
7602
7739
  "15000"
@@ -7917,11 +8054,11 @@ var daemonCommand = new Command42("daemon").description("Long-running agent daem
7917
8054
  );
7918
8055
 
7919
8056
  // src/commands/email/index.ts
7920
- import { Command as Command51 } from "commander";
8057
+ import { Command as Command52 } from "commander";
7921
8058
 
7922
8059
  // 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) => {
8060
+ import { Command as Command44 } from "commander";
8061
+ var registerCommand = new Command44("register").description("Register an email address for this agent").requiredOption("--username <name>", "Desired username (e.g. myagent)").action(async (opts) => {
7925
8062
  const check = await apiGet(
7926
8063
  `/api/emails/check-username?username=${encodeURIComponent(opts.username)}`
7927
8064
  );
@@ -7938,8 +8075,8 @@ var registerCommand = new Command43("register").description("Register an email a
7938
8075
  });
7939
8076
 
7940
8077
  // 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) => {
8078
+ import { Command as Command45 } from "commander";
8079
+ var inboxCommand2 = new Command45("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
8080
  const keystore = await loadKeystore();
7944
8081
  const params = new URLSearchParams({
7945
8082
  deviceId: keystore.deviceId,
@@ -7954,8 +8091,8 @@ var inboxCommand2 = new Command44("inbox").description("List emails in your inbo
7954
8091
  });
7955
8092
 
7956
8093
  // 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) => {
8094
+ import { Command as Command46 } from "commander";
8095
+ var readCommand = new Command46("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
7959
8096
  const keystore = await loadKeystore();
7960
8097
  const params = new URLSearchParams({
7961
8098
  deviceId: keystore.deviceId,
@@ -7967,8 +8104,8 @@ var readCommand = new Command45("read").description("Read an email by ID (marks
7967
8104
  });
7968
8105
 
7969
8106
  // 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) => {
8107
+ import { Command as Command47 } from "commander";
8108
+ var sendCommand = new Command47("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
8109
  const keystore = await loadKeystore();
7973
8110
  const result = await apiPost("/api/emails/send", {
7974
8111
  deviceId: keystore.deviceId,
@@ -7981,8 +8118,8 @@ var sendCommand = new Command46("send").description("Send an email").requiredOpt
7981
8118
  });
7982
8119
 
7983
8120
  // 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) => {
8121
+ import { Command as Command48 } from "commander";
8122
+ var replyCommand = new Command48("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").action(async (id, opts) => {
7986
8123
  const keystore = await loadKeystore();
7987
8124
  const params = new URLSearchParams({
7988
8125
  deviceId: keystore.deviceId,
@@ -8004,8 +8141,8 @@ var replyCommand = new Command47("reply").description("Reply to an email").argum
8004
8141
  });
8005
8142
 
8006
8143
  // 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) => {
8144
+ import { Command as Command49 } from "commander";
8145
+ var deleteCommand = new Command49("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
8009
8146
  const keystore = await loadKeystore();
8010
8147
  const result = await apiPost("/api/emails/delete", {
8011
8148
  deviceId: keystore.deviceId,
@@ -8016,15 +8153,15 @@ var deleteCommand = new Command48("delete").description("Delete an email by ID")
8016
8153
  });
8017
8154
 
8018
8155
  // 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 () => {
8156
+ import { Command as Command50 } from "commander";
8157
+ var addressCommand2 = new Command50("address").description("Show your registered email address").action(async () => {
8021
8158
  const keystore = await loadKeystore();
8022
8159
  const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
8023
8160
  printResult({ emailAddress: result.emailAddress ?? null });
8024
8161
  });
8025
8162
 
8026
8163
  // src/commands/email/mark-read.ts
8027
- import { Command as Command50 } from "commander";
8164
+ import { Command as Command51 } from "commander";
8028
8165
  async function setReadStatus(id, read) {
8029
8166
  const keystore = await loadKeystore();
8030
8167
  const result = await apiPost("/api/emails/mark-read", {
@@ -8035,12 +8172,12 @@ async function setReadStatus(id, read) {
8035
8172
  });
8036
8173
  printResult({ id: result.id, isRead: result.isRead });
8037
8174
  }
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) => {
8175
+ var markReadCommand = new Command51("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
8176
  await setReadStatus(id, !opts.unread);
8040
8177
  });
8041
8178
 
8042
8179
  // src/commands/email/index.ts
8043
- var emailCommand = new Command51("email").description("Email management commands");
8180
+ var emailCommand = new Command52("email").description("Email management commands");
8044
8181
  emailCommand.addCommand(registerCommand);
8045
8182
  emailCommand.addCommand(inboxCommand2);
8046
8183
  emailCommand.addCommand(readCommand);
@@ -8053,7 +8190,7 @@ emailCommand.addCommand(markReadCommand);
8053
8190
  // src/index.ts
8054
8191
  var require2 = createRequire(import.meta.url);
8055
8192
  var { version } = require2("../package.json");
8056
- var program = new Command52();
8193
+ var program = new Command53();
8057
8194
  program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
8058
8195
  program.addCommand(initCommand);
8059
8196
  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.1.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "taskmarket": "./dist/index.js"