@lucid-agents/taskmarket 1.18.1 → 1.19.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.
- package/dist/agent-compatibility.json +11 -1
- package/dist/{budget-view-JPZ7HWR2.js → budget-view-J6L7X6EY.js} +1 -1
- package/dist/{channels-KCDZ5REF.js → channels-7DEGKHO5.js} +4 -4
- package/dist/{chunk-OKZ2NRYZ.js → chunk-4ZC6SH7H.js} +18 -4
- package/dist/{chunk-RQTJZYFV.js → chunk-AEOZNLZD.js} +1 -1
- package/dist/{chunk-ONYTKAHC.js → chunk-ATHBKQT4.js} +16 -5
- package/dist/{chunk-HEGWADBV.js → chunk-ICT56PNO.js} +15 -3
- package/dist/{chunk-RHUDL5WA.js → chunk-IWZNOYQE.js} +22 -5
- package/dist/{chunk-3LNZ766H.js → chunk-M7WD6A2T.js} +2 -2
- package/dist/{chunk-LEVAZYR5.js → chunk-MZSOLQZB.js} +77 -11
- package/dist/{chunk-5VMWXDNO.js → chunk-NRKTRQEA.js} +26 -16
- package/dist/{chunk-3FF6JAMK.js → chunk-OTXEK6VM.js} +5 -4
- package/dist/{chunk-YB2B5DPR.js → chunk-X7AUWPZV.js} +3641 -3472
- package/dist/{chunk-EB6OJBF5.js → chunk-XJOB4NMV.js} +84 -2
- package/dist/{compatibility-KUYGZSUC.js → compatibility-636WJOEX.js} +1 -1
- package/dist/{doctor-TB3KKAZB.js → doctor-MBM7WQHI.js} +9 -9
- package/dist/index.js +398 -256
- package/dist/{launch-ZV6OLBFM.js → launch-ZSZURLR6.js} +493 -33
- package/dist/pi-extensions/remote-tools.cjs +15 -4
- package/dist/pi-extensions/xgate.cjs +163 -25
- package/dist/{reconcile-UXL65RRT.js → reconcile-4HIIA426.js} +4 -4
- package/dist/{status-FHZ3UGEB.js → status-BXL2F4LY.js} +8 -8
- package/dist/{sync-pull-YECZ4PJA.js → sync-pull-HL2YS3EL.js} +33 -11
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
signReadAuth,
|
|
15
15
|
submitTaskFiles,
|
|
16
16
|
taskAccessGrantHeaders
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ICT56PNO.js";
|
|
18
18
|
import {
|
|
19
19
|
ComputeCreditError,
|
|
20
20
|
applyComputeCreditSetup,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
refusedPaidWrite,
|
|
37
37
|
releasePendingComputePurchase,
|
|
38
38
|
resolvePendingComputePurchases
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-M7WD6A2T.js";
|
|
40
40
|
import {
|
|
41
41
|
MPP_TEMPO_DEFAULT_VALIDITY_SECONDS,
|
|
42
42
|
X402PayError,
|
|
@@ -58,18 +58,21 @@ import {
|
|
|
58
58
|
signSponsoredTempoTransfer,
|
|
59
59
|
signTaskmarketFeePayment,
|
|
60
60
|
signTypedData
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-NRKTRQEA.js";
|
|
62
62
|
import {
|
|
63
63
|
AgentMessageEnvelopeSchema,
|
|
64
64
|
ApiError,
|
|
65
65
|
BUG_REPORT_SEVERITIES,
|
|
66
66
|
BUG_REPORT_STATUSES,
|
|
67
|
+
DEFAULT_EVALUATION_WINDOW_HOURS,
|
|
67
68
|
DEFAULT_TERMS_BOUNDS,
|
|
69
|
+
GetBugReportInputSchema,
|
|
68
70
|
IntentStatusResponseSchema,
|
|
69
71
|
LegalAcceptanceResponseSchema,
|
|
70
72
|
LegalBundleSchema,
|
|
71
73
|
LegalChallengeResponseSchema,
|
|
72
74
|
LegalStatusResponseSchema,
|
|
75
|
+
NETWORKS,
|
|
73
76
|
NETWORK_NAMES,
|
|
74
77
|
PenaltyTo,
|
|
75
78
|
READ_AUTH_ADDRESS_HEADER,
|
|
@@ -127,6 +130,7 @@ import {
|
|
|
127
130
|
decryptPrivateKey,
|
|
128
131
|
dreamsToUsd,
|
|
129
132
|
encryptPrivateKey,
|
|
133
|
+
evaluationWindowError,
|
|
130
134
|
formatDreams,
|
|
131
135
|
formatPaymentAmount,
|
|
132
136
|
formatUsdcBaseUnits,
|
|
@@ -157,14 +161,14 @@ import {
|
|
|
157
161
|
usdcToBaseUnits,
|
|
158
162
|
withErrorContext,
|
|
159
163
|
withIdempotentWrite
|
|
160
|
-
} from "./chunk-
|
|
164
|
+
} from "./chunk-X7AUWPZV.js";
|
|
161
165
|
import {
|
|
162
166
|
channelLines
|
|
163
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-XJOB4NMV.js";
|
|
164
168
|
import "./chunk-S7SJMJ2I.js";
|
|
165
169
|
|
|
166
170
|
// src/index.ts
|
|
167
|
-
import { Command as
|
|
171
|
+
import { Command as Command104 } from "commander";
|
|
168
172
|
import { createRequire } from "module";
|
|
169
173
|
|
|
170
174
|
// src/commands/init.ts
|
|
@@ -202,8 +206,20 @@ function redactArgv(argv) {
|
|
|
202
206
|
function currentArgs() {
|
|
203
207
|
return process.argv.slice(2);
|
|
204
208
|
}
|
|
209
|
+
var ROOT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["--network"]);
|
|
210
|
+
function subcommandOf(argv) {
|
|
211
|
+
for (let i = 0; i < argv.length; i++) {
|
|
212
|
+
const arg = argv[i];
|
|
213
|
+
if (ROOT_VALUE_OPTIONS.has(arg)) {
|
|
214
|
+
i++;
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
if (!arg.startsWith("-")) return arg;
|
|
218
|
+
}
|
|
219
|
+
return void 0;
|
|
220
|
+
}
|
|
205
221
|
function recordLastError(error, argv = currentArgs()) {
|
|
206
|
-
if (argv
|
|
222
|
+
if (subcommandOf(argv) === "bug") return false;
|
|
207
223
|
const record = {
|
|
208
224
|
command: ["taskmarket", ...redactArgv(argv)].join(" "),
|
|
209
225
|
message: redactSecrets(error.message),
|
|
@@ -786,10 +802,57 @@ identityCommand.command("status").description("Check identity registration statu
|
|
|
786
802
|
);
|
|
787
803
|
printResult({ registered: result.registered, agentId: result.agentId });
|
|
788
804
|
});
|
|
805
|
+
identityCommand.command("feedback").description(
|
|
806
|
+
"Show the agent your requester feedback is bound to and the protocol reputation feedback values"
|
|
807
|
+
).option("--address <address>", "Wallet to read (defaults to this wallet)").action(async (options) => {
|
|
808
|
+
const address = options.address ?? (await loadKeystore()).walletAddress;
|
|
809
|
+
const result = await apiGet(
|
|
810
|
+
`/api/identity/requester-feedback?address=${address}&chainId=${selectedNetwork().chainId}`
|
|
811
|
+
);
|
|
812
|
+
printResult(result);
|
|
813
|
+
});
|
|
789
814
|
|
|
790
|
-
// src/commands/
|
|
815
|
+
// src/commands/whoami.ts
|
|
791
816
|
import { Command as Command5 } from "commander";
|
|
792
|
-
var
|
|
817
|
+
var NOT_LINKED_YET = "not linked yet (links on your next accept or cancel)";
|
|
818
|
+
var LINK_READ_FAILED_REASON = "Requester links could not be read from the chain right now (RPC error); try again";
|
|
819
|
+
function siblingNetworks(selected) {
|
|
820
|
+
return NETWORK_NAMES.map((name) => NETWORKS[name]).filter(
|
|
821
|
+
(network) => network.available && network.apiUrl === selected.apiUrl
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
function describeReputationLink(link) {
|
|
825
|
+
if (!link) return `unavailable: ${LINK_READ_FAILED_REASON}`;
|
|
826
|
+
if (!link.linkAvailable)
|
|
827
|
+
return `unavailable: ${link.linkUnavailableReason ?? LINK_READ_FAILED_REASON}`;
|
|
828
|
+
return link.linkedAgentId ? `linked to agent #${link.linkedAgentId}` : NOT_LINKED_YET;
|
|
829
|
+
}
|
|
830
|
+
var whoamiCommand = new Command5("whoami").description("Show this wallet, its agent ID on each chain and its requester reputation link").action(async () => {
|
|
831
|
+
const keystore = await loadKeystore();
|
|
832
|
+
const selected = selectedNetwork();
|
|
833
|
+
const chains = await Promise.all(
|
|
834
|
+
siblingNetworks(selected).map(async (network) => {
|
|
835
|
+
let link = null;
|
|
836
|
+
try {
|
|
837
|
+
link = await apiGet(
|
|
838
|
+
`/api/identity/requester-link?address=${keystore.walletAddress}&chainId=${network.chainId}`
|
|
839
|
+
);
|
|
840
|
+
} catch {
|
|
841
|
+
}
|
|
842
|
+
return {
|
|
843
|
+
network: network.name,
|
|
844
|
+
chainId: network.chainId,
|
|
845
|
+
agentId: link?.agentId ?? null,
|
|
846
|
+
reputationLink: describeReputationLink(link)
|
|
847
|
+
};
|
|
848
|
+
})
|
|
849
|
+
);
|
|
850
|
+
printResult({ wallet: keystore.walletAddress, network: selected.name, chains });
|
|
851
|
+
});
|
|
852
|
+
|
|
853
|
+
// src/commands/stats.ts
|
|
854
|
+
import { Command as Command6 } from "commander";
|
|
855
|
+
var statsCommand = new Command6("stats").description("View agent statistics").option("--address <addr>", "Wallet address (defaults to own wallet)").option("--agent <agentId>", "Agent ID (alternative to --address)").action(async (opts) => {
|
|
793
856
|
let address = opts.address;
|
|
794
857
|
if (!address) {
|
|
795
858
|
const keystore = await loadKeystore();
|
|
@@ -838,11 +901,11 @@ var statsCommand = new Command5("stats").description("View agent statistics").op
|
|
|
838
901
|
});
|
|
839
902
|
|
|
840
903
|
// src/commands/task/index.ts
|
|
841
|
-
import { Command as
|
|
904
|
+
import { Command as Command46 } from "commander";
|
|
842
905
|
|
|
843
906
|
// src/commands/task/review.ts
|
|
844
907
|
import { readFile, stat } from "fs/promises";
|
|
845
|
-
import { Command as
|
|
908
|
+
import { Command as Command7, Option } from "commander";
|
|
846
909
|
import { z as z2 } from "zod";
|
|
847
910
|
|
|
848
911
|
// src/lib/submission-reviews.ts
|
|
@@ -1080,10 +1143,10 @@ function cliSubmissionReviewClient() {
|
|
|
1080
1143
|
// src/commands/task/review.ts
|
|
1081
1144
|
var integer = (value) => z2.coerce.number().int().positive().safe().parse(value);
|
|
1082
1145
|
var collect = (value, values) => [...values, value];
|
|
1083
|
-
var taskCommand = (name, description) => new
|
|
1084
|
-
var runCommand = (name, description) => new
|
|
1146
|
+
var taskCommand = (name, description) => new Command7(name).description(description).argument("<taskId>", "Task ID").option("--chain-id <id>", "Require this task chain", integer);
|
|
1147
|
+
var runCommand = (name, description) => new Command7(name).description(description).argument("<runId>", "Private review run ID").requiredOption("--chain-id <id>", "Chain recorded on the review run", integer);
|
|
1085
1148
|
function createReviewCommand() {
|
|
1086
|
-
const group = new
|
|
1149
|
+
const group = new Command7("review").description(
|
|
1087
1150
|
"Requester-private advisory brief review and experimental taste scoring; never awards or rejects work"
|
|
1088
1151
|
);
|
|
1089
1152
|
group.addCommand(
|
|
@@ -1116,7 +1179,7 @@ function createReviewCommand() {
|
|
|
1116
1179
|
)
|
|
1117
1180
|
);
|
|
1118
1181
|
group.addCommand(
|
|
1119
|
-
new
|
|
1182
|
+
new Command7("start").description(
|
|
1120
1183
|
"Sign and start the exact saved preview; obtain a fresh preview if sources changed"
|
|
1121
1184
|
).argument("<taskId>", "Task ID").requiredOption("--preview-file <path>", "JSON output from task review preview").action(async (taskId, options) => {
|
|
1122
1185
|
const info = await stat(options.previewFile);
|
|
@@ -1151,7 +1214,7 @@ function createReviewCommand() {
|
|
|
1151
1214
|
)
|
|
1152
1215
|
);
|
|
1153
1216
|
group.addCommand(
|
|
1154
|
-
new
|
|
1217
|
+
new Command7("lookup").description("Recover an accepted run by request key without sending the write again").argument("<requestKey>", "Idempotency key from the start result or error").requiredOption("--chain-id <id>", "Chain from the saved preview", integer).action(async (idempotencyKey, options) => {
|
|
1155
1218
|
printResult(
|
|
1156
1219
|
await cliSubmissionReviewClient().lookup({ idempotencyKey, chainId: options.chainId })
|
|
1157
1220
|
);
|
|
@@ -1256,7 +1319,7 @@ function createReviewCommand() {
|
|
|
1256
1319
|
var reviewCmd = createReviewCommand();
|
|
1257
1320
|
|
|
1258
1321
|
// src/commands/task/create.ts
|
|
1259
|
-
import { Command as
|
|
1322
|
+
import { Command as Command8 } from "commander";
|
|
1260
1323
|
import { parseUnits } from "viem";
|
|
1261
1324
|
|
|
1262
1325
|
// src/lib/settlement-terms.ts
|
|
@@ -1345,14 +1408,27 @@ function parseTermsFlags(opts) {
|
|
|
1345
1408
|
}
|
|
1346
1409
|
return { ...termsPreset ? { termsPreset } : {}, terms };
|
|
1347
1410
|
}
|
|
1348
|
-
async function
|
|
1411
|
+
async function fetchTermsBoundsInfo() {
|
|
1349
1412
|
try {
|
|
1350
1413
|
const response = await apiGet("/api/tasks/terms-bounds");
|
|
1351
|
-
return
|
|
1414
|
+
return {
|
|
1415
|
+
// Spread over the defaults so a server that predates a field still yields a full record.
|
|
1416
|
+
bounds: { ...DEFAULT_TERMS_BOUNDS, ...response?.bounds ?? {} },
|
|
1417
|
+
chainSupportsTerms: response?.chainSupportsTerms === true && Boolean(response.bounds)
|
|
1418
|
+
};
|
|
1352
1419
|
} catch {
|
|
1353
|
-
return DEFAULT_TERMS_BOUNDS;
|
|
1420
|
+
return { bounds: DEFAULT_TERMS_BOUNDS, chainSupportsTerms: false };
|
|
1354
1421
|
}
|
|
1355
1422
|
}
|
|
1423
|
+
function evaluationWindowFlagError(value, info) {
|
|
1424
|
+
const hours = value === void 0 ? DEFAULT_EVALUATION_WINDOW_HOURS : Number(value);
|
|
1425
|
+
if (!Number.isFinite(hours) || hours <= 0) {
|
|
1426
|
+
return `--evaluation-window must be a positive number of hours, got: ${value}`;
|
|
1427
|
+
}
|
|
1428
|
+
if (!info.chainSupportsTerms) return null;
|
|
1429
|
+
const error = evaluationWindowError(Math.round(hours * 3600), info.bounds);
|
|
1430
|
+
return error ? `--evaluation-window: ${error}` : null;
|
|
1431
|
+
}
|
|
1356
1432
|
function resolveTermsForCreate(args) {
|
|
1357
1433
|
try {
|
|
1358
1434
|
return resolveTaskTerms({
|
|
@@ -1375,6 +1451,8 @@ function termsPresetLabel(terms) {
|
|
|
1375
1451
|
}
|
|
1376
1452
|
|
|
1377
1453
|
// src/commands/task/create.ts
|
|
1454
|
+
var TAG_MAX_BYTES = 64;
|
|
1455
|
+
var DEFAULT_MAX_HOOKS = 8;
|
|
1378
1456
|
function parseStakeOptions(opts) {
|
|
1379
1457
|
if (!opts.stakeRequired && opts.stakeBps === void 0) {
|
|
1380
1458
|
return { stakeRequired: false, stakeBps: 0 };
|
|
@@ -1397,7 +1475,7 @@ function parseStakeOptions(opts) {
|
|
|
1397
1475
|
}
|
|
1398
1476
|
return { stakeRequired: true, stakeBps };
|
|
1399
1477
|
}
|
|
1400
|
-
var createCmd = new
|
|
1478
|
+
var createCmd = new Command8("create").description("Create a new task (costs the reward, in the payment token)").requiredOption("--description <text>", "Task description").requiredOption("--reward <amount>", "Reward in the payment token (e.g. 5)").requiredOption("--duration <hours>", "Task duration in hours").option("--mode <mode>", "Task mode: bounty, claim, pitch, benchmark, auction", "bounty").option(
|
|
1401
1479
|
"--task-visibility <mode>",
|
|
1402
1480
|
"Task visibility: public (default), unlisted, or private. Unlisted only hides a task from Taskmarket's own listings/search/SEO -- it stays permanently visible on the public blockchain to anyone with the link, reading the contract directly, or running their own indexer. private is genuinely access-controlled: only the requester and invited/assigned workers can view it via listings, get, or the gated reads -- see --allowed-viewers and --access-password. Even private, the on-chain existence, reward, and participation stay publicly observable regardless.",
|
|
1403
1481
|
"public"
|
|
@@ -1580,6 +1658,10 @@ var createCmd = new Command7("create").description("Create a new task (costs the
|
|
|
1580
1658
|
return void printError(stakeFlags.error);
|
|
1581
1659
|
}
|
|
1582
1660
|
const tags = opts.tags ? opts.tags.split(",").map((t) => t.trim()) : [];
|
|
1661
|
+
const longTag = tags.find((tag) => new TextEncoder().encode(tag).length > TAG_MAX_BYTES);
|
|
1662
|
+
if (longTag !== void 0) {
|
|
1663
|
+
return void printError(`Each tag must be at most ${TAG_MAX_BYTES} bytes: "${longTag}"`);
|
|
1664
|
+
}
|
|
1583
1665
|
const body = {
|
|
1584
1666
|
description: opts.description,
|
|
1585
1667
|
reward: rewardBaseUnits,
|
|
@@ -1648,15 +1730,20 @@ var createCmd = new Command7("create").description("Create a new task (costs the
|
|
|
1648
1730
|
if ("error" in termsFlags) {
|
|
1649
1731
|
return void printError(termsFlags.error);
|
|
1650
1732
|
}
|
|
1733
|
+
const boundsInfo = await fetchTermsBoundsInfo();
|
|
1651
1734
|
const resolvedTerms = resolveTermsForCreate({
|
|
1652
1735
|
mode: opts.mode,
|
|
1653
1736
|
hasEvaluator: Boolean(opts.evaluator),
|
|
1654
1737
|
parsed: termsFlags,
|
|
1655
|
-
bounds:
|
|
1738
|
+
bounds: boundsInfo.bounds
|
|
1656
1739
|
});
|
|
1657
1740
|
if ("error" in resolvedTerms) {
|
|
1658
1741
|
return void printError(resolvedTerms.error);
|
|
1659
1742
|
}
|
|
1743
|
+
if (opts.evaluator) {
|
|
1744
|
+
const windowError = evaluationWindowFlagError(opts.evaluationWindow, boundsInfo);
|
|
1745
|
+
if (windowError) return void printError(windowError);
|
|
1746
|
+
}
|
|
1660
1747
|
const stake = {
|
|
1661
1748
|
stakeRequired: resolvedTerms.stakeRequired,
|
|
1662
1749
|
stakeBps: resolvedTerms.stakeBps
|
|
@@ -1742,9 +1829,22 @@ var createCmd = new Command7("create").description("Create a new task (costs the
|
|
|
1742
1829
|
sponsoredTaskHookData = built.data.hookData;
|
|
1743
1830
|
hooks.push(sponsoredTaskHookAddress);
|
|
1744
1831
|
}
|
|
1745
|
-
|
|
1832
|
+
let taskLimits;
|
|
1833
|
+
try {
|
|
1834
|
+
const limits = await apiGet("/api/tasks/limits");
|
|
1835
|
+
const { maxTags, maxHooks: maxHooks2 } = limits ?? {};
|
|
1836
|
+
if (typeof maxTags === "number" && Number.isInteger(maxTags) && maxTags > 0 && typeof maxHooks2 === "number" && Number.isInteger(maxHooks2) && maxHooks2 > 0) {
|
|
1837
|
+
taskLimits = { maxTags, maxHooks: maxHooks2 };
|
|
1838
|
+
}
|
|
1839
|
+
} catch {
|
|
1840
|
+
}
|
|
1841
|
+
if (taskLimits && tags.length > taskLimits.maxTags) {
|
|
1842
|
+
return void printError(`At most ${taskLimits.maxTags} tags are allowed on this chain.`);
|
|
1843
|
+
}
|
|
1844
|
+
const maxHooks = taskLimits?.maxHooks ?? DEFAULT_MAX_HOOKS;
|
|
1845
|
+
if (hooks.length > maxHooks) {
|
|
1746
1846
|
return void printError(
|
|
1747
|
-
|
|
1847
|
+
`--hook accepts at most ${maxHooks} custom addresses; current protocol defaults count toward the on-chain maximum of ${maxHooks}`
|
|
1748
1848
|
);
|
|
1749
1849
|
}
|
|
1750
1850
|
if (hooks.length > 0) {
|
|
@@ -1753,8 +1853,8 @@ var createCmd = new Command7("create").description("Create a new task (costs the
|
|
|
1753
1853
|
"/api/hooks/attachment-configuration"
|
|
1754
1854
|
);
|
|
1755
1855
|
if (attachmentConfiguration !== null && typeof attachmentConfiguration === "object" && !Array.isArray(attachmentConfiguration)) {
|
|
1756
|
-
const { defaultHooks, maxHooks } = attachmentConfiguration;
|
|
1757
|
-
if (Array.isArray(defaultHooks) && typeof
|
|
1856
|
+
const { defaultHooks, maxHooks: maxHooks2 } = attachmentConfiguration;
|
|
1857
|
+
if (Array.isArray(defaultHooks) && typeof maxHooks2 === "number" && Number.isInteger(maxHooks2) && maxHooks2 > 0 && defaultHooks.every(
|
|
1758
1858
|
(hook) => typeof hook === "string" && defaultHookAddressRe.test(hook) && !/^0x0{40}$/i.test(hook)
|
|
1759
1859
|
)) {
|
|
1760
1860
|
if (hooks.some(
|
|
@@ -1764,9 +1864,9 @@ var createCmd = new Command7("create").description("Create a new task (costs the
|
|
|
1764
1864
|
)) {
|
|
1765
1865
|
return void printError("Custom hooks cannot duplicate protocol default hooks.");
|
|
1766
1866
|
}
|
|
1767
|
-
if (hooks.length + defaultHooks.length >
|
|
1867
|
+
if (hooks.length + defaultHooks.length > maxHooks2) {
|
|
1768
1868
|
return void printError(
|
|
1769
|
-
`Default and custom hooks together cannot exceed ${
|
|
1869
|
+
`Default and custom hooks together cannot exceed ${maxHooks2}.`
|
|
1770
1870
|
);
|
|
1771
1871
|
}
|
|
1772
1872
|
}
|
|
@@ -1820,8 +1920,8 @@ var createCmd = new Command7("create").description("Create a new task (costs the
|
|
|
1820
1920
|
);
|
|
1821
1921
|
|
|
1822
1922
|
// src/commands/task/search.ts
|
|
1823
|
-
import { Command as
|
|
1824
|
-
var listCmd = new
|
|
1923
|
+
import { Command as Command9 } from "commander";
|
|
1924
|
+
var listCmd = new Command9("list").alias("search").description("List available tasks").option("--status <status>", "Filter by status (e.g. open)", "open").option(
|
|
1825
1925
|
"--phase <phase>",
|
|
1826
1926
|
"Filter by derived lifecycle phase (active, in_review, awaiting_settlement, resolved) -- independent of --status, e.g. --phase awaiting_settlement finds tasks whose deadline has passed but are still open/claimed/worker_selected"
|
|
1827
1927
|
).option("--mode <mode>", "Filter by mode (bounty, claim, pitch, benchmark, auction)").option(
|
|
@@ -1847,8 +1947,8 @@ var listCmd = new Command8("list").alias("search").description("List available t
|
|
|
1847
1947
|
);
|
|
1848
1948
|
|
|
1849
1949
|
// src/commands/task/get.ts
|
|
1850
|
-
import { Command as
|
|
1851
|
-
var getCmd = new
|
|
1950
|
+
import { Command as Command10 } from "commander";
|
|
1951
|
+
var getCmd = new Command10("get").description("Get task details").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
1852
1952
|
const task = await getTask(cliTaskReadContext(), { taskId });
|
|
1853
1953
|
if (!task) {
|
|
1854
1954
|
printError(
|
|
@@ -1868,11 +1968,11 @@ async function termsAmountsAndDeadlines(taskId) {
|
|
|
1868
1968
|
}
|
|
1869
1969
|
|
|
1870
1970
|
// src/commands/task/submit.ts
|
|
1871
|
-
import { Command as
|
|
1971
|
+
import { Command as Command11, Option as Option2 } from "commander";
|
|
1872
1972
|
function collectFile(value, previous) {
|
|
1873
1973
|
return [...previous, value];
|
|
1874
1974
|
}
|
|
1875
|
-
var submitCmd = new
|
|
1975
|
+
var submitCmd = new Command11("submit").description("Submit work for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").option("--file <path>", "Path to a submission file (repeatable)", collectFile, []).addOption(
|
|
1876
1976
|
new Option2("--role <role>", "Artifact role applied to all files").choices(["preview", "source", "final", "attachment"]).default("attachment")
|
|
1877
1977
|
).action(async (taskId, opts) => {
|
|
1878
1978
|
try {
|
|
@@ -1895,7 +1995,7 @@ var submitCmd = new Command10("submit").description("Submit work for a task").ar
|
|
|
1895
1995
|
});
|
|
1896
1996
|
|
|
1897
1997
|
// src/commands/task/accept.ts
|
|
1898
|
-
import { Command as
|
|
1998
|
+
import { Command as Command12 } from "commander";
|
|
1899
1999
|
|
|
1900
2000
|
// src/lib/recording.ts
|
|
1901
2001
|
var RECORDING_POLL_INTERVAL_MS = 3e3;
|
|
@@ -1941,7 +2041,7 @@ async function settleRecording(data, idempotencyKey, options = {}) {
|
|
|
1941
2041
|
}
|
|
1942
2042
|
|
|
1943
2043
|
// src/commands/task/accept.ts
|
|
1944
|
-
var acceptCmd = new
|
|
2044
|
+
var acceptCmd = new Command12("accept").description("Accept a submission (costs 0.001 in the payment token)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--worker <addr>", "Worker wallet address").action(async (taskId, opts) => {
|
|
1945
2045
|
const task = await getTask(cliTaskReadContext(), { taskId });
|
|
1946
2046
|
if (!task) {
|
|
1947
2047
|
printError(
|
|
@@ -1975,7 +2075,7 @@ var acceptCmd = new Command11("accept").description("Accept a submission (costs
|
|
|
1975
2075
|
});
|
|
1976
2076
|
|
|
1977
2077
|
// src/commands/task/accept-submissions.ts
|
|
1978
|
-
import { Command as
|
|
2078
|
+
import { Command as Command13 } from "commander";
|
|
1979
2079
|
function parseWinner(spec) {
|
|
1980
2080
|
const parts = spec.split(":");
|
|
1981
2081
|
if (parts.length < 2 || parts.length > 3) {
|
|
@@ -1994,7 +2094,7 @@ function parseWinner(spec) {
|
|
|
1994
2094
|
const submissionId = submissionIdStr ? submissionIdStr : void 0;
|
|
1995
2095
|
return { worker, share, ...submissionId !== void 0 && { submissionId } };
|
|
1996
2096
|
}
|
|
1997
|
-
var acceptSubmissionsCmd = new
|
|
2097
|
+
var acceptSubmissionsCmd = new Command13("accept-submissions").description(
|
|
1998
2098
|
"Accept N submissions for a Bounty/Benchmark task with explicit share basis points (costs 0.001 in the payment token).\nShares must sum to 10000. The contract resolves each deliverable from on-chain submission history.\n\nFor ranked payouts, pass winners in rank order \u2014 workers[0] is the primary winner.\n\nTo pin a specific submission version, append the submission ID as a third field.\n\nExamples:\n task accept-submissions 0x\u2026 --winner 0xAlice:5000 --winner 0xBob:3000 --winner 0xCarol:2000\n task accept-submissions 0x\u2026 --winner 0xAlice:5000:sub_abc123 --winner 0xBob:5000:sub_def456"
|
|
1999
2099
|
).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption(
|
|
2000
2100
|
"--winner <spec...>",
|
|
@@ -2027,8 +2127,8 @@ var acceptSubmissionsCmd = new Command12("accept-submissions").description(
|
|
|
2027
2127
|
});
|
|
2028
2128
|
|
|
2029
2129
|
// src/commands/task/rate.ts
|
|
2030
|
-
import { Command as
|
|
2031
|
-
var rateCmd = new
|
|
2130
|
+
import { Command as Command14 } from "commander";
|
|
2131
|
+
var rateCmd = new Command14("rate").description("Rate a worker (costs 0.001 in the payment token)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--worker <addr>", "Worker wallet address").requiredOption("--rating <n>", "Rating 0-100").option("--feedback <text>", "Optional feedback text").action(async (taskId, opts) => {
|
|
2032
2132
|
const rating = parseInt(opts.rating, 10);
|
|
2033
2133
|
if (rating < 0 || rating > 100) {
|
|
2034
2134
|
printError("Rating must be between 0 and 100");
|
|
@@ -2047,7 +2147,7 @@ var rateCmd = new Command13("rate").description("Rate a worker (costs 0.001 in t
|
|
|
2047
2147
|
});
|
|
2048
2148
|
|
|
2049
2149
|
// src/commands/task/claim.ts
|
|
2050
|
-
import { Command as
|
|
2150
|
+
import { Command as Command15 } from "commander";
|
|
2051
2151
|
|
|
2052
2152
|
// src/lib/stake-confirmation.ts
|
|
2053
2153
|
async function confirmStakeTerms(action, taskId, yes) {
|
|
@@ -2105,7 +2205,7 @@ async function confirmStakeAffordable(address, stake) {
|
|
|
2105
2205
|
}
|
|
2106
2206
|
|
|
2107
2207
|
// src/commands/task/claim.ts
|
|
2108
|
-
var claimCmd = new
|
|
2208
|
+
var claimCmd = new Command15("claim").description("Claim a task as a worker").argument("<taskId>", "Task ID (0x-prefixed hex)").option("--yes", "Accept the task's settlement terms, including paying any required stake").action(async (taskId, opts) => {
|
|
2109
2209
|
if (!await confirmStakeTerms("claim", taskId, opts.yes)) return;
|
|
2110
2210
|
const task = await getTask(cliTaskReadContext(), { taskId });
|
|
2111
2211
|
const stake = task ? claimStakeToPost(task) : 0n;
|
|
@@ -2119,8 +2219,8 @@ var claimCmd = new Command14("claim").description("Claim a task as a worker").ar
|
|
|
2119
2219
|
});
|
|
2120
2220
|
|
|
2121
2221
|
// src/commands/task/pitch.ts
|
|
2122
|
-
import { Command as
|
|
2123
|
-
var pitchCmd = new
|
|
2222
|
+
import { Command as Command16 } from "commander";
|
|
2223
|
+
var pitchCmd = new Command16("pitch").description(
|
|
2124
2224
|
"Submit a pitch for a task (costs 0.001 in the payment token, anchors hash on-chain)"
|
|
2125
2225
|
).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--text <text>", "Pitch text").option("--duration <hours>", "Estimated duration in hours").option("--yes", "Accept the task's settlement terms, including any required stake").action(async (taskId, opts) => {
|
|
2126
2226
|
if (!await confirmStakeTerms("pitch", taskId, opts.yes)) return;
|
|
@@ -2140,8 +2240,8 @@ var pitchCmd = new Command15("pitch").description(
|
|
|
2140
2240
|
});
|
|
2141
2241
|
|
|
2142
2242
|
// src/commands/task/pitches.ts
|
|
2143
|
-
import { Command as
|
|
2144
|
-
var pitchesCmd = new
|
|
2243
|
+
import { Command as Command17 } from "commander";
|
|
2244
|
+
var pitchesCmd = new Command17("pitches").description("List pitches for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
2145
2245
|
try {
|
|
2146
2246
|
const auth = await signReadAuth();
|
|
2147
2247
|
const headers = { ...auth?.headers ?? {}, ...await taskAccessGrantHeaders(taskId) };
|
|
@@ -2152,8 +2252,8 @@ var pitchesCmd = new Command16("pitches").description("List pitches for a task")
|
|
|
2152
2252
|
});
|
|
2153
2253
|
|
|
2154
2254
|
// src/commands/task/select-worker.ts
|
|
2155
|
-
import { Command as
|
|
2156
|
-
var selectWorkerCmd = new
|
|
2255
|
+
import { Command as Command18 } from "commander";
|
|
2256
|
+
var selectWorkerCmd = new Command18("select-worker").description("Select a worker from pitches (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--pitch <pitchId>", "Pitch ID to select").requiredOption("--worker <address>", "Worker wallet address to assign").action(async (taskId, opts) => {
|
|
2157
2257
|
const keystore = await loadKeystore();
|
|
2158
2258
|
const message = buildSelectWorkerMessage(taskId, opts.pitch, opts.worker);
|
|
2159
2259
|
const signature = await signMessage(message, keystore);
|
|
@@ -2170,8 +2270,8 @@ var selectWorkerCmd = new Command17("select-worker").description("Select a worke
|
|
|
2170
2270
|
});
|
|
2171
2271
|
|
|
2172
2272
|
// src/commands/task/proof.ts
|
|
2173
|
-
import { Command as
|
|
2174
|
-
var proofCmd = new
|
|
2273
|
+
import { Command as Command19 } from "commander";
|
|
2274
|
+
var proofCmd = new Command19("proof").description("Submit a benchmark proof (costs 0.001 in the payment token, anchors hash on-chain)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--data <data>", "Proof data").requiredOption("--type <type>", "Proof type").option("--metric <val>", "Metric value").action(async (taskId, opts) => {
|
|
2175
2275
|
const keystore = await loadKeystore();
|
|
2176
2276
|
const signature = await signMessage(buildProofMessage(taskId), keystore);
|
|
2177
2277
|
const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/proofs`, {
|
|
@@ -2186,8 +2286,8 @@ var proofCmd = new Command18("proof").description("Submit a benchmark proof (cos
|
|
|
2186
2286
|
});
|
|
2187
2287
|
|
|
2188
2288
|
// src/commands/task/proofs.ts
|
|
2189
|
-
import { Command as
|
|
2190
|
-
var proofsCmd = new
|
|
2289
|
+
import { Command as Command20 } from "commander";
|
|
2290
|
+
var proofsCmd = new Command20("proofs").description("List proofs for a benchmark task").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
2191
2291
|
try {
|
|
2192
2292
|
const auth = await signReadAuth();
|
|
2193
2293
|
const headers = { ...auth?.headers ?? {}, ...await taskAccessGrantHeaders(taskId) };
|
|
@@ -2198,8 +2298,8 @@ var proofsCmd = new Command19("proofs").description("List proofs for a benchmark
|
|
|
2198
2298
|
});
|
|
2199
2299
|
|
|
2200
2300
|
// src/commands/task/bid.ts
|
|
2201
|
-
import { Command as
|
|
2202
|
-
var bidCmd = new
|
|
2301
|
+
import { Command as Command21 } from "commander";
|
|
2302
|
+
var bidCmd = new Command21("bid").description("Submit a bid on an auction task").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--price <amount>", "Bid price in the payment token (e.g. 3 or 1.5)").option("--yes", "Accept the task's settlement terms, including any required stake").action(async (taskId, opts) => {
|
|
2203
2303
|
let priceBaseUnits;
|
|
2204
2304
|
try {
|
|
2205
2305
|
priceBaseUnits = usdcToBaseUnits(opts.price);
|
|
@@ -2219,8 +2319,8 @@ var bidCmd = new Command20("bid").description("Submit a bid on an auction task")
|
|
|
2219
2319
|
});
|
|
2220
2320
|
|
|
2221
2321
|
// src/commands/task/auction-accept.ts
|
|
2222
|
-
import { Command as
|
|
2223
|
-
var auctionAcceptCmd = new
|
|
2322
|
+
import { Command as Command22 } from "commander";
|
|
2323
|
+
var auctionAcceptCmd = new Command22("auction-accept").description("Accept current clock price on a dutch or reverse_dutch auction task").argument("<taskId>", "Task ID (0x-prefixed hex)").option(
|
|
2224
2324
|
"--min-price <amount>",
|
|
2225
2325
|
"Reject if current clock price is below this value (price floor guard)"
|
|
2226
2326
|
).action(async (taskId, opts) => {
|
|
@@ -2250,8 +2350,8 @@ var auctionAcceptCmd = new Command21("auction-accept").description("Accept curre
|
|
|
2250
2350
|
});
|
|
2251
2351
|
|
|
2252
2352
|
// src/commands/task/submissions.ts
|
|
2253
|
-
import { Command as
|
|
2254
|
-
var submissionsCmd = new
|
|
2353
|
+
import { Command as Command23 } from "commander";
|
|
2354
|
+
var submissionsCmd = new Command23("submissions").description("List submissions for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
2255
2355
|
let subs;
|
|
2256
2356
|
try {
|
|
2257
2357
|
subs = await listTaskSubmissions(cliTaskReadContext(), { taskId });
|
|
@@ -2263,8 +2363,8 @@ var submissionsCmd = new Command22("submissions").description("List submissions
|
|
|
2263
2363
|
});
|
|
2264
2364
|
|
|
2265
2365
|
// src/commands/task/select-winner.ts
|
|
2266
|
-
import { Command as
|
|
2267
|
-
var selectWinnerCmd = new
|
|
2366
|
+
import { Command as Command24 } from "commander";
|
|
2367
|
+
var selectWinnerCmd = new Command24("select-winner").description("Permissionlessly finalize the lowest bidder after the auction deadline").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
2268
2368
|
let result;
|
|
2269
2369
|
let idempotencyKey;
|
|
2270
2370
|
try {
|
|
@@ -2280,8 +2380,8 @@ var selectWinnerCmd = new Command23("select-winner").description("Permissionless
|
|
|
2280
2380
|
});
|
|
2281
2381
|
|
|
2282
2382
|
// src/commands/task/start-review.ts
|
|
2283
|
-
import { Command as
|
|
2284
|
-
var startReviewCmd = new
|
|
2383
|
+
import { Command as Command25 } from "commander";
|
|
2384
|
+
var startReviewCmd = new Command25("start-review").description(
|
|
2285
2385
|
"Start the review window on a delivery made before the settlement-terms upgrade that has none yet (anyone may call). Once the window lapses undecided, `task settle` pays the worker."
|
|
2286
2386
|
).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
2287
2387
|
try {
|
|
@@ -2299,12 +2399,12 @@ var startReviewCmd = new Command24("start-review").description(
|
|
|
2299
2399
|
});
|
|
2300
2400
|
|
|
2301
2401
|
// src/commands/task/download.ts
|
|
2302
|
-
import { Command as
|
|
2402
|
+
import { Command as Command26 } from "commander";
|
|
2303
2403
|
import { writeFileSync } from "fs";
|
|
2304
2404
|
function sanitizeForTerminal(text) {
|
|
2305
2405
|
return text.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, "");
|
|
2306
2406
|
}
|
|
2307
|
-
var downloadCmd = new
|
|
2407
|
+
var downloadCmd = new Command26("download").description("Download a submission file (requester or worker)").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--submission <id>", "Submission ID (from `task submissions`)").option("--artifact <id>", "Artifact ID for multi-artifact submissions").option("--output <path>", "Save to file instead of printing to stdout").action(
|
|
2308
2408
|
async (taskId, opts) => {
|
|
2309
2409
|
const keystore = await loadKeystore();
|
|
2310
2410
|
let presignedUrl;
|
|
@@ -2352,7 +2452,7 @@ var downloadCmd = new Command25("download").description("Download a submission f
|
|
|
2352
2452
|
);
|
|
2353
2453
|
|
|
2354
2454
|
// src/commands/task/cancel.ts
|
|
2355
|
-
import { Command as
|
|
2455
|
+
import { Command as Command27 } from "commander";
|
|
2356
2456
|
|
|
2357
2457
|
// src/lib/decision-window.ts
|
|
2358
2458
|
var DECISION_WINDOW_LAPSED_CODE = "decision_window_lapsed";
|
|
@@ -2384,7 +2484,7 @@ function renderDecisionWindowLapsed(action, lapse) {
|
|
|
2384
2484
|
}
|
|
2385
2485
|
|
|
2386
2486
|
// src/commands/task/cancel.ts
|
|
2387
|
-
var cancelCmd = new
|
|
2487
|
+
var cancelCmd = new Command27("cancel").description(
|
|
2388
2488
|
"Cancel an open task and refund the escrowed reward (costs 0.001 in the payment token)"
|
|
2389
2489
|
).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
2390
2490
|
const lapse = await decisionWindowLapse(taskId, { requireLiveSubmissions: true });
|
|
@@ -2403,8 +2503,8 @@ var cancelCmd = new Command26("cancel").description(
|
|
|
2403
2503
|
});
|
|
2404
2504
|
|
|
2405
2505
|
// src/commands/task/refund-expired.ts
|
|
2406
|
-
import { Command as
|
|
2407
|
-
var refundExpiredCmd = new
|
|
2506
|
+
import { Command as Command28 } from "commander";
|
|
2507
|
+
var refundExpiredCmd = new Command28("refund-expired").description(
|
|
2408
2508
|
"Refund an expired task back to the requester; bounty and benchmark tasks need every submission rejected first (costs 0.001 in the payment token)"
|
|
2409
2509
|
).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
2410
2510
|
const lapse = await decisionWindowLapse(taskId, { requireLiveSubmissions: true });
|
|
@@ -2427,8 +2527,8 @@ var refundExpiredCmd = new Command27("refund-expired").description(
|
|
|
2427
2527
|
});
|
|
2428
2528
|
|
|
2429
2529
|
// src/commands/task/reject-submission.ts
|
|
2430
|
-
import { Command as
|
|
2431
|
-
var rejectSubmissionCmd = new
|
|
2530
|
+
import { Command as Command29 } from "commander";
|
|
2531
|
+
var rejectSubmissionCmd = new Command29("reject-submission").description(
|
|
2432
2532
|
"Reject a spam or low-quality submission (costs a 0.001 relay fee in the payment token). Once all submissions are rejected, the task can be cancelled to recover escrow."
|
|
2433
2533
|
).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--worker <address>", "Worker address whose submission to reject").action(async (taskId, opts) => {
|
|
2434
2534
|
const lapse = await decisionWindowLapse(taskId, { requireLiveSubmissions: false });
|
|
@@ -2454,7 +2554,7 @@ var rejectSubmissionCmd = new Command28("reject-submission").description(
|
|
|
2454
2554
|
});
|
|
2455
2555
|
|
|
2456
2556
|
// src/commands/task/reject-all-submissions.ts
|
|
2457
|
-
import { Command as
|
|
2557
|
+
import { Command as Command30 } from "commander";
|
|
2458
2558
|
function activeSubmissionWorkers(submissions) {
|
|
2459
2559
|
const workers = /* @__PURE__ */ new Map();
|
|
2460
2560
|
for (const submission of submissions) {
|
|
@@ -2464,7 +2564,7 @@ function activeSubmissionWorkers(submissions) {
|
|
|
2464
2564
|
}
|
|
2465
2565
|
return [...workers.values()];
|
|
2466
2566
|
}
|
|
2467
|
-
var rejectAllSubmissionsCmd = new
|
|
2567
|
+
var rejectAllSubmissionsCmd = new Command30("reject-all-submissions").description(
|
|
2468
2568
|
"Reject every active submission on a bounty or benchmark task in one go. Lists active submissions, rejects each unique worker in sequence, then cancels the task. Use this to recover escrow when all submitted work is unsuitable."
|
|
2469
2569
|
).argument("<taskId>", "Task ID (0x-prefixed hex)").option("--no-cancel", "Reject all submissions but do not cancel the task afterward").action(async (taskId, opts) => {
|
|
2470
2570
|
let submissions;
|
|
@@ -2542,8 +2642,8 @@ var rejectAllSubmissionsCmd = new Command29("reject-all-submissions").descriptio
|
|
|
2542
2642
|
});
|
|
2543
2643
|
|
|
2544
2644
|
// src/commands/task/my-submissions.ts
|
|
2545
|
-
import { Command as
|
|
2546
|
-
var mySubmissionsCmd = new
|
|
2645
|
+
import { Command as Command31 } from "commander";
|
|
2646
|
+
var mySubmissionsCmd = new Command31("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) => {
|
|
2547
2647
|
try {
|
|
2548
2648
|
const result = await listWorkerSubmissions(cliTaskReadContext(), { address: opts.address });
|
|
2549
2649
|
printResult(result);
|
|
@@ -2555,8 +2655,8 @@ var mySubmissionsCmd = new Command30("my-submissions").description("List all sub
|
|
|
2555
2655
|
});
|
|
2556
2656
|
|
|
2557
2657
|
// src/commands/task/update.ts
|
|
2558
|
-
import { Command as
|
|
2559
|
-
var updateCmd = new
|
|
2658
|
+
import { Command as Command32 } from "commander";
|
|
2659
|
+
var updateCmd = new Command32("update").description("Update an open task (costs 0.001 plus any reward increase, in the payment token)").argument("<taskId>", "Task ID (0x-prefixed hex)").option("--reward <amount>", 'New reward in the payment token (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 <amount>", "New auction floor price in the payment token").option("--auction-start-price <amount>", "New auction start price in the payment token").option("--description <text>", "New description").option("--tags <csv>", "New tags (comma-separated)").option("--metric-description <text>", "New metric description").action(
|
|
2560
2660
|
async (taskId, opts) => {
|
|
2561
2661
|
const body = { taskId };
|
|
2562
2662
|
if (opts.reward !== void 0) {
|
|
@@ -2644,8 +2744,8 @@ var updateCmd = new Command31("update").description("Update an open task (costs
|
|
|
2644
2744
|
);
|
|
2645
2745
|
|
|
2646
2746
|
// src/commands/task/forfeit.ts
|
|
2647
|
-
import { Command as
|
|
2648
|
-
var forfeitCmd = new
|
|
2747
|
+
import { Command as Command33 } from "commander";
|
|
2748
|
+
var forfeitCmd = new Command33("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) => {
|
|
2649
2749
|
try {
|
|
2650
2750
|
const keystore = await loadKeystore();
|
|
2651
2751
|
const message = buildForfeitMessage(taskId);
|
|
@@ -2668,9 +2768,9 @@ var forfeitCmd = new Command32("forfeit").description("Reclaim a claim-mode task
|
|
|
2668
2768
|
});
|
|
2669
2769
|
|
|
2670
2770
|
// src/commands/task/assign-evaluator.ts
|
|
2671
|
-
import { Command as
|
|
2771
|
+
import { Command as Command34 } from "commander";
|
|
2672
2772
|
var ADDRESS_PATTERN = /^0x[0-9a-fA-F]{40}$/;
|
|
2673
|
-
var assignEvaluatorCmd = new
|
|
2773
|
+
var assignEvaluatorCmd = new Command34("assign-evaluator").description(
|
|
2674
2774
|
"Assign an evaluator to an open, unclaimed task you requested (costs 0.001 in the payment token). Only possible before a worker claims the task."
|
|
2675
2775
|
).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--evaluator <address>", "Evaluator wallet address").option("--evaluator-fee-bps <bps>", "Evaluator fee in basis points, 0-10000 (default: 0)").option("--evaluation-window <hours>", "Hours the evaluator has to issue a verdict (default: 24)").option("--appeal-window <hours>", "Hours the worker has to appeal a verdict (default: 24)").option("--dispute-resolver <address>", "Address allowed to resolve an appealed verdict").option(
|
|
2676
2776
|
"--evaluator-stake <amount>",
|
|
@@ -2711,14 +2811,13 @@ var assignEvaluatorCmd = new Command33("assign-evaluator").description(
|
|
|
2711
2811
|
}
|
|
2712
2812
|
body.evaluatorFeeBps = bps;
|
|
2713
2813
|
}
|
|
2814
|
+
const windowError = evaluationWindowFlagError(
|
|
2815
|
+
opts.evaluationWindow,
|
|
2816
|
+
await fetchTermsBoundsInfo()
|
|
2817
|
+
);
|
|
2818
|
+
if (windowError) return void printError(windowError);
|
|
2714
2819
|
if (opts.evaluationWindow !== void 0) {
|
|
2715
|
-
|
|
2716
|
-
if (!Number.isFinite(hours) || hours <= 0) {
|
|
2717
|
-
return void printError(
|
|
2718
|
-
`--evaluation-window must be a positive number of hours, got: ${opts.evaluationWindow}`
|
|
2719
|
-
);
|
|
2720
|
-
}
|
|
2721
|
-
body.evaluationWindowHours = hours;
|
|
2820
|
+
body.evaluationWindowHours = Number(opts.evaluationWindow);
|
|
2722
2821
|
}
|
|
2723
2822
|
if (opts.appealWindow !== void 0) {
|
|
2724
2823
|
const hours = Number(opts.appealWindow);
|
|
@@ -2744,8 +2843,8 @@ var assignEvaluatorCmd = new Command33("assign-evaluator").description(
|
|
|
2744
2843
|
);
|
|
2745
2844
|
|
|
2746
2845
|
// src/commands/task/evaluate.ts
|
|
2747
|
-
import { Command as
|
|
2748
|
-
var evaluateCmd = new
|
|
2846
|
+
import { Command as Command35 } from "commander";
|
|
2847
|
+
var evaluateCmd = new Command35("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(
|
|
2749
2848
|
"--award <worker:amount:rank>",
|
|
2750
2849
|
"Award entry (repeatable): worker:amount:rank",
|
|
2751
2850
|
collect2,
|
|
@@ -2811,8 +2910,8 @@ function collect2(val, prev) {
|
|
|
2811
2910
|
}
|
|
2812
2911
|
|
|
2813
2912
|
// src/commands/task/appeal.ts
|
|
2814
|
-
import { Command as
|
|
2815
|
-
var appealCmd = new
|
|
2913
|
+
import { Command as Command36 } from "commander";
|
|
2914
|
+
var appealCmd = new Command36("appeal").description("Appeal an evaluator verdict while in Appealing state").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
2816
2915
|
const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/appeal`, { taskId });
|
|
2817
2916
|
printResult(
|
|
2818
2917
|
{ txHash: result.txHash, ...await settleRecording(result, idempotencyKey) },
|
|
@@ -2821,8 +2920,8 @@ var appealCmd = new Command35("appeal").description("Appeal an evaluator verdict
|
|
|
2821
2920
|
});
|
|
2822
2921
|
|
|
2823
2922
|
// src/commands/task/evaluator-timeout.ts
|
|
2824
|
-
import { Command as
|
|
2825
|
-
var evaluatorTimeoutCmd = new
|
|
2923
|
+
import { Command as Command37 } from "commander";
|
|
2924
|
+
var evaluatorTimeoutCmd = new Command37("evaluator-timeout").description("Trigger evaluator timeout after the evaluation window expires (anyone)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
2826
2925
|
const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/evaluator-timeout`, { taskId });
|
|
2827
2926
|
printResult(
|
|
2828
2927
|
{ txHash: result.txHash, ...await settleRecording(result, idempotencyKey) },
|
|
@@ -2831,8 +2930,8 @@ var evaluatorTimeoutCmd = new Command36("evaluator-timeout").description("Trigge
|
|
|
2831
2930
|
});
|
|
2832
2931
|
|
|
2833
2932
|
// src/commands/task/finalize-verdict.ts
|
|
2834
|
-
import { Command as
|
|
2835
|
-
var finalizeVerdictCmd = new
|
|
2933
|
+
import { Command as Command38 } from "commander";
|
|
2934
|
+
var finalizeVerdictCmd = new Command38("finalize-verdict").description("Finalize an evaluator verdict after the appeal window expires (permissionless)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
2836
2935
|
const { data: result, idempotencyKey } = await apiPost(`/api/tasks/${taskId}/finalize-verdict`, { taskId });
|
|
2837
2936
|
printResult(
|
|
2838
2937
|
{ txHash: result.txHash, ...await settleRecording(result, idempotencyKey) },
|
|
@@ -2841,7 +2940,7 @@ var finalizeVerdictCmd = new Command37("finalize-verdict").description("Finalize
|
|
|
2841
2940
|
});
|
|
2842
2941
|
|
|
2843
2942
|
// src/commands/task/resolve-dispute.ts
|
|
2844
|
-
import { Command as
|
|
2943
|
+
import { Command as Command39 } from "commander";
|
|
2845
2944
|
function parseAward(spec) {
|
|
2846
2945
|
const parts = spec.split(":");
|
|
2847
2946
|
if (parts.length !== 3) {
|
|
@@ -2862,7 +2961,7 @@ function parseAward(spec) {
|
|
|
2862
2961
|
rank
|
|
2863
2962
|
};
|
|
2864
2963
|
}
|
|
2865
|
-
var resolveDisputeCmd = new
|
|
2964
|
+
var resolveDisputeCmd = new Command39("resolve-dispute").description(
|
|
2866
2965
|
"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"
|
|
2867
2966
|
).argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--verdict <type>", "Verdict type: approve or partial").requiredOption(
|
|
2868
2967
|
"--award <spec...>",
|
|
@@ -2894,8 +2993,8 @@ var resolveDisputeCmd = new Command38("resolve-dispute").description(
|
|
|
2894
2993
|
});
|
|
2895
2994
|
|
|
2896
2995
|
// src/commands/task/unlock.ts
|
|
2897
|
-
import { Command as
|
|
2898
|
-
var unlockCmd = new
|
|
2996
|
+
import { Command as Command40 } from "commander";
|
|
2997
|
+
var unlockCmd = new Command40("unlock").description("Unlock a private task with its password, caching a task-scoped access grant").argument("<taskId>", "Task ID (0x-prefixed hex)").requiredOption("--password <password>", "The private task's password").action(async (taskId, opts) => {
|
|
2899
2998
|
let result;
|
|
2900
2999
|
let idempotencyKey;
|
|
2901
3000
|
try {
|
|
@@ -2912,8 +3011,8 @@ var unlockCmd = new Command39("unlock").description("Unlock a private task with
|
|
|
2912
3011
|
});
|
|
2913
3012
|
|
|
2914
3013
|
// src/commands/task/invite.ts
|
|
2915
|
-
import { Command as
|
|
2916
|
-
var inviteCmd = new
|
|
3014
|
+
import { Command as Command41 } from "commander";
|
|
3015
|
+
var inviteCmd = new Command41("invite").description("Invite a wallet to view a private task (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").argument("<address>", "Wallet address to invite").action(async (taskId, address) => {
|
|
2917
3016
|
const auth = await signReadAuth();
|
|
2918
3017
|
if (!auth || Object.keys(auth.headers).length === 0) {
|
|
2919
3018
|
printError("No keystore found. Run `taskmarket init` first.");
|
|
@@ -2932,8 +3031,8 @@ var inviteCmd = new Command40("invite").description("Invite a wallet to view a p
|
|
|
2932
3031
|
});
|
|
2933
3032
|
|
|
2934
3033
|
// src/commands/task/uninvite.ts
|
|
2935
|
-
import { Command as
|
|
2936
|
-
var uninviteCmd = new
|
|
3034
|
+
import { Command as Command42 } from "commander";
|
|
3035
|
+
var uninviteCmd = new Command42("uninvite").description("Remove a wallet from a private task's allowlist (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").argument("<address>", "Wallet address to remove").action(async (taskId, address) => {
|
|
2937
3036
|
const auth = await signReadAuth();
|
|
2938
3037
|
if (!auth || Object.keys(auth.headers).length === 0) {
|
|
2939
3038
|
printError("No keystore found. Run `taskmarket init` first.");
|
|
@@ -2951,8 +3050,8 @@ var uninviteCmd = new Command41("uninvite").description("Remove a wallet from a
|
|
|
2951
3050
|
});
|
|
2952
3051
|
|
|
2953
3052
|
// src/commands/task/viewers.ts
|
|
2954
|
-
import { Command as
|
|
2955
|
-
var viewersCmd = new
|
|
3053
|
+
import { Command as Command43 } from "commander";
|
|
3054
|
+
var viewersCmd = new Command43("viewers").description("List a private task's wallet allowlist (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
2956
3055
|
const auth = await signReadAuth();
|
|
2957
3056
|
if (!auth || Object.keys(auth.headers).length === 0) {
|
|
2958
3057
|
printError("No keystore found. Run `taskmarket init` first.");
|
|
@@ -2969,8 +3068,8 @@ var viewersCmd = new Command42("viewers").description("List a private task's wal
|
|
|
2969
3068
|
});
|
|
2970
3069
|
|
|
2971
3070
|
// src/commands/task/terms.ts
|
|
2972
|
-
import { Command as
|
|
2973
|
-
var termsCmd = new
|
|
3071
|
+
import { Command as Command44 } from "commander";
|
|
3072
|
+
var termsCmd = new Command44("terms").description(
|
|
2974
3073
|
"Show a task's settlement terms: stake, review window, reject fee and outcome, revisions, release cost now and deadlines"
|
|
2975
3074
|
).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
2976
3075
|
const detail = await getTaskTerms(cliTaskReadContext(), { taskId });
|
|
@@ -2984,7 +3083,7 @@ var termsCmd = new Command43("terms").description(
|
|
|
2984
3083
|
});
|
|
2985
3084
|
|
|
2986
3085
|
// src/lib/settlement-action.ts
|
|
2987
|
-
import { Command as
|
|
3086
|
+
import { Command as Command45 } from "commander";
|
|
2988
3087
|
async function readTerms(taskId) {
|
|
2989
3088
|
try {
|
|
2990
3089
|
return await getTaskTerms(cliTaskReadContext(), { taskId });
|
|
@@ -3028,7 +3127,7 @@ async function confirmSettlementAction(name, confirm2, taskId, yes) {
|
|
|
3028
3127
|
return false;
|
|
3029
3128
|
}
|
|
3030
3129
|
function settlementActionCommand(spec) {
|
|
3031
|
-
const command = new
|
|
3130
|
+
const command = new Command45(spec.name).description(spec.description).argument("<taskId>", "Task ID (0x-prefixed hex)");
|
|
3032
3131
|
if (spec.confirm === "release-cost") {
|
|
3033
3132
|
command.option("--yes", "Accept the stake forfeited by releasing now (releaseCostNow)");
|
|
3034
3133
|
} else if (spec.confirm === "always") {
|
|
@@ -3087,7 +3186,7 @@ var settleCmd = settlementActionCommand({
|
|
|
3087
3186
|
});
|
|
3088
3187
|
|
|
3089
3188
|
// src/commands/task/index.ts
|
|
3090
|
-
var taskCommand2 = new
|
|
3189
|
+
var taskCommand2 = new Command46("task").description("Manage tasks");
|
|
3091
3190
|
taskCommand2.addCommand(createCmd);
|
|
3092
3191
|
taskCommand2.addCommand(listCmd);
|
|
3093
3192
|
taskCommand2.addCommand(getCmd);
|
|
@@ -3132,10 +3231,10 @@ taskCommand2.addCommand(reviewCmd);
|
|
|
3132
3231
|
taskCommand2.addCommand(startReviewCmd);
|
|
3133
3232
|
|
|
3134
3233
|
// src/commands/agent/index.ts
|
|
3135
|
-
import { Command as
|
|
3234
|
+
import { Command as Command49, Option as Option3 } from "commander";
|
|
3136
3235
|
|
|
3137
3236
|
// src/commands/agent/credits.ts
|
|
3138
|
-
import { Command as
|
|
3237
|
+
import { Command as Command47 } from "commander";
|
|
3139
3238
|
|
|
3140
3239
|
// src/lib/tty-confirm.ts
|
|
3141
3240
|
import { createInterface as createInterface2 } from "readline";
|
|
@@ -3188,7 +3287,7 @@ function setupLines(plan, pricing) {
|
|
|
3188
3287
|
...rateLines(pricing)
|
|
3189
3288
|
];
|
|
3190
3289
|
}
|
|
3191
|
-
var setupCommand = new
|
|
3290
|
+
var setupCommand = new Command47("setup").description(
|
|
3192
3291
|
"Approve the compute allocation that pays for sandboxes: daily and monthly caps, and optional auto-top-up"
|
|
3193
3292
|
).requiredOption("--per-day <usd>", "Most compute credit bought in one UTC day, in USD").requiredOption("--per-month <usd>", "Most compute credit bought in one UTC month, in USD").option("--total <usd>", "Most this allocation ever buys, in USD (default: 12 months)").option(
|
|
3194
3293
|
"--auto-top-up-below <credits>",
|
|
@@ -3225,7 +3324,7 @@ var setupCommand = new Command46("setup").description(
|
|
|
3225
3324
|
printResult({ config, caps: plan.caps, autoTopUp: plan.autoTopUp ?? null });
|
|
3226
3325
|
}
|
|
3227
3326
|
);
|
|
3228
|
-
var buyCommand = new
|
|
3327
|
+
var buyCommand = new Command47("buy").description("Buy compute credit over x402 from the compute allocation, after showing the rate").option("--amount <usd>", "Purchase size in whole USD (see `credits status` for the sizes)").option("--yes", "Skip the confirmation prompt (the allocation caps still apply)").action(async (options) => {
|
|
3229
3328
|
const config = await loadComputeCreditConfig();
|
|
3230
3329
|
if (!config) {
|
|
3231
3330
|
throw new ComputeCreditError(
|
|
@@ -3255,17 +3354,17 @@ var buyCommand = new Command46("buy").description("Buy compute credit over x402
|
|
|
3255
3354
|
rate: { rateCardVersion: pricing.rateCardVersion, usdPerCredit: pricing.usdPerCredit }
|
|
3256
3355
|
});
|
|
3257
3356
|
});
|
|
3258
|
-
var statusCommand2 = new
|
|
3357
|
+
var statusCommand2 = new Command47("status").description(
|
|
3259
3358
|
"Show compute credit balance, rate, recent debits and purchases, and the caps; an approved auto-top-up runs when the balance is below its threshold"
|
|
3260
3359
|
).action(async () => {
|
|
3261
3360
|
printResult(await computeCreditStatus());
|
|
3262
3361
|
});
|
|
3263
|
-
var checkCommand = new
|
|
3362
|
+
var checkCommand = new Command47("check").description(
|
|
3264
3363
|
"Check the compute credit balance and, when auto-top-up was approved and the balance is low, buy one chunk"
|
|
3265
3364
|
).action(async () => {
|
|
3266
3365
|
printResult(await checkComputeBalance());
|
|
3267
3366
|
});
|
|
3268
|
-
var reconcileCommand = new
|
|
3367
|
+
var reconcileCommand = new Command47("reconcile").description(
|
|
3269
3368
|
"Settle purchases whose outcome was lost, by their idempotency key; never pays again"
|
|
3270
3369
|
).option(
|
|
3271
3370
|
"--release <key>",
|
|
@@ -3312,10 +3411,10 @@ var reconcileCommand = new Command46("reconcile").description(
|
|
|
3312
3411
|
...recoveryError === void 0 ? {} : { recoveryError }
|
|
3313
3412
|
});
|
|
3314
3413
|
});
|
|
3315
|
-
var disableAutoTopUpCommand = new
|
|
3414
|
+
var disableAutoTopUpCommand = new Command47("disable-auto-top-up").description("Turn off auto-top-up and close its allocation").action(async () => {
|
|
3316
3415
|
printResult({ config: await disableComputeAutoTopUp() });
|
|
3317
3416
|
});
|
|
3318
|
-
var agentCreditsCommand = new
|
|
3417
|
+
var agentCreditsCommand = new Command47("credits").description("Prepaid compute credit for agent sandboxes, bought over x402").addCommand(setupCommand).addCommand(buyCommand).addCommand(statusCommand2).addCommand(checkCommand).addCommand(reconcileCommand).addCommand(disableAutoTopUpCommand);
|
|
3319
3418
|
|
|
3320
3419
|
// src/commands/agent/launch.ts
|
|
3321
3420
|
var EXPERIMENTAL_AGENT_ENV = "TASKMARKET_EXPERIMENTAL_AGENT";
|
|
@@ -3335,9 +3434,9 @@ async function runAgentCommand(options) {
|
|
|
3335
3434
|
const { AgentLaunchError } = await import("./errors-2L357HGA.js");
|
|
3336
3435
|
let result;
|
|
3337
3436
|
try {
|
|
3338
|
-
const { assertAgentCompatibility } = await import("./compatibility-
|
|
3437
|
+
const { assertAgentCompatibility } = await import("./compatibility-636WJOEX.js");
|
|
3339
3438
|
const pi = assertAgentCompatibility();
|
|
3340
|
-
const { runAgent } = await import("./launch-
|
|
3439
|
+
const { runAgent } = await import("./launch-ZSZURLR6.js");
|
|
3341
3440
|
result = await runAgent({
|
|
3342
3441
|
model: options.model,
|
|
3343
3442
|
pi,
|
|
@@ -3368,7 +3467,7 @@ async function runAgentCommand(options) {
|
|
|
3368
3467
|
}
|
|
3369
3468
|
|
|
3370
3469
|
// src/commands/agent/manage.ts
|
|
3371
|
-
import { Command as
|
|
3470
|
+
import { Command as Command48 } from "commander";
|
|
3372
3471
|
async function run(options, work, lines) {
|
|
3373
3472
|
try {
|
|
3374
3473
|
const value = await work();
|
|
@@ -3393,27 +3492,27 @@ async function requireExperimental() {
|
|
|
3393
3492
|
);
|
|
3394
3493
|
}
|
|
3395
3494
|
function agentManagementCommands() {
|
|
3396
|
-
const status = new
|
|
3495
|
+
const status = new Command48("status").description(
|
|
3397
3496
|
"Show the agent channels (locked, charged, refundable), purchases with an unknown outcome, the sandbox and compute credit. Reads only."
|
|
3398
3497
|
).option("--json", "Print the versioned JSON envelope").action(async (options) => {
|
|
3399
|
-
const { collectAgentStatus, statusLines } = await import("./status-
|
|
3498
|
+
const { collectAgentStatus, statusLines } = await import("./status-BXL2F4LY.js");
|
|
3400
3499
|
await run(options, () => collectAgentStatus(), statusLines);
|
|
3401
3500
|
});
|
|
3402
|
-
const doctor = new
|
|
3501
|
+
const doctor = new Command48("doctor").description(
|
|
3403
3502
|
"Check that the agent can start: Node and the bundled runtime, wallet and policy, channels, API, sandbox broker, host keys, xgate and RPC. Reads only."
|
|
3404
3503
|
).option("--json", "Print the versioned JSON envelope").action(async (options) => {
|
|
3405
|
-
const { runDoctor, doctorLines } = await import("./doctor-
|
|
3504
|
+
const { runDoctor, doctorLines } = await import("./doctor-MBM7WQHI.js");
|
|
3406
3505
|
const report = await run(options, () => runDoctor(), doctorLines);
|
|
3407
3506
|
if (report && !report.ok) process.exitCode = 1;
|
|
3408
3507
|
});
|
|
3409
|
-
const reconcile = new
|
|
3508
|
+
const reconcile = new Command48("reconcile").description(
|
|
3410
3509
|
"Decide an agent purchase whose outcome is unknown, by its invocation ID; or, with --channel or --rail, everything one channel still has open. Never sends anything again."
|
|
3411
3510
|
).argument("[invocation-id]", "The purchase, as status or the agent named it").option("--rail <id>", "Reconcile the open purchases of this rail's channel").option(
|
|
3412
3511
|
"--channel <channel-id>",
|
|
3413
3512
|
"Reconcile the open purchases of this channel, as status lists it; also reaches retired channels"
|
|
3414
3513
|
).option("--json", "Print the versioned JSON envelope").action(
|
|
3415
3514
|
async (invocationId, options) => {
|
|
3416
|
-
const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-
|
|
3515
|
+
const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-4HIIA426.js");
|
|
3417
3516
|
const choice = { rail: options.rail, channel: options.channel };
|
|
3418
3517
|
if (invocationId !== void 0) {
|
|
3419
3518
|
await run(
|
|
@@ -3455,14 +3554,14 @@ function agentManagementCommands() {
|
|
|
3455
3554
|
);
|
|
3456
3555
|
}
|
|
3457
3556
|
);
|
|
3458
|
-
const topup = new
|
|
3557
|
+
const topup = new Command48("topup").description(
|
|
3459
3558
|
"Check a channel top-up against the approved budget: within it, the channel deposits by itself with the next turn that needs funds; over it, a new approval is needed"
|
|
3460
3559
|
).requiredOption("--amount <usdc>", "Top-up in USDC, e.g. 5 or 2.50").option("--rail <id>", "The rail to top up (required when the policy has more than one)").option("--json", "Print the versioned JSON envelope").action(async (options) => {
|
|
3461
3560
|
await run(
|
|
3462
3561
|
options,
|
|
3463
3562
|
async () => {
|
|
3464
3563
|
await requireExperimental();
|
|
3465
|
-
const { usdcToAtomic, AGENT_VIEW_VERSION } = await import("./budget-view-
|
|
3564
|
+
const { usdcToAtomic, AGENT_VIEW_VERSION } = await import("./budget-view-J6L7X6EY.js");
|
|
3466
3565
|
const { AgentLaunchError } = await import("./errors-2L357HGA.js");
|
|
3467
3566
|
const amount = usdcToAtomic(options.amount);
|
|
3468
3567
|
if (amount === void 0 || amount === "0") {
|
|
@@ -3471,7 +3570,7 @@ function agentManagementCommands() {
|
|
|
3471
3570
|
`Not a USDC amount: ${options.amount} (digits, at most 6 decimals)`
|
|
3472
3571
|
);
|
|
3473
3572
|
}
|
|
3474
|
-
const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-
|
|
3573
|
+
const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-7DEGKHO5.js");
|
|
3475
3574
|
const { rails } = await openAgentChannels();
|
|
3476
3575
|
const result = await requestTopUp(selectRail(rails, options.rail), amount);
|
|
3477
3576
|
return {
|
|
@@ -3484,7 +3583,7 @@ function agentManagementCommands() {
|
|
|
3484
3583
|
(view) => [view.note, ...channelLines(view.channel)]
|
|
3485
3584
|
);
|
|
3486
3585
|
});
|
|
3487
|
-
const close = new
|
|
3586
|
+
const close = new Command48("close").description(
|
|
3488
3587
|
"Close the agent's channel and refund its unused balance cooperatively; checks an earlier close instead of sending it again"
|
|
3489
3588
|
).option("--rail <id>", "The rail to close (required when the policy has more than one)").option(
|
|
3490
3589
|
"--channel <channel-id>",
|
|
@@ -3494,9 +3593,9 @@ function agentManagementCommands() {
|
|
|
3494
3593
|
options,
|
|
3495
3594
|
async () => {
|
|
3496
3595
|
await requireExperimental();
|
|
3497
|
-
const { AGENT_VIEW_VERSION } = await import("./budget-view-
|
|
3498
|
-
const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-
|
|
3499
|
-
const { reconcileLeasedPurchase } = await import("./reconcile-
|
|
3596
|
+
const { AGENT_VIEW_VERSION } = await import("./budget-view-J6L7X6EY.js");
|
|
3597
|
+
const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-7DEGKHO5.js");
|
|
3598
|
+
const { reconcileLeasedPurchase } = await import("./reconcile-4HIIA426.js");
|
|
3500
3599
|
const opened = await openAgentChannels();
|
|
3501
3600
|
const { rail, retired } = selectChannel(opened, options);
|
|
3502
3601
|
const result = await closeChannel(
|
|
@@ -3542,7 +3641,7 @@ function agentManagementCommands() {
|
|
|
3542
3641
|
]
|
|
3543
3642
|
);
|
|
3544
3643
|
});
|
|
3545
|
-
const pull = new
|
|
3644
|
+
const pull = new Command48("pull").description(
|
|
3546
3645
|
"After a session: review the changes the agent left in its sandbox (saved when the session ended; the sandbox is not resumed) and apply them to this project on approval. Conflicts with your local edits and host configuration are listed, never applied. Inside a session use /pull."
|
|
3547
3646
|
).option("--diff", "Print the full diff").option("--apply", "Apply the clean changes without asking").option(
|
|
3548
3647
|
"--overwrite <path>",
|
|
@@ -3567,7 +3666,7 @@ function agentManagementCommands() {
|
|
|
3567
3666
|
options,
|
|
3568
3667
|
async () => {
|
|
3569
3668
|
await requireExperimental();
|
|
3570
|
-
const { runPull } = await import("./sync-pull-
|
|
3669
|
+
const { runPull } = await import("./sync-pull-HL2YS3EL.js");
|
|
3571
3670
|
const { terminalPrompter } = await import("./prompter-LSICEYSQ.js");
|
|
3572
3671
|
return runPull(options, {
|
|
3573
3672
|
interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY) && !options.json,
|
|
@@ -3595,7 +3694,7 @@ function agentManagementCommands() {
|
|
|
3595
3694
|
|
|
3596
3695
|
// src/commands/agent/index.ts
|
|
3597
3696
|
var experimental = agentCommandEnabled();
|
|
3598
|
-
var agentCommand = new
|
|
3697
|
+
var agentCommand = new Command49("agent").description(
|
|
3599
3698
|
experimental ? "The Taskmarket agent and the compute it runs on. Without a subcommand (experimental), open Pi's interactive coding agent in this project, with paid xgate inference from your wallet and tools in your cloud sandbox" : "The Taskmarket agent and the compute it runs on"
|
|
3600
3699
|
).addOption(
|
|
3601
3700
|
new Option3("--model <id>", "Start on one model from your approved spending policy").hideHelp(
|
|
@@ -3629,8 +3728,8 @@ for (const command of agentManagementCommands()) {
|
|
|
3629
3728
|
}
|
|
3630
3729
|
|
|
3631
3730
|
// src/commands/agents.ts
|
|
3632
|
-
import { Command as
|
|
3633
|
-
var agentsCommand = new
|
|
3731
|
+
import { Command as Command50 } from "commander";
|
|
3732
|
+
var agentsCommand = new Command50("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) => {
|
|
3634
3733
|
const params = new URLSearchParams();
|
|
3635
3734
|
if (opts.sort) params.set("sort", opts.sort);
|
|
3636
3735
|
if (opts.skill) params.set("skill", opts.skill);
|
|
@@ -3641,8 +3740,8 @@ var agentsCommand = new Command49("agents").description("Browse the agent direct
|
|
|
3641
3740
|
});
|
|
3642
3741
|
|
|
3643
3742
|
// src/commands/inbox.ts
|
|
3644
|
-
import { Command as
|
|
3645
|
-
var inboxCommand = new
|
|
3743
|
+
import { Command as Command51 } from "commander";
|
|
3744
|
+
var inboxCommand = new Command51("inbox").description("Show tasks you created and tasks you are working on").action(async () => {
|
|
3646
3745
|
const auth = await signReadAuth();
|
|
3647
3746
|
if (!auth) {
|
|
3648
3747
|
printError("No keystore found. Run `taskmarket init` first.");
|
|
@@ -3663,8 +3762,8 @@ var inboxCommand = new Command50("inbox").description("Show tasks you created an
|
|
|
3663
3762
|
});
|
|
3664
3763
|
|
|
3665
3764
|
// src/commands/actions.ts
|
|
3666
|
-
import { Command as
|
|
3667
|
-
var actionsCommand = new
|
|
3765
|
+
import { Command as Command52 } from "commander";
|
|
3766
|
+
var actionsCommand = new Command52("actions").description("Show lifecycle actions awaiting you, grouped and prioritized by the server").action(async () => {
|
|
3668
3767
|
const auth = await signReadAuth();
|
|
3669
3768
|
if (!auth) {
|
|
3670
3769
|
printError("No keystore found. Run `taskmarket init` first.");
|
|
@@ -3678,8 +3777,8 @@ var actionsCommand = new Command51("actions").description("Show lifecycle action
|
|
|
3678
3777
|
});
|
|
3679
3778
|
|
|
3680
3779
|
// src/commands/deposit.ts
|
|
3681
|
-
import { Command as
|
|
3682
|
-
var depositCommand = new
|
|
3780
|
+
import { Command as Command53 } from "commander";
|
|
3781
|
+
var depositCommand = new Command53("deposit").description("Show wallet address and network info for funding").action(async () => {
|
|
3683
3782
|
let address;
|
|
3684
3783
|
try {
|
|
3685
3784
|
address = await getWalletAddress();
|
|
@@ -3711,11 +3810,11 @@ var depositCommand = new Command52("deposit").description("Show wallet address a
|
|
|
3711
3810
|
});
|
|
3712
3811
|
|
|
3713
3812
|
// src/commands/wallet/index.ts
|
|
3714
|
-
import { Command as
|
|
3813
|
+
import { Command as Command64 } from "commander";
|
|
3715
3814
|
|
|
3716
3815
|
// src/commands/wallet/balance.ts
|
|
3717
|
-
import { Command as
|
|
3718
|
-
var walletBalanceCommand = new
|
|
3816
|
+
import { Command as Command54 } from "commander";
|
|
3817
|
+
var walletBalanceCommand = new Command54("balance").description("Show the wallet's payment-token balance on the selected network").option("--address <addr>", "Address to check (defaults to own wallet)").action(async (opts) => {
|
|
3719
3818
|
let address = opts.address;
|
|
3720
3819
|
if (!address) {
|
|
3721
3820
|
const keystore = await loadKeystore();
|
|
@@ -3728,7 +3827,7 @@ var walletBalanceCommand = new Command53("balance").description("Show the wallet
|
|
|
3728
3827
|
});
|
|
3729
3828
|
|
|
3730
3829
|
// src/commands/wallet/import.ts
|
|
3731
|
-
import { Command as
|
|
3830
|
+
import { Command as Command55 } from "commander";
|
|
3732
3831
|
import { createInterface as createInterface3 } from "readline";
|
|
3733
3832
|
import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
|
|
3734
3833
|
function normalizePrivateKey(raw) {
|
|
@@ -3763,7 +3862,7 @@ function promptHiddenInput(prompt) {
|
|
|
3763
3862
|
});
|
|
3764
3863
|
});
|
|
3765
3864
|
}
|
|
3766
|
-
var walletImportCommand = new
|
|
3865
|
+
var walletImportCommand = new Command55("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)").option(
|
|
3767
3866
|
"--yes",
|
|
3768
3867
|
"Confirm legal acceptance non-interactively after reviewing every current policy"
|
|
3769
3868
|
).action(async (opts) => {
|
|
@@ -3844,7 +3943,7 @@ var walletImportCommand = new Command54("import").description("Import an existin
|
|
|
3844
3943
|
|
|
3845
3944
|
// src/commands/wallet/set-withdrawal-address.ts
|
|
3846
3945
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
3847
|
-
import { Command as
|
|
3946
|
+
import { Command as Command56 } from "commander";
|
|
3848
3947
|
|
|
3849
3948
|
// src/lib/withdrawal-pin.ts
|
|
3850
3949
|
var WithdrawalAddressMismatchError = class extends Error {
|
|
@@ -3893,7 +3992,7 @@ var SIGNATURE_TTL_SECONDS = 5 * 60;
|
|
|
3893
3992
|
function isValidAddress(addr) {
|
|
3894
3993
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
3895
3994
|
}
|
|
3896
|
-
var setWithdrawalAddressCommand = new
|
|
3995
|
+
var setWithdrawalAddressCommand = new Command56("set-withdrawal-address").description("Set a withdrawal address for payment-token withdrawals (one-time, free)").argument("<address>", "Ethereum address to receive withdrawals").action(async (address) => {
|
|
3897
3996
|
if (!isValidAddress(address)) {
|
|
3898
3997
|
printError("Invalid Ethereum address: must be 0x followed by 40 hex characters");
|
|
3899
3998
|
return;
|
|
@@ -3937,8 +4036,8 @@ var setWithdrawalAddressCommand = new Command55("set-withdrawal-address").descri
|
|
|
3937
4036
|
});
|
|
3938
4037
|
|
|
3939
4038
|
// src/commands/wallet/get-withdrawal-address.ts
|
|
3940
|
-
import { Command as
|
|
3941
|
-
var getWithdrawalAddressCommand = new
|
|
4039
|
+
import { Command as Command57 } from "commander";
|
|
4040
|
+
var getWithdrawalAddressCommand = new Command57("get-withdrawal-address").description("Show the currently registered withdrawal address, if any").option("--address <addr>", "Wallet address to check (defaults to own wallet)").action(async (opts) => {
|
|
3942
4041
|
let address = opts.address;
|
|
3943
4042
|
if (!address) {
|
|
3944
4043
|
const keystore = await loadKeystore();
|
|
@@ -3949,14 +4048,14 @@ var getWithdrawalAddressCommand = new Command56("get-withdrawal-address").descri
|
|
|
3949
4048
|
});
|
|
3950
4049
|
|
|
3951
4050
|
// src/commands/wallet/change-withdrawal-address.ts
|
|
3952
|
-
import { Command as
|
|
4051
|
+
import { Command as Command58 } from "commander";
|
|
3953
4052
|
function isValidAddress2(addr) {
|
|
3954
4053
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
3955
4054
|
}
|
|
3956
4055
|
function isValidRecoveryCode(code) {
|
|
3957
4056
|
return /^\d{8}$/.test(code);
|
|
3958
4057
|
}
|
|
3959
|
-
var changeWithdrawalAddressCommand = new
|
|
4058
|
+
var changeWithdrawalAddressCommand = new Command58("change-withdrawal-address").description("Change the withdrawal address using the account recovery code (RFC-0012)").argument("<recovery-code>", "The 8-digit account recovery code from set-withdrawal-address").argument("<new-address>", "New Ethereum address to receive withdrawals").action(async (recoveryCode, newAddress) => {
|
|
3960
4059
|
if (!isValidRecoveryCode(recoveryCode)) {
|
|
3961
4060
|
printError("Invalid account recovery code: must be 8 digits");
|
|
3962
4061
|
return;
|
|
@@ -3989,8 +4088,8 @@ var changeWithdrawalAddressCommand = new Command57("change-withdrawal-address").
|
|
|
3989
4088
|
});
|
|
3990
4089
|
|
|
3991
4090
|
// src/commands/wallet/sync-withdrawal-address.ts
|
|
3992
|
-
import { Command as
|
|
3993
|
-
var syncWithdrawalAddressCommand = new
|
|
4091
|
+
import { Command as Command59 } from "commander";
|
|
4092
|
+
var syncWithdrawalAddressCommand = new Command59("sync-withdrawal-address").description(
|
|
3994
4093
|
"Accept the withdrawal address registered on the server as the locally pinned one (after a change made elsewhere, e.g. on the web)"
|
|
3995
4094
|
).action(async () => {
|
|
3996
4095
|
let keystore;
|
|
@@ -4019,8 +4118,8 @@ var syncWithdrawalAddressCommand = new Command58("sync-withdrawal-address").desc
|
|
|
4019
4118
|
});
|
|
4020
4119
|
|
|
4021
4120
|
// src/commands/wallet/reveal-recovery-code.ts
|
|
4022
|
-
import { Command as
|
|
4023
|
-
var revealRecoveryCodeCommand = new
|
|
4121
|
+
import { Command as Command60 } from "commander";
|
|
4122
|
+
var revealRecoveryCodeCommand = new Command60("reveal-recovery-code").description("One-time reveal of your account recovery code, if one has not been generated yet").action(async () => {
|
|
4024
4123
|
let keystore;
|
|
4025
4124
|
try {
|
|
4026
4125
|
keystore = await loadKeystore();
|
|
@@ -4045,8 +4144,8 @@ var revealRecoveryCodeCommand = new Command59("reveal-recovery-code").descriptio
|
|
|
4045
4144
|
});
|
|
4046
4145
|
|
|
4047
4146
|
// src/commands/wallet/publish-key.ts
|
|
4048
|
-
import { Command as
|
|
4049
|
-
var publishKeyCommand = new
|
|
4147
|
+
import { Command as Command61 } from "commander";
|
|
4148
|
+
var publishKeyCommand = new Command61("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
|
|
4050
4149
|
let keystore;
|
|
4051
4150
|
try {
|
|
4052
4151
|
keystore = await loadKeystore();
|
|
@@ -4066,13 +4165,13 @@ var publishKeyCommand = new Command60("publish-key").description("Publish your s
|
|
|
4066
4165
|
});
|
|
4067
4166
|
|
|
4068
4167
|
// src/commands/wallet/withdraw-dreams.ts
|
|
4069
|
-
import { Command as
|
|
4168
|
+
import { Command as Command62 } from "commander";
|
|
4070
4169
|
import { toHex } from "viem";
|
|
4071
4170
|
var AUTHORIZATION_VALIDITY_SECONDS = 300;
|
|
4072
4171
|
function isValidAddress3(addr) {
|
|
4073
4172
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
4074
4173
|
}
|
|
4075
|
-
var withdrawDreamsCommand = new
|
|
4174
|
+
var withdrawDreamsCommand = new Command62("withdraw-dreams").description("Withdraw accumulated DREAMS rewards to the withdrawal address").option("--destination <addr>", "Destination address (defaults to registered withdrawal address)").action(async (opts) => {
|
|
4076
4175
|
let keystore;
|
|
4077
4176
|
try {
|
|
4078
4177
|
keystore = await loadKeystore();
|
|
@@ -4103,9 +4202,23 @@ var withdrawDreamsCommand = new Command61("withdraw-dreams").description("Withdr
|
|
|
4103
4202
|
return;
|
|
4104
4203
|
}
|
|
4105
4204
|
}
|
|
4205
|
+
const balance = await apiGet(
|
|
4206
|
+
`/api/wallet/dreams-balance?address=${workerAddress}`
|
|
4207
|
+
);
|
|
4208
|
+
if (!balance.hookAddress || balance.chainId === void 0) {
|
|
4209
|
+
printError("DREAMS rewards are not configured on this server");
|
|
4210
|
+
return;
|
|
4211
|
+
}
|
|
4106
4212
|
const nonce = toHex(crypto.getRandomValues(new Uint8Array(32)));
|
|
4107
4213
|
const validBefore = String(Math.floor(Date.now() / 1e3) + AUTHORIZATION_VALIDITY_SECONDS);
|
|
4108
|
-
const message = buildWithdrawDreamsMessage(
|
|
4214
|
+
const message = buildWithdrawDreamsMessage({
|
|
4215
|
+
wallet: workerAddress,
|
|
4216
|
+
destination,
|
|
4217
|
+
nonce,
|
|
4218
|
+
validBefore,
|
|
4219
|
+
chainId: balance.chainId,
|
|
4220
|
+
hookAddress: balance.hookAddress
|
|
4221
|
+
});
|
|
4109
4222
|
const signature = await signMessage(message, keystore);
|
|
4110
4223
|
const { data: result, idempotencyKey } = await apiPost(
|
|
4111
4224
|
"/api/wallet/withdraw-dreams",
|
|
@@ -4131,7 +4244,7 @@ var withdrawDreamsCommand = new Command61("withdraw-dreams").description("Withdr
|
|
|
4131
4244
|
});
|
|
4132
4245
|
|
|
4133
4246
|
// src/commands/wallet/bridge.ts
|
|
4134
|
-
import { Command as
|
|
4247
|
+
import { Command as Command63 } from "commander";
|
|
4135
4248
|
import { toHex as toHex2 } from "viem";
|
|
4136
4249
|
var USDC_TYPES = {
|
|
4137
4250
|
TransferWithAuthorization: [
|
|
@@ -4175,7 +4288,7 @@ async function pollBridgeStatus(requestId) {
|
|
|
4175
4288
|
await sleep(bridgeTiming.intervalMs);
|
|
4176
4289
|
}
|
|
4177
4290
|
}
|
|
4178
|
-
var walletBridgeCommand = new
|
|
4291
|
+
var walletBridgeCommand = new Command63("bridge").description(
|
|
4179
4292
|
"Move free USDC on Base to OUSD at the same address on Tempo (gasless, through Relay)"
|
|
4180
4293
|
).requiredOption("--to <chain>", 'Destination chain (only "tempo")').argument("<amount>", "Amount of USDC in whole tokens (minimum 1, e.g. 25)").action(async (amount, opts) => {
|
|
4181
4294
|
if (opts.to !== "tempo") {
|
|
@@ -4305,7 +4418,7 @@ var walletBridgeCommand = new Command62("bridge").description(
|
|
|
4305
4418
|
});
|
|
4306
4419
|
|
|
4307
4420
|
// src/commands/wallet/index.ts
|
|
4308
|
-
var walletCommand = new
|
|
4421
|
+
var walletCommand = new Command64("wallet").description("Wallet management commands");
|
|
4309
4422
|
walletCommand.addCommand(walletBalanceCommand);
|
|
4310
4423
|
walletCommand.addCommand(walletImportCommand);
|
|
4311
4424
|
walletCommand.addCommand(setWithdrawalAddressCommand);
|
|
@@ -4318,7 +4431,7 @@ walletCommand.addCommand(withdrawDreamsCommand);
|
|
|
4318
4431
|
walletCommand.addCommand(walletBridgeCommand);
|
|
4319
4432
|
|
|
4320
4433
|
// src/commands/withdraw.ts
|
|
4321
|
-
import { Command as
|
|
4434
|
+
import { Command as Command65 } from "commander";
|
|
4322
4435
|
import { toHex as toHex3 } from "viem";
|
|
4323
4436
|
var RECEIVE_POLICY_BLOCKED = "recipient_receive_policy_blocked";
|
|
4324
4437
|
async function withdrawOnTempo(input) {
|
|
@@ -4374,7 +4487,7 @@ var USDC_TYPES2 = {
|
|
|
4374
4487
|
{ name: "nonce", type: "bytes32" }
|
|
4375
4488
|
]
|
|
4376
4489
|
};
|
|
4377
|
-
var withdrawCommand = new
|
|
4490
|
+
var withdrawCommand = new Command65("withdraw").description(
|
|
4378
4491
|
"Withdraw the payment token (USDC on Base, OUSD on Tempo) to the registered withdrawal address"
|
|
4379
4492
|
).argument("<amount>", "Amount in whole tokens (e.g. 5 for 5 USDC or 5 OUSD)").action(async (amount) => {
|
|
4380
4493
|
const parsed = parseFloat(amount);
|
|
@@ -4459,9 +4572,9 @@ var withdrawCommand = new Command64("withdraw").description(
|
|
|
4459
4572
|
});
|
|
4460
4573
|
|
|
4461
4574
|
// src/commands/encrypt.ts
|
|
4462
|
-
import { Command as
|
|
4575
|
+
import { Command as Command66 } from "commander";
|
|
4463
4576
|
import { promises as fs2 } from "fs";
|
|
4464
|
-
var encryptCommand = new
|
|
4577
|
+
var encryptCommand = new Command66("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) => {
|
|
4465
4578
|
let plaintext;
|
|
4466
4579
|
try {
|
|
4467
4580
|
plaintext = await fs2.readFile(file);
|
|
@@ -4509,9 +4622,9 @@ var encryptCommand = new Command65("encrypt").description("Encrypt a file with E
|
|
|
4509
4622
|
});
|
|
4510
4623
|
|
|
4511
4624
|
// src/commands/decrypt.ts
|
|
4512
|
-
import { Command as
|
|
4625
|
+
import { Command as Command67 } from "commander";
|
|
4513
4626
|
import { promises as fs3 } from "fs";
|
|
4514
|
-
var decryptCommand = new
|
|
4627
|
+
var decryptCommand = new Command67("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) => {
|
|
4515
4628
|
let ciphertext;
|
|
4516
4629
|
try {
|
|
4517
4630
|
ciphertext = await fs3.readFile(file);
|
|
@@ -4551,7 +4664,7 @@ var decryptCommand = new Command66("decrypt").description("Decrypt a file using
|
|
|
4551
4664
|
});
|
|
4552
4665
|
|
|
4553
4666
|
// src/commands/xmtp.ts
|
|
4554
|
-
import { Command as
|
|
4667
|
+
import { Command as Command68 } from "commander";
|
|
4555
4668
|
|
|
4556
4669
|
// src/lib/xmtp-client.ts
|
|
4557
4670
|
import path2 from "path";
|
|
@@ -5314,7 +5427,7 @@ function getDefaultQueryTimeoutMs() {
|
|
|
5314
5427
|
}
|
|
5315
5428
|
return Math.floor(parsed);
|
|
5316
5429
|
}
|
|
5317
|
-
var xmtpCommand = new
|
|
5430
|
+
var xmtpCommand = new Command68("xmtp").description("Manage XMTP messaging for this agent");
|
|
5318
5431
|
xmtpCommand.command("init").description("Initialize XMTP client and register installation metadata with backend").action(async () => {
|
|
5319
5432
|
const keystore = await loadKeystore();
|
|
5320
5433
|
const client = await createXmtpClient({
|
|
@@ -5551,7 +5664,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
|
|
|
5551
5664
|
});
|
|
5552
5665
|
|
|
5553
5666
|
// src/commands/daemon.ts
|
|
5554
|
-
import { Command as
|
|
5667
|
+
import { Command as Command69 } from "commander";
|
|
5555
5668
|
function diffTaskStatuses(prev, next) {
|
|
5556
5669
|
const changes = [];
|
|
5557
5670
|
for (const [taskId, newStatus] of next) {
|
|
@@ -5579,7 +5692,7 @@ function sleepOrAbort(ms, signal) {
|
|
|
5579
5692
|
});
|
|
5580
5693
|
}
|
|
5581
5694
|
var MAX_SEEN_TASK_IDS = 2e3;
|
|
5582
|
-
var daemonCommand = new
|
|
5695
|
+
var daemonCommand = new Command69("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(
|
|
5583
5696
|
"--auction-poll-interval <ms>",
|
|
5584
5697
|
"Poll interval for clock-based auction tasks (dutch/reverse_dutch) in milliseconds",
|
|
5585
5698
|
"15000"
|
|
@@ -5912,11 +6025,11 @@ var daemonCommand = new Command68("daemon").description("Long-running agent daem
|
|
|
5912
6025
|
);
|
|
5913
6026
|
|
|
5914
6027
|
// src/commands/email/index.ts
|
|
5915
|
-
import { Command as
|
|
6028
|
+
import { Command as Command78 } from "commander";
|
|
5916
6029
|
|
|
5917
6030
|
// src/commands/email/register.ts
|
|
5918
|
-
import { Command as
|
|
5919
|
-
var registerCommand = new
|
|
6031
|
+
import { Command as Command70 } from "commander";
|
|
6032
|
+
var registerCommand = new Command70("register").description("Register an email address for this agent").requiredOption("--username <name>", "Desired username (e.g. myagent)").action(async (opts) => {
|
|
5920
6033
|
const check = await apiGet(
|
|
5921
6034
|
`/api/emails/check-username?username=${encodeURIComponent(opts.username)}`
|
|
5922
6035
|
);
|
|
@@ -5937,8 +6050,8 @@ var registerCommand = new Command69("register").description("Register an email a
|
|
|
5937
6050
|
});
|
|
5938
6051
|
|
|
5939
6052
|
// src/commands/email/inbox.ts
|
|
5940
|
-
import { Command as
|
|
5941
|
-
var inboxCommand2 = new
|
|
6053
|
+
import { Command as Command71 } from "commander";
|
|
6054
|
+
var inboxCommand2 = new Command71("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) => {
|
|
5942
6055
|
const keystore = await loadKeystore();
|
|
5943
6056
|
const params = new URLSearchParams({
|
|
5944
6057
|
deviceId: keystore.deviceId,
|
|
@@ -5953,8 +6066,8 @@ var inboxCommand2 = new Command70("inbox").description("List emails in your inbo
|
|
|
5953
6066
|
});
|
|
5954
6067
|
|
|
5955
6068
|
// src/commands/email/read.ts
|
|
5956
|
-
import { Command as
|
|
5957
|
-
var readCommand = new
|
|
6069
|
+
import { Command as Command72 } from "commander";
|
|
6070
|
+
var readCommand = new Command72("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
|
|
5958
6071
|
const keystore = await loadKeystore();
|
|
5959
6072
|
const params = new URLSearchParams({
|
|
5960
6073
|
deviceId: keystore.deviceId,
|
|
@@ -5966,8 +6079,8 @@ var readCommand = new Command71("read").description("Read an email by ID (marks
|
|
|
5966
6079
|
});
|
|
5967
6080
|
|
|
5968
6081
|
// src/commands/email/send.ts
|
|
5969
|
-
import { Command as
|
|
5970
|
-
var sendCommand = new
|
|
6082
|
+
import { Command as Command73 } from "commander";
|
|
6083
|
+
var sendCommand = new Command73("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) => {
|
|
5971
6084
|
const keystore = await loadKeystore();
|
|
5972
6085
|
const { data: result, idempotencyKey } = await apiPost("/api/emails/send", {
|
|
5973
6086
|
deviceId: keystore.deviceId,
|
|
@@ -5980,8 +6093,8 @@ var sendCommand = new Command72("send").description("Send an email").requiredOpt
|
|
|
5980
6093
|
});
|
|
5981
6094
|
|
|
5982
6095
|
// src/commands/email/reply.ts
|
|
5983
|
-
import { Command as
|
|
5984
|
-
var replyCommand = new
|
|
6096
|
+
import { Command as Command74 } from "commander";
|
|
6097
|
+
var replyCommand = new Command74("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").action(async (id, opts) => {
|
|
5985
6098
|
const keystore = await loadKeystore();
|
|
5986
6099
|
const params = new URLSearchParams({
|
|
5987
6100
|
deviceId: keystore.deviceId,
|
|
@@ -6003,8 +6116,8 @@ var replyCommand = new Command73("reply").description("Reply to an email").argum
|
|
|
6003
6116
|
});
|
|
6004
6117
|
|
|
6005
6118
|
// src/commands/email/delete.ts
|
|
6006
|
-
import { Command as
|
|
6007
|
-
var deleteCommand = new
|
|
6119
|
+
import { Command as Command75 } from "commander";
|
|
6120
|
+
var deleteCommand = new Command75("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
|
|
6008
6121
|
const keystore = await loadKeystore();
|
|
6009
6122
|
const { data: result, idempotencyKey } = await apiPost(
|
|
6010
6123
|
"/api/emails/delete",
|
|
@@ -6018,15 +6131,15 @@ var deleteCommand = new Command74("delete").description("Delete an email by ID")
|
|
|
6018
6131
|
});
|
|
6019
6132
|
|
|
6020
6133
|
// src/commands/email/address.ts
|
|
6021
|
-
import { Command as
|
|
6022
|
-
var addressCommand2 = new
|
|
6134
|
+
import { Command as Command76 } from "commander";
|
|
6135
|
+
var addressCommand2 = new Command76("address").description("Show your registered email address").action(async () => {
|
|
6023
6136
|
const keystore = await loadKeystore();
|
|
6024
6137
|
const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
|
|
6025
6138
|
printResult({ emailAddress: result.emailAddress ?? null });
|
|
6026
6139
|
});
|
|
6027
6140
|
|
|
6028
6141
|
// src/commands/email/mark-read.ts
|
|
6029
|
-
import { Command as
|
|
6142
|
+
import { Command as Command77 } from "commander";
|
|
6030
6143
|
async function setReadStatus(id, read) {
|
|
6031
6144
|
const keystore = await loadKeystore();
|
|
6032
6145
|
const { data: result, idempotencyKey } = await apiPost(
|
|
@@ -6040,12 +6153,12 @@ async function setReadStatus(id, read) {
|
|
|
6040
6153
|
);
|
|
6041
6154
|
printResult({ id: result.id, isRead: result.isRead }, { idempotencyKey });
|
|
6042
6155
|
}
|
|
6043
|
-
var markReadCommand = new
|
|
6156
|
+
var markReadCommand = new Command77("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) => {
|
|
6044
6157
|
await setReadStatus(id, !opts.unread);
|
|
6045
6158
|
});
|
|
6046
6159
|
|
|
6047
6160
|
// src/commands/email/index.ts
|
|
6048
|
-
var emailCommand = new
|
|
6161
|
+
var emailCommand = new Command78("email").description("Email management commands");
|
|
6049
6162
|
emailCommand.addCommand(registerCommand);
|
|
6050
6163
|
emailCommand.addCommand(inboxCommand2);
|
|
6051
6164
|
emailCommand.addCommand(readCommand);
|
|
@@ -6056,11 +6169,11 @@ emailCommand.addCommand(addressCommand2);
|
|
|
6056
6169
|
emailCommand.addCommand(markReadCommand);
|
|
6057
6170
|
|
|
6058
6171
|
// src/commands/bug/index.ts
|
|
6059
|
-
import { Command as
|
|
6172
|
+
import { Command as Command82 } from "commander";
|
|
6060
6173
|
|
|
6061
6174
|
// src/commands/bug/list.ts
|
|
6062
|
-
import { Command as
|
|
6063
|
-
var listCommand = new
|
|
6175
|
+
import { Command as Command79 } from "commander";
|
|
6176
|
+
var listCommand = new Command79("list").description("List the bug reports you submitted and their status").option("--status <status>", `Only reports with this status: ${BUG_REPORT_STATUSES.join(", ")}`).option("--limit <n>", "Maximum reports to return (1-100)", "50").action(async (opts) => {
|
|
6064
6177
|
if (opts.status && !BUG_REPORT_STATUSES.includes(opts.status)) {
|
|
6065
6178
|
printError(`--status must be one of ${BUG_REPORT_STATUSES.join(", ")}`);
|
|
6066
6179
|
return;
|
|
@@ -6087,10 +6200,9 @@ var listCommand = new Command78("list").description("List the bug reports you su
|
|
|
6087
6200
|
});
|
|
6088
6201
|
|
|
6089
6202
|
// src/commands/bug/show.ts
|
|
6090
|
-
import { Command as
|
|
6091
|
-
var
|
|
6092
|
-
|
|
6093
|
-
if (!UUID.test(id)) {
|
|
6203
|
+
import { Command as Command80 } from "commander";
|
|
6204
|
+
var showCommand = new Command80("show").description("Show one of your bug reports, its status and any linked GitHub issue").argument("<id>", "Bug report id").action(async (id) => {
|
|
6205
|
+
if (!GetBugReportInputSchema.safeParse({ id }).success) {
|
|
6094
6206
|
printError("Bug report id must be a UUID");
|
|
6095
6207
|
return;
|
|
6096
6208
|
}
|
|
@@ -6107,7 +6219,7 @@ var showCommand = new Command79("show").description("Show one of your bug report
|
|
|
6107
6219
|
});
|
|
6108
6220
|
|
|
6109
6221
|
// src/commands/bug/submit.ts
|
|
6110
|
-
import { Command as
|
|
6222
|
+
import { Command as Command81 } from "commander";
|
|
6111
6223
|
|
|
6112
6224
|
// src/commands/bug/context.ts
|
|
6113
6225
|
import os from "os";
|
|
@@ -6128,12 +6240,31 @@ function cliVersionOf(command) {
|
|
|
6128
6240
|
}
|
|
6129
6241
|
|
|
6130
6242
|
// src/commands/bug/submit.ts
|
|
6131
|
-
|
|
6243
|
+
var LAST_COMMAND_MAX_CHARS = 2048;
|
|
6244
|
+
var LAST_ERROR_MAX_CHARS = 16 * 1024;
|
|
6245
|
+
var STDIN_FIRST_BYTE_MS = 5e3;
|
|
6246
|
+
async function readStdin(firstByteMs) {
|
|
6132
6247
|
const chunks = [];
|
|
6133
|
-
|
|
6248
|
+
const iterator = process.stdin[Symbol.asyncIterator]();
|
|
6249
|
+
let timer;
|
|
6250
|
+
const first = await Promise.race([
|
|
6251
|
+
iterator.next(),
|
|
6252
|
+
...firstByteMs === void 0 ? [] : [new Promise((resolve) => timer = setTimeout(() => resolve(null), firstByteMs))]
|
|
6253
|
+
]);
|
|
6254
|
+
clearTimeout(timer);
|
|
6255
|
+
if (first === null) {
|
|
6256
|
+
process.stdin.destroy();
|
|
6257
|
+
return null;
|
|
6258
|
+
}
|
|
6259
|
+
if (!first.done) {
|
|
6260
|
+
chunks.push(Buffer.from(first.value));
|
|
6261
|
+
for await (const chunk of { [Symbol.asyncIterator]: () => iterator }) {
|
|
6262
|
+
chunks.push(Buffer.from(chunk));
|
|
6263
|
+
}
|
|
6264
|
+
}
|
|
6134
6265
|
return Buffer.concat(chunks).toString("utf8");
|
|
6135
6266
|
}
|
|
6136
|
-
var submitCommand = new
|
|
6267
|
+
var submitCommand = new Command81("submit").description("Report a Taskmarket bug; CLI version, OS, Node version and network are attached").requiredOption("--title <text>", "Short summary (at most 200 characters)").option(
|
|
6137
6268
|
"--description <text>",
|
|
6138
6269
|
'What happened and how to reproduce it; read from stdin when omitted or "-"'
|
|
6139
6270
|
).option("--severity <level>", `How bad it is: ${BUG_REPORT_SEVERITIES.join(", ")}`, "medium").option("--task <id>", "Task the bug happened on").option("--tx <hash>", "Transaction hash involved").option(
|
|
@@ -6146,7 +6277,12 @@ var submitCommand = new Command80("submit").description("Report a Taskmarket bug
|
|
|
6146
6277
|
printError("Pass --description or pipe the description on stdin");
|
|
6147
6278
|
return;
|
|
6148
6279
|
}
|
|
6149
|
-
|
|
6280
|
+
const read = await readStdin(description === "-" ? void 0 : STDIN_FIRST_BYTE_MS);
|
|
6281
|
+
if (read === null) {
|
|
6282
|
+
printError("Pass --description, or pipe the description on stdin");
|
|
6283
|
+
return;
|
|
6284
|
+
}
|
|
6285
|
+
description = read;
|
|
6150
6286
|
}
|
|
6151
6287
|
const context = collectBugContext(cliVersionOf(this), { taskId: opts.task, txHash: opts.tx });
|
|
6152
6288
|
if (opts.includeLastError) {
|
|
@@ -6155,14 +6291,19 @@ var submitCommand = new Command80("submit").description("Report a Taskmarket bug
|
|
|
6155
6291
|
printError("No failed command is recorded yet; run without --include-last-error");
|
|
6156
6292
|
return;
|
|
6157
6293
|
}
|
|
6158
|
-
context.command = lastError.command;
|
|
6159
|
-
|
|
6160
|
-
message:
|
|
6294
|
+
context.command = lastError.command.slice(0, LAST_COMMAND_MAX_CHARS);
|
|
6295
|
+
const errorJson = (message2) => JSON.stringify({
|
|
6296
|
+
message: message2,
|
|
6161
6297
|
code: lastError.code,
|
|
6162
6298
|
status: lastError.status,
|
|
6163
6299
|
at: lastError.at,
|
|
6164
6300
|
cliVersion: lastError.cliVersion
|
|
6165
6301
|
});
|
|
6302
|
+
let message = lastError.message;
|
|
6303
|
+
while (message.length > 0 && errorJson(message).length > LAST_ERROR_MAX_CHARS) {
|
|
6304
|
+
message = message.slice(0, Math.floor(message.length / 2));
|
|
6305
|
+
}
|
|
6306
|
+
context.error = errorJson(message);
|
|
6166
6307
|
}
|
|
6167
6308
|
const parsed = SubmitBugReportInputSchema.safeParse({
|
|
6168
6309
|
title: opts.title,
|
|
@@ -6194,7 +6335,7 @@ var submitCommand = new Command80("submit").description("Report a Taskmarket bug
|
|
|
6194
6335
|
});
|
|
6195
6336
|
|
|
6196
6337
|
// src/commands/bug/index.ts
|
|
6197
|
-
var bugCommand = new
|
|
6338
|
+
var bugCommand = new Command82("bug").description(
|
|
6198
6339
|
"Report Taskmarket bugs and follow their status"
|
|
6199
6340
|
);
|
|
6200
6341
|
bugCommand.addCommand(submitCommand);
|
|
@@ -6202,11 +6343,11 @@ bugCommand.addCommand(listCommand);
|
|
|
6202
6343
|
bugCommand.addCommand(showCommand);
|
|
6203
6344
|
|
|
6204
6345
|
// src/commands/requester/index.ts
|
|
6205
|
-
import { Command as
|
|
6346
|
+
import { Command as Command84 } from "commander";
|
|
6206
6347
|
|
|
6207
6348
|
// src/commands/requester/stats.ts
|
|
6208
|
-
import { Command as
|
|
6209
|
-
var requesterStatsCmd = new
|
|
6349
|
+
import { Command as Command83 } from "commander";
|
|
6350
|
+
var requesterStatsCmd = new Command83("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address) => {
|
|
6210
6351
|
if (!/^0x[0-9a-fA-F]{40}$/.test(address)) {
|
|
6211
6352
|
printError("Address must be a 0x-prefixed 20-byte hex string");
|
|
6212
6353
|
return;
|
|
@@ -6220,13 +6361,13 @@ var requesterStatsCmd = new Command82("stats").description("Get requester reputa
|
|
|
6220
6361
|
});
|
|
6221
6362
|
|
|
6222
6363
|
// src/commands/requester/index.ts
|
|
6223
|
-
var requesterCmd = new
|
|
6364
|
+
var requesterCmd = new Command84("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
|
|
6224
6365
|
|
|
6225
6366
|
// src/commands/x402/index.ts
|
|
6226
|
-
import { Command as
|
|
6367
|
+
import { Command as Command88 } from "commander";
|
|
6227
6368
|
|
|
6228
6369
|
// src/commands/x402/payments.ts
|
|
6229
|
-
import { Command as
|
|
6370
|
+
import { Command as Command85, Option as Option4 } from "commander";
|
|
6230
6371
|
import { createInterface as createInterface4 } from "readline";
|
|
6231
6372
|
var PAYMENT_STATES = [
|
|
6232
6373
|
"reserved",
|
|
@@ -6252,7 +6393,7 @@ async function confirmManualResolution() {
|
|
|
6252
6393
|
readline.close();
|
|
6253
6394
|
return answer.trim().toLowerCase() === "resolve";
|
|
6254
6395
|
}
|
|
6255
|
-
var x402PaymentsCommand = new
|
|
6396
|
+
var x402PaymentsCommand = new Command85("payments").description(
|
|
6256
6397
|
"Inspect and reconcile X402 Pay payment records"
|
|
6257
6398
|
);
|
|
6258
6399
|
x402PaymentsCommand.command("list").description("List current payment records").addOption(new Option4("--state <state>", "Filter by state").choices(PAYMENT_STATES)).action(async (options) => {
|
|
@@ -6281,7 +6422,7 @@ x402PaymentsCommand.command("resolve").description("Manually record an externall
|
|
|
6281
6422
|
|
|
6282
6423
|
// src/commands/x402/policy.ts
|
|
6283
6424
|
import { promises as fs4 } from "fs";
|
|
6284
|
-
import { Command as
|
|
6425
|
+
import { Command as Command86 } from "commander";
|
|
6285
6426
|
import { createInterface as createInterface5 } from "readline";
|
|
6286
6427
|
async function confirmUnattendedRule(rule) {
|
|
6287
6428
|
if (!process.stdin.isTTY) {
|
|
@@ -6307,7 +6448,7 @@ async function confirmUnattendedRule(rule) {
|
|
|
6307
6448
|
readline.close();
|
|
6308
6449
|
return answer.trim().toLowerCase() === "authorize";
|
|
6309
6450
|
}
|
|
6310
|
-
var x402PolicyCommand = new
|
|
6451
|
+
var x402PolicyCommand = new Command86("policy").description(
|
|
6311
6452
|
"Manage local X402 Pay spending policy"
|
|
6312
6453
|
);
|
|
6313
6454
|
x402PolicyCommand.command("init").description("Create a deny-all policy file").action(async () => {
|
|
@@ -6343,14 +6484,14 @@ for (const enabled of [true, false]) {
|
|
|
6343
6484
|
}
|
|
6344
6485
|
|
|
6345
6486
|
// src/commands/x402/request.ts
|
|
6346
|
-
import { Command as
|
|
6487
|
+
import { Command as Command87, Option as Option5 } from "commander";
|
|
6347
6488
|
function collect3(value, previous) {
|
|
6348
6489
|
return [...previous, value];
|
|
6349
6490
|
}
|
|
6350
6491
|
function confirm(lines) {
|
|
6351
6492
|
return confirmAtTerminal(lines, "use --non-interactive with policy");
|
|
6352
6493
|
}
|
|
6353
|
-
var x402RequestCommand = new
|
|
6494
|
+
var x402RequestCommand = new Command87("request").description("Request and pay for a direct x402 HTTP resource (X402 Pay)").argument("<url>", "HTTPS resource URL").addOption(new Option5("--method <method>", "HTTP method").choices(["GET", "POST"]).default("GET")).option("--json <json>", "Inline JSON POST body").option("--body-file <path>", "Read JSON POST body from a file").option("--headers-file <path>", "Read request headers from an owner-only JSON file").option(
|
|
6354
6495
|
"--header-env <header=ENV_VAR>",
|
|
6355
6496
|
"Read one request header from an environment variable (repeatable)",
|
|
6356
6497
|
collect3,
|
|
@@ -6398,7 +6539,7 @@ var x402RequestCommand = new Command86("request").description("Request and pay f
|
|
|
6398
6539
|
);
|
|
6399
6540
|
|
|
6400
6541
|
// src/commands/x402/index.ts
|
|
6401
|
-
var x402Command = new
|
|
6542
|
+
var x402Command = new Command88("x402").description(
|
|
6402
6543
|
"Pay x402 services with local spending policies (X402 Pay)"
|
|
6403
6544
|
);
|
|
6404
6545
|
x402Command.addCommand(x402RequestCommand);
|
|
@@ -6406,10 +6547,10 @@ x402Command.addCommand(x402PolicyCommand);
|
|
|
6406
6547
|
x402Command.addCommand(x402PaymentsCommand);
|
|
6407
6548
|
|
|
6408
6549
|
// src/commands/sponsored-task/index.ts
|
|
6409
|
-
import { Command as
|
|
6550
|
+
import { Command as Command103 } from "commander";
|
|
6410
6551
|
|
|
6411
6552
|
// src/commands/sponsored-task/create.ts
|
|
6412
|
-
import { Command as
|
|
6553
|
+
import { Command as Command89 } from "commander";
|
|
6413
6554
|
import { toHex as toHex4 } from "viem";
|
|
6414
6555
|
|
|
6415
6556
|
// ../../packages/contracts/abi/generated/SponsoredTasksVault.ts
|
|
@@ -9631,7 +9772,7 @@ async function approveSponsoredTaskSpend(input) {
|
|
|
9631
9772
|
function isValidAddress4(addr) {
|
|
9632
9773
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
9633
9774
|
}
|
|
9634
|
-
var sponsoredTaskCreateCommand = new
|
|
9775
|
+
var sponsoredTaskCreateCommand = new Command89("create").description("Create a new Sponsored Task vault for a project token").requiredOption("--factory <address>", "SponsoredTaskFactory contract address").requiredOption("--chain-id <id>", "Chain id the factory is deployed on").requiredOption("--token <address>", "Project ERC-20 token address to fund the vault with").option("--owner <address>", "Vault owner (defaults to your own wallet)").action(async (opts) => {
|
|
9635
9776
|
if (!isValidAddress4(opts.factory) || !isValidAddress4(opts.token)) {
|
|
9636
9777
|
printError("Invalid Ethereum address for --factory or --token");
|
|
9637
9778
|
return;
|
|
@@ -9668,11 +9809,11 @@ var sponsoredTaskCreateCommand = new Command88("create").description("Create a n
|
|
|
9668
9809
|
});
|
|
9669
9810
|
|
|
9670
9811
|
// src/commands/sponsored-task/fund.ts
|
|
9671
|
-
import { Command as
|
|
9812
|
+
import { Command as Command90 } from "commander";
|
|
9672
9813
|
function isValidAddress5(addr) {
|
|
9673
9814
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
9674
9815
|
}
|
|
9675
|
-
var sponsoredTaskFundCommand = new
|
|
9816
|
+
var sponsoredTaskFundCommand = new Command90("fund").description("Fund a Sponsored Task vault with its project token (base units)").requiredOption("--vault <address>", "Vault address").requiredOption("--token <address>", "Project ERC-20 token address").requiredOption("--chain-id <id>", "Chain id the vault is deployed on").requiredOption("--amount <baseUnits>", "Amount to fund, in the token base units").action(async (opts) => {
|
|
9676
9817
|
if (!isValidAddress5(opts.vault) || !isValidAddress5(opts.token)) {
|
|
9677
9818
|
printError("Invalid Ethereum address for --vault or --token");
|
|
9678
9819
|
return;
|
|
@@ -9711,7 +9852,7 @@ var sponsoredTaskFundCommand = new Command89("fund").description("Fund a Sponsor
|
|
|
9711
9852
|
});
|
|
9712
9853
|
|
|
9713
9854
|
// src/commands/sponsored-task/managers.ts
|
|
9714
|
-
import { Command as
|
|
9855
|
+
import { Command as Command91 } from "commander";
|
|
9715
9856
|
function isValidAddress6(addr) {
|
|
9716
9857
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
9717
9858
|
}
|
|
@@ -9757,7 +9898,7 @@ async function configure(opts) {
|
|
|
9757
9898
|
});
|
|
9758
9899
|
printResult({ txHash, manager: opts.manager, spendCap: cap.toString(), active: opts.active });
|
|
9759
9900
|
}
|
|
9760
|
-
var sponsoredTaskManagersCommand = new
|
|
9901
|
+
var sponsoredTaskManagersCommand = new Command91("managers").description(
|
|
9761
9902
|
"Manage authorized managers for a Sponsored Task vault"
|
|
9762
9903
|
);
|
|
9763
9904
|
sponsoredTaskManagersCommand.command("add").description("Authorize a manager with a token-denominated spend cap").requiredOption("--vault <address>", "Vault address").requiredOption("--chain-id <id>", "Chain id the vault is deployed on").requiredOption("--manager <address>", "Manager address to authorize").requiredOption("--cap <baseUnits>", "Spend cap, in the project token base units").action((opts) => configure({ ...opts, active: true }));
|
|
@@ -9768,8 +9909,8 @@ sponsoredTaskManagersCommand.command("list").description("List a vault authorize
|
|
|
9768
9909
|
});
|
|
9769
9910
|
|
|
9770
9911
|
// src/commands/sponsored-task/managed.ts
|
|
9771
|
-
import { Command as
|
|
9772
|
-
var sponsoredTaskManagedCommand = new
|
|
9912
|
+
import { Command as Command92 } from "commander";
|
|
9913
|
+
var sponsoredTaskManagedCommand = new Command92("managed").description(
|
|
9773
9914
|
"List the active Sponsored Task vaults an address can fund tasks from as an active manager (defaults to your wallet)"
|
|
9774
9915
|
).option("--address <address>", "Manager address (defaults to your wallet)").option("--limit <n>", "Max vaults to return (1-100)", "50").option("--cursor <vaultId>", "Pagination cursor from a previous nextCursor").action(async (opts) => {
|
|
9775
9916
|
let address = opts.address;
|
|
@@ -9799,7 +9940,7 @@ var sponsoredTaskManagedCommand = new Command91("managed").description(
|
|
|
9799
9940
|
});
|
|
9800
9941
|
|
|
9801
9942
|
// src/commands/sponsored-task/fee-bank.ts
|
|
9802
|
-
import { Command as
|
|
9943
|
+
import { Command as Command93 } from "commander";
|
|
9803
9944
|
function isValidAddress7(addr) {
|
|
9804
9945
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
9805
9946
|
}
|
|
@@ -9811,7 +9952,7 @@ async function requireKeystore2() {
|
|
|
9811
9952
|
return null;
|
|
9812
9953
|
}
|
|
9813
9954
|
}
|
|
9814
|
-
var sponsoredTaskFeeBankCommand = new
|
|
9955
|
+
var sponsoredTaskFeeBankCommand = new Command93("fee-bank").description(
|
|
9815
9956
|
"Manage a manager USDC credit balance, charged by the Sponsored Task hook at task creation"
|
|
9816
9957
|
);
|
|
9817
9958
|
sponsoredTaskFeeBankCommand.command("deposit").description("Deposit USDC credit for creating sponsored tasks").requiredOption("--fee-bank <address>", "SponsoredTaskFeeBank contract address").requiredOption("--usdc <address>", "USDC token address").requiredOption("--chain-id <id>", "Chain id the fee bank is deployed on").requiredOption("--amount <baseUnits>", "Amount to deposit, in USDC base units (6 decimals)").action(async (opts) => {
|
|
@@ -9895,8 +10036,8 @@ sponsoredTaskFeeBankCommand.command("withdraw").description("Withdraw unused USD
|
|
|
9895
10036
|
);
|
|
9896
10037
|
|
|
9897
10038
|
// src/commands/sponsored-task/list.ts
|
|
9898
|
-
import { Command as
|
|
9899
|
-
var sponsoredTaskListCommand = new
|
|
10039
|
+
import { Command as Command94 } from "commander";
|
|
10040
|
+
var sponsoredTaskListCommand = new Command94("list").description("List Sponsored Task vaults").option("--limit <n>", "Max vaults to return", "50").option("--cursor <vaultId>", "Pagination cursor").option("--include-unverified", "Include vaults not yet curator-approved", false).action(async (opts) => {
|
|
9900
10041
|
const params = new URLSearchParams({ limit: opts.limit });
|
|
9901
10042
|
if (opts.cursor) params.set("cursor", opts.cursor);
|
|
9902
10043
|
if (opts.includeUnverified) params.set("includeUnverified", "true");
|
|
@@ -9905,8 +10046,8 @@ var sponsoredTaskListCommand = new Command93("list").description("List Sponsored
|
|
|
9905
10046
|
});
|
|
9906
10047
|
|
|
9907
10048
|
// src/commands/sponsored-task/settlements.ts
|
|
9908
|
-
import { Command as
|
|
9909
|
-
var sponsoredTaskSettlementsCommand = new
|
|
10049
|
+
import { Command as Command95 } from "commander";
|
|
10050
|
+
var sponsoredTaskSettlementsCommand = new Command95("settlements").description("List the settlements a Sponsored Task vault has installed, newest first").argument("<vaultId>", "Vault id").option("--limit <n>", "Max settlements to return (1-100)", "25").option("--cursor <cursor>", "Pagination cursor from a previous nextCursor").action(async (vaultId, opts) => {
|
|
9910
10051
|
const limit = Number(opts.limit);
|
|
9911
10052
|
if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
|
|
9912
10053
|
printError("--limit must be an integer from 1 to 100");
|
|
@@ -9921,17 +10062,17 @@ var sponsoredTaskSettlementsCommand = new Command94("settlements").description("
|
|
|
9921
10062
|
});
|
|
9922
10063
|
|
|
9923
10064
|
// src/commands/sponsored-task/show.ts
|
|
9924
|
-
import { Command as
|
|
9925
|
-
var sponsoredTaskShowCommand = new
|
|
10065
|
+
import { Command as Command96 } from "commander";
|
|
10066
|
+
var sponsoredTaskShowCommand = new Command96("show").description("Show a Sponsored Task vault by id").argument("<vaultId>", "Vault id").action(async (vaultId) => {
|
|
9926
10067
|
const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}`);
|
|
9927
10068
|
printResult(result);
|
|
9928
10069
|
});
|
|
9929
10070
|
|
|
9930
10071
|
// src/commands/sponsored-task/request-review.ts
|
|
9931
10072
|
import { randomBytes as randomBytes3 } from "crypto";
|
|
9932
|
-
import { Command as
|
|
10073
|
+
import { Command as Command97 } from "commander";
|
|
9933
10074
|
var REQUEST_TTL_SECONDS = 5 * 60;
|
|
9934
|
-
var sponsoredTaskRequestReviewCommand = new
|
|
10075
|
+
var sponsoredTaskRequestReviewCommand = new Command97("request-review").description("Ask Taskmarket curators to review a Sponsored Task vault (vault owner only)").argument("<vaultId>", "Vault id").action(async (vaultId) => {
|
|
9935
10076
|
let keystore;
|
|
9936
10077
|
try {
|
|
9937
10078
|
keystore = await loadKeystore();
|
|
@@ -9988,18 +10129,18 @@ var sponsoredTaskRequestReviewCommand = new Command96("request-review").descript
|
|
|
9988
10129
|
});
|
|
9989
10130
|
|
|
9990
10131
|
// src/commands/sponsored-task/balance.ts
|
|
9991
|
-
import { Command as
|
|
9992
|
-
var sponsoredTaskBalanceCommand = new
|
|
10132
|
+
import { Command as Command98 } from "commander";
|
|
10133
|
+
var sponsoredTaskBalanceCommand = new Command98("balance").description("Show a Sponsored Task vault funded/available/reserved balances").argument("<vaultId>", "Vault id").action(async (vaultId) => {
|
|
9993
10134
|
const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}/balance`);
|
|
9994
10135
|
printResult(result);
|
|
9995
10136
|
});
|
|
9996
10137
|
|
|
9997
10138
|
// src/commands/sponsored-task/withdraw.ts
|
|
9998
|
-
import { Command as
|
|
10139
|
+
import { Command as Command99 } from "commander";
|
|
9999
10140
|
function isValidAddress8(addr) {
|
|
10000
10141
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
10001
10142
|
}
|
|
10002
|
-
var sponsoredTaskWithdrawCommand = new
|
|
10143
|
+
var sponsoredTaskWithdrawCommand = new Command99("withdraw").description("Withdraw unreserved project tokens from a vault (owner only)").requiredOption("--vault <address>", "Vault address").requiredOption("--chain-id <id>", "Chain id the vault is deployed on").requiredOption("--amount <baseUnits>", "Amount to withdraw, in the project token base units").option("--recipient <address>", "Recipient (defaults to your own wallet)").action(async (opts) => {
|
|
10003
10144
|
if (!isValidAddress8(opts.vault) || opts.recipient && !isValidAddress8(opts.recipient)) {
|
|
10004
10145
|
printError("Invalid Ethereum address for --vault or --recipient");
|
|
10005
10146
|
return;
|
|
@@ -10029,11 +10170,11 @@ var sponsoredTaskWithdrawCommand = new Command98("withdraw").description("Withdr
|
|
|
10029
10170
|
});
|
|
10030
10171
|
|
|
10031
10172
|
// src/commands/sponsored-task/exit.ts
|
|
10032
|
-
import { Command as
|
|
10173
|
+
import { Command as Command100 } from "commander";
|
|
10033
10174
|
function isValidAddress9(addr) {
|
|
10034
10175
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
10035
10176
|
}
|
|
10036
|
-
var sponsoredTaskExitCommand = new
|
|
10177
|
+
var sponsoredTaskExitCommand = new Command100("exit").description(
|
|
10037
10178
|
"Terminally exit a vault: sweeps every reserved and unclaimed token back to you, invalidating every outstanding reservation, claim signature, and Merkle proof at once. There is no undo and no per-allocation revoke -- a worker with a pending but unclaimed entitlement gets nothing once this runs."
|
|
10038
10179
|
).requiredOption("--vault <address>", "Vault address").requiredOption("--chain-id <id>", "Chain id the vault is deployed on").option("--recipient <address>", "Recipient (defaults to your own wallet)").option("--yes", "Skip the confirmation prompt", false).action(async (opts) => {
|
|
10039
10180
|
if (!isValidAddress9(opts.vault) || opts.recipient && !isValidAddress9(opts.recipient)) {
|
|
@@ -10069,7 +10210,7 @@ var sponsoredTaskExitCommand = new Command99("exit").description(
|
|
|
10069
10210
|
});
|
|
10070
10211
|
|
|
10071
10212
|
// src/commands/sponsored-task/claim.ts
|
|
10072
|
-
import { Command as
|
|
10213
|
+
import { Command as Command101 } from "commander";
|
|
10073
10214
|
var CLAIM_TO_TYPES = {
|
|
10074
10215
|
ClaimTo: [
|
|
10075
10216
|
{ name: "vaultId", type: "bytes32" },
|
|
@@ -10104,7 +10245,7 @@ async function postClaimWithRetry(path3, body, options = {}) {
|
|
|
10104
10245
|
}
|
|
10105
10246
|
}
|
|
10106
10247
|
}
|
|
10107
|
-
var sponsoredTaskClaimCommand = new
|
|
10248
|
+
var sponsoredTaskClaimCommand = new Command101("claim").description("Claim your unclaimed Sponsored Task reward for a vault task").argument("<vaultId>", "Vault id").option(
|
|
10108
10249
|
"--task-id <id>",
|
|
10109
10250
|
"Claim the entitlement for a specific task (defaults to the first unclaimed one)"
|
|
10110
10251
|
).action(async (vaultId, opts) => {
|
|
@@ -10190,10 +10331,10 @@ var sponsoredTaskClaimCommand = new Command100("claim").description("Claim your
|
|
|
10190
10331
|
});
|
|
10191
10332
|
|
|
10192
10333
|
// src/commands/sponsored-task/rewards.ts
|
|
10193
|
-
import { Command as
|
|
10334
|
+
import { Command as Command102 } from "commander";
|
|
10194
10335
|
var REWARD_STATES = SponsoredTaskRewardStateSchema.options;
|
|
10195
10336
|
var CLAIM_STATUSES = SponsoredTaskWorkerRewardClaimStatusSchema.options;
|
|
10196
|
-
var sponsoredTaskRewardsCommand = new
|
|
10337
|
+
var sponsoredTaskRewardsCommand = new Command102("rewards").description("List Sponsored Task rewards across every vault (defaults to your wallet)").option("--address <address>", "Worker address (defaults to your wallet)").option("--state <state>", `Reward state: ${REWARD_STATES.join(", ")}`).option("--claim-status <status>", `Claim status: ${CLAIM_STATUSES.join(", ")}`).option("--limit <n>", "Max rewards to return (1-100)", "50").option("--cursor <cursor>", "Pagination cursor from a previous nextCursor").action(
|
|
10197
10338
|
async (opts) => {
|
|
10198
10339
|
let address = opts.address;
|
|
10199
10340
|
if (address === void 0) {
|
|
@@ -10233,7 +10374,7 @@ var sponsoredTaskRewardsCommand = new Command101("rewards").description("List Sp
|
|
|
10233
10374
|
);
|
|
10234
10375
|
|
|
10235
10376
|
// src/commands/sponsored-task/index.ts
|
|
10236
|
-
var sponsoredTaskCommand = new
|
|
10377
|
+
var sponsoredTaskCommand = new Command103("sponsored-task").description(
|
|
10237
10378
|
"Sponsored Task vault administration and reward claims"
|
|
10238
10379
|
);
|
|
10239
10380
|
sponsoredTaskCommand.addCommand(sponsoredTaskCreateCommand);
|
|
@@ -10254,7 +10395,7 @@ sponsoredTaskCommand.addCommand(sponsoredTaskRewardsCommand);
|
|
|
10254
10395
|
// src/index.ts
|
|
10255
10396
|
var require2 = createRequire(import.meta.url);
|
|
10256
10397
|
var { version } = require2("../package.json");
|
|
10257
|
-
var program = new
|
|
10398
|
+
var program = new Command104();
|
|
10258
10399
|
setLastErrorCliVersion(version);
|
|
10259
10400
|
program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
|
|
10260
10401
|
program.option(
|
|
@@ -10274,6 +10415,7 @@ program.addCommand(initCommand);
|
|
|
10274
10415
|
program.addCommand(walletCommand);
|
|
10275
10416
|
program.addCommand(addressCommand);
|
|
10276
10417
|
program.addCommand(identityCommand);
|
|
10418
|
+
program.addCommand(whoamiCommand);
|
|
10277
10419
|
program.addCommand(statsCommand);
|
|
10278
10420
|
program.addCommand(taskCommand2);
|
|
10279
10421
|
program.addCommand(agentCommand);
|