@lucid-agents/taskmarket 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +121 -68
- 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 Command58 } from "commander";
|
|
10
10
|
import { createRequire } from "module";
|
|
11
11
|
|
|
12
12
|
// src/commands/init.ts
|
|
@@ -492,7 +492,7 @@ var statsCommand = new Command4("stats").description("View agent statistics").op
|
|
|
492
492
|
});
|
|
493
493
|
|
|
494
494
|
// src/commands/task/index.ts
|
|
495
|
-
import { Command as
|
|
495
|
+
import { Command as Command33 } from "commander";
|
|
496
496
|
|
|
497
497
|
// src/commands/task/create.ts
|
|
498
498
|
import { Command as Command5 } from "commander";
|
|
@@ -1076,9 +1076,61 @@ var rejectSubmissionCmd = new Command23("reject-submission").description(
|
|
|
1076
1076
|
}
|
|
1077
1077
|
});
|
|
1078
1078
|
|
|
1079
|
-
// src/commands/task/
|
|
1079
|
+
// src/commands/task/reject-all-submissions.ts
|
|
1080
1080
|
import { Command as Command24 } from "commander";
|
|
1081
|
-
var
|
|
1081
|
+
var rejectAllSubmissionsCmd = new Command24("reject-all-submissions").description(
|
|
1082
|
+
"Reject every active submission on a bounty or benchmark task in one go. Reads pending reject_submission actions from the task, rejects each worker in sequence, then cancels the task. Use this to recover escrow when all submitted work is unsuitable."
|
|
1083
|
+
).argument("<taskId>", "Task ID (0x-prefixed hex)").option("--no-cancel", "Reject all submissions but do not cancel the task afterward").action(async (taskId, opts) => {
|
|
1084
|
+
let task;
|
|
1085
|
+
try {
|
|
1086
|
+
task = await apiGet(`/api/tasks/${taskId}`);
|
|
1087
|
+
} catch (err) {
|
|
1088
|
+
return printError(err instanceof Error ? err.message : String(err));
|
|
1089
|
+
}
|
|
1090
|
+
const rejectActions = (task.pendingActions ?? []).filter(
|
|
1091
|
+
(a) => a.action === "reject_submission" && a.worker
|
|
1092
|
+
);
|
|
1093
|
+
if (rejectActions.length === 0) {
|
|
1094
|
+
printResult({ rejected: 0, message: "no active submissions to reject" });
|
|
1095
|
+
return;
|
|
1096
|
+
}
|
|
1097
|
+
const results = [];
|
|
1098
|
+
for (const action of rejectActions) {
|
|
1099
|
+
const worker = action.worker;
|
|
1100
|
+
try {
|
|
1101
|
+
const res = await x402Post(`/api/tasks/${taskId}/reject-submission`, {
|
|
1102
|
+
taskId,
|
|
1103
|
+
worker
|
|
1104
|
+
});
|
|
1105
|
+
results.push({ worker, txHash: res.txHash });
|
|
1106
|
+
} catch (err) {
|
|
1107
|
+
results.push({ worker, error: err instanceof Error ? err.message : String(err) });
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
const failed = results.filter((r) => r.error);
|
|
1111
|
+
if (failed.length > 0) {
|
|
1112
|
+
return printError(
|
|
1113
|
+
`${failed.length} of ${results.length} rejection(s) failed: ` + failed.map((r) => `${r.worker}: ${r.error}`).join("; ")
|
|
1114
|
+
);
|
|
1115
|
+
}
|
|
1116
|
+
if (!opts.cancel) {
|
|
1117
|
+
printResult({ rejected: results.length, results });
|
|
1118
|
+
return;
|
|
1119
|
+
}
|
|
1120
|
+
let cancelRes;
|
|
1121
|
+
try {
|
|
1122
|
+
cancelRes = await x402Post(`/api/tasks/${taskId}/cancel`, { taskId });
|
|
1123
|
+
} catch (err) {
|
|
1124
|
+
return printError(
|
|
1125
|
+
`All ${results.length} submission(s) rejected but cancel failed: ${err instanceof Error ? err.message : String(err)}`
|
|
1126
|
+
);
|
|
1127
|
+
}
|
|
1128
|
+
printResult({ rejected: results.length, results, cancelTxHash: cancelRes.txHash });
|
|
1129
|
+
});
|
|
1130
|
+
|
|
1131
|
+
// src/commands/task/my-submissions.ts
|
|
1132
|
+
import { Command as Command25 } from "commander";
|
|
1133
|
+
var mySubmissionsCmd = new Command25("my-submissions").description("List all submissions made by your wallet across all tasks.").option("--address <address>", "Wallet address to query (defaults to own wallet from keystore)").action(async (opts) => {
|
|
1082
1134
|
try {
|
|
1083
1135
|
let address = opts.address;
|
|
1084
1136
|
if (!address) {
|
|
@@ -1096,13 +1148,13 @@ var mySubmissionsCmd = new Command24("my-submissions").description("List all sub
|
|
|
1096
1148
|
});
|
|
1097
1149
|
|
|
1098
1150
|
// src/commands/task/update.ts
|
|
1099
|
-
import { Command as
|
|
1151
|
+
import { Command as Command26 } from "commander";
|
|
1100
1152
|
function toBaseUnits(humanUsdc) {
|
|
1101
1153
|
const [intPart = "0", fracPart = ""] = humanUsdc.trim().split(".");
|
|
1102
1154
|
const padded = fracPart.slice(0, 6).padEnd(6, "0");
|
|
1103
1155
|
return (BigInt(intPart) * 1000000n + BigInt(padded)).toString();
|
|
1104
1156
|
}
|
|
1105
|
-
var updateCmd = new
|
|
1157
|
+
var updateCmd = new Command26("update").description("Update an open task (costs 0.001 USDC)").argument("<taskId>", "Task ID (0x-prefixed hex)").option("--reward <usdc>", 'New reward in USDC (human units, e.g. "50")').option("--extend-expiry <seconds>", "Extend expiry by this many seconds").option("--bid-deadline <iso>", "New bid deadline (ISO 8601)").option("--pitch-deadline <iso>", "New pitch deadline (ISO 8601)").option("--auction-floor-price <usdc>", "New auction floor price in USDC").option("--auction-start-price <usdc>", "New auction start price in USDC").option("--description <text>", "New description").option("--tags <csv>", "New tags (comma-separated)").option("--metric-description <text>", "New metric description").action(
|
|
1106
1158
|
async (taskId, opts) => {
|
|
1107
1159
|
const body = { taskId };
|
|
1108
1160
|
if (opts.reward !== void 0) {
|
|
@@ -1157,8 +1209,8 @@ var updateCmd = new Command25("update").description("Update an open task (costs
|
|
|
1157
1209
|
);
|
|
1158
1210
|
|
|
1159
1211
|
// src/commands/task/forfeit.ts
|
|
1160
|
-
import { Command as
|
|
1161
|
-
var forfeitCmd = new
|
|
1212
|
+
import { Command as Command27 } from "commander";
|
|
1213
|
+
var forfeitCmd = new Command27("forfeit").description("Reclaim a claim-mode task whose worker's claim has expired (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
1162
1214
|
try {
|
|
1163
1215
|
const keystore = await loadKeystore();
|
|
1164
1216
|
const message = `taskmarket:forfeit:${taskId}`;
|
|
@@ -1175,8 +1227,8 @@ var forfeitCmd = new Command26("forfeit").description("Reclaim a claim-mode task
|
|
|
1175
1227
|
});
|
|
1176
1228
|
|
|
1177
1229
|
// src/commands/task/evaluate.ts
|
|
1178
|
-
import { Command as
|
|
1179
|
-
var evaluateCmd = new
|
|
1230
|
+
import { Command as Command28 } from "commander";
|
|
1231
|
+
var evaluateCmd = new Command28("evaluate").description("Submit an evaluation verdict for a task in Review state").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--verdict <type>", "Verdict: approve, reject, or partial").option("--score <n>", "Score 0-1000 (default: 1000)", "1000").option("--confidence <n>", "Confidence 0-1000 (default: 1000)", "1000").option("--evidence-hash <hash>", "Evidence hash (32-byte hex)").option(
|
|
1180
1232
|
"--award <worker:amount:rank>",
|
|
1181
1233
|
"Award entry (repeatable): worker:amountUSDC:rank",
|
|
1182
1234
|
collect,
|
|
@@ -1239,28 +1291,28 @@ function collect(val, prev) {
|
|
|
1239
1291
|
}
|
|
1240
1292
|
|
|
1241
1293
|
// src/commands/task/appeal.ts
|
|
1242
|
-
import { Command as
|
|
1243
|
-
var appealCmd = new
|
|
1294
|
+
import { Command as Command29 } from "commander";
|
|
1295
|
+
var appealCmd = new Command29("appeal").description("Appeal an evaluator verdict while in Appealing state").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
1244
1296
|
const result = await x402Post(`/api/tasks/${taskId}/appeal`, { taskId });
|
|
1245
1297
|
printResult({ txHash: result.txHash });
|
|
1246
1298
|
});
|
|
1247
1299
|
|
|
1248
1300
|
// src/commands/task/evaluator-timeout.ts
|
|
1249
|
-
import { Command as
|
|
1250
|
-
var evaluatorTimeoutCmd = new
|
|
1301
|
+
import { Command as Command30 } from "commander";
|
|
1302
|
+
var evaluatorTimeoutCmd = new Command30("evaluator-timeout").description("Trigger evaluator timeout after the evaluation window expires (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
1251
1303
|
const result = await x402Post(`/api/tasks/${taskId}/evaluator-timeout`, { taskId });
|
|
1252
1304
|
printResult({ txHash: result.txHash });
|
|
1253
1305
|
});
|
|
1254
1306
|
|
|
1255
1307
|
// src/commands/task/finalize-verdict.ts
|
|
1256
|
-
import { Command as
|
|
1257
|
-
var finalizeVerdictCmd = new
|
|
1308
|
+
import { Command as Command31 } from "commander";
|
|
1309
|
+
var finalizeVerdictCmd = new Command31("finalize-verdict").description("Finalize an evaluator verdict after the appeal window expires (permissionless)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
1258
1310
|
const result = await x402Post(`/api/tasks/${taskId}/finalize-verdict`, { taskId });
|
|
1259
1311
|
printResult({ txHash: result.txHash });
|
|
1260
1312
|
});
|
|
1261
1313
|
|
|
1262
1314
|
// src/commands/task/resolve-dispute.ts
|
|
1263
|
-
import { Command as
|
|
1315
|
+
import { Command as Command32 } from "commander";
|
|
1264
1316
|
function parseAward(spec) {
|
|
1265
1317
|
const parts = spec.split(":");
|
|
1266
1318
|
if (parts.length !== 3) {
|
|
@@ -1284,7 +1336,7 @@ function parseAward(spec) {
|
|
|
1284
1336
|
rank
|
|
1285
1337
|
};
|
|
1286
1338
|
}
|
|
1287
|
-
var resolveDisputeCmd = new
|
|
1339
|
+
var resolveDisputeCmd = new Command32("resolve-dispute").description(
|
|
1288
1340
|
"Resolve a disputed task as the designated dispute resolver (X402 required).\n\nExamples:\n task resolve-dispute 0x\u2026 --verdict approve --award 0xAlice:5:1\n task resolve-dispute 0x\u2026 --verdict partial --award 0xAlice:3:1 --award 0xBob:2:2"
|
|
1289
1341
|
).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--verdict <type>", "Verdict type: approve or partial").requiredOption(
|
|
1290
1342
|
"--award <spec...>",
|
|
@@ -1310,7 +1362,7 @@ var resolveDisputeCmd = new Command31("resolve-dispute").description(
|
|
|
1310
1362
|
});
|
|
1311
1363
|
|
|
1312
1364
|
// src/commands/task/index.ts
|
|
1313
|
-
var taskCommand = new
|
|
1365
|
+
var taskCommand = new Command33("task").description("Manage tasks");
|
|
1314
1366
|
taskCommand.addCommand(createCmd);
|
|
1315
1367
|
taskCommand.addCommand(listCmd);
|
|
1316
1368
|
taskCommand.addCommand(getCmd);
|
|
@@ -1330,6 +1382,7 @@ taskCommand.addCommand(downloadCmd);
|
|
|
1330
1382
|
taskCommand.addCommand(cancelCmd);
|
|
1331
1383
|
taskCommand.addCommand(refundExpiredCmd);
|
|
1332
1384
|
taskCommand.addCommand(rejectSubmissionCmd);
|
|
1385
|
+
taskCommand.addCommand(rejectAllSubmissionsCmd);
|
|
1333
1386
|
taskCommand.addCommand(mySubmissionsCmd);
|
|
1334
1387
|
taskCommand.addCommand(updateCmd);
|
|
1335
1388
|
taskCommand.addCommand(forfeitCmd);
|
|
@@ -1340,8 +1393,8 @@ taskCommand.addCommand(finalizeVerdictCmd);
|
|
|
1340
1393
|
taskCommand.addCommand(resolveDisputeCmd);
|
|
1341
1394
|
|
|
1342
1395
|
// src/commands/agents.ts
|
|
1343
|
-
import { Command as
|
|
1344
|
-
var agentsCommand = new
|
|
1396
|
+
import { Command as Command34 } from "commander";
|
|
1397
|
+
var agentsCommand = new Command34("agents").description("Browse the agent directory").option("--sort <order>", "Sort order: reputation or tasks", "reputation").option("--skill <tag>", "Filter by skill tag").option("--search <query>", "Search by agentId or wallet address").option("--limit <n>", "Maximum results to return", "20").action(async (opts) => {
|
|
1345
1398
|
const params = new URLSearchParams();
|
|
1346
1399
|
if (opts.sort) params.set("sort", opts.sort);
|
|
1347
1400
|
if (opts.skill) params.set("skill", opts.skill);
|
|
@@ -1352,8 +1405,8 @@ var agentsCommand = new Command33("agents").description("Browse the agent direct
|
|
|
1352
1405
|
});
|
|
1353
1406
|
|
|
1354
1407
|
// src/commands/inbox.ts
|
|
1355
|
-
import { Command as
|
|
1356
|
-
var inboxCommand = new
|
|
1408
|
+
import { Command as Command35 } from "commander";
|
|
1409
|
+
var inboxCommand = new Command35("inbox").description("Show tasks you created and tasks you are working on").action(async () => {
|
|
1357
1410
|
let address;
|
|
1358
1411
|
try {
|
|
1359
1412
|
address = await getWalletAddress();
|
|
@@ -1379,8 +1432,8 @@ var inboxCommand = new Command34("inbox").description("Show tasks you created an
|
|
|
1379
1432
|
});
|
|
1380
1433
|
|
|
1381
1434
|
// src/commands/deposit.ts
|
|
1382
|
-
import { Command as
|
|
1383
|
-
var depositCommand = new
|
|
1435
|
+
import { Command as Command36 } from "commander";
|
|
1436
|
+
var depositCommand = new Command36("deposit").description("Show wallet address and network info for funding").action(async () => {
|
|
1384
1437
|
let address;
|
|
1385
1438
|
try {
|
|
1386
1439
|
address = await getWalletAddress();
|
|
@@ -1407,11 +1460,11 @@ var depositCommand = new Command35("deposit").description("Show wallet address a
|
|
|
1407
1460
|
});
|
|
1408
1461
|
|
|
1409
1462
|
// src/commands/wallet/index.ts
|
|
1410
|
-
import { Command as
|
|
1463
|
+
import { Command as Command41 } from "commander";
|
|
1411
1464
|
|
|
1412
1465
|
// src/commands/wallet/balance.ts
|
|
1413
|
-
import { Command as
|
|
1414
|
-
var walletBalanceCommand = new
|
|
1466
|
+
import { Command as Command37 } from "commander";
|
|
1467
|
+
var walletBalanceCommand = new Command37("balance").description("Show USDC balance").option("--address <addr>", "Address to check (defaults to own wallet)").action(async (opts) => {
|
|
1415
1468
|
let address = opts.address;
|
|
1416
1469
|
if (!address) {
|
|
1417
1470
|
const keystore = await loadKeystore();
|
|
@@ -1422,7 +1475,7 @@ var walletBalanceCommand = new Command36("balance").description("Show USDC balan
|
|
|
1422
1475
|
});
|
|
1423
1476
|
|
|
1424
1477
|
// src/commands/wallet/import.ts
|
|
1425
|
-
import { Command as
|
|
1478
|
+
import { Command as Command38 } from "commander";
|
|
1426
1479
|
import { createInterface } from "readline";
|
|
1427
1480
|
import { privateKeyToAccount as privateKeyToAccount3 } from "viem/accounts";
|
|
1428
1481
|
function normalizePrivateKey(raw) {
|
|
@@ -1457,7 +1510,7 @@ function promptHiddenInput(prompt) {
|
|
|
1457
1510
|
});
|
|
1458
1511
|
});
|
|
1459
1512
|
}
|
|
1460
|
-
var walletImportCommand = new
|
|
1513
|
+
var walletImportCommand = new Command38("import").description("Import an existing private key as the agent wallet").option("--key <privateKey>", "Private key to import (64 hex chars, with or without 0x prefix)").action(async (opts) => {
|
|
1461
1514
|
if (await keystoreExists()) {
|
|
1462
1515
|
const keystore = await loadKeystore();
|
|
1463
1516
|
printResult({ address: keystore.walletAddress, agentId: keystore.agentId });
|
|
@@ -1522,11 +1575,11 @@ var walletImportCommand = new Command37("import").description("Import an existin
|
|
|
1522
1575
|
});
|
|
1523
1576
|
|
|
1524
1577
|
// src/commands/wallet/set-withdrawal-address.ts
|
|
1525
|
-
import { Command as
|
|
1578
|
+
import { Command as Command39 } from "commander";
|
|
1526
1579
|
function isValidAddress(addr) {
|
|
1527
1580
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
1528
1581
|
}
|
|
1529
|
-
var setWithdrawalAddressCommand = new
|
|
1582
|
+
var setWithdrawalAddressCommand = new Command39("set-withdrawal-address").description("Set a withdrawal address for USDC withdrawals (one-time, free)").argument("<address>", "Ethereum address to receive withdrawals").action(async (address) => {
|
|
1530
1583
|
if (!isValidAddress(address)) {
|
|
1531
1584
|
printError("Invalid Ethereum address: must be 0x followed by 40 hex characters");
|
|
1532
1585
|
}
|
|
@@ -1548,8 +1601,8 @@ var setWithdrawalAddressCommand = new Command38("set-withdrawal-address").descri
|
|
|
1548
1601
|
});
|
|
1549
1602
|
|
|
1550
1603
|
// src/commands/wallet/publish-key.ts
|
|
1551
|
-
import { Command as
|
|
1552
|
-
var publishKeyCommand = new
|
|
1604
|
+
import { Command as Command40 } from "commander";
|
|
1605
|
+
var publishKeyCommand = new Command40("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
|
|
1553
1606
|
let keystore;
|
|
1554
1607
|
try {
|
|
1555
1608
|
keystore = await loadKeystore();
|
|
@@ -1568,14 +1621,14 @@ var publishKeyCommand = new Command39("publish-key").description("Publish your s
|
|
|
1568
1621
|
});
|
|
1569
1622
|
|
|
1570
1623
|
// src/commands/wallet/index.ts
|
|
1571
|
-
var walletCommand = new
|
|
1624
|
+
var walletCommand = new Command41("wallet").description("Wallet management commands");
|
|
1572
1625
|
walletCommand.addCommand(walletBalanceCommand);
|
|
1573
1626
|
walletCommand.addCommand(walletImportCommand);
|
|
1574
1627
|
walletCommand.addCommand(setWithdrawalAddressCommand);
|
|
1575
1628
|
walletCommand.addCommand(publishKeyCommand);
|
|
1576
1629
|
|
|
1577
1630
|
// src/commands/withdraw.ts
|
|
1578
|
-
import { Command as
|
|
1631
|
+
import { Command as Command42 } from "commander";
|
|
1579
1632
|
import { toHex as toHex2 } from "viem";
|
|
1580
1633
|
var USDC_TYPES = {
|
|
1581
1634
|
TransferWithAuthorization: [
|
|
@@ -1587,7 +1640,7 @@ var USDC_TYPES = {
|
|
|
1587
1640
|
{ name: "nonce", type: "bytes32" }
|
|
1588
1641
|
]
|
|
1589
1642
|
};
|
|
1590
|
-
var withdrawCommand = new
|
|
1643
|
+
var withdrawCommand = new Command42("withdraw").description("Withdraw USDC to the registered withdrawal address").argument("<amount>", "Amount in USDC (e.g. 5 for 5 USDC)").action(async (amount) => {
|
|
1591
1644
|
const parsed = parseFloat(amount);
|
|
1592
1645
|
if (isNaN(parsed) || parsed <= 0) {
|
|
1593
1646
|
printError("Invalid amount: must be a positive number (e.g. 5 for 5 USDC)");
|
|
@@ -1637,9 +1690,9 @@ var withdrawCommand = new Command41("withdraw").description("Withdraw USDC to th
|
|
|
1637
1690
|
});
|
|
1638
1691
|
|
|
1639
1692
|
// src/commands/encrypt.ts
|
|
1640
|
-
import { Command as
|
|
1693
|
+
import { Command as Command43 } from "commander";
|
|
1641
1694
|
import { promises as fs2 } from "fs";
|
|
1642
|
-
var encryptCommand = new
|
|
1695
|
+
var encryptCommand = new Command43("encrypt").description("Encrypt a file with ECIES using wallet keys").argument("<file>", "Path to the file to encrypt").option("--recipient <address>", "Recipient wallet address (default: self)").option("--output <path>", "Output path (default: <file>.enc)").action(async (file, opts) => {
|
|
1643
1696
|
let plaintext;
|
|
1644
1697
|
try {
|
|
1645
1698
|
plaintext = await fs2.readFile(file);
|
|
@@ -1688,9 +1741,9 @@ var encryptCommand = new Command42("encrypt").description("Encrypt a file with E
|
|
|
1688
1741
|
});
|
|
1689
1742
|
|
|
1690
1743
|
// src/commands/decrypt.ts
|
|
1691
|
-
import { Command as
|
|
1744
|
+
import { Command as Command44 } from "commander";
|
|
1692
1745
|
import { promises as fs3 } from "fs";
|
|
1693
|
-
var decryptCommand = new
|
|
1746
|
+
var decryptCommand = new Command44("decrypt").description("Decrypt a file using your wallet key").argument("<file>", "Path to the encrypted file").option("--output <path>", "Output path (default: strips .enc, otherwise appends .dec)").action(async (file, opts) => {
|
|
1694
1747
|
let ciphertext;
|
|
1695
1748
|
try {
|
|
1696
1749
|
ciphertext = await fs3.readFile(file);
|
|
@@ -1728,7 +1781,7 @@ var decryptCommand = new Command43("decrypt").description("Decrypt a file using
|
|
|
1728
1781
|
});
|
|
1729
1782
|
|
|
1730
1783
|
// src/commands/xmtp.ts
|
|
1731
|
-
import { Command as
|
|
1784
|
+
import { Command as Command45 } from "commander";
|
|
1732
1785
|
|
|
1733
1786
|
// src/lib/xmtp-client.ts
|
|
1734
1787
|
import os2 from "os";
|
|
@@ -7509,7 +7562,7 @@ function getDefaultQueryTimeoutMs() {
|
|
|
7509
7562
|
}
|
|
7510
7563
|
return Math.floor(parsed);
|
|
7511
7564
|
}
|
|
7512
|
-
var xmtpCommand = new
|
|
7565
|
+
var xmtpCommand = new Command45("xmtp").description("Manage XMTP messaging for this agent");
|
|
7513
7566
|
xmtpCommand.command("init").description("Initialize XMTP client and register installation metadata with backend").action(async () => {
|
|
7514
7567
|
const keystore = await loadKeystore();
|
|
7515
7568
|
const client = await createXmtpClient({
|
|
@@ -7737,7 +7790,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
|
|
|
7737
7790
|
});
|
|
7738
7791
|
|
|
7739
7792
|
// src/commands/daemon.ts
|
|
7740
|
-
import { Command as
|
|
7793
|
+
import { Command as Command46 } from "commander";
|
|
7741
7794
|
function diffTaskStatuses(prev, next) {
|
|
7742
7795
|
const changes = [];
|
|
7743
7796
|
for (const [taskId, newStatus] of next) {
|
|
@@ -7765,7 +7818,7 @@ function sleepOrAbort(ms, signal) {
|
|
|
7765
7818
|
});
|
|
7766
7819
|
}
|
|
7767
7820
|
var MAX_SEEN_TASK_IDS = 2e3;
|
|
7768
|
-
var daemonCommand = new
|
|
7821
|
+
var daemonCommand = new Command46("daemon").description("Long-running agent daemon: XMTP stream, heartbeats, and task polling").option("--heartbeat-interval <ms>", "Heartbeat interval in milliseconds", "1800000").option("--inbox-interval <ms>", "Inbox poll interval in milliseconds", "15000").option("--task-interval <ms>", "New task poll interval in milliseconds", "15000").option(
|
|
7769
7822
|
"--auction-poll-interval <ms>",
|
|
7770
7823
|
"Poll interval for clock-based auction tasks (dutch/reverse_dutch) in milliseconds",
|
|
7771
7824
|
"15000"
|
|
@@ -8086,11 +8139,11 @@ var daemonCommand = new Command45("daemon").description("Long-running agent daem
|
|
|
8086
8139
|
);
|
|
8087
8140
|
|
|
8088
8141
|
// src/commands/email/index.ts
|
|
8089
|
-
import { Command as
|
|
8142
|
+
import { Command as Command55 } from "commander";
|
|
8090
8143
|
|
|
8091
8144
|
// src/commands/email/register.ts
|
|
8092
|
-
import { Command as
|
|
8093
|
-
var registerCommand = new
|
|
8145
|
+
import { Command as Command47 } from "commander";
|
|
8146
|
+
var registerCommand = new Command47("register").description("Register an email address for this agent").requiredOption("--username <name>", "Desired username (e.g. myagent)").action(async (opts) => {
|
|
8094
8147
|
const check = await apiGet(
|
|
8095
8148
|
`/api/emails/check-username?username=${encodeURIComponent(opts.username)}`
|
|
8096
8149
|
);
|
|
@@ -8107,8 +8160,8 @@ var registerCommand = new Command46("register").description("Register an email a
|
|
|
8107
8160
|
});
|
|
8108
8161
|
|
|
8109
8162
|
// src/commands/email/inbox.ts
|
|
8110
|
-
import { Command as
|
|
8111
|
-
var inboxCommand2 = new
|
|
8163
|
+
import { Command as Command48 } from "commander";
|
|
8164
|
+
var inboxCommand2 = new Command48("inbox").description("List emails in your inbox").option("--limit <n>", "Number of emails to return", "20").option("--unread", "Show only unread emails").action(async (opts) => {
|
|
8112
8165
|
const keystore = await loadKeystore();
|
|
8113
8166
|
const params = new URLSearchParams({
|
|
8114
8167
|
deviceId: keystore.deviceId,
|
|
@@ -8123,8 +8176,8 @@ var inboxCommand2 = new Command47("inbox").description("List emails in your inbo
|
|
|
8123
8176
|
});
|
|
8124
8177
|
|
|
8125
8178
|
// src/commands/email/read.ts
|
|
8126
|
-
import { Command as
|
|
8127
|
-
var readCommand = new
|
|
8179
|
+
import { Command as Command49 } from "commander";
|
|
8180
|
+
var readCommand = new Command49("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
|
|
8128
8181
|
const keystore = await loadKeystore();
|
|
8129
8182
|
const params = new URLSearchParams({
|
|
8130
8183
|
deviceId: keystore.deviceId,
|
|
@@ -8136,8 +8189,8 @@ var readCommand = new Command48("read").description("Read an email by ID (marks
|
|
|
8136
8189
|
});
|
|
8137
8190
|
|
|
8138
8191
|
// src/commands/email/send.ts
|
|
8139
|
-
import { Command as
|
|
8140
|
-
var sendCommand = new
|
|
8192
|
+
import { Command as Command50 } from "commander";
|
|
8193
|
+
var sendCommand = new Command50("send").description("Send an email").requiredOption("--to <address>", "Recipient email address").requiredOption("--subject <subject>", "Email subject").requiredOption("--body <text>", "Email body text").action(async (opts) => {
|
|
8141
8194
|
const keystore = await loadKeystore();
|
|
8142
8195
|
const result = await apiPost("/api/emails/send", {
|
|
8143
8196
|
deviceId: keystore.deviceId,
|
|
@@ -8150,8 +8203,8 @@ var sendCommand = new Command49("send").description("Send an email").requiredOpt
|
|
|
8150
8203
|
});
|
|
8151
8204
|
|
|
8152
8205
|
// src/commands/email/reply.ts
|
|
8153
|
-
import { Command as
|
|
8154
|
-
var replyCommand = new
|
|
8206
|
+
import { Command as Command51 } from "commander";
|
|
8207
|
+
var replyCommand = new Command51("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").action(async (id, opts) => {
|
|
8155
8208
|
const keystore = await loadKeystore();
|
|
8156
8209
|
const params = new URLSearchParams({
|
|
8157
8210
|
deviceId: keystore.deviceId,
|
|
@@ -8173,8 +8226,8 @@ var replyCommand = new Command50("reply").description("Reply to an email").argum
|
|
|
8173
8226
|
});
|
|
8174
8227
|
|
|
8175
8228
|
// src/commands/email/delete.ts
|
|
8176
|
-
import { Command as
|
|
8177
|
-
var deleteCommand = new
|
|
8229
|
+
import { Command as Command52 } from "commander";
|
|
8230
|
+
var deleteCommand = new Command52("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
|
|
8178
8231
|
const keystore = await loadKeystore();
|
|
8179
8232
|
const result = await apiPost("/api/emails/delete", {
|
|
8180
8233
|
deviceId: keystore.deviceId,
|
|
@@ -8185,15 +8238,15 @@ var deleteCommand = new Command51("delete").description("Delete an email by ID")
|
|
|
8185
8238
|
});
|
|
8186
8239
|
|
|
8187
8240
|
// src/commands/email/address.ts
|
|
8188
|
-
import { Command as
|
|
8189
|
-
var addressCommand2 = new
|
|
8241
|
+
import { Command as Command53 } from "commander";
|
|
8242
|
+
var addressCommand2 = new Command53("address").description("Show your registered email address").action(async () => {
|
|
8190
8243
|
const keystore = await loadKeystore();
|
|
8191
8244
|
const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
|
|
8192
8245
|
printResult({ emailAddress: result.emailAddress ?? null });
|
|
8193
8246
|
});
|
|
8194
8247
|
|
|
8195
8248
|
// src/commands/email/mark-read.ts
|
|
8196
|
-
import { Command as
|
|
8249
|
+
import { Command as Command54 } from "commander";
|
|
8197
8250
|
async function setReadStatus(id, read) {
|
|
8198
8251
|
const keystore = await loadKeystore();
|
|
8199
8252
|
const result = await apiPost("/api/emails/mark-read", {
|
|
@@ -8204,12 +8257,12 @@ async function setReadStatus(id, read) {
|
|
|
8204
8257
|
});
|
|
8205
8258
|
printResult({ id: result.id, isRead: result.isRead });
|
|
8206
8259
|
}
|
|
8207
|
-
var markReadCommand = new
|
|
8260
|
+
var markReadCommand = new Command54("mark-read").description("Mark an email as read or unread").argument("<id>", "Email ID").option("--unread", "Mark as unread instead of read").action(async (id, opts) => {
|
|
8208
8261
|
await setReadStatus(id, !opts.unread);
|
|
8209
8262
|
});
|
|
8210
8263
|
|
|
8211
8264
|
// src/commands/email/index.ts
|
|
8212
|
-
var emailCommand = new
|
|
8265
|
+
var emailCommand = new Command55("email").description("Email management commands");
|
|
8213
8266
|
emailCommand.addCommand(registerCommand);
|
|
8214
8267
|
emailCommand.addCommand(inboxCommand2);
|
|
8215
8268
|
emailCommand.addCommand(readCommand);
|
|
@@ -8220,11 +8273,11 @@ emailCommand.addCommand(addressCommand2);
|
|
|
8220
8273
|
emailCommand.addCommand(markReadCommand);
|
|
8221
8274
|
|
|
8222
8275
|
// src/commands/requester/index.ts
|
|
8223
|
-
import { Command as
|
|
8276
|
+
import { Command as Command57 } from "commander";
|
|
8224
8277
|
|
|
8225
8278
|
// src/commands/requester/stats.ts
|
|
8226
|
-
import { Command as
|
|
8227
|
-
var requesterStatsCmd = new
|
|
8279
|
+
import { Command as Command56 } from "commander";
|
|
8280
|
+
var requesterStatsCmd = new Command56("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address) => {
|
|
8228
8281
|
if (!/^0x[0-9a-fA-F]{40}$/.test(address)) {
|
|
8229
8282
|
printError("Address must be a 0x-prefixed 20-byte hex string");
|
|
8230
8283
|
process.exit(1);
|
|
@@ -8240,12 +8293,12 @@ var requesterStatsCmd = new Command55("stats").description("Get requester reputa
|
|
|
8240
8293
|
});
|
|
8241
8294
|
|
|
8242
8295
|
// src/commands/requester/index.ts
|
|
8243
|
-
var requesterCmd = new
|
|
8296
|
+
var requesterCmd = new Command57("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
|
|
8244
8297
|
|
|
8245
8298
|
// src/index.ts
|
|
8246
8299
|
var require2 = createRequire(import.meta.url);
|
|
8247
8300
|
var { version } = require2("../package.json");
|
|
8248
|
-
var program = new
|
|
8301
|
+
var program = new Command58();
|
|
8249
8302
|
program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
|
|
8250
8303
|
program.addCommand(initCommand);
|
|
8251
8304
|
program.addCommand(walletCommand);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucid-agents/taskmarket",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"taskmarket": "./dist/index.js"
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"tsx": "^4.7.0",
|
|
18
18
|
"typescript": "^5.3.3",
|
|
19
19
|
"vitest": "^2.0.0",
|
|
20
|
-
"@taskmarket/eslint-config": "0.0.0",
|
|
21
20
|
"@taskmarket/prettier-config": "0.0.0",
|
|
22
|
-
"@taskmarket/shared": "2.0.0"
|
|
21
|
+
"@taskmarket/shared": "2.0.0",
|
|
22
|
+
"@taskmarket/eslint-config": "0.0.0"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"dist"
|