@lucid-agents/taskmarket 1.1.1 → 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.
- package/dist/index.js +130 -89
- 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
|
|
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
|
|
495
|
+
import { Command as Command32 } from "commander";
|
|
496
496
|
|
|
497
497
|
// src/commands/task/create.ts
|
|
498
498
|
import { Command as Command5 } from "commander";
|
|
@@ -1079,14 +1079,50 @@ var refundExpiredCmd = new Command22("refund-expired").description(
|
|
|
1079
1079
|
}
|
|
1080
1080
|
});
|
|
1081
1081
|
|
|
1082
|
-
// src/commands/task/
|
|
1082
|
+
// src/commands/task/reject-submission.ts
|
|
1083
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";
|
|
1084
1120
|
function toBaseUnits(humanUsdc) {
|
|
1085
1121
|
const [intPart = "0", fracPart = ""] = humanUsdc.trim().split(".");
|
|
1086
1122
|
const padded = fracPart.slice(0, 6).padEnd(6, "0");
|
|
1087
1123
|
return (BigInt(intPart) * 1000000n + BigInt(padded)).toString();
|
|
1088
1124
|
}
|
|
1089
|
-
var updateCmd = new
|
|
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(
|
|
1090
1126
|
async (taskId, opts) => {
|
|
1091
1127
|
const body = { taskId };
|
|
1092
1128
|
if (opts.reward !== void 0) {
|
|
@@ -1141,8 +1177,8 @@ var updateCmd = new Command23("update").description("Update an open task (costs
|
|
|
1141
1177
|
);
|
|
1142
1178
|
|
|
1143
1179
|
// src/commands/task/forfeit.ts
|
|
1144
|
-
import { Command as
|
|
1145
|
-
var forfeitCmd = new
|
|
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) => {
|
|
1146
1182
|
try {
|
|
1147
1183
|
const keystore = await loadKeystore();
|
|
1148
1184
|
const message = `taskmarket:forfeit:${taskId}`;
|
|
@@ -1159,8 +1195,8 @@ var forfeitCmd = new Command24("forfeit").description("Reclaim a claim-mode task
|
|
|
1159
1195
|
});
|
|
1160
1196
|
|
|
1161
1197
|
// src/commands/task/evaluate.ts
|
|
1162
|
-
import { Command as
|
|
1163
|
-
var evaluateCmd = new
|
|
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(
|
|
1164
1200
|
"--award <worker:amount:rank>",
|
|
1165
1201
|
"Award entry (repeatable): worker:amountUSDC:rank",
|
|
1166
1202
|
collect,
|
|
@@ -1223,28 +1259,28 @@ function collect(val, prev) {
|
|
|
1223
1259
|
}
|
|
1224
1260
|
|
|
1225
1261
|
// src/commands/task/appeal.ts
|
|
1226
|
-
import { Command as
|
|
1227
|
-
var appealCmd = new
|
|
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) => {
|
|
1228
1264
|
const result = await x402Post(`/api/tasks/${taskId}/appeal`, { taskId });
|
|
1229
1265
|
printResult({ txHash: result.txHash });
|
|
1230
1266
|
});
|
|
1231
1267
|
|
|
1232
1268
|
// src/commands/task/evaluator-timeout.ts
|
|
1233
|
-
import { Command as
|
|
1234
|
-
var evaluatorTimeoutCmd = new
|
|
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) => {
|
|
1235
1271
|
const result = await x402Post(`/api/tasks/${taskId}/evaluator-timeout`, { taskId });
|
|
1236
1272
|
printResult({ txHash: result.txHash });
|
|
1237
1273
|
});
|
|
1238
1274
|
|
|
1239
1275
|
// src/commands/task/finalize-verdict.ts
|
|
1240
|
-
import { Command as
|
|
1241
|
-
var finalizeVerdictCmd = new
|
|
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) => {
|
|
1242
1278
|
const result = await x402Post(`/api/tasks/${taskId}/finalize-verdict`, { taskId });
|
|
1243
1279
|
printResult({ txHash: result.txHash });
|
|
1244
1280
|
});
|
|
1245
1281
|
|
|
1246
1282
|
// src/commands/task/resolve-dispute.ts
|
|
1247
|
-
import { Command as
|
|
1283
|
+
import { Command as Command31 } from "commander";
|
|
1248
1284
|
function parseAward(spec) {
|
|
1249
1285
|
const parts = spec.split(":");
|
|
1250
1286
|
if (parts.length !== 3) {
|
|
@@ -1268,7 +1304,7 @@ function parseAward(spec) {
|
|
|
1268
1304
|
rank
|
|
1269
1305
|
};
|
|
1270
1306
|
}
|
|
1271
|
-
var resolveDisputeCmd = new
|
|
1307
|
+
var resolveDisputeCmd = new Command31("resolve-dispute").description(
|
|
1272
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"
|
|
1273
1309
|
).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--verdict <type>", "Verdict type: approve or partial").requiredOption(
|
|
1274
1310
|
"--award <spec...>",
|
|
@@ -1294,7 +1330,7 @@ var resolveDisputeCmd = new Command29("resolve-dispute").description(
|
|
|
1294
1330
|
});
|
|
1295
1331
|
|
|
1296
1332
|
// src/commands/task/index.ts
|
|
1297
|
-
var taskCommand = new
|
|
1333
|
+
var taskCommand = new Command32("task").description("Manage tasks");
|
|
1298
1334
|
taskCommand.addCommand(createCmd);
|
|
1299
1335
|
taskCommand.addCommand(listCmd);
|
|
1300
1336
|
taskCommand.addCommand(getCmd);
|
|
@@ -1313,6 +1349,8 @@ taskCommand.addCommand(selectWinnerCmd);
|
|
|
1313
1349
|
taskCommand.addCommand(downloadCmd);
|
|
1314
1350
|
taskCommand.addCommand(cancelCmd);
|
|
1315
1351
|
taskCommand.addCommand(refundExpiredCmd);
|
|
1352
|
+
taskCommand.addCommand(rejectSubmissionCmd);
|
|
1353
|
+
taskCommand.addCommand(mySubmissionsCmd);
|
|
1316
1354
|
taskCommand.addCommand(updateCmd);
|
|
1317
1355
|
taskCommand.addCommand(forfeitCmd);
|
|
1318
1356
|
taskCommand.addCommand(evaluateCmd);
|
|
@@ -1322,8 +1360,8 @@ taskCommand.addCommand(finalizeVerdictCmd);
|
|
|
1322
1360
|
taskCommand.addCommand(resolveDisputeCmd);
|
|
1323
1361
|
|
|
1324
1362
|
// src/commands/agents.ts
|
|
1325
|
-
import { Command as
|
|
1326
|
-
var agentsCommand = new
|
|
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) => {
|
|
1327
1365
|
const params = new URLSearchParams();
|
|
1328
1366
|
if (opts.sort) params.set("sort", opts.sort);
|
|
1329
1367
|
if (opts.skill) params.set("skill", opts.skill);
|
|
@@ -1334,8 +1372,8 @@ var agentsCommand = new Command31("agents").description("Browse the agent direct
|
|
|
1334
1372
|
});
|
|
1335
1373
|
|
|
1336
1374
|
// src/commands/inbox.ts
|
|
1337
|
-
import { Command as
|
|
1338
|
-
var inboxCommand = new
|
|
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 () => {
|
|
1339
1377
|
let address;
|
|
1340
1378
|
try {
|
|
1341
1379
|
address = await getWalletAddress();
|
|
@@ -1361,8 +1399,8 @@ var inboxCommand = new Command32("inbox").description("Show tasks you created an
|
|
|
1361
1399
|
});
|
|
1362
1400
|
|
|
1363
1401
|
// src/commands/deposit.ts
|
|
1364
|
-
import { Command as
|
|
1365
|
-
var depositCommand = new
|
|
1402
|
+
import { Command as Command35 } from "commander";
|
|
1403
|
+
var depositCommand = new Command35("deposit").description("Show wallet address and network info for funding").action(async () => {
|
|
1366
1404
|
let address;
|
|
1367
1405
|
try {
|
|
1368
1406
|
address = await getWalletAddress();
|
|
@@ -1389,11 +1427,11 @@ var depositCommand = new Command33("deposit").description("Show wallet address a
|
|
|
1389
1427
|
});
|
|
1390
1428
|
|
|
1391
1429
|
// src/commands/wallet/index.ts
|
|
1392
|
-
import { Command as
|
|
1430
|
+
import { Command as Command40 } from "commander";
|
|
1393
1431
|
|
|
1394
1432
|
// src/commands/wallet/balance.ts
|
|
1395
|
-
import { Command as
|
|
1396
|
-
var walletBalanceCommand = new
|
|
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) => {
|
|
1397
1435
|
let address = opts.address;
|
|
1398
1436
|
if (!address) {
|
|
1399
1437
|
const keystore = await loadKeystore();
|
|
@@ -1404,7 +1442,7 @@ var walletBalanceCommand = new Command34("balance").description("Show USDC balan
|
|
|
1404
1442
|
});
|
|
1405
1443
|
|
|
1406
1444
|
// src/commands/wallet/import.ts
|
|
1407
|
-
import { Command as
|
|
1445
|
+
import { Command as Command37 } from "commander";
|
|
1408
1446
|
import { createInterface } from "readline";
|
|
1409
1447
|
import { privateKeyToAccount as privateKeyToAccount3 } from "viem/accounts";
|
|
1410
1448
|
function normalizePrivateKey(raw) {
|
|
@@ -1439,7 +1477,7 @@ function promptHiddenInput(prompt) {
|
|
|
1439
1477
|
});
|
|
1440
1478
|
});
|
|
1441
1479
|
}
|
|
1442
|
-
var walletImportCommand = new
|
|
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) => {
|
|
1443
1481
|
if (await keystoreExists()) {
|
|
1444
1482
|
const keystore = await loadKeystore();
|
|
1445
1483
|
printResult({ address: keystore.walletAddress, agentId: keystore.agentId });
|
|
@@ -1504,11 +1542,11 @@ var walletImportCommand = new Command35("import").description("Import an existin
|
|
|
1504
1542
|
});
|
|
1505
1543
|
|
|
1506
1544
|
// src/commands/wallet/set-withdrawal-address.ts
|
|
1507
|
-
import { Command as
|
|
1545
|
+
import { Command as Command38 } from "commander";
|
|
1508
1546
|
function isValidAddress(addr) {
|
|
1509
1547
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
1510
1548
|
}
|
|
1511
|
-
var setWithdrawalAddressCommand = new
|
|
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) => {
|
|
1512
1550
|
if (!isValidAddress(address)) {
|
|
1513
1551
|
printError("Invalid Ethereum address: must be 0x followed by 40 hex characters");
|
|
1514
1552
|
}
|
|
@@ -1530,8 +1568,8 @@ var setWithdrawalAddressCommand = new Command36("set-withdrawal-address").descri
|
|
|
1530
1568
|
});
|
|
1531
1569
|
|
|
1532
1570
|
// src/commands/wallet/publish-key.ts
|
|
1533
|
-
import { Command as
|
|
1534
|
-
var publishKeyCommand = new
|
|
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 () => {
|
|
1535
1573
|
let keystore;
|
|
1536
1574
|
try {
|
|
1537
1575
|
keystore = await loadKeystore();
|
|
@@ -1550,14 +1588,14 @@ var publishKeyCommand = new Command37("publish-key").description("Publish your s
|
|
|
1550
1588
|
});
|
|
1551
1589
|
|
|
1552
1590
|
// src/commands/wallet/index.ts
|
|
1553
|
-
var walletCommand = new
|
|
1591
|
+
var walletCommand = new Command40("wallet").description("Wallet management commands");
|
|
1554
1592
|
walletCommand.addCommand(walletBalanceCommand);
|
|
1555
1593
|
walletCommand.addCommand(walletImportCommand);
|
|
1556
1594
|
walletCommand.addCommand(setWithdrawalAddressCommand);
|
|
1557
1595
|
walletCommand.addCommand(publishKeyCommand);
|
|
1558
1596
|
|
|
1559
1597
|
// src/commands/withdraw.ts
|
|
1560
|
-
import { Command as
|
|
1598
|
+
import { Command as Command41 } from "commander";
|
|
1561
1599
|
import { toHex as toHex2 } from "viem";
|
|
1562
1600
|
var USDC_TYPES = {
|
|
1563
1601
|
TransferWithAuthorization: [
|
|
@@ -1569,7 +1607,7 @@ var USDC_TYPES = {
|
|
|
1569
1607
|
{ name: "nonce", type: "bytes32" }
|
|
1570
1608
|
]
|
|
1571
1609
|
};
|
|
1572
|
-
var withdrawCommand = new
|
|
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) => {
|
|
1573
1611
|
const parsed = parseFloat(amount);
|
|
1574
1612
|
if (isNaN(parsed) || parsed <= 0) {
|
|
1575
1613
|
printError("Invalid amount: must be a positive number (e.g. 5 for 5 USDC)");
|
|
@@ -1619,9 +1657,9 @@ var withdrawCommand = new Command39("withdraw").description("Withdraw USDC to th
|
|
|
1619
1657
|
});
|
|
1620
1658
|
|
|
1621
1659
|
// src/commands/encrypt.ts
|
|
1622
|
-
import { Command as
|
|
1660
|
+
import { Command as Command42 } from "commander";
|
|
1623
1661
|
import { promises as fs2 } from "fs";
|
|
1624
|
-
var encryptCommand = new
|
|
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) => {
|
|
1625
1663
|
let plaintext;
|
|
1626
1664
|
try {
|
|
1627
1665
|
plaintext = await fs2.readFile(file);
|
|
@@ -1670,9 +1708,9 @@ var encryptCommand = new Command40("encrypt").description("Encrypt a file with E
|
|
|
1670
1708
|
});
|
|
1671
1709
|
|
|
1672
1710
|
// src/commands/decrypt.ts
|
|
1673
|
-
import { Command as
|
|
1711
|
+
import { Command as Command43 } from "commander";
|
|
1674
1712
|
import { promises as fs3 } from "fs";
|
|
1675
|
-
var decryptCommand = new
|
|
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) => {
|
|
1676
1714
|
let ciphertext;
|
|
1677
1715
|
try {
|
|
1678
1716
|
ciphertext = await fs3.readFile(file);
|
|
@@ -1710,7 +1748,7 @@ var decryptCommand = new Command41("decrypt").description("Decrypt a file using
|
|
|
1710
1748
|
});
|
|
1711
1749
|
|
|
1712
1750
|
// src/commands/xmtp.ts
|
|
1713
|
-
import { Command as
|
|
1751
|
+
import { Command as Command44 } from "commander";
|
|
1714
1752
|
|
|
1715
1753
|
// src/lib/xmtp-client.ts
|
|
1716
1754
|
import os2 from "os";
|
|
@@ -5777,6 +5815,33 @@ var TaskStatus = external_exports.enum([
|
|
|
5777
5815
|
"cancelled"
|
|
5778
5816
|
]);
|
|
5779
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
|
+
});
|
|
5780
5845
|
var TaskCreateSchema = external_exports.object({
|
|
5781
5846
|
description: external_exports.string().min(1, "Description is required").max(2e3, "Description is too long"),
|
|
5782
5847
|
reward: external_exports.string().min(1, "Reward is required"),
|
|
@@ -5852,7 +5917,9 @@ var TaskResponseSchema = external_exports.object({
|
|
|
5852
5917
|
verdictScore: external_exports.number().nullable().optional(),
|
|
5853
5918
|
verdictConfidence: external_exports.number().nullable().optional(),
|
|
5854
5919
|
verdictEvidenceHash: external_exports.string().nullable().optional(),
|
|
5855
|
-
submissionWindowOpen: external_exports.boolean()
|
|
5920
|
+
submissionWindowOpen: external_exports.boolean(),
|
|
5921
|
+
netReward: external_exports.string().optional(),
|
|
5922
|
+
pendingActions: PendingActionSchema.array().optional()
|
|
5856
5923
|
});
|
|
5857
5924
|
var TaskListInputSchema = external_exports.object({
|
|
5858
5925
|
limit: external_exports.number().min(1).max(100).optional().default(20),
|
|
@@ -5881,32 +5948,6 @@ var TaskInboxResponseSchema = external_exports.object({
|
|
|
5881
5948
|
asRequester: external_exports.array(TaskResponseSchema),
|
|
5882
5949
|
asWorker: external_exports.array(TaskResponseSchema)
|
|
5883
5950
|
});
|
|
5884
|
-
var PendingActionName = external_exports.enum([
|
|
5885
|
-
"accept",
|
|
5886
|
-
"appeal",
|
|
5887
|
-
"auction_accept",
|
|
5888
|
-
"bid",
|
|
5889
|
-
"cancel",
|
|
5890
|
-
"claim",
|
|
5891
|
-
"evaluate",
|
|
5892
|
-
"evaluator_timeout",
|
|
5893
|
-
"finalize_verdict",
|
|
5894
|
-
"forfeit",
|
|
5895
|
-
"pitch",
|
|
5896
|
-
"rate",
|
|
5897
|
-
"refund_expired",
|
|
5898
|
-
"resolve_dispute",
|
|
5899
|
-
"select_winner",
|
|
5900
|
-
"select_worker",
|
|
5901
|
-
"submit",
|
|
5902
|
-
"submit_proof",
|
|
5903
|
-
"update"
|
|
5904
|
-
]);
|
|
5905
|
-
var PendingActionSchema = external_exports.object({
|
|
5906
|
-
role: external_exports.enum(["requester", "worker", "evaluator", "dispute_resolver", "anyone"]),
|
|
5907
|
-
action: PendingActionName,
|
|
5908
|
-
command: external_exports.string()
|
|
5909
|
-
});
|
|
5910
5951
|
var TaskDetailResponseSchema = TaskResponseSchema.extend({
|
|
5911
5952
|
pendingActions: PendingActionSchema.array()
|
|
5912
5953
|
});
|
|
@@ -7477,7 +7518,7 @@ function getDefaultQueryTimeoutMs() {
|
|
|
7477
7518
|
}
|
|
7478
7519
|
return Math.floor(parsed);
|
|
7479
7520
|
}
|
|
7480
|
-
var xmtpCommand = new
|
|
7521
|
+
var xmtpCommand = new Command44("xmtp").description("Manage XMTP messaging for this agent");
|
|
7481
7522
|
xmtpCommand.command("init").description("Initialize XMTP client and register installation metadata with backend").action(async () => {
|
|
7482
7523
|
const keystore = await loadKeystore();
|
|
7483
7524
|
const client = await createXmtpClient({
|
|
@@ -7705,7 +7746,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
|
|
|
7705
7746
|
});
|
|
7706
7747
|
|
|
7707
7748
|
// src/commands/daemon.ts
|
|
7708
|
-
import { Command as
|
|
7749
|
+
import { Command as Command45 } from "commander";
|
|
7709
7750
|
function diffTaskStatuses(prev, next) {
|
|
7710
7751
|
const changes = [];
|
|
7711
7752
|
for (const [taskId, newStatus] of next) {
|
|
@@ -7733,7 +7774,7 @@ function sleepOrAbort(ms, signal) {
|
|
|
7733
7774
|
});
|
|
7734
7775
|
}
|
|
7735
7776
|
var MAX_SEEN_TASK_IDS = 2e3;
|
|
7736
|
-
var daemonCommand = new
|
|
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(
|
|
7737
7778
|
"--auction-poll-interval <ms>",
|
|
7738
7779
|
"Poll interval for clock-based auction tasks (dutch/reverse_dutch) in milliseconds",
|
|
7739
7780
|
"15000"
|
|
@@ -8054,11 +8095,11 @@ var daemonCommand = new Command43("daemon").description("Long-running agent daem
|
|
|
8054
8095
|
);
|
|
8055
8096
|
|
|
8056
8097
|
// src/commands/email/index.ts
|
|
8057
|
-
import { Command as
|
|
8098
|
+
import { Command as Command54 } from "commander";
|
|
8058
8099
|
|
|
8059
8100
|
// src/commands/email/register.ts
|
|
8060
|
-
import { Command as
|
|
8061
|
-
var registerCommand = new
|
|
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) => {
|
|
8062
8103
|
const check = await apiGet(
|
|
8063
8104
|
`/api/emails/check-username?username=${encodeURIComponent(opts.username)}`
|
|
8064
8105
|
);
|
|
@@ -8075,8 +8116,8 @@ var registerCommand = new Command44("register").description("Register an email a
|
|
|
8075
8116
|
});
|
|
8076
8117
|
|
|
8077
8118
|
// src/commands/email/inbox.ts
|
|
8078
|
-
import { Command as
|
|
8079
|
-
var inboxCommand2 = new
|
|
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) => {
|
|
8080
8121
|
const keystore = await loadKeystore();
|
|
8081
8122
|
const params = new URLSearchParams({
|
|
8082
8123
|
deviceId: keystore.deviceId,
|
|
@@ -8091,8 +8132,8 @@ var inboxCommand2 = new Command45("inbox").description("List emails in your inbo
|
|
|
8091
8132
|
});
|
|
8092
8133
|
|
|
8093
8134
|
// src/commands/email/read.ts
|
|
8094
|
-
import { Command as
|
|
8095
|
-
var readCommand = new
|
|
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) => {
|
|
8096
8137
|
const keystore = await loadKeystore();
|
|
8097
8138
|
const params = new URLSearchParams({
|
|
8098
8139
|
deviceId: keystore.deviceId,
|
|
@@ -8104,8 +8145,8 @@ var readCommand = new Command46("read").description("Read an email by ID (marks
|
|
|
8104
8145
|
});
|
|
8105
8146
|
|
|
8106
8147
|
// src/commands/email/send.ts
|
|
8107
|
-
import { Command as
|
|
8108
|
-
var sendCommand = new
|
|
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) => {
|
|
8109
8150
|
const keystore = await loadKeystore();
|
|
8110
8151
|
const result = await apiPost("/api/emails/send", {
|
|
8111
8152
|
deviceId: keystore.deviceId,
|
|
@@ -8118,8 +8159,8 @@ var sendCommand = new Command47("send").description("Send an email").requiredOpt
|
|
|
8118
8159
|
});
|
|
8119
8160
|
|
|
8120
8161
|
// src/commands/email/reply.ts
|
|
8121
|
-
import { Command as
|
|
8122
|
-
var replyCommand = new
|
|
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) => {
|
|
8123
8164
|
const keystore = await loadKeystore();
|
|
8124
8165
|
const params = new URLSearchParams({
|
|
8125
8166
|
deviceId: keystore.deviceId,
|
|
@@ -8141,8 +8182,8 @@ var replyCommand = new Command48("reply").description("Reply to an email").argum
|
|
|
8141
8182
|
});
|
|
8142
8183
|
|
|
8143
8184
|
// src/commands/email/delete.ts
|
|
8144
|
-
import { Command as
|
|
8145
|
-
var deleteCommand = new
|
|
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) => {
|
|
8146
8187
|
const keystore = await loadKeystore();
|
|
8147
8188
|
const result = await apiPost("/api/emails/delete", {
|
|
8148
8189
|
deviceId: keystore.deviceId,
|
|
@@ -8153,15 +8194,15 @@ var deleteCommand = new Command49("delete").description("Delete an email by ID")
|
|
|
8153
8194
|
});
|
|
8154
8195
|
|
|
8155
8196
|
// src/commands/email/address.ts
|
|
8156
|
-
import { Command as
|
|
8157
|
-
var addressCommand2 = new
|
|
8197
|
+
import { Command as Command52 } from "commander";
|
|
8198
|
+
var addressCommand2 = new Command52("address").description("Show your registered email address").action(async () => {
|
|
8158
8199
|
const keystore = await loadKeystore();
|
|
8159
8200
|
const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
|
|
8160
8201
|
printResult({ emailAddress: result.emailAddress ?? null });
|
|
8161
8202
|
});
|
|
8162
8203
|
|
|
8163
8204
|
// src/commands/email/mark-read.ts
|
|
8164
|
-
import { Command as
|
|
8205
|
+
import { Command as Command53 } from "commander";
|
|
8165
8206
|
async function setReadStatus(id, read) {
|
|
8166
8207
|
const keystore = await loadKeystore();
|
|
8167
8208
|
const result = await apiPost("/api/emails/mark-read", {
|
|
@@ -8172,12 +8213,12 @@ async function setReadStatus(id, read) {
|
|
|
8172
8213
|
});
|
|
8173
8214
|
printResult({ id: result.id, isRead: result.isRead });
|
|
8174
8215
|
}
|
|
8175
|
-
var markReadCommand = new
|
|
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) => {
|
|
8176
8217
|
await setReadStatus(id, !opts.unread);
|
|
8177
8218
|
});
|
|
8178
8219
|
|
|
8179
8220
|
// src/commands/email/index.ts
|
|
8180
|
-
var emailCommand = new
|
|
8221
|
+
var emailCommand = new Command54("email").description("Email management commands");
|
|
8181
8222
|
emailCommand.addCommand(registerCommand);
|
|
8182
8223
|
emailCommand.addCommand(inboxCommand2);
|
|
8183
8224
|
emailCommand.addCommand(readCommand);
|
|
@@ -8190,7 +8231,7 @@ emailCommand.addCommand(markReadCommand);
|
|
|
8190
8231
|
// src/index.ts
|
|
8191
8232
|
var require2 = createRequire(import.meta.url);
|
|
8192
8233
|
var { version } = require2("../package.json");
|
|
8193
|
-
var program = new
|
|
8234
|
+
var program = new Command55();
|
|
8194
8235
|
program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
|
|
8195
8236
|
program.addCommand(initCommand);
|
|
8196
8237
|
program.addCommand(walletCommand);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucid-agents/taskmarket",
|
|
3
|
-
"version": "1.
|
|
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/
|
|
22
|
-
"@taskmarket/
|
|
21
|
+
"@taskmarket/shared": "2.0.0",
|
|
22
|
+
"@taskmarket/prettier-config": "0.0.0"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"dist"
|