@lucid-agents/taskmarket 1.41.0 → 1.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-compatibility.json +1 -1
- package/dist/{api-S2IU3JCT.js → api-4I33LJ7A.js} +2 -2
- package/dist/{channels-4LHC2LND.js → channels-456WXKVT.js} +4 -4
- package/dist/{chunk-5VGLI7T4.js → chunk-3FI5KV44.js} +1 -1
- package/dist/{chunk-A37LXOBO.js → chunk-4Q67KT6T.js} +5 -5
- package/dist/{chunk-Z66B234H.js → chunk-5IOQEQH3.js} +1 -1
- package/dist/{chunk-HH2RBNNT.js → chunk-ASZ3YR77.js} +2 -2
- package/dist/{chunk-PRKO232N.js → chunk-HWDFJ5N7.js} +1 -1
- package/dist/{chunk-PNBVFBTB.js → chunk-I7OL2FMA.js} +8 -8
- package/dist/{chunk-HYYMYJV4.js → chunk-IN6WPBUK.js} +3 -3
- package/dist/{chunk-7Y5S6QR7.js → chunk-JOVLOWPY.js} +5092 -4006
- package/dist/{chunk-ORCB435L.js → chunk-L67V45XI.js} +1 -1
- package/dist/{chunk-6XMZQPS5.js → chunk-QRMNHEUF.js} +3 -3
- package/dist/{chunk-LIVNNQYQ.js → chunk-UTTATTGM.js} +1 -1
- package/dist/{chunk-A6JG4LL5.js → chunk-UXZ5ZDBF.js} +3 -3
- package/dist/{doctor-EII4X6TP.js → doctor-K4RKUTXL.js} +8 -8
- package/dist/index.js +782 -361
- package/dist/{launch-SV7PLTVI.js → launch-RL4BS22J.js} +11 -11
- package/dist/{read-auth-SP6JR5V4.js → read-auth-YC7ZM7J3.js} +3 -3
- package/dist/{reconcile-FN727GXS.js → reconcile-ZFFNXOD7.js} +4 -4
- package/dist/{status-ASLURNQV.js → status-IZ7ZTA5D.js} +8 -8
- package/dist/{sync-pull-NAO3WOFB.js → sync-pull-Q7W6IPWN.js} +4 -4
- package/dist/{task-access-grants-2UQMMUAR.js → task-access-grants-4T4IPSVF.js} +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
listWorkerSubmissions,
|
|
15
15
|
submitTaskFiles,
|
|
16
16
|
taskRequirementsOf
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-I7OL2FMA.js";
|
|
18
18
|
import {
|
|
19
19
|
ComputeCreditError,
|
|
20
20
|
applyComputeCreditSetup,
|
|
@@ -37,14 +37,14 @@ import {
|
|
|
37
37
|
releasePendingComputePurchase,
|
|
38
38
|
resolvePendingComputePurchases,
|
|
39
39
|
x402FeePost
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-UXZ5ZDBF.js";
|
|
41
41
|
import {
|
|
42
42
|
signReadAuth
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-ASZ3YR77.js";
|
|
44
44
|
import {
|
|
45
45
|
saveTaskAccessGrant,
|
|
46
46
|
taskAccessGrantHeaders
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-L67V45XI.js";
|
|
48
48
|
import {
|
|
49
49
|
MPP_TEMPO_DEFAULT_VALIDITY_SECONDS,
|
|
50
50
|
X402PayError,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
setX402PolicyRuleEnabled,
|
|
63
63
|
signSponsoredTempoTransfer,
|
|
64
64
|
signTaskmarketFeePayment
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-5IOQEQH3.js";
|
|
66
66
|
import {
|
|
67
67
|
ALL_NETWORKS,
|
|
68
68
|
ApiError,
|
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
withErrorContext,
|
|
126
126
|
withIdempotentWrite,
|
|
127
127
|
withTapSignature
|
|
128
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-3FI5KV44.js";
|
|
129
129
|
import {
|
|
130
130
|
AGENT_AVATAR_MAX_BYTES,
|
|
131
131
|
AGENT_HIRES_ROLES,
|
|
@@ -159,6 +159,7 @@ import {
|
|
|
159
159
|
CrossChainFundingConfigOutputSchema,
|
|
160
160
|
DEFAULT_EVALUATION_WINDOW_HOURS,
|
|
161
161
|
DEFAULT_TERMS_BOUNDS,
|
|
162
|
+
DEFAULT_TEST_GLOBS,
|
|
162
163
|
DiscoveryFilterSchema,
|
|
163
164
|
EMAIL_SEND_SUBJECT_MAX_LENGTH,
|
|
164
165
|
ENTRY_POINT_GET_NONCE_ABI,
|
|
@@ -251,6 +252,7 @@ import {
|
|
|
251
252
|
SuggestionProposalsListInputSchema,
|
|
252
253
|
SuggestionScheduleConfigSchema,
|
|
253
254
|
SuggestionScheduleSettingsSchema,
|
|
255
|
+
TASK_HIDDEN_CHECKS_COMMITMENT_PATTERN,
|
|
254
256
|
TASK_TEMPLATE_IDS,
|
|
255
257
|
TaskActionQueueInputSchema,
|
|
256
258
|
TaskCapabilitiesSchema,
|
|
@@ -272,6 +274,7 @@ import {
|
|
|
272
274
|
USER_SKILL_SANDBOX_LIMITS,
|
|
273
275
|
WALLET_BRIDGE_ORIGIN_CHAIN_ID,
|
|
274
276
|
WALLET_BRIDGE_TEMPO_CHAIN_ID,
|
|
277
|
+
WORKFLOW_OBJECTION_REASON_MAX,
|
|
275
278
|
WORKFLOW_PRESET_NAMES,
|
|
276
279
|
WORKFLOW_STEP_LIMIT_MAX,
|
|
277
280
|
WORKFLOW_STEP_LIMIT_MIN,
|
|
@@ -312,13 +315,17 @@ import {
|
|
|
312
315
|
coreChains,
|
|
313
316
|
dreamsToUsd,
|
|
314
317
|
evaluationWindowError,
|
|
318
|
+
extractLiterals,
|
|
319
|
+
extractTaskChecks,
|
|
315
320
|
findHiddenCharacters,
|
|
316
321
|
findTemplate,
|
|
317
322
|
formatDreams,
|
|
318
323
|
formatPaymentAmount,
|
|
324
|
+
formatTaskChecksErrors,
|
|
319
325
|
formatUsdcBaseUnits,
|
|
320
326
|
getAgentName,
|
|
321
327
|
getTaskmarketHome,
|
|
328
|
+
hiddenChecksResult,
|
|
322
329
|
hireAcceptAtCapacity,
|
|
323
330
|
hireAcceptAtCapacityMessage,
|
|
324
331
|
hireSelectAtCapacityMessage,
|
|
@@ -336,6 +343,7 @@ import {
|
|
|
336
343
|
isTerminalWalletBridgeStatus,
|
|
337
344
|
listingSubmissionWriteChange,
|
|
338
345
|
marketEventPreferenceChange,
|
|
346
|
+
matchesAnyGlob,
|
|
339
347
|
needsYouKindForIntent,
|
|
340
348
|
normalizeReferenceCode,
|
|
341
349
|
normalizeWorkflowTemplateTags,
|
|
@@ -350,6 +358,8 @@ import {
|
|
|
350
358
|
requirementUnavailable,
|
|
351
359
|
requirementValues,
|
|
352
360
|
resolveTaskTerms,
|
|
361
|
+
runDataChecks,
|
|
362
|
+
runPatchChecks,
|
|
353
363
|
settlementActionExpiresAt,
|
|
354
364
|
settlementActionRequiresExpiry,
|
|
355
365
|
settlerModeContracts,
|
|
@@ -358,6 +368,7 @@ import {
|
|
|
358
368
|
splitUserSkill,
|
|
359
369
|
sponsoredVaultRelayKind,
|
|
360
370
|
svmChain,
|
|
371
|
+
taskChecksPassed,
|
|
361
372
|
taskTemplates,
|
|
362
373
|
taskmarketChain,
|
|
363
374
|
unknownCapabilityMessage,
|
|
@@ -365,17 +376,18 @@ import {
|
|
|
365
376
|
userSkillArchiveWriteChange,
|
|
366
377
|
userSkillCreateWriteChange,
|
|
367
378
|
userSkillVersionWriteChange,
|
|
379
|
+
validateTaskChecks,
|
|
368
380
|
validateWorkflowDocument,
|
|
369
381
|
validateWorkflowTemplate,
|
|
370
382
|
vaultCallGasLimit7702,
|
|
371
383
|
verifierProviderId,
|
|
372
384
|
verifiersUnsupportedOnChain,
|
|
373
385
|
viemChainFor
|
|
374
|
-
} from "./chunk-
|
|
386
|
+
} from "./chunk-JOVLOWPY.js";
|
|
375
387
|
import "./chunk-S7SJMJ2I.js";
|
|
376
388
|
|
|
377
389
|
// src/index.ts
|
|
378
|
-
import { Command as
|
|
390
|
+
import { Command as Command158 } from "commander";
|
|
379
391
|
import { createRequire } from "module";
|
|
380
392
|
|
|
381
393
|
// src/commands/init.ts
|
|
@@ -3914,8 +3926,8 @@ function addRaceContender(contender) {
|
|
|
3914
3926
|
const record = { deferreds, settled: false };
|
|
3915
3927
|
Promise.resolve(contender).then(
|
|
3916
3928
|
(value) => {
|
|
3917
|
-
for (const { resolve } of deferreds) {
|
|
3918
|
-
|
|
3929
|
+
for (const { resolve: resolve2 } of deferreds) {
|
|
3930
|
+
resolve2(value);
|
|
3919
3931
|
}
|
|
3920
3932
|
deferreds.clear();
|
|
3921
3933
|
record.settled = true;
|
|
@@ -3933,11 +3945,11 @@ function addRaceContender(contender) {
|
|
|
3933
3945
|
var wm = /* @__PURE__ */ new WeakMap();
|
|
3934
3946
|
async function safeRace(contenders) {
|
|
3935
3947
|
let deferred;
|
|
3936
|
-
const result = new Promise((
|
|
3937
|
-
deferred = { reject, resolve };
|
|
3948
|
+
const result = new Promise((resolve2, reject) => {
|
|
3949
|
+
deferred = { reject, resolve: resolve2 };
|
|
3938
3950
|
for (const contender of contenders) {
|
|
3939
3951
|
if (!isObject(contender)) {
|
|
3940
|
-
Promise.resolve(contender).then(
|
|
3952
|
+
Promise.resolve(contender).then(resolve2, reject);
|
|
3941
3953
|
continue;
|
|
3942
3954
|
}
|
|
3943
3955
|
let record = wm.get(contender);
|
|
@@ -3946,7 +3958,7 @@ async function safeRace(contenders) {
|
|
|
3946
3958
|
record.deferreds.add(deferred);
|
|
3947
3959
|
wm.set(contender, record);
|
|
3948
3960
|
} else if (record.settled) {
|
|
3949
|
-
Promise.resolve(contender).then(
|
|
3961
|
+
Promise.resolve(contender).then(resolve2, reject);
|
|
3950
3962
|
} else {
|
|
3951
3963
|
record.deferreds.add(deferred);
|
|
3952
3964
|
}
|
|
@@ -5352,7 +5364,7 @@ function getRpcTransportWithRequestCoalescing(transport, getDeduplicationKey) {
|
|
|
5352
5364
|
coalescedRequest.numConsumers++;
|
|
5353
5365
|
if (signal) {
|
|
5354
5366
|
const responsePromise = coalescedRequest.responsePromise;
|
|
5355
|
-
return await new Promise((
|
|
5367
|
+
return await new Promise((resolve2, reject) => {
|
|
5356
5368
|
const handleAbort = () => {
|
|
5357
5369
|
signal.removeEventListener("abort", handleAbort);
|
|
5358
5370
|
coalescedRequest.numConsumers -= 1;
|
|
@@ -5365,7 +5377,7 @@ function getRpcTransportWithRequestCoalescing(transport, getDeduplicationKey) {
|
|
|
5365
5377
|
reject(signal.reason);
|
|
5366
5378
|
};
|
|
5367
5379
|
signal.addEventListener("abort", handleAbort);
|
|
5368
|
-
responsePromise.then(
|
|
5380
|
+
responsePromise.then(resolve2).catch(reject).finally(() => {
|
|
5369
5381
|
signal.removeEventListener("abort", handleAbort);
|
|
5370
5382
|
});
|
|
5371
5383
|
});
|
|
@@ -7485,11 +7497,11 @@ async function tryRegisterEmail(deviceId, apiToken, username, explicit, warnings
|
|
|
7485
7497
|
function terminalIo() {
|
|
7486
7498
|
return {
|
|
7487
7499
|
interactive: Boolean(process.stdin.isTTY && process.stderr.isTTY),
|
|
7488
|
-
ask: (question) => new Promise((
|
|
7500
|
+
ask: (question) => new Promise((resolve2) => {
|
|
7489
7501
|
const rl = createInterface2({ input: process.stdin, output: process.stderr });
|
|
7490
7502
|
rl.question(question, (answer) => {
|
|
7491
7503
|
rl.close();
|
|
7492
|
-
|
|
7504
|
+
resolve2(answer);
|
|
7493
7505
|
});
|
|
7494
7506
|
})
|
|
7495
7507
|
};
|
|
@@ -7947,7 +7959,7 @@ async function approveSponsoredTaskSpend(input) {
|
|
|
7947
7959
|
`Approval confirmed but the RPC endpoint still reports an allowance of ${allowance}; retry once the endpoint catches up`
|
|
7948
7960
|
);
|
|
7949
7961
|
}
|
|
7950
|
-
await new Promise((
|
|
7962
|
+
await new Promise((resolve2) => setTimeout(resolve2, pollIntervalMs));
|
|
7951
7963
|
}
|
|
7952
7964
|
}
|
|
7953
7965
|
|
|
@@ -8439,7 +8451,7 @@ var searchCommand = new Command8("search").description(
|
|
|
8439
8451
|
});
|
|
8440
8452
|
|
|
8441
8453
|
// src/commands/task/index.ts
|
|
8442
|
-
import { Command as
|
|
8454
|
+
import { Command as Command56 } from "commander";
|
|
8443
8455
|
|
|
8444
8456
|
// src/commands/task/review.ts
|
|
8445
8457
|
import { readFile, stat } from "fs/promises";
|
|
@@ -8468,7 +8480,7 @@ var taskPath = (taskId) => `/api/tasks/${encodeURIComponent(taskId)}`;
|
|
|
8468
8480
|
var runPath = (runId) => `/api/submission-reviews/${encodeURIComponent(runId)}`;
|
|
8469
8481
|
function createSubmissionReviewClient(options) {
|
|
8470
8482
|
const now = options.now ?? Date.now;
|
|
8471
|
-
const sleep4 = options.sleep ?? ((ms2) => new Promise((
|
|
8483
|
+
const sleep4 = options.sleep ?? ((ms2) => new Promise((resolve2) => setTimeout(resolve2, ms2)));
|
|
8472
8484
|
let headersPromise;
|
|
8473
8485
|
const headers = () => headersPromise ??= (async () => {
|
|
8474
8486
|
const signer = await options.signer();
|
|
@@ -9005,7 +9017,7 @@ function retryAfterMs(res) {
|
|
|
9005
9017
|
return Math.min(wait, MAX_RETRY_AFTER_SECONDS) * 1e3;
|
|
9006
9018
|
}
|
|
9007
9019
|
async function x402Post(path9, body, options) {
|
|
9008
|
-
const sleep4 = options?.sleep ?? ((ms2) => new Promise((
|
|
9020
|
+
const sleep4 = options?.sleep ?? ((ms2) => new Promise((resolve2) => setTimeout(resolve2, ms2)));
|
|
9009
9021
|
if (paymentProtocolOf(selectedNetwork().chainId) === "mpp")
|
|
9010
9022
|
return mppPost(path9, body, options);
|
|
9011
9023
|
const keystore = await loadKeystore();
|
|
@@ -9448,7 +9460,7 @@ function taskGateCandidates(task) {
|
|
|
9448
9460
|
// src/lib/recording.ts
|
|
9449
9461
|
var RECORDING_POLL_INTERVAL_MS = 3e3;
|
|
9450
9462
|
var RECORDING_POLL_TIMEOUT_MS = 75e3;
|
|
9451
|
-
var sleepFor = (ms2) => new Promise((
|
|
9463
|
+
var sleepFor = (ms2) => new Promise((resolve2) => setTimeout(resolve2, ms2));
|
|
9452
9464
|
async function settleRecording(data, idempotencyKey, options = {}) {
|
|
9453
9465
|
if (!isRecordingPendingResponse(data)) return {};
|
|
9454
9466
|
const { txHash, intentId } = data;
|
|
@@ -12761,6 +12773,363 @@ var templateCmd = new Command53("template").description(
|
|
|
12761
12773
|
"Browse the curated task templates; create from one with `task create --template <id>`"
|
|
12762
12774
|
).addCommand(listCmd3).addCommand(showCmd);
|
|
12763
12775
|
|
|
12776
|
+
// src/commands/task/precheck.ts
|
|
12777
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
12778
|
+
import { Command as Command54 } from "commander";
|
|
12779
|
+
|
|
12780
|
+
// src/lib/task-precheck.ts
|
|
12781
|
+
import { spawnSync } from "child_process";
|
|
12782
|
+
import {
|
|
12783
|
+
cpSync,
|
|
12784
|
+
existsSync,
|
|
12785
|
+
mkdtempSync,
|
|
12786
|
+
readdirSync,
|
|
12787
|
+
readFileSync,
|
|
12788
|
+
rmSync,
|
|
12789
|
+
statSync
|
|
12790
|
+
} from "fs";
|
|
12791
|
+
import { tmpdir } from "os";
|
|
12792
|
+
import { basename, join, resolve } from "path";
|
|
12793
|
+
var OUTPUT_TAIL = 300;
|
|
12794
|
+
var MAX_BUFFER = 8 * 1024 * 1024;
|
|
12795
|
+
function tail(text) {
|
|
12796
|
+
const t = (text ?? "").trim();
|
|
12797
|
+
return t.length > OUTPUT_TAIL ? "..." + t.slice(-OUTPUT_TAIL) : t;
|
|
12798
|
+
}
|
|
12799
|
+
function patchApplies(dir, patch) {
|
|
12800
|
+
const run2 = spawnSync("git", ["apply", "--check", resolve(patch)], {
|
|
12801
|
+
cwd: dir,
|
|
12802
|
+
encoding: "utf8",
|
|
12803
|
+
maxBuffer: MAX_BUFFER
|
|
12804
|
+
});
|
|
12805
|
+
if (run2.error) return { applied: false, detail: `git could not run: ${run2.error.message}` };
|
|
12806
|
+
return run2.status === 0 ? { applied: true, detail: "the patch applies cleanly" } : { applied: false, detail: tail(run2.stderr) || `git apply --check exited ${run2.status}` };
|
|
12807
|
+
}
|
|
12808
|
+
function runCommandCheck(check, cwd, env = process.env) {
|
|
12809
|
+
const [cmd, ...args] = check.cmd;
|
|
12810
|
+
const run2 = spawnSync(cmd, args, {
|
|
12811
|
+
cwd,
|
|
12812
|
+
env,
|
|
12813
|
+
encoding: "utf8",
|
|
12814
|
+
timeout: check.timeoutS * 1e3,
|
|
12815
|
+
killSignal: "SIGKILL",
|
|
12816
|
+
maxBuffer: MAX_BUFFER
|
|
12817
|
+
});
|
|
12818
|
+
if (run2.error) {
|
|
12819
|
+
const code = run2.error.code;
|
|
12820
|
+
if (code === "ETIMEDOUT") {
|
|
12821
|
+
return { passed: false, detail: `timed out after ${check.timeoutS}s` };
|
|
12822
|
+
}
|
|
12823
|
+
return { passed: false, detail: `could not run: ${run2.error.message}` };
|
|
12824
|
+
}
|
|
12825
|
+
if (run2.status === 0) return { passed: true, detail: "exit 0" };
|
|
12826
|
+
const out = tail(run2.stderr) || tail(run2.stdout);
|
|
12827
|
+
return {
|
|
12828
|
+
passed: false,
|
|
12829
|
+
detail: `exit ${run2.status ?? run2.signal}${out ? `: ${out}` : ""}`
|
|
12830
|
+
};
|
|
12831
|
+
}
|
|
12832
|
+
function commandChecks(spec) {
|
|
12833
|
+
return spec.checks.filter(
|
|
12834
|
+
(c) => c.kind === "command"
|
|
12835
|
+
);
|
|
12836
|
+
}
|
|
12837
|
+
function runCliChecks(spec, engineResults, target, options) {
|
|
12838
|
+
const byId = /* @__PURE__ */ new Map();
|
|
12839
|
+
let work = null;
|
|
12840
|
+
let patchOk = null;
|
|
12841
|
+
try {
|
|
12842
|
+
const needsWork = options.yes && commandChecks(spec).length > 0;
|
|
12843
|
+
if (needsWork) {
|
|
12844
|
+
work = mkdtempSync(join(tmpdir(), "taskmarket-precheck-"));
|
|
12845
|
+
if (target.dir) {
|
|
12846
|
+
cpSync(resolve(target.dir), work, { recursive: true });
|
|
12847
|
+
if (target.patch) {
|
|
12848
|
+
const run2 = spawnSync("git", ["apply", resolve(target.patch)], {
|
|
12849
|
+
cwd: work,
|
|
12850
|
+
encoding: "utf8"
|
|
12851
|
+
});
|
|
12852
|
+
patchOk = run2.status === 0 ? { applied: true, detail: "applied" } : { applied: false, detail: tail(run2.stderr) || "git apply failed" };
|
|
12853
|
+
}
|
|
12854
|
+
} else if (target.file) {
|
|
12855
|
+
cpSync(resolve(target.file), join(work, basename(target.file)));
|
|
12856
|
+
}
|
|
12857
|
+
}
|
|
12858
|
+
for (const check of spec.checks) {
|
|
12859
|
+
if (check.kind === "patch_applies") {
|
|
12860
|
+
let result;
|
|
12861
|
+
if (!target.dir || !target.patch) {
|
|
12862
|
+
result = {
|
|
12863
|
+
id: check.id,
|
|
12864
|
+
kind: check.kind,
|
|
12865
|
+
passed: false,
|
|
12866
|
+
skipped: true,
|
|
12867
|
+
detail: "pass --dir <checkout> and --patch <file> to test the patch"
|
|
12868
|
+
};
|
|
12869
|
+
} else {
|
|
12870
|
+
const r = patchApplies(target.dir, target.patch);
|
|
12871
|
+
result = { id: check.id, kind: check.kind, passed: r.applied, detail: r.detail };
|
|
12872
|
+
}
|
|
12873
|
+
byId.set(check.id, result);
|
|
12874
|
+
} else if (check.kind === "command") {
|
|
12875
|
+
if (!options.yes) {
|
|
12876
|
+
byId.set(check.id, {
|
|
12877
|
+
id: check.id,
|
|
12878
|
+
kind: check.kind,
|
|
12879
|
+
passed: false,
|
|
12880
|
+
skipped: true,
|
|
12881
|
+
detail: "pass --yes to run commands"
|
|
12882
|
+
});
|
|
12883
|
+
} else if (patchOk && !patchOk.applied) {
|
|
12884
|
+
byId.set(check.id, {
|
|
12885
|
+
id: check.id,
|
|
12886
|
+
kind: check.kind,
|
|
12887
|
+
passed: false,
|
|
12888
|
+
detail: `the patch did not apply, so the command did not run: ${patchOk.detail}`
|
|
12889
|
+
});
|
|
12890
|
+
} else {
|
|
12891
|
+
const env = {
|
|
12892
|
+
...process.env,
|
|
12893
|
+
...target.file ? { TASKMARKET_DELIVERABLE: join(work, basename(target.file)) } : {}
|
|
12894
|
+
};
|
|
12895
|
+
const r = runCommandCheck(check, work, env);
|
|
12896
|
+
byId.set(check.id, { id: check.id, kind: check.kind, ...r });
|
|
12897
|
+
}
|
|
12898
|
+
}
|
|
12899
|
+
}
|
|
12900
|
+
} finally {
|
|
12901
|
+
if (work && existsSync(work)) rmSync(work, { recursive: true, force: true });
|
|
12902
|
+
}
|
|
12903
|
+
return engineResults.map((r) => byId.get(r.id) ?? r);
|
|
12904
|
+
}
|
|
12905
|
+
function isDirectory(path9) {
|
|
12906
|
+
try {
|
|
12907
|
+
return statSync(path9).isDirectory();
|
|
12908
|
+
} catch {
|
|
12909
|
+
return false;
|
|
12910
|
+
}
|
|
12911
|
+
}
|
|
12912
|
+
var LITERAL_FILE_LIMIT = 2e3;
|
|
12913
|
+
var LITERAL_BYTES_LIMIT = 1024 * 1024;
|
|
12914
|
+
var SKIPPED_DIRS = /* @__PURE__ */ new Set([
|
|
12915
|
+
".git",
|
|
12916
|
+
"node_modules",
|
|
12917
|
+
"target",
|
|
12918
|
+
"dist",
|
|
12919
|
+
"build",
|
|
12920
|
+
".venv",
|
|
12921
|
+
"__pycache__"
|
|
12922
|
+
]);
|
|
12923
|
+
function collectTestLiterals(dir, paths) {
|
|
12924
|
+
const globs = paths ?? DEFAULT_TEST_GLOBS;
|
|
12925
|
+
const root = resolve(dir);
|
|
12926
|
+
const found = /* @__PURE__ */ new Set();
|
|
12927
|
+
let visited = 0;
|
|
12928
|
+
const walk2 = (rel) => {
|
|
12929
|
+
let names;
|
|
12930
|
+
try {
|
|
12931
|
+
names = readdirSync(join(root, rel)).sort();
|
|
12932
|
+
} catch {
|
|
12933
|
+
return;
|
|
12934
|
+
}
|
|
12935
|
+
for (const name of names) {
|
|
12936
|
+
if (visited >= LITERAL_FILE_LIMIT) return;
|
|
12937
|
+
const next = rel === "" ? name : `${rel}/${name}`;
|
|
12938
|
+
let info;
|
|
12939
|
+
try {
|
|
12940
|
+
info = statSync(join(root, next));
|
|
12941
|
+
} catch {
|
|
12942
|
+
continue;
|
|
12943
|
+
}
|
|
12944
|
+
if (info.isDirectory()) {
|
|
12945
|
+
if (!SKIPPED_DIRS.has(name)) walk2(next);
|
|
12946
|
+
} else if (info.isFile() && info.size <= LITERAL_BYTES_LIMIT && matchesAnyGlob(next, globs)) {
|
|
12947
|
+
visited++;
|
|
12948
|
+
try {
|
|
12949
|
+
for (const lit of extractLiterals(readFileSync(join(root, next), "utf8"))) found.add(lit);
|
|
12950
|
+
} catch {
|
|
12951
|
+
}
|
|
12952
|
+
}
|
|
12953
|
+
}
|
|
12954
|
+
};
|
|
12955
|
+
walk2("");
|
|
12956
|
+
return [...found].sort();
|
|
12957
|
+
}
|
|
12958
|
+
|
|
12959
|
+
// src/commands/task/precheck.ts
|
|
12960
|
+
async function specOf(taskId) {
|
|
12961
|
+
const task = await getTask(cliTaskReadContext(), { taskId });
|
|
12962
|
+
if (!task) {
|
|
12963
|
+
return `Task not found: ${taskId} (or this is a private task you don't have access to)`;
|
|
12964
|
+
}
|
|
12965
|
+
if (task.checks) return task.checks;
|
|
12966
|
+
const found = extractTaskChecks(task.description ?? "");
|
|
12967
|
+
if (found && !found.ok) {
|
|
12968
|
+
return `The task's taskmarket-checks block is invalid: ${formatTaskChecksErrors(found.errors)}`;
|
|
12969
|
+
}
|
|
12970
|
+
if (!found) return `Task ${taskId} has no taskmarket-checks block, so there is nothing to check`;
|
|
12971
|
+
return found.spec;
|
|
12972
|
+
}
|
|
12973
|
+
var precheckCmd = new Command54("precheck").description(
|
|
12974
|
+
"Run a task's public checks on your own deliverable before you submit: --file for a file, --dir (and --patch) for a patch against a checked-out repository"
|
|
12975
|
+
).argument("<taskId>", "Task ID (0x-prefixed hex)").option("--file <path>", "The deliverable file (file deliverables)").option("--dir <path>", "The checked-out repository (patch deliverables)").option("--patch <file>", "The patch to test against --dir (patch deliverables)").option("--yes", "Run the task's command checks on this machine (they are the requester's)").action(
|
|
12976
|
+
async (taskId, opts) => {
|
|
12977
|
+
try {
|
|
12978
|
+
const spec = await specOf(taskId);
|
|
12979
|
+
if (typeof spec === "string") return printError(spec);
|
|
12980
|
+
const deliverable = spec.deliverable;
|
|
12981
|
+
let engine;
|
|
12982
|
+
if (deliverable.type === "file") {
|
|
12983
|
+
if (!opts.file)
|
|
12984
|
+
return printError("This task takes a file deliverable: pass --file <path>");
|
|
12985
|
+
if (opts.dir || opts.patch) {
|
|
12986
|
+
return printError(
|
|
12987
|
+
"--dir and --patch are for patch deliverables; this task takes a file"
|
|
12988
|
+
);
|
|
12989
|
+
}
|
|
12990
|
+
let bytes;
|
|
12991
|
+
try {
|
|
12992
|
+
bytes = readFileSync2(opts.file);
|
|
12993
|
+
} catch (error) {
|
|
12994
|
+
return renderFailure(
|
|
12995
|
+
new Error(`Cannot read ${opts.file}: ${error.message}`)
|
|
12996
|
+
);
|
|
12997
|
+
}
|
|
12998
|
+
engine = runDataChecks(spec, { bytes });
|
|
12999
|
+
} else {
|
|
13000
|
+
if (!opts.dir) {
|
|
13001
|
+
return printError(
|
|
13002
|
+
"This task takes a patch deliverable: pass --dir <checkout> and --patch <file>"
|
|
13003
|
+
);
|
|
13004
|
+
}
|
|
13005
|
+
if (opts.file)
|
|
13006
|
+
return printError("--file is for file deliverables; this task takes a patch");
|
|
13007
|
+
if (!isDirectory(opts.dir)) return printError(`Not a directory: ${opts.dir}`);
|
|
13008
|
+
let patchText = null;
|
|
13009
|
+
if (opts.patch) {
|
|
13010
|
+
try {
|
|
13011
|
+
patchText = readFileSync2(opts.patch, "utf8");
|
|
13012
|
+
} catch (error) {
|
|
13013
|
+
return renderFailure(
|
|
13014
|
+
new Error(`Cannot read ${opts.patch}: ${error.message}`)
|
|
13015
|
+
);
|
|
13016
|
+
}
|
|
13017
|
+
}
|
|
13018
|
+
if (patchText === null) {
|
|
13019
|
+
engine = runDataChecks(spec, { text: "" });
|
|
13020
|
+
} else {
|
|
13021
|
+
const specials = spec.checks.flatMap(
|
|
13022
|
+
(c) => c.kind === "no_test_special_casing" ? [c] : []
|
|
13023
|
+
);
|
|
13024
|
+
const literals = /* @__PURE__ */ new Set();
|
|
13025
|
+
for (const c of specials) {
|
|
13026
|
+
for (const lit of collectTestLiterals(opts.dir, c.paths)) literals.add(lit);
|
|
13027
|
+
}
|
|
13028
|
+
engine = runPatchChecks(spec, {
|
|
13029
|
+
patch: patchText,
|
|
13030
|
+
testLiterals: specials.length > 0 ? [...literals].sort() : void 0
|
|
13031
|
+
});
|
|
13032
|
+
}
|
|
13033
|
+
}
|
|
13034
|
+
const commands = commandChecks(spec);
|
|
13035
|
+
if (opts.yes && commands.length > 0) {
|
|
13036
|
+
process.stderr.write(
|
|
13037
|
+
"Running the requester's commands on this machine:\n" + commands.map((c) => ` ${c.id}: ${c.cmd.join(" ")}
|
|
13038
|
+
`).join("") + (spec.environment?.network === "none" ? "The task expects no network; this run does not enforce that.\n" : "")
|
|
13039
|
+
);
|
|
13040
|
+
}
|
|
13041
|
+
const results = runCliChecks(
|
|
13042
|
+
spec,
|
|
13043
|
+
engine,
|
|
13044
|
+
{ file: opts.file, dir: opts.dir, patch: opts.patch },
|
|
13045
|
+
{ yes: opts.yes === true }
|
|
13046
|
+
);
|
|
13047
|
+
const hidden = hiddenChecksResult(spec);
|
|
13048
|
+
const all = hidden ? [...results, hidden] : results;
|
|
13049
|
+
printResult({
|
|
13050
|
+
taskId,
|
|
13051
|
+
passed: taskChecksPassed(all),
|
|
13052
|
+
skipped: results.filter((r) => r.skipped).length,
|
|
13053
|
+
warnings: results.filter((r) => r.warning).length,
|
|
13054
|
+
results: all,
|
|
13055
|
+
...spec.environment?.image || spec.environment?.setup?.length ? {
|
|
13056
|
+
note: "Precheck runs on this machine. The declared image and setup are not applied; the verifier runs the checks in that environment."
|
|
13057
|
+
} : {}
|
|
13058
|
+
});
|
|
13059
|
+
} catch (error) {
|
|
13060
|
+
renderFailure(error, { fallback: "Precheck failed." });
|
|
13061
|
+
}
|
|
13062
|
+
}
|
|
13063
|
+
);
|
|
13064
|
+
|
|
13065
|
+
// src/commands/task/checks.ts
|
|
13066
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
13067
|
+
import { Command as Command55 } from "commander";
|
|
13068
|
+
|
|
13069
|
+
// src/lib/task-hidden-checks.ts
|
|
13070
|
+
import { createHash } from "crypto";
|
|
13071
|
+
function hiddenChecksCommitment(bytes) {
|
|
13072
|
+
return `sha256:${createHash("sha256").update(bytes).digest("hex")}`;
|
|
13073
|
+
}
|
|
13074
|
+
function readHiddenChecksFile(bytes) {
|
|
13075
|
+
let value;
|
|
13076
|
+
try {
|
|
13077
|
+
value = JSON.parse(new TextDecoder("utf-8").decode(bytes));
|
|
13078
|
+
} catch (error) {
|
|
13079
|
+
return { valid: false, error: `The file is not valid JSON: ${error.message}` };
|
|
13080
|
+
}
|
|
13081
|
+
if (typeof value === "object" && value !== null && "hiddenChecks" in value) {
|
|
13082
|
+
return { valid: false, error: "A hidden checks file cannot itself carry hiddenChecks" };
|
|
13083
|
+
}
|
|
13084
|
+
const result = validateTaskChecks(value);
|
|
13085
|
+
if (!result.ok) {
|
|
13086
|
+
return {
|
|
13087
|
+
valid: false,
|
|
13088
|
+
error: `Not a valid taskmarket.checks/1 spec: ${formatTaskChecksErrors(result.errors)}`
|
|
13089
|
+
};
|
|
13090
|
+
}
|
|
13091
|
+
return { valid: true, count: result.spec.checks.length };
|
|
13092
|
+
}
|
|
13093
|
+
function isCommitment(value) {
|
|
13094
|
+
return TASK_HIDDEN_CHECKS_COMMITMENT_PATTERN.test(value);
|
|
13095
|
+
}
|
|
13096
|
+
|
|
13097
|
+
// src/commands/task/checks.ts
|
|
13098
|
+
function readBytes(path9) {
|
|
13099
|
+
try {
|
|
13100
|
+
return readFileSync3(path9);
|
|
13101
|
+
} catch (error) {
|
|
13102
|
+
return `Cannot read ${path9}: ${error.message}`;
|
|
13103
|
+
}
|
|
13104
|
+
}
|
|
13105
|
+
var commitCmd = new Command55("commit").description(
|
|
13106
|
+
"Commit to a hidden checks file: validates it and prints { commitment, count }. Put both in the public spec's hiddenChecks, then encrypt the file to each verifier with `taskmarket encrypt`"
|
|
13107
|
+
).requiredOption("--file <path>", "The hidden checks file (a taskmarket.checks/1 spec)").action((opts) => {
|
|
13108
|
+
const bytes = readBytes(opts.file);
|
|
13109
|
+
if (typeof bytes === "string") return void printError(bytes);
|
|
13110
|
+
const file = readHiddenChecksFile(bytes);
|
|
13111
|
+
if (!file.valid) return void printError(file.error);
|
|
13112
|
+
printResult({ commitment: hiddenChecksCommitment(bytes), count: file.count });
|
|
13113
|
+
});
|
|
13114
|
+
var verifyCmd = new Command55("verify").description("Check a decrypted hidden checks file against the commitment in the public spec").requiredOption("--file <path>", "The decrypted hidden checks file").requiredOption("--commitment <sha256:...>", "The spec's hiddenChecks.commitment").action((opts) => {
|
|
13115
|
+
if (!isCommitment(opts.commitment)) {
|
|
13116
|
+
return void printError("--commitment must look like sha256:<64 lowercase hex characters>");
|
|
13117
|
+
}
|
|
13118
|
+
const bytes = readBytes(opts.file);
|
|
13119
|
+
if (typeof bytes === "string") return void printError(bytes);
|
|
13120
|
+
const actual = hiddenChecksCommitment(bytes);
|
|
13121
|
+
const file = readHiddenChecksFile(bytes);
|
|
13122
|
+
printResult({
|
|
13123
|
+
matches: actual === opts.commitment,
|
|
13124
|
+
commitment: actual,
|
|
13125
|
+
expected: opts.commitment,
|
|
13126
|
+
count: file.valid ? file.count : null
|
|
13127
|
+
});
|
|
13128
|
+
});
|
|
13129
|
+
var checksCmd = new Command55("checks").description(
|
|
13130
|
+
"Hidden checks: commit to a private checks file and verify it against the commitment"
|
|
13131
|
+
).addCommand(commitCmd).addCommand(verifyCmd);
|
|
13132
|
+
|
|
12764
13133
|
// src/commands/task/settlement-actions.ts
|
|
12765
13134
|
var releaseCmd = settlementActionCommand({
|
|
12766
13135
|
name: "release",
|
|
@@ -12786,11 +13155,13 @@ var settleCmd = settlementActionCommand({
|
|
|
12786
13155
|
});
|
|
12787
13156
|
|
|
12788
13157
|
// src/commands/task/index.ts
|
|
12789
|
-
var taskCommand2 = new
|
|
13158
|
+
var taskCommand2 = new Command56("task").description("Manage tasks");
|
|
12790
13159
|
taskCommand2.addCommand(createCmd);
|
|
12791
13160
|
taskCommand2.addCommand(templateCmd);
|
|
12792
13161
|
taskCommand2.addCommand(listCmd);
|
|
12793
13162
|
taskCommand2.addCommand(getCmd);
|
|
13163
|
+
taskCommand2.addCommand(precheckCmd);
|
|
13164
|
+
taskCommand2.addCommand(checksCmd);
|
|
12794
13165
|
taskCommand2.addCommand(payoutGateCmd);
|
|
12795
13166
|
taskCommand2.addCommand(linkGateCmd);
|
|
12796
13167
|
taskCommand2.addCommand(extendGateCmd);
|
|
@@ -12838,10 +13209,10 @@ taskCommand2.addCommand(reviewCmd, { hidden: true });
|
|
|
12838
13209
|
taskCommand2.addCommand(startReviewCmd);
|
|
12839
13210
|
|
|
12840
13211
|
// src/commands/agent/index.ts
|
|
12841
|
-
import { Command as
|
|
13212
|
+
import { Command as Command60, Option as Option4 } from "commander";
|
|
12842
13213
|
|
|
12843
13214
|
// src/commands/agent/credits.ts
|
|
12844
|
-
import { Command as
|
|
13215
|
+
import { Command as Command57 } from "commander";
|
|
12845
13216
|
|
|
12846
13217
|
// src/lib/tty-confirm.ts
|
|
12847
13218
|
import { createInterface as createInterface3 } from "readline";
|
|
@@ -12853,7 +13224,7 @@ async function confirmAtTerminal(lines, unattended) {
|
|
|
12853
13224
|
`);
|
|
12854
13225
|
const readline = createInterface3({ input: process.stdin, output: process.stderr });
|
|
12855
13226
|
const answer = await new Promise(
|
|
12856
|
-
(
|
|
13227
|
+
(resolve2) => readline.question("Type yes to approve: ", resolve2)
|
|
12857
13228
|
);
|
|
12858
13229
|
readline.close();
|
|
12859
13230
|
return answer.trim().toLowerCase() === "yes";
|
|
@@ -12894,7 +13265,7 @@ function setupLines(plan, pricing) {
|
|
|
12894
13265
|
...rateLines(pricing)
|
|
12895
13266
|
];
|
|
12896
13267
|
}
|
|
12897
|
-
var setupCommand = new
|
|
13268
|
+
var setupCommand = new Command57("setup").description(
|
|
12898
13269
|
"Approve the compute allocation that pays for sandboxes: daily and monthly caps, and optional auto-top-up"
|
|
12899
13270
|
).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(
|
|
12900
13271
|
"--auto-top-up-below <credits>",
|
|
@@ -12931,7 +13302,7 @@ var setupCommand = new Command55("setup").description(
|
|
|
12931
13302
|
printResult({ config, caps: plan.caps, autoTopUp: plan.autoTopUp ?? null });
|
|
12932
13303
|
}
|
|
12933
13304
|
);
|
|
12934
|
-
var buyCommand = new
|
|
13305
|
+
var buyCommand = new Command57("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) => {
|
|
12935
13306
|
const config = await loadComputeCreditConfig();
|
|
12936
13307
|
if (!config) {
|
|
12937
13308
|
throw new ComputeCreditError(
|
|
@@ -12961,17 +13332,17 @@ var buyCommand = new Command55("buy").description("Buy compute credit over x402
|
|
|
12961
13332
|
rate: { rateCardVersion: pricing.rateCardVersion, usdPerCredit: pricing.usdPerCredit }
|
|
12962
13333
|
});
|
|
12963
13334
|
});
|
|
12964
|
-
var statusCommand2 = new
|
|
13335
|
+
var statusCommand2 = new Command57("status").description(
|
|
12965
13336
|
"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"
|
|
12966
13337
|
).action(async () => {
|
|
12967
13338
|
printResult(await computeCreditStatus());
|
|
12968
13339
|
});
|
|
12969
|
-
var checkCommand = new
|
|
13340
|
+
var checkCommand = new Command57("check").description(
|
|
12970
13341
|
"Check the compute credit balance and, when auto-top-up was approved and the balance is low, buy one chunk"
|
|
12971
13342
|
).action(async () => {
|
|
12972
13343
|
printResult(await checkComputeBalance());
|
|
12973
13344
|
});
|
|
12974
|
-
var reconcileCommand = new
|
|
13345
|
+
var reconcileCommand = new Command57("reconcile").description(
|
|
12975
13346
|
"Settle purchases whose outcome was lost, by their idempotency key; never pays again"
|
|
12976
13347
|
).option(
|
|
12977
13348
|
"--release <key>",
|
|
@@ -13018,10 +13389,10 @@ var reconcileCommand = new Command55("reconcile").description(
|
|
|
13018
13389
|
...recoveryError === void 0 ? {} : { recoveryError }
|
|
13019
13390
|
});
|
|
13020
13391
|
});
|
|
13021
|
-
var disableAutoTopUpCommand = new
|
|
13392
|
+
var disableAutoTopUpCommand = new Command57("disable-auto-top-up").description("Turn off auto-top-up and close its allocation").action(async () => {
|
|
13022
13393
|
printResult({ config: await disableComputeAutoTopUp() });
|
|
13023
13394
|
});
|
|
13024
|
-
var agentCreditsCommand = new
|
|
13395
|
+
var agentCreditsCommand = new Command57("credits").description("Prepaid compute credit for agent sandboxes, bought over x402").addCommand(setupCommand).addCommand(buyCommand).addCommand(statusCommand2).addCommand(checkCommand).addCommand(reconcileCommand).addCommand(disableAutoTopUpCommand);
|
|
13025
13396
|
|
|
13026
13397
|
// src/commands/agent/launch.ts
|
|
13027
13398
|
var EXPERIMENTAL_AGENT_ENV = "TASKMARKET_EXPERIMENTAL_AGENT";
|
|
@@ -13043,7 +13414,7 @@ async function runAgentCommand(options) {
|
|
|
13043
13414
|
try {
|
|
13044
13415
|
const { assertAgentCompatibility } = await import("./compatibility-636WJOEX.js");
|
|
13045
13416
|
const pi = assertAgentCompatibility();
|
|
13046
|
-
const { runAgent } = await import("./launch-
|
|
13417
|
+
const { runAgent } = await import("./launch-RL4BS22J.js");
|
|
13047
13418
|
result = await runAgent({
|
|
13048
13419
|
model: options.model,
|
|
13049
13420
|
pi,
|
|
@@ -13074,10 +13445,10 @@ async function runAgentCommand(options) {
|
|
|
13074
13445
|
}
|
|
13075
13446
|
|
|
13076
13447
|
// src/commands/agent/listing.ts
|
|
13077
|
-
import { createHash, randomBytes as randomBytes4 } from "crypto";
|
|
13448
|
+
import { createHash as createHash2, randomBytes as randomBytes4 } from "crypto";
|
|
13078
13449
|
import { readFile as readFile2 } from "fs/promises";
|
|
13079
13450
|
import { extname } from "path";
|
|
13080
|
-
import { Command as
|
|
13451
|
+
import { Command as Command58, Option as Option3 } from "commander";
|
|
13081
13452
|
var WRITE_TTL_SECONDS2 = 5 * 60;
|
|
13082
13453
|
var HOUR = 3600;
|
|
13083
13454
|
var LISTING_UNTRUSTED_FIELDS = [
|
|
@@ -13184,7 +13555,7 @@ async function sendAvatar(file) {
|
|
|
13184
13555
|
const bytes = await readFile2(file);
|
|
13185
13556
|
if (bytes.length > AGENT_AVATAR_MAX_BYTES) throw new Error("--avatar must be at most 1 MB");
|
|
13186
13557
|
image = bytes.toString("base64");
|
|
13187
|
-
imageSha256 =
|
|
13558
|
+
imageSha256 = createHash2("sha256").update(bytes).digest("hex");
|
|
13188
13559
|
}
|
|
13189
13560
|
const keystore = await loadKeystore();
|
|
13190
13561
|
const nonce = `0x${randomBytes4(32).toString("hex")}`;
|
|
@@ -13210,7 +13581,7 @@ async function ownListing() {
|
|
|
13210
13581
|
const keystore = await loadKeystore();
|
|
13211
13582
|
return fetchListing(keystore.walletAddress);
|
|
13212
13583
|
}
|
|
13213
|
-
var profileCommand = new
|
|
13584
|
+
var profileCommand = new Command58("profile").description(
|
|
13214
13585
|
"Your listing's profile: name, description, roles, specialties and capabilities"
|
|
13215
13586
|
);
|
|
13216
13587
|
profileCommand.command("set").description(
|
|
@@ -13362,7 +13733,7 @@ function addServiceOptions(command) {
|
|
|
13362
13733
|
"fixed or quote: a hire of this service must name an evaluator before it is accepted"
|
|
13363
13734
|
).option("--no-requires-evaluator", "fixed or quote: hires need no evaluator (the default)");
|
|
13364
13735
|
}
|
|
13365
|
-
var serviceCommand = new
|
|
13736
|
+
var serviceCommand = new Command58("service").description(
|
|
13366
13737
|
"Your listing services: the priced offers requesters hire you for"
|
|
13367
13738
|
);
|
|
13368
13739
|
addServiceOptions(
|
|
@@ -13404,7 +13775,7 @@ serviceCommand.command("remove").description("Remove a service from your listing
|
|
|
13404
13775
|
renderFailure(err);
|
|
13405
13776
|
}
|
|
13406
13777
|
});
|
|
13407
|
-
var availabilityCommand = new
|
|
13778
|
+
var availabilityCommand = new Command58("availability").description(
|
|
13408
13779
|
"Open your listing for hires or pause it (services stay visible but cannot be hired), and set your capacity"
|
|
13409
13780
|
).argument("[state]", "open or paused; keeps the saved state when left out").option("--capacity <n>", 'Most hires in progress at once, or "none" for no limit').action(async (state, opts) => {
|
|
13410
13781
|
try {
|
|
@@ -13424,7 +13795,7 @@ var availabilityCommand = new Command56("availability").description(
|
|
|
13424
13795
|
renderFailure(err);
|
|
13425
13796
|
}
|
|
13426
13797
|
});
|
|
13427
|
-
var listingCommand = new
|
|
13798
|
+
var listingCommand = new Command58("listing").description(
|
|
13428
13799
|
"Show your listing, or another worker's, with whether it is taking hires now and each service's track record on the selected --network"
|
|
13429
13800
|
).argument("[address]", "Wallet address; your own when left out").action(async (address3) => {
|
|
13430
13801
|
try {
|
|
@@ -13451,7 +13822,7 @@ function agentListingCommands() {
|
|
|
13451
13822
|
}
|
|
13452
13823
|
|
|
13453
13824
|
// src/commands/agent/manage.ts
|
|
13454
|
-
import { Command as
|
|
13825
|
+
import { Command as Command59 } from "commander";
|
|
13455
13826
|
async function run(work) {
|
|
13456
13827
|
try {
|
|
13457
13828
|
const value = await work();
|
|
@@ -13474,27 +13845,27 @@ async function requireExperimental() {
|
|
|
13474
13845
|
);
|
|
13475
13846
|
}
|
|
13476
13847
|
function agentManagementCommands() {
|
|
13477
|
-
const status = new
|
|
13848
|
+
const status = new Command59("status").description(
|
|
13478
13849
|
"Show the agent channels (locked, charged, refundable), purchases with an unknown outcome, the sandbox and compute credit. Reads only."
|
|
13479
13850
|
).action(async () => {
|
|
13480
|
-
const { collectAgentStatus } = await import("./status-
|
|
13851
|
+
const { collectAgentStatus } = await import("./status-IZ7ZTA5D.js");
|
|
13481
13852
|
await run(() => collectAgentStatus());
|
|
13482
13853
|
});
|
|
13483
|
-
const doctor = new
|
|
13854
|
+
const doctor = new Command59("doctor").description(
|
|
13484
13855
|
"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."
|
|
13485
13856
|
).action(async () => {
|
|
13486
|
-
const { runDoctor } = await import("./doctor-
|
|
13857
|
+
const { runDoctor } = await import("./doctor-K4RKUTXL.js");
|
|
13487
13858
|
const report = await run(() => runDoctor());
|
|
13488
13859
|
if (report && !report.ok) process.exitCode = 1;
|
|
13489
13860
|
});
|
|
13490
|
-
const reconcile = new
|
|
13861
|
+
const reconcile = new Command59("reconcile").description(
|
|
13491
13862
|
"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."
|
|
13492
13863
|
).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(
|
|
13493
13864
|
"--channel <channel-id>",
|
|
13494
13865
|
"Reconcile the open purchases of this channel, as status lists it; also reaches retired channels"
|
|
13495
13866
|
).action(
|
|
13496
13867
|
async (invocationId, options) => {
|
|
13497
|
-
const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-
|
|
13868
|
+
const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-ZFFNXOD7.js");
|
|
13498
13869
|
const choice = { rail: options.rail, channel: options.channel };
|
|
13499
13870
|
if (invocationId !== void 0) {
|
|
13500
13871
|
await run(() => reconcileInvocation(invocationId, { choice }));
|
|
@@ -13512,7 +13883,7 @@ function agentManagementCommands() {
|
|
|
13512
13883
|
});
|
|
13513
13884
|
}
|
|
13514
13885
|
);
|
|
13515
|
-
const topup = new
|
|
13886
|
+
const topup = new Command59("topup").description(
|
|
13516
13887
|
"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"
|
|
13517
13888
|
).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)").action(async (options) => {
|
|
13518
13889
|
await run(async () => {
|
|
@@ -13526,7 +13897,7 @@ function agentManagementCommands() {
|
|
|
13526
13897
|
`Not a USDC amount: ${options.amount} (digits, at most 6 decimals)`
|
|
13527
13898
|
);
|
|
13528
13899
|
}
|
|
13529
|
-
const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-
|
|
13900
|
+
const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-456WXKVT.js");
|
|
13530
13901
|
const { rails } = await openAgentChannels();
|
|
13531
13902
|
const result = await requestTopUp(selectRail(rails, options.rail), amount);
|
|
13532
13903
|
return {
|
|
@@ -13537,7 +13908,7 @@ function agentManagementCommands() {
|
|
|
13537
13908
|
};
|
|
13538
13909
|
});
|
|
13539
13910
|
});
|
|
13540
|
-
const close = new
|
|
13911
|
+
const close = new Command59("close").description(
|
|
13541
13912
|
"Close the agent's channel and refund its unused balance cooperatively; checks an earlier close instead of sending it again"
|
|
13542
13913
|
).option("--rail <id>", "The rail to close (required when the policy has more than one)").option(
|
|
13543
13914
|
"--channel <channel-id>",
|
|
@@ -13546,8 +13917,8 @@ function agentManagementCommands() {
|
|
|
13546
13917
|
await run(async () => {
|
|
13547
13918
|
await requireExperimental();
|
|
13548
13919
|
const { AGENT_VIEW_VERSION } = await import("./budget-view-J6L7X6EY.js");
|
|
13549
|
-
const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-
|
|
13550
|
-
const { reconcileLeasedPurchase } = await import("./reconcile-
|
|
13920
|
+
const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-456WXKVT.js");
|
|
13921
|
+
const { reconcileLeasedPurchase } = await import("./reconcile-ZFFNXOD7.js");
|
|
13551
13922
|
const opened = await openAgentChannels();
|
|
13552
13923
|
const { rail, retired } = selectChannel(opened, options);
|
|
13553
13924
|
const result = await closeChannel(
|
|
@@ -13578,7 +13949,7 @@ function agentManagementCommands() {
|
|
|
13578
13949
|
};
|
|
13579
13950
|
});
|
|
13580
13951
|
});
|
|
13581
|
-
const pull = new
|
|
13952
|
+
const pull = new Command59("pull").description(
|
|
13582
13953
|
"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."
|
|
13583
13954
|
).option("--diff", "Print the full diff").option("--apply", "Apply the clean changes without asking").option(
|
|
13584
13955
|
"--overwrite <path>",
|
|
@@ -13601,7 +13972,7 @@ function agentManagementCommands() {
|
|
|
13601
13972
|
async (options) => {
|
|
13602
13973
|
await run(async () => {
|
|
13603
13974
|
await requireExperimental();
|
|
13604
|
-
const { runPull } = await import("./sync-pull-
|
|
13975
|
+
const { runPull } = await import("./sync-pull-Q7W6IPWN.js");
|
|
13605
13976
|
const { terminalPrompter } = await import("./prompter-LSICEYSQ.js");
|
|
13606
13977
|
return runPull(options, {
|
|
13607
13978
|
interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
@@ -13619,7 +13990,7 @@ function agentManagementCommands() {
|
|
|
13619
13990
|
|
|
13620
13991
|
// src/commands/agent/index.ts
|
|
13621
13992
|
var experimental = agentCommandEnabled();
|
|
13622
|
-
var agentCommand = new
|
|
13993
|
+
var agentCommand = new Command60("agent").description(
|
|
13623
13994
|
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"
|
|
13624
13995
|
).addOption(
|
|
13625
13996
|
new Option4("--model <id>", "Start on one model from your approved spending policy").hideHelp(
|
|
@@ -13656,7 +14027,7 @@ for (const command of agentManagementCommands()) {
|
|
|
13656
14027
|
}
|
|
13657
14028
|
|
|
13658
14029
|
// src/commands/agents.ts
|
|
13659
|
-
import { Command as
|
|
14030
|
+
import { Command as Command61 } from "commander";
|
|
13660
14031
|
var MIN_RATINGS = ["3", "4", "4.5"];
|
|
13661
14032
|
var MIN_TASKS = ["5", "10", "50"];
|
|
13662
14033
|
var AVAILABILITIES = ["available", "unavailable", "any"];
|
|
@@ -13666,7 +14037,7 @@ function allowListed(flag, value, allowed) {
|
|
|
13666
14037
|
throw new Error(`${flag} must be one of: ${allowed.join(", ")}`);
|
|
13667
14038
|
}
|
|
13668
14039
|
}
|
|
13669
|
-
var agentsCommand = new
|
|
14040
|
+
var agentsCommand = new Command61("agents").description("Browse the worker directory (agents and humans) on the selected --network").enablePositionalOptions().option(
|
|
13670
14041
|
"--sort <order>",
|
|
13671
14042
|
"Sort order: reputation (top rated), tasks, hires (most hired: completed reserved, quote and request hires) or volume (settled earnings)",
|
|
13672
14043
|
"reputation"
|
|
@@ -13912,7 +14283,7 @@ agentsCommand.command("report").description("Report a worker's listing, or one o
|
|
|
13912
14283
|
});
|
|
13913
14284
|
|
|
13914
14285
|
// src/commands/dashboard.ts
|
|
13915
|
-
import { Command as
|
|
14286
|
+
import { Command as Command62 } from "commander";
|
|
13916
14287
|
|
|
13917
14288
|
// src/lib/dashboard.ts
|
|
13918
14289
|
var DASHBOARD_LIST_LIMIT = 5;
|
|
@@ -14109,7 +14480,7 @@ async function settle(read4) {
|
|
|
14109
14480
|
return { value: null, error: error instanceof Error ? error.message : String(error) };
|
|
14110
14481
|
}
|
|
14111
14482
|
}
|
|
14112
|
-
var dashboardCommand = new
|
|
14483
|
+
var dashboardCommand = new Command62("dashboard").description(
|
|
14113
14484
|
"Show your home base: what needs you, your money, tasks you posted and work you do, projects and workflows, and recent activity"
|
|
14114
14485
|
).action(async () => {
|
|
14115
14486
|
const auth = await signReadAuth();
|
|
@@ -14218,8 +14589,8 @@ var dashboardCommand = new Command60("dashboard").description(
|
|
|
14218
14589
|
});
|
|
14219
14590
|
|
|
14220
14591
|
// src/commands/inbox.ts
|
|
14221
|
-
import { Command as
|
|
14222
|
-
var inboxCommand = new
|
|
14592
|
+
import { Command as Command63 } from "commander";
|
|
14593
|
+
var inboxCommand = new Command63("inbox").description(
|
|
14223
14594
|
"Show what you need to do now, then tasks you created, tasks you are working on, and private tasks you were invited to"
|
|
14224
14595
|
).option(
|
|
14225
14596
|
"--limit <n>",
|
|
@@ -14362,7 +14733,7 @@ var inboxCommand = new Command61("inbox").description(
|
|
|
14362
14733
|
);
|
|
14363
14734
|
|
|
14364
14735
|
// src/commands/deposit.ts
|
|
14365
|
-
import { Command as
|
|
14736
|
+
import { Command as Command64 } from "commander";
|
|
14366
14737
|
|
|
14367
14738
|
// src/lib/relay-bridge.ts
|
|
14368
14739
|
import { z as z4 } from "zod";
|
|
@@ -14445,7 +14816,7 @@ async function fundingOptionsFor(chainId) {
|
|
|
14445
14816
|
note: "Run `taskmarket deposit --relay-route <routeId> --amount <n>` for a Relay deposit address. Fiat funding: see issue #2720."
|
|
14446
14817
|
};
|
|
14447
14818
|
}
|
|
14448
|
-
var depositCommand = new
|
|
14819
|
+
var depositCommand = new Command64("deposit").description(
|
|
14449
14820
|
"Show wallet address, network info and cross-chain funding options for the selected --network"
|
|
14450
14821
|
).option(
|
|
14451
14822
|
"--relay-route <routeId>",
|
|
@@ -14535,10 +14906,10 @@ var depositCommand = new Command62("deposit").description(
|
|
|
14535
14906
|
});
|
|
14536
14907
|
|
|
14537
14908
|
// src/commands/wallet/index.ts
|
|
14538
|
-
import { Command as
|
|
14909
|
+
import { Command as Command75 } from "commander";
|
|
14539
14910
|
|
|
14540
14911
|
// src/commands/wallet/balance.ts
|
|
14541
|
-
import { Command as
|
|
14912
|
+
import { Command as Command65 } from "commander";
|
|
14542
14913
|
function balancePath(address3, chainId) {
|
|
14543
14914
|
return `/api/wallet/balance?address=${address3}&chainId=${chainId}`;
|
|
14544
14915
|
}
|
|
@@ -14572,7 +14943,7 @@ async function allChainBalances(address3) {
|
|
|
14572
14943
|
);
|
|
14573
14944
|
return { address: address3, chains };
|
|
14574
14945
|
}
|
|
14575
|
-
var walletBalanceCommand = new
|
|
14946
|
+
var walletBalanceCommand = new Command65("balance").description("Show the wallet's payment-token balance on the selected network").option("--address <addr>", "Address to check (defaults to own wallet)").option(
|
|
14576
14947
|
"--all-chains",
|
|
14577
14948
|
"Show the balance on every chain the selected deployment serves, one entry per chain"
|
|
14578
14949
|
).option(
|
|
@@ -14612,7 +14983,7 @@ var walletBalanceCommand = new Command63("balance").description("Show the wallet
|
|
|
14612
14983
|
);
|
|
14613
14984
|
|
|
14614
14985
|
// src/commands/wallet/import.ts
|
|
14615
|
-
import { Command as
|
|
14986
|
+
import { Command as Command66 } from "commander";
|
|
14616
14987
|
import { createInterface as createInterface4 } from "readline";
|
|
14617
14988
|
import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
|
|
14618
14989
|
function normalizePrivateKey(raw) {
|
|
@@ -14623,7 +14994,7 @@ function normalizePrivateKey(raw) {
|
|
|
14623
14994
|
return `0x${hex3}`;
|
|
14624
14995
|
}
|
|
14625
14996
|
function promptHiddenInput(prompt) {
|
|
14626
|
-
return new Promise((
|
|
14997
|
+
return new Promise((resolve2) => {
|
|
14627
14998
|
const rl = createInterface4({
|
|
14628
14999
|
input: process.stdin,
|
|
14629
15000
|
output: process.stderr,
|
|
@@ -14643,7 +15014,7 @@ function promptHiddenInput(prompt) {
|
|
|
14643
15014
|
muted.muted = false;
|
|
14644
15015
|
process.stderr.write("\n");
|
|
14645
15016
|
rl.close();
|
|
14646
|
-
|
|
15017
|
+
resolve2(answer);
|
|
14647
15018
|
});
|
|
14648
15019
|
});
|
|
14649
15020
|
}
|
|
@@ -14686,7 +15057,7 @@ async function importSolanaWallet(flagKey) {
|
|
|
14686
15057
|
{ warnings: argvKeyWarnings(keySource) }
|
|
14687
15058
|
);
|
|
14688
15059
|
}
|
|
14689
|
-
var walletImportCommand = new
|
|
15060
|
+
var walletImportCommand = new Command66("import").description("Import an existing private key as the agent wallet").option(
|
|
14690
15061
|
"--key <privateKey>",
|
|
14691
15062
|
"Private key to import (64 hex chars, with or without 0x prefix; with --solana, a base58 or JSON-array Solana secret key)"
|
|
14692
15063
|
).option(
|
|
@@ -14777,7 +15148,7 @@ var walletImportCommand = new Command64("import").description("Import an existin
|
|
|
14777
15148
|
|
|
14778
15149
|
// src/commands/wallet/set-withdrawal-address.ts
|
|
14779
15150
|
import { randomBytes as randomBytes5 } from "crypto";
|
|
14780
|
-
import { Command as
|
|
15151
|
+
import { Command as Command67 } from "commander";
|
|
14781
15152
|
|
|
14782
15153
|
// src/lib/withdrawal-pin.ts
|
|
14783
15154
|
var WithdrawalAddressMismatchError = class extends Error {
|
|
@@ -14854,7 +15225,7 @@ var SIGNATURE_TTL_SECONDS = 5 * 60;
|
|
|
14854
15225
|
function isValidAddress(addr) {
|
|
14855
15226
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
14856
15227
|
}
|
|
14857
|
-
var setWithdrawalAddressCommand = new
|
|
15228
|
+
var setWithdrawalAddressCommand = new Command67("set-withdrawal-address").description(
|
|
14858
15229
|
"Set the withdrawal address for payment-token withdrawals on the selected network (once per chain, free)"
|
|
14859
15230
|
).argument("<address>", "Ethereum address to receive withdrawals").action(async (address3) => {
|
|
14860
15231
|
if (!isValidAddress(address3)) {
|
|
@@ -14915,8 +15286,8 @@ var setWithdrawalAddressCommand = new Command65("set-withdrawal-address").descri
|
|
|
14915
15286
|
});
|
|
14916
15287
|
|
|
14917
15288
|
// src/commands/wallet/get-withdrawal-address.ts
|
|
14918
|
-
import { Command as
|
|
14919
|
-
var getWithdrawalAddressCommand = new
|
|
15289
|
+
import { Command as Command68 } from "commander";
|
|
15290
|
+
var getWithdrawalAddressCommand = new Command68("get-withdrawal-address").description(
|
|
14920
15291
|
"Show the withdrawal address registered on the selected network, if any (the address is per chain)"
|
|
14921
15292
|
).option("--address <addr>", "Wallet address to check (defaults to own wallet)").action(async (opts) => {
|
|
14922
15293
|
let address3 = opts.address;
|
|
@@ -14932,14 +15303,14 @@ var getWithdrawalAddressCommand = new Command66("get-withdrawal-address").descri
|
|
|
14932
15303
|
});
|
|
14933
15304
|
|
|
14934
15305
|
// src/commands/wallet/change-withdrawal-address.ts
|
|
14935
|
-
import { Command as
|
|
15306
|
+
import { Command as Command69 } from "commander";
|
|
14936
15307
|
function isValidAddress2(addr) {
|
|
14937
15308
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
14938
15309
|
}
|
|
14939
15310
|
function isValidRecoveryCode(code) {
|
|
14940
15311
|
return /^\d{8}$/.test(code);
|
|
14941
15312
|
}
|
|
14942
|
-
var changeWithdrawalAddressCommand = new
|
|
15313
|
+
var changeWithdrawalAddressCommand = new Command69("change-withdrawal-address").description(
|
|
14943
15314
|
"Change the selected network's withdrawal address using that chain's account recovery code (RFC-0012)"
|
|
14944
15315
|
).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) => {
|
|
14945
15316
|
if (!isValidRecoveryCode(recoveryCode)) {
|
|
@@ -14991,8 +15362,8 @@ var changeWithdrawalAddressCommand = new Command67("change-withdrawal-address").
|
|
|
14991
15362
|
});
|
|
14992
15363
|
|
|
14993
15364
|
// src/commands/wallet/sync-withdrawal-address.ts
|
|
14994
|
-
import { Command as
|
|
14995
|
-
var syncWithdrawalAddressCommand = new
|
|
15365
|
+
import { Command as Command70 } from "commander";
|
|
15366
|
+
var syncWithdrawalAddressCommand = new Command70("sync-withdrawal-address").description(
|
|
14996
15367
|
"Accept the selected network's withdrawal address registered on the server as the locally pinned one (after a change made elsewhere, e.g. on the web)"
|
|
14997
15368
|
).action(async () => {
|
|
14998
15369
|
let keystore;
|
|
@@ -15025,8 +15396,8 @@ var syncWithdrawalAddressCommand = new Command68("sync-withdrawal-address").desc
|
|
|
15025
15396
|
});
|
|
15026
15397
|
|
|
15027
15398
|
// src/commands/wallet/reveal-recovery-code.ts
|
|
15028
|
-
import { Command as
|
|
15029
|
-
var revealRecoveryCodeCommand = new
|
|
15399
|
+
import { Command as Command71 } from "commander";
|
|
15400
|
+
var revealRecoveryCodeCommand = new Command71("reveal-recovery-code").description(
|
|
15030
15401
|
"One-time reveal of the selected network's account recovery code, if one has not been generated yet"
|
|
15031
15402
|
).action(async () => {
|
|
15032
15403
|
let keystore;
|
|
@@ -15065,8 +15436,8 @@ var revealRecoveryCodeCommand = new Command69("reveal-recovery-code").descriptio
|
|
|
15065
15436
|
});
|
|
15066
15437
|
|
|
15067
15438
|
// src/commands/wallet/publish-key.ts
|
|
15068
|
-
import { Command as
|
|
15069
|
-
var publishKeyCommand = new
|
|
15439
|
+
import { Command as Command72 } from "commander";
|
|
15440
|
+
var publishKeyCommand = new Command72("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
|
|
15070
15441
|
let keystore;
|
|
15071
15442
|
try {
|
|
15072
15443
|
keystore = await loadKeystore();
|
|
@@ -15086,7 +15457,7 @@ var publishKeyCommand = new Command70("publish-key").description("Publish your s
|
|
|
15086
15457
|
});
|
|
15087
15458
|
|
|
15088
15459
|
// src/commands/wallet/withdraw-dreams.ts
|
|
15089
|
-
import { Command as
|
|
15460
|
+
import { Command as Command73 } from "commander";
|
|
15090
15461
|
import { toHex } from "viem";
|
|
15091
15462
|
var AUTHORIZATION_VALIDITY_SECONDS = 300;
|
|
15092
15463
|
function isValidAddress3(addr) {
|
|
@@ -15108,7 +15479,7 @@ function withdrawalTargets(balance, hook) {
|
|
|
15108
15479
|
targets: hooks.filter((entry) => BigInt(entry.claimableBaseUnits) > 0n).map((entry) => ({ hookAddress: entry.hookAddress, send: true }))
|
|
15109
15480
|
};
|
|
15110
15481
|
}
|
|
15111
|
-
var withdrawDreamsCommand = new
|
|
15482
|
+
var withdrawDreamsCommand = new Command73("withdraw-dreams").description(
|
|
15112
15483
|
"Withdraw accumulated DREAMS rewards to the withdrawal address: one signed withdrawal from each reward hook holding a balance, or from --hook alone"
|
|
15113
15484
|
).option("--destination <addr>", "Destination address (defaults to registered withdrawal address)").option("--hook <address>", "Withdraw from this reward hook only").action(async (opts) => {
|
|
15114
15485
|
let keystore;
|
|
@@ -15229,7 +15600,7 @@ var withdrawDreamsCommand = new Command71("withdraw-dreams").description(
|
|
|
15229
15600
|
});
|
|
15230
15601
|
|
|
15231
15602
|
// src/commands/wallet/bridge.ts
|
|
15232
|
-
import { Command as
|
|
15603
|
+
import { Command as Command74 } from "commander";
|
|
15233
15604
|
import { toHex as toHex2 } from "viem";
|
|
15234
15605
|
var USDC_TYPES = {
|
|
15235
15606
|
TransferWithAuthorization: [
|
|
@@ -15247,7 +15618,7 @@ function progress(message) {
|
|
|
15247
15618
|
`);
|
|
15248
15619
|
}
|
|
15249
15620
|
function sleep(ms2) {
|
|
15250
|
-
return new Promise((
|
|
15621
|
+
return new Promise((resolve2) => setTimeout(resolve2, ms2));
|
|
15251
15622
|
}
|
|
15252
15623
|
function sameAddress2(a, b) {
|
|
15253
15624
|
return a.toLowerCase() === b.toLowerCase();
|
|
@@ -15273,7 +15644,7 @@ async function pollBridgeStatus(requestId) {
|
|
|
15273
15644
|
await sleep(bridgeTiming.intervalMs);
|
|
15274
15645
|
}
|
|
15275
15646
|
}
|
|
15276
|
-
var walletBridgeCommand = new
|
|
15647
|
+
var walletBridgeCommand = new Command74("bridge").description(
|
|
15277
15648
|
"Move free USDC on Base to OUSD at the same address on Tempo (gasless, through Relay)"
|
|
15278
15649
|
).requiredOption("--to <chain>", 'Destination chain (only "tempo")').option(
|
|
15279
15650
|
"--recipient <address>",
|
|
@@ -15412,7 +15783,7 @@ var walletBridgeCommand = new Command72("bridge").description(
|
|
|
15412
15783
|
});
|
|
15413
15784
|
|
|
15414
15785
|
// src/commands/wallet/index.ts
|
|
15415
|
-
var walletCommand = new
|
|
15786
|
+
var walletCommand = new Command75("wallet").description("Wallet management commands");
|
|
15416
15787
|
walletCommand.addCommand(walletBalanceCommand);
|
|
15417
15788
|
walletCommand.addCommand(walletImportCommand);
|
|
15418
15789
|
walletCommand.addCommand(setWithdrawalAddressCommand);
|
|
@@ -15425,7 +15796,7 @@ walletCommand.addCommand(withdrawDreamsCommand);
|
|
|
15425
15796
|
walletCommand.addCommand(walletBridgeCommand);
|
|
15426
15797
|
|
|
15427
15798
|
// src/commands/withdraw.ts
|
|
15428
|
-
import { Command as
|
|
15799
|
+
import { Command as Command76 } from "commander";
|
|
15429
15800
|
import { toHex as toHex3 } from "viem";
|
|
15430
15801
|
|
|
15431
15802
|
// src/lib/solana-relay.ts
|
|
@@ -15483,7 +15854,7 @@ async function waitForSolanaSignature(rpc, signature, { timeoutMs = CONFIRM_TIME
|
|
|
15483
15854
|
if (status?.confirmationStatus === "confirmed" || status?.confirmationStatus === "finalized")
|
|
15484
15855
|
return true;
|
|
15485
15856
|
if (Date.now() >= deadline) return false;
|
|
15486
|
-
await new Promise((
|
|
15857
|
+
await new Promise((resolve2) => setTimeout(resolve2, pollMs));
|
|
15487
15858
|
}
|
|
15488
15859
|
}
|
|
15489
15860
|
async function relaySolanaInstructions(input) {
|
|
@@ -15604,7 +15975,7 @@ var USDC_TYPES2 = {
|
|
|
15604
15975
|
{ name: "nonce", type: "bytes32" }
|
|
15605
15976
|
]
|
|
15606
15977
|
};
|
|
15607
|
-
var withdrawCommand = new
|
|
15978
|
+
var withdrawCommand = new Command76("withdraw").description(
|
|
15608
15979
|
"Withdraw the payment token (USDC on Base, OUSD on Tempo) to the registered withdrawal address"
|
|
15609
15980
|
).argument("<amount>", "Amount in whole tokens (e.g. 5 for 5 USDC or 5 OUSD)").option("--solana", "Send an SPL token from the agent's Solana wallet instead").option("--mint <address>", "With --solana: the SPL Token or Token-2022 mint to send").option("--to <address>", "With --solana: the Solana address to send to").option("--solana-cluster <cluster>", "With --solana: mainnet-beta or devnet").option("--yes", "With --solana: send without the terminal confirmation").action(async (amount, opts) => {
|
|
15610
15981
|
if (opts.solana) {
|
|
@@ -15693,9 +16064,9 @@ var withdrawCommand = new Command74("withdraw").description(
|
|
|
15693
16064
|
});
|
|
15694
16065
|
|
|
15695
16066
|
// src/commands/encrypt.ts
|
|
15696
|
-
import { Command as
|
|
16067
|
+
import { Command as Command77 } from "commander";
|
|
15697
16068
|
import { promises as fs2 } from "fs";
|
|
15698
|
-
var encryptCommand = new
|
|
16069
|
+
var encryptCommand = new Command77("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) => {
|
|
15699
16070
|
let plaintext;
|
|
15700
16071
|
try {
|
|
15701
16072
|
plaintext = await fs2.readFile(file);
|
|
@@ -15743,9 +16114,9 @@ var encryptCommand = new Command75("encrypt").description("Encrypt a file with E
|
|
|
15743
16114
|
});
|
|
15744
16115
|
|
|
15745
16116
|
// src/commands/decrypt.ts
|
|
15746
|
-
import { Command as
|
|
16117
|
+
import { Command as Command78 } from "commander";
|
|
15747
16118
|
import { promises as fs3 } from "fs";
|
|
15748
|
-
var decryptCommand = new
|
|
16119
|
+
var decryptCommand = new Command78("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) => {
|
|
15749
16120
|
let ciphertext;
|
|
15750
16121
|
try {
|
|
15751
16122
|
ciphertext = await fs3.readFile(file);
|
|
@@ -15785,7 +16156,7 @@ var decryptCommand = new Command76("decrypt").description("Decrypt a file using
|
|
|
15785
16156
|
});
|
|
15786
16157
|
|
|
15787
16158
|
// src/commands/xmtp.ts
|
|
15788
|
-
import { Command as
|
|
16159
|
+
import { Command as Command79 } from "commander";
|
|
15789
16160
|
|
|
15790
16161
|
// src/lib/xmtp-client.ts
|
|
15791
16162
|
import fs6 from "fs";
|
|
@@ -15823,12 +16194,12 @@ function decodeEnvelope(raw) {
|
|
|
15823
16194
|
var XmtpQueryManager = class {
|
|
15824
16195
|
pending = /* @__PURE__ */ new Map();
|
|
15825
16196
|
waitForResponse(requestId, timeoutMs) {
|
|
15826
|
-
return new Promise((
|
|
16197
|
+
return new Promise((resolve2, reject) => {
|
|
15827
16198
|
const timeout = setTimeout(() => {
|
|
15828
16199
|
this.pending.delete(requestId);
|
|
15829
16200
|
reject(new Error(`XMTP query timed out after ${timeoutMs}ms`));
|
|
15830
16201
|
}, timeoutMs);
|
|
15831
|
-
this.pending.set(requestId, { resolve, reject, timeout });
|
|
16202
|
+
this.pending.set(requestId, { resolve: resolve2, reject, timeout });
|
|
15832
16203
|
});
|
|
15833
16204
|
}
|
|
15834
16205
|
resolveResponse(envelope) {
|
|
@@ -16094,7 +16465,7 @@ function shouldHandleEnvelope(envelope, options) {
|
|
|
16094
16465
|
return true;
|
|
16095
16466
|
}
|
|
16096
16467
|
function sleep2(ms2) {
|
|
16097
|
-
return new Promise((
|
|
16468
|
+
return new Promise((resolve2) => setTimeout(resolve2, ms2));
|
|
16098
16469
|
}
|
|
16099
16470
|
async function runStreamWithReconnect(options) {
|
|
16100
16471
|
const maxReconnectAttempts = options.maxReconnectAttempts ?? Number.POSITIVE_INFINITY;
|
|
@@ -16248,7 +16619,7 @@ async function createDevClient(input) {
|
|
|
16248
16619
|
live = true;
|
|
16249
16620
|
options?.onLive?.();
|
|
16250
16621
|
}
|
|
16251
|
-
await new Promise((
|
|
16622
|
+
await new Promise((resolve2) => setTimeout(resolve2, 100));
|
|
16252
16623
|
}
|
|
16253
16624
|
return;
|
|
16254
16625
|
}
|
|
@@ -16263,7 +16634,7 @@ async function createDevClient(input) {
|
|
|
16263
16634
|
}
|
|
16264
16635
|
continue;
|
|
16265
16636
|
}
|
|
16266
|
-
await new Promise((
|
|
16637
|
+
await new Promise((resolve2) => setTimeout(resolve2, 250));
|
|
16267
16638
|
}
|
|
16268
16639
|
},
|
|
16269
16640
|
async setConsentState(_inboxId, _state) {
|
|
@@ -16394,7 +16765,7 @@ function toTransportError(error, fallbackMessage) {
|
|
|
16394
16765
|
return new XmtpTransportError(message, category, error);
|
|
16395
16766
|
}
|
|
16396
16767
|
function sleep3(ms2) {
|
|
16397
|
-
return new Promise((
|
|
16768
|
+
return new Promise((resolve2) => setTimeout(resolve2, ms2));
|
|
16398
16769
|
}
|
|
16399
16770
|
function parseRetryAttempts() {
|
|
16400
16771
|
const raw = process.env.TASKMARKET_XMTP_SEND_MAX_ATTEMPTS;
|
|
@@ -16493,7 +16864,7 @@ async function sendViaConversation(client, toInboxId, body) {
|
|
|
16493
16864
|
);
|
|
16494
16865
|
}
|
|
16495
16866
|
function callAsync(operation) {
|
|
16496
|
-
return new Promise((
|
|
16867
|
+
return new Promise((resolve2) => resolve2(operation()));
|
|
16497
16868
|
}
|
|
16498
16869
|
async function sendWithSdkClient(client, toInboxId, body) {
|
|
16499
16870
|
const clientObject = asObject(client);
|
|
@@ -17199,7 +17570,7 @@ function senderInboxIdFor(keystore, client) {
|
|
|
17199
17570
|
}
|
|
17200
17571
|
return client.inboxId;
|
|
17201
17572
|
}
|
|
17202
|
-
var xmtpCommand = new
|
|
17573
|
+
var xmtpCommand = new Command79("xmtp").description("Manage XMTP messaging for this agent");
|
|
17203
17574
|
xmtpCommand.hook("preAction", () => {
|
|
17204
17575
|
if (resolveXmtpEnv() !== "memory") assertXmtpSupported();
|
|
17205
17576
|
});
|
|
@@ -17464,7 +17835,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
|
|
|
17464
17835
|
});
|
|
17465
17836
|
|
|
17466
17837
|
// src/commands/daemon.ts
|
|
17467
|
-
import { Command as
|
|
17838
|
+
import { Command as Command81 } from "commander";
|
|
17468
17839
|
|
|
17469
17840
|
// src/lib/market-event-settings-auth.ts
|
|
17470
17841
|
function signMarketEventSettingsWrite(change) {
|
|
@@ -17472,7 +17843,7 @@ function signMarketEventSettingsWrite(change) {
|
|
|
17472
17843
|
}
|
|
17473
17844
|
|
|
17474
17845
|
// src/commands/events.ts
|
|
17475
|
-
import { Command as
|
|
17846
|
+
import { Command as Command80 } from "commander";
|
|
17476
17847
|
|
|
17477
17848
|
// src/lib/market-event-cursor.ts
|
|
17478
17849
|
import { promises as fs7 } from "fs";
|
|
@@ -17582,15 +17953,15 @@ function warn(message) {
|
|
|
17582
17953
|
`);
|
|
17583
17954
|
}
|
|
17584
17955
|
function abortableSleep(ms2, signal) {
|
|
17585
|
-
return new Promise((
|
|
17956
|
+
return new Promise((resolve2) => {
|
|
17586
17957
|
if (signal?.aborted) {
|
|
17587
|
-
|
|
17958
|
+
resolve2();
|
|
17588
17959
|
return;
|
|
17589
17960
|
}
|
|
17590
17961
|
const done = () => {
|
|
17591
17962
|
clearTimeout(timer);
|
|
17592
17963
|
signal?.removeEventListener("abort", done);
|
|
17593
|
-
|
|
17964
|
+
resolve2();
|
|
17594
17965
|
};
|
|
17595
17966
|
const timer = setTimeout(done, ms2);
|
|
17596
17967
|
signal?.addEventListener("abort", done, { once: true });
|
|
@@ -17868,14 +18239,14 @@ async function readOrMarkSeen(options) {
|
|
|
17868
18239
|
printResult(data, { idempotencyKey });
|
|
17869
18240
|
}
|
|
17870
18241
|
function createSeenCommand() {
|
|
17871
|
-
return new
|
|
18242
|
+
return new Command80("seen").description(
|
|
17872
18243
|
"Show the newest event you have seen and how many are unread (the web Inbox's Activity count); --mark moves it forward"
|
|
17873
18244
|
).option("--mark <id>", "Mark events up to this event id as seen, or `latest` for all of them").action(async (options) => {
|
|
17874
18245
|
await readOrMarkSeen(options);
|
|
17875
18246
|
});
|
|
17876
18247
|
}
|
|
17877
18248
|
function createEventsCommand() {
|
|
17878
|
-
return new
|
|
18249
|
+
return new Command80("events").description(
|
|
17879
18250
|
"Read your market events, oldest first (or newest first with --newest), or one task's timeline; --follow waits for new ones and resumes after a restart"
|
|
17880
18251
|
).option("--since <id>", "Only events after this event id (overrides the stored cursor)").option("--limit <n>", `Events per read, 1 to ${MARKET_EVENT_PAGE_MAX}`).option(
|
|
17881
18252
|
"--task <taskId>",
|
|
@@ -17969,15 +18340,15 @@ var EMAIL_POLL_INTERVAL_MS = 6e4;
|
|
|
17969
18340
|
var EMAIL_RETRY_MAX_MS = 15 * 6e4;
|
|
17970
18341
|
var MAX_CURSOR_IDS = 100;
|
|
17971
18342
|
function abortableSleep2(ms2, signal) {
|
|
17972
|
-
return new Promise((
|
|
18343
|
+
return new Promise((resolve2) => {
|
|
17973
18344
|
if (signal?.aborted) {
|
|
17974
|
-
|
|
18345
|
+
resolve2();
|
|
17975
18346
|
return;
|
|
17976
18347
|
}
|
|
17977
18348
|
const done = () => {
|
|
17978
18349
|
clearTimeout(timer);
|
|
17979
18350
|
signal?.removeEventListener("abort", done);
|
|
17980
|
-
|
|
18351
|
+
resolve2();
|
|
17981
18352
|
};
|
|
17982
18353
|
const timer = setTimeout(done, ms2);
|
|
17983
18354
|
signal?.addEventListener("abort", done, { once: true });
|
|
@@ -18241,20 +18612,20 @@ async function storeTaskFilters(json) {
|
|
|
18241
18612
|
printResult({ source: "market", type: "discovery.filter", ...data }, { idempotencyKey });
|
|
18242
18613
|
}
|
|
18243
18614
|
function sleepOrAbort(ms2, signal) {
|
|
18244
|
-
return new Promise((
|
|
18245
|
-
const id = setTimeout(
|
|
18615
|
+
return new Promise((resolve2) => {
|
|
18616
|
+
const id = setTimeout(resolve2, ms2);
|
|
18246
18617
|
signal.addEventListener(
|
|
18247
18618
|
"abort",
|
|
18248
18619
|
() => {
|
|
18249
18620
|
clearTimeout(id);
|
|
18250
|
-
|
|
18621
|
+
resolve2();
|
|
18251
18622
|
},
|
|
18252
18623
|
{ once: true }
|
|
18253
18624
|
);
|
|
18254
18625
|
});
|
|
18255
18626
|
}
|
|
18256
18627
|
function createDaemonCommand(seams = {}) {
|
|
18257
|
-
return new
|
|
18628
|
+
return new Command81("daemon").description(
|
|
18258
18629
|
"The one long-running process for everything that reaches your agent: your market events from a stored cursor, your inbound XMTP messages and the mail to your agent email, one JSON line each, marked with its source"
|
|
18259
18630
|
).option("--heartbeat-interval <ms>", "Heartbeat interval in milliseconds", "1800000").option(
|
|
18260
18631
|
"--task-filters <json>",
|
|
@@ -18433,10 +18804,10 @@ function createDaemonCommand(seams = {}) {
|
|
|
18433
18804
|
var daemonCommand = createDaemonCommand();
|
|
18434
18805
|
|
|
18435
18806
|
// src/commands/events-filter.ts
|
|
18436
|
-
import { Command as
|
|
18807
|
+
import { Command as Command83 } from "commander";
|
|
18437
18808
|
|
|
18438
18809
|
// src/commands/events-settings.ts
|
|
18439
|
-
import { Command as
|
|
18810
|
+
import { Command as Command82 } from "commander";
|
|
18440
18811
|
var PREFERENCES_PATH = "/api/market-events/preferences";
|
|
18441
18812
|
var CHANNEL_OPTION = [
|
|
18442
18813
|
"--channel <channel>",
|
|
@@ -18454,7 +18825,7 @@ async function walletHeaders() {
|
|
|
18454
18825
|
function parseChannel(channel) {
|
|
18455
18826
|
return parseInput(MarketEventWalletChannelSchema, channel ?? "email");
|
|
18456
18827
|
}
|
|
18457
|
-
var listCommand = new
|
|
18828
|
+
var listCommand = new Command82("list").description(
|
|
18458
18829
|
"Show which event types reach this wallet on one channel (email by default); locked types cannot be turned off"
|
|
18459
18830
|
).option(...CHANNEL_OPTION).action(async (options) => {
|
|
18460
18831
|
try {
|
|
@@ -18468,7 +18839,7 @@ var listCommand = new Command80("list").description(
|
|
|
18468
18839
|
}
|
|
18469
18840
|
});
|
|
18470
18841
|
function setCommand(name, enabled, description) {
|
|
18471
|
-
return new
|
|
18842
|
+
return new Command82(name).description(description).argument("<type>", "Event type, e.g. task.invited (see `taskmarket events settings list`)").option(...CHANNEL_OPTION).action(async (type, options) => {
|
|
18472
18843
|
try {
|
|
18473
18844
|
const channel = parseChannel(options.channel);
|
|
18474
18845
|
const body = parseInput(SetMarketEventPreferenceInputSchema, { type, enabled });
|
|
@@ -18488,7 +18859,7 @@ function setCommand(name, enabled, description) {
|
|
|
18488
18859
|
}
|
|
18489
18860
|
});
|
|
18490
18861
|
}
|
|
18491
|
-
var eventsSettingsCommand = new
|
|
18862
|
+
var eventsSettingsCommand = new Command82("settings").description(
|
|
18492
18863
|
"Choose which market events reach this wallet by email or as in-app notices in the web app"
|
|
18493
18864
|
).addCommand(listCommand).addCommand(setCommand("on", true, "Turn an event type on for this wallet on one channel")).addCommand(
|
|
18494
18865
|
setCommand(
|
|
@@ -18542,7 +18913,7 @@ function mergeFilter(current, options) {
|
|
|
18542
18913
|
}
|
|
18543
18914
|
return { filter: parsed.data };
|
|
18544
18915
|
}
|
|
18545
|
-
var eventsFilterCommand = new
|
|
18916
|
+
var eventsFilterCommand = new Command83("filter").description(
|
|
18546
18917
|
"Read or set this wallet's discovery filter: which newly listed tasks are announced to it as task.listed events"
|
|
18547
18918
|
).option("--enable", "Turn discovery on").option("--disable", "Turn discovery off: no task.listed events at all").option(
|
|
18548
18919
|
"--modes <list>",
|
|
@@ -18604,11 +18975,11 @@ function attachEventsFilter(program2) {
|
|
|
18604
18975
|
}
|
|
18605
18976
|
|
|
18606
18977
|
// src/commands/email/index.ts
|
|
18607
|
-
import { Command as
|
|
18978
|
+
import { Command as Command92 } from "commander";
|
|
18608
18979
|
|
|
18609
18980
|
// src/commands/email/register.ts
|
|
18610
|
-
import { Command as
|
|
18611
|
-
var registerCommand = new
|
|
18981
|
+
import { Command as Command84 } from "commander";
|
|
18982
|
+
var registerCommand = new Command84("register").description("Register an email address for this agent").requiredOption("--username <name>", "Desired username (e.g. myagent)").action(async (opts) => {
|
|
18612
18983
|
const check = await apiGet(
|
|
18613
18984
|
`/api/emails/check-username?username=${encodeURIComponent(opts.username)}`
|
|
18614
18985
|
);
|
|
@@ -18629,8 +19000,8 @@ var registerCommand = new Command82("register").description("Register an email a
|
|
|
18629
19000
|
});
|
|
18630
19001
|
|
|
18631
19002
|
// src/commands/email/inbox.ts
|
|
18632
|
-
import { Command as
|
|
18633
|
-
var inboxCommand2 = new
|
|
19003
|
+
import { Command as Command85 } from "commander";
|
|
19004
|
+
var inboxCommand2 = new Command85("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) => {
|
|
18634
19005
|
const keystore = await loadKeystore();
|
|
18635
19006
|
const params = new URLSearchParams({
|
|
18636
19007
|
deviceId: keystore.deviceId,
|
|
@@ -18646,8 +19017,8 @@ var inboxCommand2 = new Command83("inbox").description("List emails in your inbo
|
|
|
18646
19017
|
});
|
|
18647
19018
|
|
|
18648
19019
|
// src/commands/email/read.ts
|
|
18649
|
-
import { Command as
|
|
18650
|
-
var readCommand = new
|
|
19020
|
+
import { Command as Command86 } from "commander";
|
|
19021
|
+
var readCommand = new Command86("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
|
|
18651
19022
|
const keystore = await loadKeystore();
|
|
18652
19023
|
const params = new URLSearchParams({
|
|
18653
19024
|
deviceId: keystore.deviceId,
|
|
@@ -18660,8 +19031,8 @@ var readCommand = new Command84("read").description("Read an email by ID (marks
|
|
|
18660
19031
|
});
|
|
18661
19032
|
|
|
18662
19033
|
// src/commands/email/send.ts
|
|
18663
|
-
import { Command as
|
|
18664
|
-
var sendCommand = new
|
|
19034
|
+
import { Command as Command87 } from "commander";
|
|
19035
|
+
var sendCommand = new Command87("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) => {
|
|
18665
19036
|
const keystore = await loadKeystore();
|
|
18666
19037
|
const { data: result, idempotencyKey } = await apiPost("/api/emails/send", {
|
|
18667
19038
|
deviceId: keystore.deviceId,
|
|
@@ -18674,8 +19045,8 @@ var sendCommand = new Command85("send").description("Send an email").requiredOpt
|
|
|
18674
19045
|
});
|
|
18675
19046
|
|
|
18676
19047
|
// src/commands/email/reply.ts
|
|
18677
|
-
import { Command as
|
|
18678
|
-
var replyCommand = new
|
|
19048
|
+
import { Command as Command88 } from "commander";
|
|
19049
|
+
var replyCommand = new Command88("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").action(async (id, opts) => {
|
|
18679
19050
|
const keystore = await loadKeystore();
|
|
18680
19051
|
const params = new URLSearchParams({
|
|
18681
19052
|
deviceId: keystore.deviceId,
|
|
@@ -18701,8 +19072,8 @@ var replyCommand = new Command86("reply").description("Reply to an email").argum
|
|
|
18701
19072
|
});
|
|
18702
19073
|
|
|
18703
19074
|
// src/commands/email/delete.ts
|
|
18704
|
-
import { Command as
|
|
18705
|
-
var deleteCommand = new
|
|
19075
|
+
import { Command as Command89 } from "commander";
|
|
19076
|
+
var deleteCommand = new Command89("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
|
|
18706
19077
|
const keystore = await loadKeystore();
|
|
18707
19078
|
const { data: result, idempotencyKey } = await apiPost(
|
|
18708
19079
|
"/api/emails/delete",
|
|
@@ -18716,15 +19087,15 @@ var deleteCommand = new Command87("delete").description("Delete an email by ID")
|
|
|
18716
19087
|
});
|
|
18717
19088
|
|
|
18718
19089
|
// src/commands/email/address.ts
|
|
18719
|
-
import { Command as
|
|
18720
|
-
var addressCommand3 = new
|
|
19090
|
+
import { Command as Command90 } from "commander";
|
|
19091
|
+
var addressCommand3 = new Command90("address").description("Show your registered email address").action(async () => {
|
|
18721
19092
|
const keystore = await loadKeystore();
|
|
18722
19093
|
const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
|
|
18723
19094
|
printResult({ emailAddress: result.emailAddress ?? null });
|
|
18724
19095
|
});
|
|
18725
19096
|
|
|
18726
19097
|
// src/commands/email/mark-read.ts
|
|
18727
|
-
import { Command as
|
|
19098
|
+
import { Command as Command91 } from "commander";
|
|
18728
19099
|
async function setReadStatus(id, read4) {
|
|
18729
19100
|
const keystore = await loadKeystore();
|
|
18730
19101
|
const { data: result, idempotencyKey } = await apiPost(
|
|
@@ -18738,12 +19109,12 @@ async function setReadStatus(id, read4) {
|
|
|
18738
19109
|
);
|
|
18739
19110
|
printResult({ id: result.id, isRead: result.isRead }, { idempotencyKey });
|
|
18740
19111
|
}
|
|
18741
|
-
var markReadCommand = new
|
|
19112
|
+
var markReadCommand = new Command91("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) => {
|
|
18742
19113
|
await setReadStatus(id, !opts.unread);
|
|
18743
19114
|
});
|
|
18744
19115
|
|
|
18745
19116
|
// src/commands/email/index.ts
|
|
18746
|
-
var emailCommand = new
|
|
19117
|
+
var emailCommand = new Command92("email").description("Email management commands");
|
|
18747
19118
|
emailCommand.addCommand(registerCommand);
|
|
18748
19119
|
emailCommand.addCommand(inboxCommand2);
|
|
18749
19120
|
emailCommand.addCommand(readCommand);
|
|
@@ -18754,10 +19125,10 @@ emailCommand.addCommand(addressCommand3);
|
|
|
18754
19125
|
emailCommand.addCommand(markReadCommand);
|
|
18755
19126
|
|
|
18756
19127
|
// src/commands/bug/index.ts
|
|
18757
|
-
import { Command as
|
|
19128
|
+
import { Command as Command101 } from "commander";
|
|
18758
19129
|
|
|
18759
19130
|
// src/commands/bug/browse.ts
|
|
18760
|
-
import { Command as
|
|
19131
|
+
import { Command as Command93 } from "commander";
|
|
18761
19132
|
|
|
18762
19133
|
// src/commands/bug/known-problem.ts
|
|
18763
19134
|
async function fetchKnownProblem() {
|
|
@@ -18770,7 +19141,7 @@ async function fetchKnownProblem() {
|
|
|
18770
19141
|
}
|
|
18771
19142
|
|
|
18772
19143
|
// src/commands/bug/browse.ts
|
|
18773
|
-
var browseCommand = new
|
|
19144
|
+
var browseCommand = new Command93("browse").description(
|
|
18774
19145
|
"Browse public bug reports, to check whether a bug is already known; no wallet needed"
|
|
18775
19146
|
).option("--query <text>", "Only reports whose title or description contains this text").option("--status <status>", `Only reports with this status: ${BUG_REPORT_STATUSES.join(", ")}`).option("--sort <order>", `Order: ${PUBLIC_BUG_REPORT_SORTS.join(", ")}`, "newest").option("--limit <n>", "Maximum reports to return (1-100)", "50").option("--offset <n>", "Skip this many reports, for paging", "0").action(
|
|
18776
19147
|
async (opts) => {
|
|
@@ -18817,7 +19188,7 @@ var browseCommand = new Command91("browse").description(
|
|
|
18817
19188
|
);
|
|
18818
19189
|
|
|
18819
19190
|
// src/commands/bug/comment.ts
|
|
18820
|
-
import { Command as
|
|
19191
|
+
import { Command as Command94 } from "commander";
|
|
18821
19192
|
|
|
18822
19193
|
// src/lib/stdin.ts
|
|
18823
19194
|
var STDIN_FIRST_BYTE_MS = 5e3;
|
|
@@ -18827,7 +19198,7 @@ async function readStdin(firstByteMs) {
|
|
|
18827
19198
|
let timer;
|
|
18828
19199
|
const first = await Promise.race([
|
|
18829
19200
|
iterator.next(),
|
|
18830
|
-
...firstByteMs === void 0 ? [] : [new Promise((
|
|
19201
|
+
...firstByteMs === void 0 ? [] : [new Promise((resolve2) => timer = setTimeout(() => resolve2(null), firstByteMs))]
|
|
18831
19202
|
]);
|
|
18832
19203
|
clearTimeout(timer);
|
|
18833
19204
|
if (first === null) {
|
|
@@ -18871,7 +19242,7 @@ async function resolveBugReportId(ref) {
|
|
|
18871
19242
|
}
|
|
18872
19243
|
|
|
18873
19244
|
// src/commands/bug/comment.ts
|
|
18874
|
-
var commentCommand = new
|
|
19245
|
+
var commentCommand = new Command94("comment").description(
|
|
18875
19246
|
"Comment on a public bug report. Comments are public: never include keys, seed phrases or other private data"
|
|
18876
19247
|
).argument("<report>", BUG_REPORT_REF_HELP).argument("[message]", 'Your comment; read from stdin when omitted or "-"').option("--agent <id>", "Your agent id, shown with the comment").action(async (report, message, opts) => {
|
|
18877
19248
|
const ref = parseBugReportRef(report);
|
|
@@ -18917,8 +19288,8 @@ var commentCommand = new Command92("comment").description(
|
|
|
18917
19288
|
});
|
|
18918
19289
|
|
|
18919
19290
|
// src/commands/bug/list.ts
|
|
18920
|
-
import { Command as
|
|
18921
|
-
var listCommand2 = new
|
|
19291
|
+
import { Command as Command95 } from "commander";
|
|
19292
|
+
var listCommand2 = new Command95("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) => {
|
|
18922
19293
|
if (opts.status && !BUG_REPORT_STATUSES.includes(opts.status)) {
|
|
18923
19294
|
printError(`--status must be one of ${BUG_REPORT_STATUSES.join(", ")}`);
|
|
18924
19295
|
return;
|
|
@@ -18949,8 +19320,8 @@ var listCommand2 = new Command93("list").description("List the bug reports you s
|
|
|
18949
19320
|
});
|
|
18950
19321
|
|
|
18951
19322
|
// src/commands/bug/me-too.ts
|
|
18952
|
-
import { Command as
|
|
18953
|
-
var meTooCommand = new
|
|
19323
|
+
import { Command as Command96 } from "commander";
|
|
19324
|
+
var meTooCommand = new Command96("me-too").description("Say you hit a public bug report too; counted once per wallet").argument("<report>", BUG_REPORT_REF_HELP).action(async (report) => {
|
|
18954
19325
|
const ref = parseBugReportRef(report);
|
|
18955
19326
|
if (!ref) {
|
|
18956
19327
|
printError(BUG_REPORT_REF_ERROR);
|
|
@@ -18974,8 +19345,8 @@ var meTooCommand = new Command94("me-too").description("Say you hit a public bug
|
|
|
18974
19345
|
});
|
|
18975
19346
|
|
|
18976
19347
|
// src/commands/bug/reply.ts
|
|
18977
|
-
import { Command as
|
|
18978
|
-
var replyCommand2 = new
|
|
19348
|
+
import { Command as Command97 } from "commander";
|
|
19349
|
+
var replyCommand2 = new Command97("reply").description(
|
|
18979
19350
|
"Reply to Taskmarket staff on one of your bug reports; a reply does not change its status"
|
|
18980
19351
|
).argument("<id>", "Bug report id").argument("[message]", 'Your reply; read from stdin when omitted or "-"').action(async (id, message) => {
|
|
18981
19352
|
const body = await textOrStdin(message);
|
|
@@ -19009,8 +19380,8 @@ var replyCommand2 = new Command95("reply").description(
|
|
|
19009
19380
|
});
|
|
19010
19381
|
|
|
19011
19382
|
// src/commands/bug/show.ts
|
|
19012
|
-
import { Command as
|
|
19013
|
-
var showCommand = new
|
|
19383
|
+
import { Command as Command98 } from "commander";
|
|
19384
|
+
var showCommand = new Command98("show").description(
|
|
19014
19385
|
"Show a public bug report by its number (#N, no wallet needed), or one of your own by its id with messages from staff"
|
|
19015
19386
|
).argument("<report>", "Public number (#N) of any public report, or the id of one of yours").action(async (report) => {
|
|
19016
19387
|
const ref = parseBugReportRef(report);
|
|
@@ -19038,7 +19409,7 @@ var showCommand = new Command96("show").description(
|
|
|
19038
19409
|
});
|
|
19039
19410
|
|
|
19040
19411
|
// src/commands/bug/submit.ts
|
|
19041
|
-
import { Command as
|
|
19412
|
+
import { Command as Command99 } from "commander";
|
|
19042
19413
|
|
|
19043
19414
|
// src/commands/bug/context.ts
|
|
19044
19415
|
import os from "os";
|
|
@@ -19062,7 +19433,7 @@ function cliVersionOf(command) {
|
|
|
19062
19433
|
var LAST_COMMAND_MAX_CHARS = 2048;
|
|
19063
19434
|
var LAST_ERROR_MAX_CHARS = 16 * 1024;
|
|
19064
19435
|
var PUBLIC_NOTICE = "This report is public: anyone can read it, with your wallet and agent id. Never include keys, seed phrases or other private data. Make it private with `taskmarket bug visibility <id> private`.";
|
|
19065
|
-
var submitCommand = new
|
|
19436
|
+
var submitCommand = new Command99("submit").description(
|
|
19066
19437
|
"Report a Taskmarket bug; CLI version, OS, Node version and network are attached. Reports are public unless --private"
|
|
19067
19438
|
).requiredOption("--title <text>", "Short summary (at most 200 characters)").option(
|
|
19068
19439
|
"--description <text>",
|
|
@@ -19138,8 +19509,8 @@ var submitCommand = new Command97("submit").description(
|
|
|
19138
19509
|
});
|
|
19139
19510
|
|
|
19140
19511
|
// src/commands/bug/visibility.ts
|
|
19141
|
-
import { Command as
|
|
19142
|
-
var visibilityCommand = new
|
|
19512
|
+
import { Command as Command100 } from "commander";
|
|
19513
|
+
var visibilityCommand = new Command100("visibility").description(
|
|
19143
19514
|
"Make one of your bug reports public or private; a private report is seen only by you and staff"
|
|
19144
19515
|
).argument("<report>", `${BUG_REPORT_REF_HELP}; a private report only by its id`).argument("<visibility>", BUG_REPORT_VISIBILITIES.join(" or ")).action(async (report, visibility) => {
|
|
19145
19516
|
const ref = parseBugReportRef(report);
|
|
@@ -19174,7 +19545,7 @@ var visibilityCommand = new Command98("visibility").description(
|
|
|
19174
19545
|
});
|
|
19175
19546
|
|
|
19176
19547
|
// src/commands/bug/index.ts
|
|
19177
|
-
var bugCommand = new
|
|
19548
|
+
var bugCommand = new Command101("bug").description(
|
|
19178
19549
|
"Report Taskmarket bugs, browse public reports, follow their status and reply to staff"
|
|
19179
19550
|
);
|
|
19180
19551
|
bugCommand.addCommand(submitCommand);
|
|
@@ -19187,7 +19558,7 @@ bugCommand.addCommand(commentCommand);
|
|
|
19187
19558
|
bugCommand.addCommand(visibilityCommand);
|
|
19188
19559
|
|
|
19189
19560
|
// src/commands/bookmark/index.ts
|
|
19190
|
-
import { Command as
|
|
19561
|
+
import { Command as Command103 } from "commander";
|
|
19191
19562
|
|
|
19192
19563
|
// src/commands/bookmark/auth.ts
|
|
19193
19564
|
async function bookmarkAuth(action) {
|
|
@@ -19200,8 +19571,8 @@ async function bookmarkAuth(action) {
|
|
|
19200
19571
|
}
|
|
19201
19572
|
|
|
19202
19573
|
// src/commands/bookmark/collection.ts
|
|
19203
|
-
import { Command as
|
|
19204
|
-
var createCommand = new
|
|
19574
|
+
import { Command as Command102 } from "commander";
|
|
19575
|
+
var createCommand = new Command102("create").description("Create a private collection").argument("<name>", "Collection name, up to 120 characters").action(async (name) => {
|
|
19205
19576
|
const trimmed = name.trim();
|
|
19206
19577
|
if (trimmed.length === 0 || trimmed.length > 120) {
|
|
19207
19578
|
printError("Collection name must be 1 to 120 characters");
|
|
@@ -19220,7 +19591,7 @@ var createCommand = new Command100("create").description("Create a private colle
|
|
|
19220
19591
|
return renderFailure(error);
|
|
19221
19592
|
}
|
|
19222
19593
|
});
|
|
19223
|
-
var listCommand3 = new
|
|
19594
|
+
var listCommand3 = new Command102("list").description("List your collections; a published one carries its publishedSlug (/c/<slug>)").action(async () => {
|
|
19224
19595
|
const auth = await bookmarkAuth("Listing collections");
|
|
19225
19596
|
if (!auth) return;
|
|
19226
19597
|
try {
|
|
@@ -19230,7 +19601,7 @@ var listCommand3 = new Command100("list").description("List your collections; a
|
|
|
19230
19601
|
}
|
|
19231
19602
|
});
|
|
19232
19603
|
function publishToggle(name, description, action) {
|
|
19233
|
-
return new
|
|
19604
|
+
return new Command102(name).description(description).argument("<collection-id>", "Collection id (from `taskmarket bookmark collection list`)").action(async (collectionId) => {
|
|
19234
19605
|
const auth = await bookmarkAuth(action);
|
|
19235
19606
|
if (!auth) return;
|
|
19236
19607
|
try {
|
|
@@ -19246,7 +19617,7 @@ function publishToggle(name, description, action) {
|
|
|
19246
19617
|
}
|
|
19247
19618
|
});
|
|
19248
19619
|
}
|
|
19249
|
-
var collectionCommand = new
|
|
19620
|
+
var collectionCommand = new Command102("collection").description(
|
|
19250
19621
|
"Create, list, publish and unpublish bookmark collections"
|
|
19251
19622
|
);
|
|
19252
19623
|
collectionCommand.addCommand(createCommand);
|
|
@@ -19277,7 +19648,7 @@ function parseEntityType(value, flag) {
|
|
|
19277
19648
|
function chainFor(entityType) {
|
|
19278
19649
|
return entityType === "agent" ? { chainId: selectedNetwork().chainId } : {};
|
|
19279
19650
|
}
|
|
19280
|
-
var addCommand = new
|
|
19651
|
+
var addCommand = new Command103("add").description(
|
|
19281
19652
|
"Bookmark a task, submission or agent; an agent is saved on the selected network (--network)"
|
|
19282
19653
|
).argument("<type>", `What to bookmark: ${ENTITY_TYPES.join(", ")}`).argument("<id>", "Task id, submission id or agent id").option("--collection <id>", "Save it to one of your collections (moves an existing bookmark)").option("--note <text>", "A private note, up to 500 characters").action(async (type, id, opts) => {
|
|
19283
19654
|
const entityType = parseEntityType(type, "<type>");
|
|
@@ -19305,7 +19676,7 @@ var addCommand = new Command101("add").description(
|
|
|
19305
19676
|
return renderFailure(error);
|
|
19306
19677
|
}
|
|
19307
19678
|
});
|
|
19308
|
-
var removeCommand = new
|
|
19679
|
+
var removeCommand = new Command103("remove").description("Remove a bookmark; an agent bookmark is matched on the selected network").argument("<type>", `What was bookmarked: ${ENTITY_TYPES.join(", ")}`).argument("<id>", "Task id, submission id or agent id").action(async (type, id) => {
|
|
19309
19680
|
const entityType = parseEntityType(type, "<type>");
|
|
19310
19681
|
if (!entityType) return;
|
|
19311
19682
|
const auth = await bookmarkAuth("Removing a bookmark");
|
|
@@ -19321,7 +19692,7 @@ var removeCommand = new Command101("remove").description("Remove a bookmark; an
|
|
|
19321
19692
|
return renderFailure(error);
|
|
19322
19693
|
}
|
|
19323
19694
|
});
|
|
19324
|
-
var listCommand4 = new
|
|
19695
|
+
var listCommand4 = new Command103("list").description("List your bookmarks, newest first; agent entries carry their chainId").option("--type <type>", `Only one kind: ${ENTITY_TYPES.join(", ")}`).option("--collection <id>", "Only bookmarks in this collection").option("--pinned", "Only pinned bookmarks").option("--limit <n>", "Maximum bookmarks to return (1-100)", "50").option("--cursor <cursor>", "Cursor from previous page (nextCursor in JSON output)").action(
|
|
19325
19696
|
async (opts) => {
|
|
19326
19697
|
const entityType = opts.type === void 0 ? void 0 : parseEntityType(opts.type, "--type");
|
|
19327
19698
|
if (entityType === null) return;
|
|
@@ -19345,7 +19716,7 @@ var listCommand4 = new Command101("list").description("List your bookmarks, newe
|
|
|
19345
19716
|
}
|
|
19346
19717
|
);
|
|
19347
19718
|
function pinToggle(name, description, action) {
|
|
19348
|
-
return new
|
|
19719
|
+
return new Command103(name).description(description).argument("<id>", "Bookmark id (from `taskmarket bookmark list`)").action(async (id) => {
|
|
19349
19720
|
const auth = await bookmarkAuth(action);
|
|
19350
19721
|
if (!auth) return;
|
|
19351
19722
|
try {
|
|
@@ -19360,7 +19731,7 @@ function pinToggle(name, description, action) {
|
|
|
19360
19731
|
}
|
|
19361
19732
|
});
|
|
19362
19733
|
}
|
|
19363
|
-
var countCommand = new
|
|
19734
|
+
var countCommand = new Command103("count").description("Count your saved bookmarks").option("--pinned", "Count only pinned bookmarks").action(async (opts) => {
|
|
19364
19735
|
const auth = await bookmarkAuth("Counting bookmarks");
|
|
19365
19736
|
if (!auth) return;
|
|
19366
19737
|
const params = new URLSearchParams();
|
|
@@ -19374,7 +19745,7 @@ var countCommand = new Command101("count").description("Count your saved bookmar
|
|
|
19374
19745
|
return renderFailure(error);
|
|
19375
19746
|
}
|
|
19376
19747
|
});
|
|
19377
|
-
var bookmarkCommand = new
|
|
19748
|
+
var bookmarkCommand = new Command103("bookmark").description(
|
|
19378
19749
|
"Save tasks, submissions and agents to your private list, and share collections of them"
|
|
19379
19750
|
);
|
|
19380
19751
|
bookmarkCommand.addCommand(addCommand);
|
|
@@ -19391,18 +19762,18 @@ bookmarkCommand.addCommand(collectionCommand);
|
|
|
19391
19762
|
|
|
19392
19763
|
// src/commands/skills/index.ts
|
|
19393
19764
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
19394
|
-
import { Command as
|
|
19765
|
+
import { Command as Command104 } from "commander";
|
|
19395
19766
|
|
|
19396
19767
|
// src/lib/skill-directory.ts
|
|
19397
19768
|
import { lstat, readdir, readFile as readFile3 } from "fs/promises";
|
|
19398
|
-
import { join, relative, sep } from "path";
|
|
19769
|
+
import { join as join2, relative, sep } from "path";
|
|
19399
19770
|
var MAX_ENTRIES = USER_SKILL_LIMITS.files + USER_SKILL_SANDBOX_LIMITS.files + 300;
|
|
19400
19771
|
async function walk(root) {
|
|
19401
19772
|
const entries = [];
|
|
19402
19773
|
const visit = async (dir) => {
|
|
19403
19774
|
const names = (await readdir(dir)).sort();
|
|
19404
19775
|
for (const name of names) {
|
|
19405
|
-
const full =
|
|
19776
|
+
const full = join2(dir, name);
|
|
19406
19777
|
const path9 = relative(root, full).split(sep).join("/");
|
|
19407
19778
|
const info = await lstat(full);
|
|
19408
19779
|
if (info.isDirectory()) {
|
|
@@ -19531,7 +19902,7 @@ var bundleOptions = (command) => command.requiredOption("--agent <agentId>", "Th
|
|
|
19531
19902
|
).option("--request-key <uuid>", "Reuse to resend the same write without applying it twice");
|
|
19532
19903
|
var SIZE_NOTE = "The whole request, files included (binary assets as base64), must fit in 1 MiB; a larger one is refused before signing";
|
|
19533
19904
|
var createCommand2 = bundleOptions(
|
|
19534
|
-
new
|
|
19905
|
+
new Command104("create").description(
|
|
19535
19906
|
`Create a skill in your owner's library from a skill directory (SKILL.md, references, sandbox-only scripts and assets), as its first version. ${SIZE_NOTE}`
|
|
19536
19907
|
).argument("<dir>", "The skill directory, with SKILL.md at its root").option("--skill-id <uuid>", "The new skill ID (default: a new random ID)")
|
|
19537
19908
|
).action(async (dir, opts) => {
|
|
@@ -19549,7 +19920,7 @@ var createCommand2 = bundleOptions(
|
|
|
19549
19920
|
}
|
|
19550
19921
|
});
|
|
19551
19922
|
var versionCommand = bundleOptions(
|
|
19552
|
-
new
|
|
19923
|
+
new Command104("version").description(`Save a new version of a skill you authored from a skill directory. ${SIZE_NOTE}`).argument("<skillId>", "The skill ID").argument("<dir>", "The skill directory, with SKILL.md at its root")
|
|
19553
19924
|
).action(async (skillId, dir, opts) => {
|
|
19554
19925
|
try {
|
|
19555
19926
|
const { body, excluded } = await bundleWrite("version", dir, skillId, opts);
|
|
@@ -19566,7 +19937,7 @@ var versionCommand = bundleOptions(
|
|
|
19566
19937
|
return fail(error);
|
|
19567
19938
|
}
|
|
19568
19939
|
});
|
|
19569
|
-
var archiveCommand = new
|
|
19940
|
+
var archiveCommand = new Command104("archive").description("Archive a skill you authored; it stays in the library, archived").argument("<skillId>", "The skill ID").requiredOption("--agent <agentId>", "The hosted agent that authored the skill (its agent ID)").option(
|
|
19570
19941
|
"--remove-assignments",
|
|
19571
19942
|
"Also remove the skill from this agent's assignments; archiving is refused while other agents have it assigned"
|
|
19572
19943
|
).option("--request-key <uuid>", "Reuse to resend the same write without applying it twice").action(
|
|
@@ -19592,7 +19963,7 @@ var archiveCommand = new Command102("archive").description("Archive a skill you
|
|
|
19592
19963
|
}
|
|
19593
19964
|
}
|
|
19594
19965
|
);
|
|
19595
|
-
var skillsCommand = new
|
|
19966
|
+
var skillsCommand = new Command104("skills").description(
|
|
19596
19967
|
"Skills in your owner's library that you, a hosted agent, author: create, version and archive"
|
|
19597
19968
|
);
|
|
19598
19969
|
skillsCommand.addCommand(createCommand2);
|
|
@@ -19603,7 +19974,7 @@ skillsCommand.addCommand(archiveCommand);
|
|
|
19603
19974
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
19604
19975
|
import fs10 from "fs/promises";
|
|
19605
19976
|
import path8 from "path";
|
|
19606
|
-
import { Command as
|
|
19977
|
+
import { Command as Command105 } from "commander";
|
|
19607
19978
|
var BRIEF_COOKIE = "taskmarket_brief";
|
|
19608
19979
|
var CREDENTIAL_PATTERN = /^[0-9a-f-]{36}\.[0-9a-f]{64}$/;
|
|
19609
19980
|
var credentialFile = () => path8.join(getTaskmarketHome(), "brief.json");
|
|
@@ -19693,7 +20064,7 @@ async function sendTurn(credential, message, current, turnId = randomUUID5()) {
|
|
|
19693
20064
|
)).data
|
|
19694
20065
|
);
|
|
19695
20066
|
}
|
|
19696
|
-
var briefCommand = new
|
|
20067
|
+
var briefCommand = new Command105("brief").description(
|
|
19697
20068
|
"Draft a task brief in conversation with the drafting assistant"
|
|
19698
20069
|
);
|
|
19699
20070
|
briefCommand.command("start").description(
|
|
@@ -19747,11 +20118,11 @@ briefCommand.command("discard").description("Delete the saved brief").action(asy
|
|
|
19747
20118
|
});
|
|
19748
20119
|
|
|
19749
20120
|
// src/commands/requester/index.ts
|
|
19750
|
-
import { Command as
|
|
20121
|
+
import { Command as Command107 } from "commander";
|
|
19751
20122
|
|
|
19752
20123
|
// src/commands/requester/stats.ts
|
|
19753
|
-
import { Command as
|
|
19754
|
-
var requesterStatsCmd = new
|
|
20124
|
+
import { Command as Command106 } from "commander";
|
|
20125
|
+
var requesterStatsCmd = new Command106("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address3) => {
|
|
19755
20126
|
if (!/^0x[0-9a-fA-F]{40}$/.test(address3)) {
|
|
19756
20127
|
printError("Address must be a 0x-prefixed 20-byte hex string");
|
|
19757
20128
|
return;
|
|
@@ -19765,23 +20136,23 @@ var requesterStatsCmd = new Command104("stats").description("Get requester reput
|
|
|
19765
20136
|
});
|
|
19766
20137
|
|
|
19767
20138
|
// src/commands/requester/index.ts
|
|
19768
|
-
var requesterCmd = new
|
|
20139
|
+
var requesterCmd = new Command107("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
|
|
19769
20140
|
|
|
19770
20141
|
// src/commands/capabilities.ts
|
|
19771
|
-
import { Command as
|
|
20142
|
+
import { Command as Command108 } from "commander";
|
|
19772
20143
|
async function fetchCapabilities(category) {
|
|
19773
20144
|
const input = parseInput(CapabilitiesListInputSchema, { category });
|
|
19774
20145
|
const query4 = input.category ? `?category=${encodeURIComponent(input.category)}` : "";
|
|
19775
20146
|
return CapabilitiesListResponseSchema.parse(await apiGet(`/api/capabilities${query4}`));
|
|
19776
20147
|
}
|
|
19777
|
-
var listCommand5 = new
|
|
20148
|
+
var listCommand5 = new Command108("list").description("List the capability registry, optionally for one category").option("--category <id>", "Only this category (for example onchain or web-data)").action(async (opts) => {
|
|
19778
20149
|
try {
|
|
19779
20150
|
printResult(await fetchCapabilities(opts.category));
|
|
19780
20151
|
} catch (err) {
|
|
19781
20152
|
renderFailure(err);
|
|
19782
20153
|
}
|
|
19783
20154
|
});
|
|
19784
|
-
var showCommand2 = new
|
|
20155
|
+
var showCommand2 = new Command108("show").description("Show one capability by slug").argument("<slug>", "Capability slug, for example web-search").action(async (slug) => {
|
|
19785
20156
|
try {
|
|
19786
20157
|
const { capabilities } = await fetchCapabilities();
|
|
19787
20158
|
const entry = capabilities.find((item) => item.slug === slug);
|
|
@@ -19791,13 +20162,13 @@ var showCommand2 = new Command106("show").description("Show one capability by sl
|
|
|
19791
20162
|
renderFailure(err);
|
|
19792
20163
|
}
|
|
19793
20164
|
});
|
|
19794
|
-
var capabilitiesCommand = new
|
|
20165
|
+
var capabilitiesCommand = new Command108("capabilities").description("Read the listing capability registry").addCommand(listCommand5).addCommand(showCommand2);
|
|
19795
20166
|
|
|
19796
20167
|
// src/commands/x402/index.ts
|
|
19797
|
-
import { Command as
|
|
20168
|
+
import { Command as Command112 } from "commander";
|
|
19798
20169
|
|
|
19799
20170
|
// src/commands/x402/payments.ts
|
|
19800
|
-
import { Command as
|
|
20171
|
+
import { Command as Command109, Option as Option5 } from "commander";
|
|
19801
20172
|
import { createInterface as createInterface5 } from "readline";
|
|
19802
20173
|
var PAYMENT_STATES = [
|
|
19803
20174
|
"reserved",
|
|
@@ -19815,15 +20186,15 @@ async function confirmManualResolution() {
|
|
|
19815
20186
|
if (!process.stdin.isTTY) throw new Error("Manual resolution requires an interactive TTY");
|
|
19816
20187
|
const readline = createInterface5({ input: process.stdin, output: process.stderr });
|
|
19817
20188
|
const answer = await new Promise(
|
|
19818
|
-
(
|
|
20189
|
+
(resolve2) => readline.question(
|
|
19819
20190
|
"Manual resolution changes local spending accounting. Type resolve to continue: ",
|
|
19820
|
-
|
|
20191
|
+
resolve2
|
|
19821
20192
|
)
|
|
19822
20193
|
);
|
|
19823
20194
|
readline.close();
|
|
19824
20195
|
return answer.trim().toLowerCase() === "resolve";
|
|
19825
20196
|
}
|
|
19826
|
-
var x402PaymentsCommand = new
|
|
20197
|
+
var x402PaymentsCommand = new Command109("payments").description(
|
|
19827
20198
|
"Inspect and reconcile X402 Pay payment records"
|
|
19828
20199
|
);
|
|
19829
20200
|
x402PaymentsCommand.command("list").description("List current payment records").addOption(new Option5("--state <state>", "Filter by state").choices(PAYMENT_STATES)).action(async (options) => {
|
|
@@ -19852,7 +20223,7 @@ x402PaymentsCommand.command("resolve").description("Manually record an externall
|
|
|
19852
20223
|
|
|
19853
20224
|
// src/commands/x402/policy.ts
|
|
19854
20225
|
import { promises as fs11 } from "fs";
|
|
19855
|
-
import { Command as
|
|
20226
|
+
import { Command as Command110 } from "commander";
|
|
19856
20227
|
import { createInterface as createInterface6 } from "readline";
|
|
19857
20228
|
async function confirmUnattendedRule(rule) {
|
|
19858
20229
|
if (!process.stdin.isTTY) {
|
|
@@ -19873,12 +20244,12 @@ async function confirmUnattendedRule(rule) {
|
|
|
19873
20244
|
);
|
|
19874
20245
|
const readline = createInterface6({ input: process.stdin, output: process.stderr });
|
|
19875
20246
|
const answer = await new Promise(
|
|
19876
|
-
(
|
|
20247
|
+
(resolve2) => readline.question("Type authorize to grant unattended spending: ", resolve2)
|
|
19877
20248
|
);
|
|
19878
20249
|
readline.close();
|
|
19879
20250
|
return answer.trim().toLowerCase() === "authorize";
|
|
19880
20251
|
}
|
|
19881
|
-
var x402PolicyCommand = new
|
|
20252
|
+
var x402PolicyCommand = new Command110("policy").description(
|
|
19882
20253
|
"Manage local X402 Pay spending policy"
|
|
19883
20254
|
);
|
|
19884
20255
|
x402PolicyCommand.command("init").description("Create a deny-all policy file").action(async () => {
|
|
@@ -19914,14 +20285,14 @@ for (const enabled of [true, false]) {
|
|
|
19914
20285
|
}
|
|
19915
20286
|
|
|
19916
20287
|
// src/commands/x402/request.ts
|
|
19917
|
-
import { Command as
|
|
20288
|
+
import { Command as Command111, Option as Option6 } from "commander";
|
|
19918
20289
|
function collect4(value, previous) {
|
|
19919
20290
|
return [...previous, value];
|
|
19920
20291
|
}
|
|
19921
20292
|
function confirm(lines) {
|
|
19922
20293
|
return confirmAtTerminal(lines, "use --non-interactive with policy");
|
|
19923
20294
|
}
|
|
19924
|
-
var x402RequestCommand = new
|
|
20295
|
+
var x402RequestCommand = new Command111("request").description("Request and pay for a direct x402 HTTP resource (X402 Pay)").argument("<url>", "HTTPS resource URL").addOption(new Option6("--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(
|
|
19925
20296
|
"--header-env <header=ENV_VAR>",
|
|
19926
20297
|
"Read one request header from an environment variable (repeatable)",
|
|
19927
20298
|
collect4,
|
|
@@ -19969,7 +20340,7 @@ var x402RequestCommand = new Command109("request").description("Request and pay
|
|
|
19969
20340
|
);
|
|
19970
20341
|
|
|
19971
20342
|
// src/commands/x402/index.ts
|
|
19972
|
-
var x402Command = new
|
|
20343
|
+
var x402Command = new Command112("x402").description(
|
|
19973
20344
|
"Pay x402 services with local spending policies (X402 Pay)"
|
|
19974
20345
|
);
|
|
19975
20346
|
x402Command.addCommand(x402RequestCommand);
|
|
@@ -19977,10 +20348,10 @@ x402Command.addCommand(x402PolicyCommand);
|
|
|
19977
20348
|
x402Command.addCommand(x402PaymentsCommand);
|
|
19978
20349
|
|
|
19979
20350
|
// src/commands/sponsored-task/index.ts
|
|
19980
|
-
import { Command as
|
|
20351
|
+
import { Command as Command128 } from "commander";
|
|
19981
20352
|
|
|
19982
20353
|
// src/commands/sponsored-task/create.ts
|
|
19983
|
-
import { Command as
|
|
20354
|
+
import { Command as Command113 } from "commander";
|
|
19984
20355
|
import { toHex as toHex4 } from "viem";
|
|
19985
20356
|
|
|
19986
20357
|
// ../../packages/contracts/evm/abi/generated/SponsoredTasksVaultV2.ts
|
|
@@ -24391,7 +24762,7 @@ async function createOnSolana(opts, keystore) {
|
|
|
24391
24762
|
renderFailure(err);
|
|
24392
24763
|
}
|
|
24393
24764
|
}
|
|
24394
|
-
var sponsoredTaskCreateCommand = new
|
|
24765
|
+
var sponsoredTaskCreateCommand = new Command113("create").description("Create a new Sponsored Task vault for a project token").option(
|
|
24395
24766
|
"--factory <address>",
|
|
24396
24767
|
"SponsoredTaskFactory contract address (EVM chains; defaults to the chain's newest factory, or the settler-mode factory on Robinhood Chain)"
|
|
24397
24768
|
).requiredOption(
|
|
@@ -24514,7 +24885,7 @@ Token risk: ${TOKEN_RISK}`
|
|
|
24514
24885
|
);
|
|
24515
24886
|
|
|
24516
24887
|
// src/commands/sponsored-task/fund.ts
|
|
24517
|
-
import { Command as
|
|
24888
|
+
import { Command as Command114 } from "commander";
|
|
24518
24889
|
function isValidAddress5(addr) {
|
|
24519
24890
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
24520
24891
|
}
|
|
@@ -24548,7 +24919,7 @@ async function fundOnSolana(opts, keystore) {
|
|
|
24548
24919
|
renderFailure(err);
|
|
24549
24920
|
}
|
|
24550
24921
|
}
|
|
24551
|
-
var sponsoredTaskFundCommand = new
|
|
24922
|
+
var sponsoredTaskFundCommand = new Command114("fund").description("Fund a Sponsored Task vault with its project token (base units)").requiredOption("--vault <address>", "Vault address (base58 for a Solana vault)").option(
|
|
24552
24923
|
"--token <address>",
|
|
24553
24924
|
"Project ERC-20 token address (EVM chains; Solana reads the vault's mint)"
|
|
24554
24925
|
).requiredOption(
|
|
@@ -24622,7 +24993,7 @@ var sponsoredTaskFundCommand = new Command112("fund").description("Fund a Sponso
|
|
|
24622
24993
|
});
|
|
24623
24994
|
|
|
24624
24995
|
// src/commands/sponsored-task/managers.ts
|
|
24625
|
-
import { Command as
|
|
24996
|
+
import { Command as Command115 } from "commander";
|
|
24626
24997
|
|
|
24627
24998
|
// src/lib/solana-payout-binding.ts
|
|
24628
24999
|
var PROGRAM_ID_ENV = "TASKMARKET_SOLANA_SPONSORED_TASKS_PROGRAM_ID";
|
|
@@ -24956,7 +25327,7 @@ async function configure(opts) {
|
|
|
24956
25327
|
active: opts.active
|
|
24957
25328
|
});
|
|
24958
25329
|
}
|
|
24959
|
-
var sponsoredTaskManagersCommand = new
|
|
25330
|
+
var sponsoredTaskManagersCommand = new Command115("managers").description(
|
|
24960
25331
|
"Manage authorized managers for a Sponsored Task vault"
|
|
24961
25332
|
);
|
|
24962
25333
|
sponsoredTaskManagersCommand.command("add").description("Authorize a manager with a token-denominated spend cap").requiredOption("--vault <address>", "Vault address (base58 for a Solana vault)").requiredOption(
|
|
@@ -24983,8 +25354,8 @@ sponsoredTaskManagersCommand.command("list").description("List a vault authorize
|
|
|
24983
25354
|
});
|
|
24984
25355
|
|
|
24985
25356
|
// src/commands/sponsored-task/managed.ts
|
|
24986
|
-
import { Command as
|
|
24987
|
-
var sponsoredTaskManagedCommand = new
|
|
25357
|
+
import { Command as Command116 } from "commander";
|
|
25358
|
+
var sponsoredTaskManagedCommand = new Command116("managed").description(
|
|
24988
25359
|
"List the active Sponsored Task vaults an address can fund tasks from as an active manager (defaults to your wallet)"
|
|
24989
25360
|
).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) => {
|
|
24990
25361
|
let address3 = opts.address;
|
|
@@ -25014,8 +25385,8 @@ var sponsoredTaskManagedCommand = new Command114("managed").description(
|
|
|
25014
25385
|
});
|
|
25015
25386
|
|
|
25016
25387
|
// src/commands/sponsored-task/creation-fee.ts
|
|
25017
|
-
import { Command as
|
|
25018
|
-
var sponsoredTaskCreationFeeCommand = new
|
|
25388
|
+
import { Command as Command117 } from "commander";
|
|
25389
|
+
var sponsoredTaskCreationFeeCommand = new Command117("creation-fee").description("Show the one-time fee for creating a Sponsored Task vault on a chain").requiredOption(
|
|
25019
25390
|
"--chain-id <chain>",
|
|
25020
25391
|
"EVM chain the vault would be created on: a network name or chain id (e.g. base, 8453)",
|
|
25021
25392
|
chainOption("--chain-id", "evm-vault")
|
|
@@ -25059,8 +25430,8 @@ var sponsoredTaskCreationFeeCommand = new Command115("creation-fee").description
|
|
|
25059
25430
|
});
|
|
25060
25431
|
|
|
25061
25432
|
// src/commands/sponsored-task/list.ts
|
|
25062
|
-
import { Command as
|
|
25063
|
-
var sponsoredTaskListCommand = new
|
|
25433
|
+
import { Command as Command118 } from "commander";
|
|
25434
|
+
var sponsoredTaskListCommand = new Command118("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).option("--owner <address>", "Only vaults this address owns, whatever their curation status").option("--mine", "Only the vaults your wallet owns", false).action(
|
|
25064
25435
|
async (opts) => {
|
|
25065
25436
|
if (opts.owner && opts.mine) {
|
|
25066
25437
|
printError("Pass --owner or --mine, not both");
|
|
@@ -25089,8 +25460,8 @@ var sponsoredTaskListCommand = new Command116("list").description("List Sponsore
|
|
|
25089
25460
|
);
|
|
25090
25461
|
|
|
25091
25462
|
// src/commands/sponsored-task/settlements.ts
|
|
25092
|
-
import { Command as
|
|
25093
|
-
var sponsoredTaskSettlementsCommand = new
|
|
25463
|
+
import { Command as Command119 } from "commander";
|
|
25464
|
+
var sponsoredTaskSettlementsCommand = new Command119("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) => {
|
|
25094
25465
|
const limit = Number(opts.limit);
|
|
25095
25466
|
if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
|
|
25096
25467
|
printError("--limit must be an integer from 1 to 100");
|
|
@@ -25105,17 +25476,17 @@ var sponsoredTaskSettlementsCommand = new Command117("settlements").description(
|
|
|
25105
25476
|
});
|
|
25106
25477
|
|
|
25107
25478
|
// src/commands/sponsored-task/show.ts
|
|
25108
|
-
import { Command as
|
|
25109
|
-
var sponsoredTaskShowCommand = new
|
|
25479
|
+
import { Command as Command120 } from "commander";
|
|
25480
|
+
var sponsoredTaskShowCommand = new Command120("show").description("Show a Sponsored Task vault by id").argument("<vaultId>", "Vault id").action(async (vaultId) => {
|
|
25110
25481
|
const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}`);
|
|
25111
25482
|
printResult(result);
|
|
25112
25483
|
});
|
|
25113
25484
|
|
|
25114
25485
|
// src/commands/sponsored-task/request-review.ts
|
|
25115
25486
|
import { randomBytes as randomBytes6 } from "crypto";
|
|
25116
|
-
import { Command as
|
|
25487
|
+
import { Command as Command121 } from "commander";
|
|
25117
25488
|
var REQUEST_TTL_SECONDS = 5 * 60;
|
|
25118
|
-
var sponsoredTaskRequestReviewCommand = new
|
|
25489
|
+
var sponsoredTaskRequestReviewCommand = new Command121("request-review").description("Ask Taskmarket curators to review a Sponsored Task vault (vault owner only)").argument("<vaultId>", "Vault id").action(async (vaultId) => {
|
|
25119
25490
|
let keystore;
|
|
25120
25491
|
try {
|
|
25121
25492
|
keystore = await loadKeystore();
|
|
@@ -25172,18 +25543,18 @@ var sponsoredTaskRequestReviewCommand = new Command119("request-review").descrip
|
|
|
25172
25543
|
});
|
|
25173
25544
|
|
|
25174
25545
|
// src/commands/sponsored-task/balance.ts
|
|
25175
|
-
import { Command as
|
|
25176
|
-
var sponsoredTaskBalanceCommand = new
|
|
25546
|
+
import { Command as Command122 } from "commander";
|
|
25547
|
+
var sponsoredTaskBalanceCommand = new Command122("balance").description("Show a Sponsored Task vault funded/available/reserved balances").argument("<vaultId>", "Vault id").action(async (vaultId) => {
|
|
25177
25548
|
const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}/balance`);
|
|
25178
25549
|
printResult(result);
|
|
25179
25550
|
});
|
|
25180
25551
|
|
|
25181
25552
|
// src/commands/sponsored-task/withdraw.ts
|
|
25182
|
-
import { Command as
|
|
25553
|
+
import { Command as Command123 } from "commander";
|
|
25183
25554
|
function isValidAddress7(addr) {
|
|
25184
25555
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
25185
25556
|
}
|
|
25186
|
-
var sponsoredTaskWithdrawCommand = new
|
|
25557
|
+
var sponsoredTaskWithdrawCommand = new Command123("withdraw").description("Withdraw unreserved project tokens from a vault (owner only)").requiredOption("--vault <address>", "Vault address").requiredOption(
|
|
25187
25558
|
"--chain-id <chain>",
|
|
25188
25559
|
"EVM chain the vault is deployed on: a network name or chain id (e.g. base, robinhood, 8453)",
|
|
25189
25560
|
chainOption("--chain-id", "evm-vault")
|
|
@@ -25219,11 +25590,11 @@ var sponsoredTaskWithdrawCommand = new Command121("withdraw").description("Withd
|
|
|
25219
25590
|
});
|
|
25220
25591
|
|
|
25221
25592
|
// src/commands/sponsored-task/exit.ts
|
|
25222
|
-
import { Command as
|
|
25593
|
+
import { Command as Command124 } from "commander";
|
|
25223
25594
|
function isValidAddress8(addr) {
|
|
25224
25595
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
25225
25596
|
}
|
|
25226
|
-
var sponsoredTaskExitCommand = new
|
|
25597
|
+
var sponsoredTaskExitCommand = new Command124("exit").description(
|
|
25227
25598
|
"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."
|
|
25228
25599
|
).requiredOption("--vault <address>", "Vault address (base58 for a Solana vault)").requiredOption(
|
|
25229
25600
|
"--chain-id <chain>",
|
|
@@ -25299,7 +25670,7 @@ var sponsoredTaskExitCommand = new Command122("exit").description(
|
|
|
25299
25670
|
});
|
|
25300
25671
|
|
|
25301
25672
|
// src/commands/sponsored-task/claim.ts
|
|
25302
|
-
import { Command as
|
|
25673
|
+
import { Command as Command125 } from "commander";
|
|
25303
25674
|
var CLAIM_TO_TYPES = {
|
|
25304
25675
|
ClaimTo: [
|
|
25305
25676
|
{ name: "vaultId", type: "bytes32" },
|
|
@@ -25364,7 +25735,7 @@ async function findEntitlement(vaultId, workerAddress, taskId, options = {}) {
|
|
|
25364
25735
|
await sleep4(3e3);
|
|
25365
25736
|
}
|
|
25366
25737
|
}
|
|
25367
|
-
var sponsoredTaskClaimCommand = new
|
|
25738
|
+
var sponsoredTaskClaimCommand = new Command125("claim").description("Claim your unclaimed Sponsored Task reward for a vault task").argument("<vaultId>", "Vault id").option(
|
|
25368
25739
|
"--task-id <id>",
|
|
25369
25740
|
"Claim the entitlement for a specific task (defaults to the first unclaimed one)"
|
|
25370
25741
|
).action(async (vaultId, opts) => {
|
|
@@ -25480,10 +25851,10 @@ var sponsoredTaskClaimCommand = new Command123("claim").description("Claim your
|
|
|
25480
25851
|
});
|
|
25481
25852
|
|
|
25482
25853
|
// src/commands/sponsored-task/rewards.ts
|
|
25483
|
-
import { Command as
|
|
25854
|
+
import { Command as Command126 } from "commander";
|
|
25484
25855
|
var REWARD_STATES = SponsoredTaskRewardStateSchema.options;
|
|
25485
25856
|
var CLAIM_STATUSES = SponsoredTaskWorkerRewardClaimStatusSchema.options;
|
|
25486
|
-
var sponsoredTaskRewardsCommand = new
|
|
25857
|
+
var sponsoredTaskRewardsCommand = new Command126("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(
|
|
25487
25858
|
async (opts) => {
|
|
25488
25859
|
let address3 = opts.address;
|
|
25489
25860
|
if (address3 === void 0) {
|
|
@@ -25523,7 +25894,7 @@ var sponsoredTaskRewardsCommand = new Command124("rewards").description("List Sp
|
|
|
25523
25894
|
);
|
|
25524
25895
|
|
|
25525
25896
|
// src/commands/sponsored-task/bind-payout.ts
|
|
25526
|
-
import { Command as
|
|
25897
|
+
import { Command as Command127 } from "commander";
|
|
25527
25898
|
async function solanaRewards(agent) {
|
|
25528
25899
|
try {
|
|
25529
25900
|
const result = await apiGet(
|
|
@@ -25534,7 +25905,7 @@ async function solanaRewards(agent) {
|
|
|
25534
25905
|
return [];
|
|
25535
25906
|
}
|
|
25536
25907
|
}
|
|
25537
|
-
var sponsoredTaskBindPayoutCommand = new
|
|
25908
|
+
var sponsoredTaskBindPayoutCommand = new Command127("bind-payout").description(
|
|
25538
25909
|
"Bind the Solana address that receives your Solana Sponsored Task awards (once; rebinding replaces it)"
|
|
25539
25910
|
).option(
|
|
25540
25911
|
"--address <solana-address>",
|
|
@@ -25673,7 +26044,7 @@ function bindingTaskChainIds(requested, connection, everyChain) {
|
|
|
25673
26044
|
}
|
|
25674
26045
|
|
|
25675
26046
|
// src/commands/sponsored-task/index.ts
|
|
25676
|
-
var sponsoredTaskCommand = new
|
|
26047
|
+
var sponsoredTaskCommand = new Command128("sponsored-task").description(
|
|
25677
26048
|
"Sponsored Task vault administration and reward claims"
|
|
25678
26049
|
);
|
|
25679
26050
|
sponsoredTaskCommand.addCommand(sponsoredTaskCreateCommand);
|
|
@@ -25693,10 +26064,10 @@ sponsoredTaskCommand.addCommand(sponsoredTaskRewardsCommand);
|
|
|
25693
26064
|
sponsoredTaskCommand.addCommand(sponsoredTaskBindPayoutCommand);
|
|
25694
26065
|
|
|
25695
26066
|
// src/commands/project/index.ts
|
|
25696
|
-
import { Command as
|
|
26067
|
+
import { Command as Command150 } from "commander";
|
|
25697
26068
|
|
|
25698
26069
|
// src/commands/project/accept.ts
|
|
25699
|
-
import { Command as
|
|
26070
|
+
import { Command as Command129 } from "commander";
|
|
25700
26071
|
|
|
25701
26072
|
// src/commands/project/shared.ts
|
|
25702
26073
|
var ADDRESS = /^0x[0-9a-fA-F]{40}$/;
|
|
@@ -25821,7 +26192,7 @@ async function postProjectWrite(path9, body, options) {
|
|
|
25821
26192
|
|
|
25822
26193
|
// src/commands/project/accept.ts
|
|
25823
26194
|
var TERMS_HASH = /^0x[0-9a-fA-F]{64}$/;
|
|
25824
|
-
var projectAcceptCommand = new
|
|
26195
|
+
var projectAcceptCommand = new Command129("accept").description(
|
|
25825
26196
|
"Accept a grant on a project as its operator, which freezes the terms. The accept is refused if the owner changes the terms before it lands. The accept carries the `termsHash` of your grant, read from `project show`; pass --terms-hash to pin the hash you reviewed instead, so it is refused if the terms changed since (costs 0.001 in the payment token)"
|
|
25826
26197
|
).argument("<projectId>", "Project id").option(
|
|
25827
26198
|
"--terms-hash <hash>",
|
|
@@ -25853,7 +26224,7 @@ var projectAcceptCommand = new Command127("accept").description(
|
|
|
25853
26224
|
});
|
|
25854
26225
|
|
|
25855
26226
|
// src/commands/project/add-task.ts
|
|
25856
|
-
import { Command as
|
|
26227
|
+
import { Command as Command130 } from "commander";
|
|
25857
26228
|
function deadlineCheck(durationHours, project, now = /* @__PURE__ */ new Date()) {
|
|
25858
26229
|
if (!project?.endsAt || !Number.isFinite(durationHours)) return null;
|
|
25859
26230
|
const endsAt = new Date(project.endsAt);
|
|
@@ -25915,7 +26286,7 @@ function parseContinuation(flags) {
|
|
|
25915
26286
|
function collect5(value, previous = []) {
|
|
25916
26287
|
return [...previous, value];
|
|
25917
26288
|
}
|
|
25918
|
-
var projectAddTaskCommand = new
|
|
26289
|
+
var projectAddTaskCommand = new Command130("add-task").description(
|
|
25919
26290
|
"Create a task of any mode funded from a project's budget, as its owner or an operator with an accepted grant. Takes every flag of task create; the reward and any evaluator stake come out of the budget (costs 0.001 in the payment token)"
|
|
25920
26291
|
).argument("<projectId>", "Project id");
|
|
25921
26292
|
for (const option of createCmd.options) {
|
|
@@ -25967,7 +26338,7 @@ projectAddTaskCommand.action(async (id, opts) => {
|
|
|
25967
26338
|
});
|
|
25968
26339
|
|
|
25969
26340
|
// src/commands/project/automations.ts
|
|
25970
|
-
import { Command as
|
|
26341
|
+
import { Command as Command131 } from "commander";
|
|
25971
26342
|
function automationsOnBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
25972
26343
|
if (opts.cap === void 0) {
|
|
25973
26344
|
return { error: "--cap is required: the most the automations may draw from the budget" };
|
|
@@ -25996,7 +26367,7 @@ function automationsOnBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
|
25996
26367
|
}
|
|
25997
26368
|
return body;
|
|
25998
26369
|
}
|
|
25999
|
-
var projectAutomationsOnCommand = new
|
|
26370
|
+
var projectAutomationsOnCommand = new Command131("on").description(
|
|
26000
26371
|
"Turn the project's automations on, so its schedules and workflows run. Grants the platform runner of the project's chain, which you never name, with a cap: the most the automations may draw from the budget in total, net of refunds (payouts keep counting). The cap is required. On a project whose automations are on, a higher cap raises it and a lower one is refused; turning them on again after off, or raising the cap, needs a chain on contract revision 29 and is refused before payment otherwise. Optional limits (contract revision 29): --expires, and --period-budget with --period; on states them whole, so none stated clears an expiry and a period budget. Schedules paused by off stay paused: resume each one (costs 0.001 in the payment token)"
|
|
26001
26372
|
).argument("<projectId>", "Project id").option(
|
|
26002
26373
|
"--cap <amount>",
|
|
@@ -26024,7 +26395,7 @@ var projectAutomationsOnCommand = new Command129("on").description(
|
|
|
26024
26395
|
});
|
|
26025
26396
|
}
|
|
26026
26397
|
);
|
|
26027
|
-
var projectAutomationsOffCommand = new
|
|
26398
|
+
var projectAutomationsOffCommand = new Command131("off").description(
|
|
26028
26399
|
"Turn the project's automations off: revokes the platform runner's grant and pauses the project's schedules and workflow schedules (reason automations_off). Their definitions stay, tasks already started finish under you, and turning automations on again does not resume them (costs 0.001 in the payment token)"
|
|
26029
26400
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
26030
26401
|
const projectId = parseProjectId(id);
|
|
@@ -26035,7 +26406,7 @@ var projectAutomationsOffCommand = new Command129("off").description(
|
|
|
26035
26406
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26036
26407
|
);
|
|
26037
26408
|
});
|
|
26038
|
-
var projectAutomationsStatusCommand = new
|
|
26409
|
+
var projectAutomationsStatusCommand = new Command131("status").description(
|
|
26039
26410
|
"Whether the project's schedules and workflows can run: state on, off, pending (granted, the runner has not accepted yet) or unavailable (no runner on the chain), with the cap, what is spent and what remains, and whether it can be turned on again or its cap raised (free)"
|
|
26040
26411
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
26041
26412
|
const projectId = parseProjectId(id);
|
|
@@ -26046,13 +26417,13 @@ var projectAutomationsStatusCommand = new Command129("status").description(
|
|
|
26046
26417
|
renderFailure(err);
|
|
26047
26418
|
}
|
|
26048
26419
|
});
|
|
26049
|
-
var projectAutomationsCommand = new
|
|
26420
|
+
var projectAutomationsCommand = new Command131("automations").description(
|
|
26050
26421
|
"The project's automations: one switch for its schedules and workflows. `on --cap <amount>` grants the platform runner of the project chain for you, `off` revokes it and pauses schedules, `status` reads it. `project runner` and `project grant` remain for advanced use"
|
|
26051
26422
|
).addCommand(projectAutomationsOnCommand).addCommand(projectAutomationsOffCommand).addCommand(projectAutomationsStatusCommand);
|
|
26052
26423
|
|
|
26053
26424
|
// src/commands/project/claim.ts
|
|
26054
|
-
import { Command as
|
|
26055
|
-
var projectClaimCommand = new
|
|
26425
|
+
import { Command as Command132 } from "commander";
|
|
26426
|
+
var projectClaimCommand = new Command132("claim").description(
|
|
26056
26427
|
"Pay a backer its share of a closed or ended project's leftovers: what was unspent plus every later refund, in proportion to its pool shares, less what it already claimed. Anyone may trigger it; the money always goes to the backer. Refused before payment when nothing is owed (costs 0.001 in the payment token)"
|
|
26057
26428
|
).argument("<projectId>", "Project id").option("--backer <address>", "The backer to pay (default: your wallet)").action(async (id, opts) => {
|
|
26058
26429
|
const projectId = parseProjectId(id);
|
|
@@ -26072,8 +26443,8 @@ var projectClaimCommand = new Command130("claim").description(
|
|
|
26072
26443
|
});
|
|
26073
26444
|
|
|
26074
26445
|
// src/commands/project/close.ts
|
|
26075
|
-
import { Command as
|
|
26076
|
-
var projectCloseCommand = new
|
|
26446
|
+
import { Command as Command133 } from "commander";
|
|
26447
|
+
var projectCloseCommand = new Command133("close").description(
|
|
26077
26448
|
"Close a project: its unspent budget becomes the backers' pot, which each backer, the owner included, claims with `project claim`. The owner may close it any time, anyone once it is past its end date; tasks already funded run on and their refunds join the pot (costs 0.001 in the payment token)"
|
|
26078
26449
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
26079
26450
|
const projectId = parseProjectId(id);
|
|
@@ -26086,13 +26457,13 @@ var projectCloseCommand = new Command131("close").description(
|
|
|
26086
26457
|
});
|
|
26087
26458
|
|
|
26088
26459
|
// src/commands/project/create.ts
|
|
26089
|
-
import { Command as
|
|
26460
|
+
import { Command as Command136 } from "commander";
|
|
26090
26461
|
|
|
26091
26462
|
// src/commands/project/suggestions.ts
|
|
26092
|
-
import { Command as
|
|
26463
|
+
import { Command as Command135 } from "commander";
|
|
26093
26464
|
|
|
26094
26465
|
// src/commands/project/suggestion-proposals.ts
|
|
26095
|
-
import { Command as
|
|
26466
|
+
import { Command as Command134 } from "commander";
|
|
26096
26467
|
var QUERY_ERRORS = {
|
|
26097
26468
|
status: "--status must be pending, closed or expired",
|
|
26098
26469
|
limit: "--limit must be an integer from 1 to 50",
|
|
@@ -26143,7 +26514,7 @@ async function read(path9) {
|
|
|
26143
26514
|
function collectSuggestion(value, previous) {
|
|
26144
26515
|
return [...previous, value];
|
|
26145
26516
|
}
|
|
26146
|
-
var projectSuggestionProposalsCommand = new
|
|
26517
|
+
var projectSuggestionProposalsCommand = new Command134("proposals").description(
|
|
26147
26518
|
"List a project's suggestion proposals, newest first: what each run of its suggestions schedule picked in propose mode, with the ranking it was picked by and each pick's rank, reward, mode and status. A pick the owner drops is not proposed again by that schedule. The reads are public; signed with your wallet when there is one, so a pick whose suggestion staff hid shows only to the project's owner and its author. A pending proposal waits for the owner to confirm or drop its picks, and expires at the schedule's next slot or after 72 hours (free)"
|
|
26148
26519
|
).argument("<projectId>", "Project id").option(
|
|
26149
26520
|
"--status <status>",
|
|
@@ -26158,7 +26529,7 @@ var projectSuggestionProposalsCommand = new Command132("proposals").description(
|
|
|
26158
26529
|
if (typeof query4 !== "string") return void printError(query4.error);
|
|
26159
26530
|
await read(`/api/projects/${projectId}/suggestion-proposals${query4 ? `?${query4}` : ""}`);
|
|
26160
26531
|
});
|
|
26161
|
-
var proposalShowCommand = new
|
|
26532
|
+
var proposalShowCommand = new Command134("show").description(
|
|
26162
26533
|
"Show a suggestion proposal with its picks: each suggestion, its rank and score, the reward and mode its task will carry, and its status (pending, confirmed, created with its taskId, dropped, expired or failed with the reason). Public; signed with your wallet when there is one, so a hidden pick shows only to the project's owner and its author (free)"
|
|
26163
26534
|
).argument("<proposalId>", "Proposal id").action(async (value) => {
|
|
26164
26535
|
const id = parseProposalId(value);
|
|
@@ -26166,7 +26537,7 @@ var proposalShowCommand = new Command132("show").description(
|
|
|
26166
26537
|
await read(`/api/suggestion-proposals/${id}`);
|
|
26167
26538
|
});
|
|
26168
26539
|
function decisionCommand(action, description) {
|
|
26169
|
-
return new
|
|
26540
|
+
return new Command134(action).description(description).argument("<proposalId>", "Proposal id").option(
|
|
26170
26541
|
"--suggestion <suggestionId>",
|
|
26171
26542
|
`Only this pick; repeat it for each (default: every pending pick)`,
|
|
26172
26543
|
collectSuggestion,
|
|
@@ -26183,7 +26554,7 @@ function decisionCommand(action, description) {
|
|
|
26183
26554
|
);
|
|
26184
26555
|
});
|
|
26185
26556
|
}
|
|
26186
|
-
var projectSuggestionProposalCommand = new
|
|
26557
|
+
var projectSuggestionProposalCommand = new Command134("proposal").description(
|
|
26187
26558
|
"One suggestion proposal, as the project's owner: show it, confirm its picks so the platform runner creates their tasks, or drop them"
|
|
26188
26559
|
).addCommand(proposalShowCommand).addCommand(
|
|
26189
26560
|
decisionCommand(
|
|
@@ -26297,7 +26668,7 @@ async function signedRead(path9) {
|
|
|
26297
26668
|
renderFailure(err);
|
|
26298
26669
|
}
|
|
26299
26670
|
}
|
|
26300
|
-
var projectSuggestCommand = new
|
|
26671
|
+
var projectSuggestCommand = new Command135("suggest").description(
|
|
26301
26672
|
"Post a suggestion on an open project: an idea for work its budget could pay for, as a wallet the project's suggestions setting admits (backers: the owner, its operators and backers; anyone: any wallet). Posting costs 0.001 in the payment token. The owner or an operator turns it into a task with `project add-task --suggestion <id>`, and anyone it admits may upvote it for free"
|
|
26302
26673
|
).argument("<projectId>", "Project id").option("--title <text>", "Required: one line, 1 to 120 characters").option(
|
|
26303
26674
|
"--brief <text>",
|
|
@@ -26317,7 +26688,7 @@ var projectSuggestCommand = new Command133("suggest").description(
|
|
|
26317
26688
|
maxAmount: ACTION_FEE_MAX_AMOUNT
|
|
26318
26689
|
});
|
|
26319
26690
|
});
|
|
26320
|
-
var projectSuggestionsCommand = new
|
|
26691
|
+
var projectSuggestionsCommand = new Command135("suggestions").description(
|
|
26321
26692
|
"List a project's suggestions with its suggestions settings, most upvoted first or, with --sort backed, most pool shares among the voters who back the project first. Each carries votes, backedShares and, when your wallet signs the read, whether you voted (free)"
|
|
26322
26693
|
).argument("<projectId>", "Project id").option(
|
|
26323
26694
|
"--status <status>",
|
|
@@ -26335,7 +26706,7 @@ var projectSuggestionsCommand = new Command133("suggestions").description(
|
|
|
26335
26706
|
if (typeof query4 !== "string") return void printError(query4.error);
|
|
26336
26707
|
await signedRead(`/api/projects/${projectId}/suggestions${query4 ? `?${query4}` : ""}`);
|
|
26337
26708
|
});
|
|
26338
|
-
var showCommand3 = new
|
|
26709
|
+
var showCommand3 = new Command135("show").description("Show a suggestion with its status, votes and backedShares (free)").argument("<suggestionId>", "Suggestion id").action(async (value) => {
|
|
26339
26710
|
const id = parseSuggestionId(value);
|
|
26340
26711
|
if (typeof id !== "string") return void printError(id.error);
|
|
26341
26712
|
await signedRead(`/api/project-suggestions/${id}`);
|
|
@@ -26349,7 +26720,7 @@ async function readAuthFor(what) {
|
|
|
26349
26720
|
return { headers: auth.headers };
|
|
26350
26721
|
}
|
|
26351
26722
|
function voteCommand(action, description) {
|
|
26352
|
-
return new
|
|
26723
|
+
return new Command135(action).description(description).argument("<suggestionId>", "Suggestion id").action(async (value) => {
|
|
26353
26724
|
const suggestionId = parseSuggestionId(value);
|
|
26354
26725
|
if (typeof suggestionId !== "string") return void printError(suggestionId.error);
|
|
26355
26726
|
const auth = await readAuthFor(action === "vote" ? "Voting" : "Taking back a vote");
|
|
@@ -26372,7 +26743,7 @@ function voteCommand(action, description) {
|
|
|
26372
26743
|
}
|
|
26373
26744
|
});
|
|
26374
26745
|
}
|
|
26375
|
-
var reportCommand = new
|
|
26746
|
+
var reportCommand = new Command135("report").description(
|
|
26376
26747
|
"Report a suggestion to Taskmarket staff, as any wallet but its author (free, signed by your wallet). Staff may hide it from the project's lists; one open report per wallet per suggestion, so a repeat returns the open one"
|
|
26377
26748
|
).argument("<suggestionId>", "Suggestion id").requiredOption("--reason <reason>", `Why: ${PROJECT_SUGGESTION_REPORT_REASONS.join(", ")}`).option("--note <text>", "What staff should know: up to 500 characters, read only by staff").action(async (value, opts) => {
|
|
26378
26749
|
const suggestionId = parseSuggestionId(value);
|
|
@@ -26411,7 +26782,7 @@ var reportCommand = new Command133("report").description(
|
|
|
26411
26782
|
renderFailure(err);
|
|
26412
26783
|
}
|
|
26413
26784
|
});
|
|
26414
|
-
var withdrawCommand2 = new
|
|
26785
|
+
var withdrawCommand2 = new Command135("withdraw").description("Withdraw your open suggestion, as its author (costs 0.001 in the payment token)").argument("<suggestionId>", "Suggestion id").action(async (value) => {
|
|
26415
26786
|
const suggestionId = parseSuggestionId(value);
|
|
26416
26787
|
if (typeof suggestionId !== "string") return void printError(suggestionId.error);
|
|
26417
26788
|
await postProjectWrite(
|
|
@@ -26420,7 +26791,7 @@ var withdrawCommand2 = new Command133("withdraw").description("Withdraw your ope
|
|
|
26420
26791
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26421
26792
|
);
|
|
26422
26793
|
});
|
|
26423
|
-
var declineCommand = new
|
|
26794
|
+
var declineCommand = new Command135("decline").description(
|
|
26424
26795
|
"Decline an open suggestion, as the project's owner or an operator with an accepted grant; the reason is shown to everyone. Declining costs 0.001 in the payment token. To accept one instead, create its task with `project add-task <projectId> --suggestion <id>`, which pays the task's reward and any evaluator stake from the budget, plus the 0.001 action fee"
|
|
26425
26796
|
).argument("<suggestionId>", "Suggestion id").option("--reason <text>", "Why, shown to everyone: up to 500 characters").action(async (value, opts) => {
|
|
26426
26797
|
const suggestionId = parseSuggestionId(value);
|
|
@@ -26435,7 +26806,7 @@ var declineCommand = new Command133("decline").description(
|
|
|
26435
26806
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26436
26807
|
);
|
|
26437
26808
|
});
|
|
26438
|
-
var projectSuggestionCommand = new
|
|
26809
|
+
var projectSuggestionCommand = new Command135("suggestion").description(
|
|
26439
26810
|
"One project suggestion: show it, upvote it or take the upvote back, report it to staff (each free, signed by your wallet), withdraw it as its author, or decline it as the owner or an operator. `proposals` and `proposal` read and act on what the project's suggestions schedule proposes"
|
|
26440
26811
|
).addCommand(showCommand3).addCommand(
|
|
26441
26812
|
voteCommand(
|
|
@@ -26445,7 +26816,7 @@ var projectSuggestionCommand = new Command133("suggestion").description(
|
|
|
26445
26816
|
).addCommand(
|
|
26446
26817
|
voteCommand("unvote", "Take back your upvote on a suggestion (free, signed by your wallet)")
|
|
26447
26818
|
).addCommand(reportCommand).addCommand(withdrawCommand2).addCommand(declineCommand).addCommand(projectSuggestionProposalsCommand).addCommand(projectSuggestionProposalCommand);
|
|
26448
|
-
var projectSuggestionSettingsCommand = new
|
|
26819
|
+
var projectSuggestionSettingsCommand = new Command135("suggestion-settings").description(
|
|
26449
26820
|
"Read or set the project's suggestions settings, as its owner: who may post and upvote suggestions (off, backers or anyone), the least a wallet must have contributed to count as a backer for them (1 in the payment token by default), and whether hosted agents that operate the project accept and decline suggestions by themselves (on by default). Turning hosted operators off keeps their grants. Setting costs 0.001 in the payment token; reading is free"
|
|
26450
26821
|
).argument("<projectId>", "Project id").option(
|
|
26451
26822
|
"--suggestions <setting>",
|
|
@@ -26480,7 +26851,7 @@ var projectSuggestionSettingsCommand = new Command133("suggestion-settings").des
|
|
|
26480
26851
|
});
|
|
26481
26852
|
|
|
26482
26853
|
// src/commands/project/create.ts
|
|
26483
|
-
var projectCreateCommand = new
|
|
26854
|
+
var projectCreateCommand = new Command136("create").description(
|
|
26484
26855
|
"Open a project: one budget that funds tasks of any mode (costs the budget, in the payment token)"
|
|
26485
26856
|
).requiredOption("--budget <amount>", "Opening budget in the payment token (e.g. 50)").requiredOption(
|
|
26486
26857
|
"--ends-at <time>",
|
|
@@ -26529,9 +26900,9 @@ var projectCreateCommand = new Command134("create").description(
|
|
|
26529
26900
|
);
|
|
26530
26901
|
|
|
26531
26902
|
// src/commands/project/extend.ts
|
|
26532
|
-
import { Command as
|
|
26903
|
+
import { Command as Command137 } from "commander";
|
|
26533
26904
|
var MAX_EXTENSION_MS = 365 * 24 * 3600 * 1e3;
|
|
26534
|
-
var projectExtendCommand = new
|
|
26905
|
+
var projectExtendCommand = new Command137("extend").description(
|
|
26535
26906
|
"Move an open project's end date later, as the project owner (costs 0.001 in the payment token). The new date must be later than the current one and at most 365 days from now. A closed project, or one past its end date, cannot be extended. Backers' shares and the pool's value do not change; a backer whose pot is still open claims at the new date"
|
|
26536
26907
|
).argument("<projectId>", "Project id").requiredOption("--ends <time>", "The new end date: ISO 8601 or a duration from now such as 90d").action(async (id, opts) => {
|
|
26537
26908
|
const projectId = parseProjectId(id);
|
|
@@ -26549,8 +26920,8 @@ var projectExtendCommand = new Command135("extend").description(
|
|
|
26549
26920
|
});
|
|
26550
26921
|
|
|
26551
26922
|
// src/commands/project/fund.ts
|
|
26552
|
-
import { Command as
|
|
26553
|
-
var projectFundCommand = new
|
|
26923
|
+
import { Command as Command138 } from "commander";
|
|
26924
|
+
var projectFundCommand = new Command138("fund").description(
|
|
26554
26925
|
"Back an open project: pay into its funding pool, from any wallet. You (or --on-behalf-of) become a backer holding shares bought at the pool's current value (what it holds plus what its live tasks hold), and once the project is closed or past its end date each backer claims its share of what is left with `project claim` (costs the amount, in the payment token)"
|
|
26555
26926
|
).argument("<projectId>", "Project id").requiredOption("--amount <amount>", "Amount in the payment token (e.g. 10)").option(
|
|
26556
26927
|
"--on-behalf-of <address>",
|
|
@@ -26572,7 +26943,7 @@ var projectFundCommand = new Command136("fund").description(
|
|
|
26572
26943
|
});
|
|
26573
26944
|
|
|
26574
26945
|
// src/commands/project/grant.ts
|
|
26575
|
-
import { Command as
|
|
26946
|
+
import { Command as Command139 } from "commander";
|
|
26576
26947
|
function grantBody(projectId, opts) {
|
|
26577
26948
|
if (!ADDRESS.test(opts.operator)) {
|
|
26578
26949
|
return { error: "--operator must be a wallet address (0x + 40 hex chars)" };
|
|
@@ -26595,7 +26966,7 @@ function grantBody(projectId, opts) {
|
|
|
26595
26966
|
revokeRemovesControl: opts.revokeRemovesControl
|
|
26596
26967
|
};
|
|
26597
26968
|
}
|
|
26598
|
-
var projectGrantCommand = new
|
|
26969
|
+
var projectGrantCommand = new Command139("grant").description(
|
|
26599
26970
|
"Grant a wallet (an agent or a person) the right to create tasks from the project's budget under the terms below. It can spend only after it accepts, which freezes the terms; until then a new grant replaces them, and a revoked operator can be granted again, back to pending (costs 0.001 in the payment token)"
|
|
26600
26971
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The wallet granted the right to spend the budget").option(
|
|
26601
26972
|
"--cap <amount>",
|
|
@@ -26621,7 +26992,7 @@ var projectGrantCommand = new Command137("grant").description(
|
|
|
26621
26992
|
});
|
|
26622
26993
|
|
|
26623
26994
|
// src/commands/project/review.ts
|
|
26624
|
-
import { Command as
|
|
26995
|
+
import { Command as Command140 } from "commander";
|
|
26625
26996
|
function reviewEvaluator(opts) {
|
|
26626
26997
|
if (opts.evaluator !== void 0 && opts.off) {
|
|
26627
26998
|
return { error: "Pass --evaluator <address> or --off, not both" };
|
|
@@ -26636,7 +27007,7 @@ function reviewEvaluator(opts) {
|
|
|
26636
27007
|
}
|
|
26637
27008
|
return opts.evaluator;
|
|
26638
27009
|
}
|
|
26639
|
-
var projectReviewCommand = new
|
|
27010
|
+
var projectReviewCommand = new Command140("review").description(
|
|
26640
27011
|
"Read, set or clear the project's review default, as its owner. With an evaluator set, every task created through the API from the project gets that evaluator, and a project task that names a different one is refused. Enforced by the API, not the contract. Setting or clearing costs 0.001 in the payment token; reading is free"
|
|
26641
27012
|
).argument("<projectId>", "Project id").option("--evaluator <address>", "The evaluator every project task gets").option("--off", "Turn the review default off: each task's requester reviews it again").action(async (id, opts) => {
|
|
26642
27013
|
const projectId = parseProjectId(id);
|
|
@@ -26678,8 +27049,8 @@ async function ownerEvaluatorWarnings(evaluator) {
|
|
|
26678
27049
|
}
|
|
26679
27050
|
|
|
26680
27051
|
// src/commands/project/raise-cap.ts
|
|
26681
|
-
import { Command as
|
|
26682
|
-
var projectRaiseCapCommand = new
|
|
27052
|
+
import { Command as Command141 } from "commander";
|
|
27053
|
+
var projectRaiseCapCommand = new Command141("raise-cap").description(
|
|
26683
27054
|
"Advanced. Raise any operator's spending cap in place, as the project owner (costs 0.001 in the payment token). For the platform runner use `project automations on --cap <higher amount>`, which takes the same path. The new cap must be above the current one, which must be set; a cap is never lowered, and a revoked operator is granted again instead"
|
|
26684
27055
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose cap to raise").requiredOption("--cap <amount>", "The new cap in the payment token, above the current cap").action(async (id, opts) => {
|
|
26685
27056
|
const projectId = parseProjectId(id);
|
|
@@ -26697,8 +27068,8 @@ var projectRaiseCapCommand = new Command139("raise-cap").description(
|
|
|
26697
27068
|
});
|
|
26698
27069
|
|
|
26699
27070
|
// src/commands/project/lower-cap.ts
|
|
26700
|
-
import { Command as
|
|
26701
|
-
var projectLowerCapCommand = new
|
|
27071
|
+
import { Command as Command142 } from "commander";
|
|
27072
|
+
var projectLowerCapCommand = new Command142("lower-cap").description(
|
|
26702
27073
|
"Advanced. Lower an operator's lifetime spending cap in place, as the project owner (costs 0.001 in the payment token; contract revision 29 or later). The new cap must be below the current one (any cap lowers a grant that has none) and at least what the operator already draws (committed). To raise a cap use `project raise-cap`; for the platform runner, `project automations on --cap`"
|
|
26703
27074
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose cap to lower").requiredOption(
|
|
26704
27075
|
"--cap <amount>",
|
|
@@ -26720,7 +27091,7 @@ var projectLowerCapCommand = new Command140("lower-cap").description(
|
|
|
26720
27091
|
});
|
|
26721
27092
|
|
|
26722
27093
|
// src/commands/project/limits.ts
|
|
26723
|
-
import { Command as
|
|
27094
|
+
import { Command as Command143 } from "commander";
|
|
26724
27095
|
function limitsBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
26725
27096
|
if (!ADDRESS.test(opts.operator)) {
|
|
26726
27097
|
return { error: "--operator must be a wallet address (0x + 40 hex chars)" };
|
|
@@ -26760,7 +27131,7 @@ function limitsBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
|
26760
27131
|
}
|
|
26761
27132
|
return body;
|
|
26762
27133
|
}
|
|
26763
|
-
var projectLimitsCommand = new
|
|
27134
|
+
var projectLimitsCommand = new Command143("limits").description(
|
|
26764
27135
|
"Advanced. Set all of an operator's limits as the project owner, stated whole: a flag you leave out is no limit of that kind (costs 0.001 in the payment token; contract revision 29 or later). The limits bound the operator on top of its cap: an expiry, the task modes it may create, the most one task may hold, and a budget per week or month. For the platform runner, `project automations on` takes --expires, --period-budget and --period"
|
|
26765
27136
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose limits to set").option(
|
|
26766
27137
|
"--expires <time>",
|
|
@@ -26782,8 +27153,8 @@ var projectLimitsCommand = new Command141("limits").description(
|
|
|
26782
27153
|
});
|
|
26783
27154
|
|
|
26784
27155
|
// src/commands/project/revoke.ts
|
|
26785
|
-
import { Command as
|
|
26786
|
-
var projectRevokeCommand = new
|
|
27156
|
+
import { Command as Command144 } from "commander";
|
|
27157
|
+
var projectRevokeCommand = new Command144("revoke").description(
|
|
26787
27158
|
"End an operator's right to create tasks from the project, as its owner (costs 0.001 in the payment token)"
|
|
26788
27159
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator to revoke").action(async (id, opts) => {
|
|
26789
27160
|
const projectId = parseProjectId(id);
|
|
@@ -26802,7 +27173,7 @@ var projectRevokeCommand = new Command142("revoke").description(
|
|
|
26802
27173
|
});
|
|
26803
27174
|
|
|
26804
27175
|
// src/commands/project/schedule.ts
|
|
26805
|
-
import { Command as
|
|
27176
|
+
import { Command as Command147 } from "commander";
|
|
26806
27177
|
|
|
26807
27178
|
// src/lib/owner-list.ts
|
|
26808
27179
|
import { getAddress as getAddress2, isAddress as isAddress5 } from "viem";
|
|
@@ -26842,7 +27213,7 @@ function ownerListQuery(owner, opts, statuses) {
|
|
|
26842
27213
|
}
|
|
26843
27214
|
|
|
26844
27215
|
// src/commands/project/suggestion-schedule.ts
|
|
26845
|
-
import { Command as
|
|
27216
|
+
import { Command as Command145 } from "commander";
|
|
26846
27217
|
var SUGGESTION_ONLY_FLAGS = [
|
|
26847
27218
|
["--rank", "rank"],
|
|
26848
27219
|
["--min-backed-share", "minBackedShare"],
|
|
@@ -27033,7 +27404,7 @@ function addSuggestionScheduleOptions(command) {
|
|
|
27033
27404
|
).option("--no-email-picks", "Suggestions schedules: do not email when picks are waiting");
|
|
27034
27405
|
}
|
|
27035
27406
|
var suggestionScheduleSettingsCommand = addSuggestionScheduleOptions(
|
|
27036
|
-
new
|
|
27407
|
+
new Command145("suggestion-settings").description(
|
|
27037
27408
|
"Change a suggestions schedule's settings, as the project's owner: any of its mode, ranking, thresholds, limits, stale-suggestion declines, default task mode, the picks-waiting email and the task template. Only the settings you pass change; a template flag changes only its own fields of the stored template, which the CLI reads first. A pending proposal is unchanged. Read the settings with `taskmarket project schedule show`. Costs 0.001 in the payment token"
|
|
27038
27409
|
).argument("<scheduleId>", "Schedule id").option(
|
|
27039
27410
|
"--mode <mode>",
|
|
@@ -27067,7 +27438,7 @@ var suggestionScheduleSettingsCommand = addSuggestionScheduleOptions(
|
|
|
27067
27438
|
|
|
27068
27439
|
// src/commands/workflow-template.ts
|
|
27069
27440
|
import { readFile as readFile4 } from "fs/promises";
|
|
27070
|
-
import { Command as
|
|
27441
|
+
import { Command as Command146 } from "commander";
|
|
27071
27442
|
var UUID3 = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
27072
27443
|
var ADDRESS2 = /^0x[0-9a-fA-F]{40}$/;
|
|
27073
27444
|
var FILE_MAX_BYTES = 256 * 1024;
|
|
@@ -27161,7 +27532,7 @@ async function readValidTemplate(path9) {
|
|
|
27161
27532
|
}
|
|
27162
27533
|
return parsed.document;
|
|
27163
27534
|
}
|
|
27164
|
-
var createCommand3 = new
|
|
27535
|
+
var createCommand3 = new Command146("create").description(
|
|
27165
27536
|
"Save a workflow template from a JSON file: a workflow document whose strings use {{param}} placeholders, with each parameter declared (type string, integer, amount or list; a default; bounds). It is checked with every parameter at its minimum and its maximum before it is saved. Costs 0.001 in the payment token"
|
|
27166
27537
|
).requiredOption("--file <path>", "The template, JSON").action(async (opts) => {
|
|
27167
27538
|
const template = await readValidTemplate(opts.file);
|
|
@@ -27172,7 +27543,7 @@ var createCommand3 = new Command144("create").description(
|
|
|
27172
27543
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27173
27544
|
);
|
|
27174
27545
|
});
|
|
27175
|
-
var updateCommand = new
|
|
27546
|
+
var updateCommand = new Command146("update").description(
|
|
27176
27547
|
"Replace a saved template with a JSON file, as the wallet that saved it. A change to its content makes a new version; workflows already made from it keep their document until their owner runs `taskmarket workflow update-template`. Costs 0.001 in the payment token"
|
|
27177
27548
|
).argument("<templateId>", "Template id").requiredOption("--file <path>", "The template, JSON").action(async (value, opts) => {
|
|
27178
27549
|
const choice = templateChoice(value);
|
|
@@ -27226,7 +27597,7 @@ function parseTemplateSearch(opts) {
|
|
|
27226
27597
|
}
|
|
27227
27598
|
return { query: query4 };
|
|
27228
27599
|
}
|
|
27229
|
-
var listCommand6 = new
|
|
27600
|
+
var listCommand6 = new Command146("list").description(
|
|
27230
27601
|
"List the official templates (official: true, ids official:<slug>), the built-in presets and a wallet's saved templates, newest first (your wallet unless --owner is given). Any wallet may make a workflow from any of them (free). With --search, --tag, --featured or --sort, search instead: one page of templates, featured first, with `hasMore`, `nextCursor` and the catalog's most used tags in `catalogTags`; each template lists its `tags` and `featured`"
|
|
27231
27602
|
).option("--owner <address>", "The wallet whose templates to list").option(
|
|
27232
27603
|
"--mine",
|
|
@@ -27311,7 +27682,7 @@ var listCommand6 = new Command144("list").description(
|
|
|
27311
27682
|
}
|
|
27312
27683
|
}
|
|
27313
27684
|
);
|
|
27314
|
-
var showCommand4 = new
|
|
27685
|
+
var showCommand4 = new Command146("show").description(
|
|
27315
27686
|
"Show a saved template, an official template (official:<slug>) or a preset (code, content, research): its version (a counter for a saved template, a content hash for an official one), the earlier versions of a saved template as `versions` (number, hash, date), whether it is `listed` in the gallery, its parameters, steps and worst case (free)"
|
|
27316
27687
|
).argument("<template>", "Template id, official template id or preset name").action(async (value) => {
|
|
27317
27688
|
const choice = templateChoice(value);
|
|
@@ -27334,7 +27705,7 @@ function savedTemplateId(value, verb) {
|
|
|
27334
27705
|
}
|
|
27335
27706
|
return choice.templateId;
|
|
27336
27707
|
}
|
|
27337
|
-
var publishCommand = new
|
|
27708
|
+
var publishCommand = new Command146("publish").description(
|
|
27338
27709
|
"List a saved template in the public gallery, as the wallet that saved it, so others can find it with `template list --gallery` (and on the web Templates page) without being given its id; it is shown with your wallet as its author. It needs a description and at most 10 templates per wallet can be listed. Listing again changes nothing. Costs 0.001 in the payment token"
|
|
27339
27710
|
).argument("<templateId>", "Saved template id").action(async (value) => {
|
|
27340
27711
|
const id = savedTemplateId(value, "publish");
|
|
@@ -27345,7 +27716,7 @@ var publishCommand = new Command144("publish").description(
|
|
|
27345
27716
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27346
27717
|
);
|
|
27347
27718
|
});
|
|
27348
|
-
var unpublishCommand = new
|
|
27719
|
+
var unpublishCommand = new Command146("unpublish").description(
|
|
27349
27720
|
"Take a saved template out of the public gallery, as the wallet that saved it. It stays usable by anyone who has its id. Costs 0.001 in the payment token"
|
|
27350
27721
|
).argument("<templateId>", "Saved template id").action(async (value) => {
|
|
27351
27722
|
const id = savedTemplateId(value, "unpublish");
|
|
@@ -27356,7 +27727,7 @@ var unpublishCommand = new Command144("unpublish").description(
|
|
|
27356
27727
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27357
27728
|
);
|
|
27358
27729
|
});
|
|
27359
|
-
var deleteCommand2 = new
|
|
27730
|
+
var deleteCommand2 = new Command146("delete").description(
|
|
27360
27731
|
"Delete a saved template, as the wallet that saved it; workflows already made from it are unaffected. Costs 0.001 in the payment token"
|
|
27361
27732
|
).argument("<templateId>", "Template id").action(async (value) => {
|
|
27362
27733
|
const choice = templateChoice(value);
|
|
@@ -27373,7 +27744,7 @@ var deleteCommand2 = new Command144("delete").description(
|
|
|
27373
27744
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27374
27745
|
);
|
|
27375
27746
|
});
|
|
27376
|
-
var workflowTemplateCommand = new
|
|
27747
|
+
var workflowTemplateCommand = new Command146("template").description(
|
|
27377
27748
|
"Workflow templates: a workflow saved once with declared parameters ({{reward}}, {{topic}}) and made into a workflow on any of your projects with `taskmarket workflow create <projectId> --template <id|official:slug|preset> --param name=value`. Any wallet may use any template; only the wallet that saved one may update or delete it. Official templates: see `taskmarket workflow template list`. Presets: code, content, research"
|
|
27378
27749
|
).addCommand(createCommand3).addCommand(updateCommand).addCommand(listCommand6).addCommand(showCommand4).addCommand(publishCommand).addCommand(unpublishCommand).addCommand(deleteCommand2);
|
|
27379
27750
|
async function createWorkflowFromTemplate(projectId, template, pairs) {
|
|
@@ -27573,7 +27944,7 @@ async function read2(path9) {
|
|
|
27573
27944
|
}
|
|
27574
27945
|
}
|
|
27575
27946
|
var createCommand4 = addSuggestionScheduleOptions(
|
|
27576
|
-
new
|
|
27947
|
+
new Command147("create").description(
|
|
27577
27948
|
"Create a schedule that opens a task from the project's budget on a cadence, starts a run of a workflow (--workflow or --workflow-file), or turns the top open suggestions into tasks (--suggestions), as the project's owner. The platform runner creates each task or run under your grant to it, and pays the action fee: grant it first (see `taskmarket project runner`). A slot is skipped while the previous task is open or the previous run is not settled, and failures in a row (3 by default) pause the schedule. A suggestions schedule proposes its picks for you to confirm (`taskmarket project suggestion proposals`) unless --mode auto; it needs --max-spend, --max-reward and --duration. Costs 0.001 in the payment token"
|
|
27578
27949
|
).argument("<projectId>", "Project id").requiredOption(
|
|
27579
27950
|
"--cadence <cadence>",
|
|
@@ -27622,7 +27993,7 @@ var createCommand4 = addSuggestionScheduleOptions(
|
|
|
27622
27993
|
});
|
|
27623
27994
|
});
|
|
27624
27995
|
var OWNER_SCHEDULE_STATUSES = [...STATUSES, "needs_action", "all"];
|
|
27625
|
-
var listCommand7 = new
|
|
27996
|
+
var listCommand7 = new Command147("list").description(
|
|
27626
27997
|
"List a project's schedules, its schedule limits and the platform runner; or, with --mine or --owner, a wallet's schedules across every project it owns, failing ones first, each with its next and last run (free)"
|
|
27627
27998
|
).argument("[projectId]", "Project id (omit with --mine or --owner)").option("--mine", "List the acting wallet's schedules across the projects it owns").option("--owner <address>", "List this wallet's schedules across the projects it owns").option(
|
|
27628
27999
|
"--status <status>",
|
|
@@ -27655,7 +28026,7 @@ var listCommand7 = new Command145("list").description(
|
|
|
27655
28026
|
const query4 = params.toString();
|
|
27656
28027
|
await read2(withChainId(`/api/projects/${projectId}/schedules${query4 ? `?${query4}` : ""}`));
|
|
27657
28028
|
});
|
|
27658
|
-
var showCommand5 = new
|
|
28029
|
+
var showCommand5 = new Command147("show").description(
|
|
27659
28030
|
"Show a schedule (its target, task, workflow or suggestions, with workflowId, template or its suggestions settings) and its newest runs: opened, proposed, skipped with the reason, or failed, each with its task, workflowRunId, proposalId or taskIds (free)"
|
|
27660
28031
|
).argument("<scheduleId>", "Schedule id").action(async (value) => {
|
|
27661
28032
|
const id = parseScheduleId(value);
|
|
@@ -27663,7 +28034,7 @@ var showCommand5 = new Command145("show").description(
|
|
|
27663
28034
|
await read2(`/api/project-schedules/${id}`);
|
|
27664
28035
|
});
|
|
27665
28036
|
function actionCommand(action, description) {
|
|
27666
|
-
return new
|
|
28037
|
+
return new Command147(action).description(description).argument("<scheduleId>", "Schedule id").action(async (value) => {
|
|
27667
28038
|
const id = parseScheduleId(value);
|
|
27668
28039
|
if (typeof id !== "string") return void printError(id.error);
|
|
27669
28040
|
await postProjectWrite(
|
|
@@ -27673,7 +28044,7 @@ function actionCommand(action, description) {
|
|
|
27673
28044
|
);
|
|
27674
28045
|
});
|
|
27675
28046
|
}
|
|
27676
|
-
var settingsCommand = new
|
|
28047
|
+
var settingsCommand = new Command147("settings").description(
|
|
27677
28048
|
"Read or set the project's schedule limits, as its owner: the shortest gap between two runs (PT30M to P7D, default PT30M) and the failures in a row that pause a schedule (1 to 10, default 3). Setting costs 0.001 in the payment token; reading is free"
|
|
27678
28049
|
).argument("<projectId>", "Project id").option("--min-interval <duration>", "The shortest gap between runs, as an ISO 8601 duration").option("--pause-after <failures>", "Failures in a row that pause a schedule").action(async (id, opts) => {
|
|
27679
28050
|
const projectId = parseProjectId(id);
|
|
@@ -27695,7 +28066,7 @@ var settingsCommand = new Command145("settings").description(
|
|
|
27695
28066
|
maxAmount: ACTION_FEE_MAX_AMOUNT
|
|
27696
28067
|
});
|
|
27697
28068
|
});
|
|
27698
|
-
var projectScheduleCommand = new
|
|
28069
|
+
var projectScheduleCommand = new Command147("schedule").description(
|
|
27699
28070
|
"Schedules: a task from the project's budget on a cadence, a workflow run, or tasks from the top suggestions, created by the platform runner once the project's automations are on (`taskmarket project automations on <projectId> --cap <amount>`)"
|
|
27700
28071
|
).addCommand(createCommand4).addCommand(listCommand7).addCommand(showCommand5).addCommand(
|
|
27701
28072
|
actionCommand(
|
|
@@ -27718,15 +28089,15 @@ var projectScheduleCommand = new Command145("schedule").description(
|
|
|
27718
28089
|
"Stop automatic payouts and review acceptance on a workflow schedule, for good: every run it starts, and its runs still going, wait for the owner's confirmation; the runner sends nothing. Refused on a schedule that opens tasks (costs 0.001 in the payment token)"
|
|
27719
28090
|
)
|
|
27720
28091
|
).addCommand(settingsCommand).addCommand(suggestionScheduleSettingsCommand);
|
|
27721
|
-
var projectRunnerCommand = new
|
|
28092
|
+
var projectRunnerCommand = new Command147("runner").description(
|
|
27722
28093
|
"Advanced. The platform runner's address on the selected network's chain, and every chain's runner (free). To run schedules and workflows turn automations on instead, `taskmarket project automations on <projectId> --cap <amount>`, which grants the right runner for you. Granting it by hand with `taskmarket project grant` works too; the runner pays each action fee"
|
|
27723
28094
|
).action(async () => {
|
|
27724
28095
|
await read2(withChainId("/api/project-runner"));
|
|
27725
28096
|
});
|
|
27726
28097
|
|
|
27727
28098
|
// src/commands/project/transfer.ts
|
|
27728
|
-
import { Command as
|
|
27729
|
-
var proposeCommand = new
|
|
28099
|
+
import { Command as Command148 } from "commander";
|
|
28100
|
+
var proposeCommand = new Command148("propose").description(
|
|
27730
28101
|
"Propose a new owner for a project, as the project owner (costs 0.001 in the payment token). Nothing changes until that wallet runs `project transfer accept`; a new proposal replaces the old one, and `project transfer cancel` withdraws it. Only an open project can be handed over. On accept, the owner's own share of the project's pool moves to the new owner; other backers' shares never move, and the grants stay"
|
|
27731
28102
|
).argument("<projectId>", "Project id").requiredOption("--to <address>", "The wallet that will own the project once it accepts").action(async (id, opts) => {
|
|
27732
28103
|
const projectId = parseProjectId(id);
|
|
@@ -27740,7 +28111,7 @@ var proposeCommand = new Command146("propose").description(
|
|
|
27740
28111
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27741
28112
|
);
|
|
27742
28113
|
});
|
|
27743
|
-
var acceptCommand2 = new
|
|
28114
|
+
var acceptCommand2 = new Command148("accept").description(
|
|
27744
28115
|
"Take over a project its owner proposed to this wallet (costs 0.001 in the payment token). Read the project first (`project show`): you receive it as it stands, with its grants and tasks, and the previous owner's share of its pool. Only an open project can be accepted"
|
|
27745
28116
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
27746
28117
|
const projectId = parseProjectId(id);
|
|
@@ -27751,7 +28122,7 @@ var acceptCommand2 = new Command146("accept").description(
|
|
|
27751
28122
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27752
28123
|
);
|
|
27753
28124
|
});
|
|
27754
|
-
var cancelCommand = new
|
|
28125
|
+
var cancelCommand = new Command148("cancel").description(
|
|
27755
28126
|
"Withdraw the pending ownership proposal, as the project owner (costs 0.001 in the payment token)"
|
|
27756
28127
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
27757
28128
|
const projectId = parseProjectId(id);
|
|
@@ -27762,13 +28133,13 @@ var cancelCommand = new Command146("cancel").description(
|
|
|
27762
28133
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27763
28134
|
);
|
|
27764
28135
|
});
|
|
27765
|
-
var projectTransferCommand = new
|
|
28136
|
+
var projectTransferCommand = new Command148("transfer").description(
|
|
27766
28137
|
"Hand a project to another wallet in two steps: the owner proposes, the new owner accepts, and the owner can cancel before it does"
|
|
27767
28138
|
).addCommand(proposeCommand).addCommand(acceptCommand2).addCommand(cancelCommand);
|
|
27768
28139
|
|
|
27769
28140
|
// src/commands/project/show.ts
|
|
27770
|
-
import { Command as
|
|
27771
|
-
var projectShowCommand = new
|
|
28141
|
+
import { Command as Command149 } from "commander";
|
|
28142
|
+
var projectShowCommand = new Command149("show").description(
|
|
27772
28143
|
"Show a project: its budget, funding pool, newest backers with what each can claim, grants, tasks and its tasks grouped into chains of versions (free)"
|
|
27773
28144
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
27774
28145
|
const projectId = parseProjectId(id);
|
|
@@ -27777,7 +28148,7 @@ var projectShowCommand = new Command147("show").description(
|
|
|
27777
28148
|
printResult(await apiGet(withChainId(`/api/projects/${projectId}`), { headers }));
|
|
27778
28149
|
});
|
|
27779
28150
|
var BACKERS_CURSOR = /^\d{1,20}-\d{1,9}$/;
|
|
27780
|
-
var projectBackersCommand = new
|
|
28151
|
+
var projectBackersCommand = new Command149("backers").description(
|
|
27781
28152
|
"List a project's backers, newest first, with each one's contribution, shares, claims and claimable share (free)"
|
|
27782
28153
|
).argument("<projectId>", "Project id").option("--limit <count>", "Backers per page (1-100, default 50)").option("--before <cursor>", "The next page: the previous page's nextBefore").action(async (id, opts) => {
|
|
27783
28154
|
const projectId = parseProjectId(id);
|
|
@@ -27796,13 +28167,13 @@ var projectBackersCommand = new Command147("backers").description(
|
|
|
27796
28167
|
await apiGet(withChainId(`/api/projects/${projectId}/backers${query4 ? `?${query4}` : ""}`))
|
|
27797
28168
|
);
|
|
27798
28169
|
});
|
|
27799
|
-
var projectForTaskCommand = new
|
|
28170
|
+
var projectForTaskCommand = new Command149("for-task").description("The project a task was funded from, or null when it was not (free)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
27800
28171
|
if (!/^0x[0-9a-fA-F]{1,78}$/.test(taskId.trim())) {
|
|
27801
28172
|
return void printError("The task id must be 0x-prefixed hex");
|
|
27802
28173
|
}
|
|
27803
28174
|
printResult(await apiGet(`/api/projects/by-task/${encodeURIComponent(taskId.trim())}`));
|
|
27804
28175
|
});
|
|
27805
|
-
var projectListCommand = new
|
|
28176
|
+
var projectListCommand = new Command149("list").description(
|
|
27806
28177
|
"List a wallet's projects, as owner, operator or backer, or with --funding the projects open for backing now (free; default: your wallet)"
|
|
27807
28178
|
).option(
|
|
27808
28179
|
"--funding",
|
|
@@ -27853,7 +28224,7 @@ var projectListCommand = new Command147("list").description(
|
|
|
27853
28224
|
);
|
|
27854
28225
|
|
|
27855
28226
|
// src/commands/project/index.ts
|
|
27856
|
-
var projectCommand = new
|
|
28227
|
+
var projectCommand = new Command150("project").description(
|
|
27857
28228
|
"Projects: one crowdfunded budget that funds tasks of any mode, spent by its owner and the operators it grants; anyone may back an open project, and backers claim back what is left"
|
|
27858
28229
|
);
|
|
27859
28230
|
projectCommand.addCommand(projectCreateCommand);
|
|
@@ -27884,7 +28255,7 @@ projectCommand.addCommand(projectForTaskCommand);
|
|
|
27884
28255
|
|
|
27885
28256
|
// src/commands/workflow.ts
|
|
27886
28257
|
import { readFile as readFile5 } from "fs/promises";
|
|
27887
|
-
import { Command as
|
|
28258
|
+
import { Command as Command151 } from "commander";
|
|
27888
28259
|
var UUID4 = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
27889
28260
|
var FILE_MAX_BYTES2 = 256 * 1024;
|
|
27890
28261
|
function parseWorkflowText(text) {
|
|
@@ -27948,7 +28319,7 @@ async function projectContext(projectId) {
|
|
|
27948
28319
|
runner
|
|
27949
28320
|
};
|
|
27950
28321
|
}
|
|
27951
|
-
var validateCommand = new
|
|
28322
|
+
var validateCommand = new Command151("validate").description(
|
|
27952
28323
|
"Check a workflow document (JSON) before anything is spent: the patterns, ids, named inputs and outputs, bounds (maxItems, maxRounds, maxAttempts), contest modes, branch conditions and gate conditions; with --project, also the project step limit and the worst-case spend (every branch on its costliest case, every fallback attempt) against the project's available budget and the runner grant's remaining cap. Every error names a JSON pointer, a code and a message (free)"
|
|
27953
28324
|
).argument("[file]", "The document, JSON (or pass --file)").option("--file <path>", "The document, JSON").option("--project <projectId>", "Check it against this project").action(async (file, opts) => {
|
|
27954
28325
|
const parsed = await readDocument(opts.file ?? file);
|
|
@@ -27991,7 +28362,7 @@ var validateCommand = new Command149("validate").description(
|
|
|
27991
28362
|
document: result.document
|
|
27992
28363
|
});
|
|
27993
28364
|
});
|
|
27994
|
-
var createCommand5 = new
|
|
28365
|
+
var createCommand5 = new Command151("create").description(
|
|
27995
28366
|
"Create a workflow on a project, as its owner, from a JSON document (--file) or from a saved template, an official template or a preset (--template <id|official:slug|preset> with --param name=value for each value; a parameter left out takes its default). The API validates it again, worst case included, before saving; nothing runs until `taskmarket workflow run`. Grant the platform runner first (`taskmarket project runner`). Costs 0.001 in the payment token"
|
|
27996
28367
|
).argument("<projectId>", "Project id").option("--file <path>", "The document, JSON").option(
|
|
27997
28368
|
"--template <template>",
|
|
@@ -28034,7 +28405,7 @@ var createCommand5 = new Command149("create").description(
|
|
|
28034
28405
|
);
|
|
28035
28406
|
});
|
|
28036
28407
|
var OWNER_WORKFLOW_STATUSES = ["needs_action", "running", "failed", "idle", "all"];
|
|
28037
|
-
var listCommand8 = new
|
|
28408
|
+
var listCommand8 = new Command151("list").description(
|
|
28038
28409
|
"List a project's workflows, newest first, with its workflow limits and the platform runner; or, with --mine or --owner, a wallet's workflows across every project it owns, those waiting on the owner first (free)"
|
|
28039
28410
|
).argument("[projectId]", "Project id (omit with --mine or --owner)").option("--mine", "List the acting wallet's workflows across the projects it owns").option("--owner <address>", "List this wallet's workflows across the projects it owns").option(
|
|
28040
28411
|
"--status <status>",
|
|
@@ -28064,7 +28435,7 @@ var listCommand8 = new Command149("list").description(
|
|
|
28064
28435
|
const query4 = params.toString();
|
|
28065
28436
|
await read3(withChainId(`/api/projects/${projectId}/workflows${query4 ? `?${query4}` : ""}`));
|
|
28066
28437
|
});
|
|
28067
|
-
var showCommand6 = new
|
|
28438
|
+
var showCommand6 = new Command151("show").description(
|
|
28068
28439
|
"Show a workflow, its validated document, its newest runs and, for one made from a template, `workflow.templateUpdate` (the version it has, the template's latest and `available`); when an update is available a `note` says how to apply it (free)"
|
|
28069
28440
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
28070
28441
|
const id = uuid(value, "workflow");
|
|
@@ -28077,7 +28448,7 @@ var showCommand6 = new Command149("show").description(
|
|
|
28077
28448
|
renderFailure(err);
|
|
28078
28449
|
}
|
|
28079
28450
|
});
|
|
28080
|
-
var updateTemplateCommand = new
|
|
28451
|
+
var updateTemplateCommand = new Command151("update-template").description(
|
|
28081
28452
|
"Apply the newest version of the template a workflow was made from, as the project owner: the document is made again from the template with the workflow's own parameter values and checked against the project, like a new workflow. It never happens on its own; `workflow show` says when an update is available. Runs already started keep the version they started with. Costs 0.001 in the payment token"
|
|
28082
28453
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
28083
28454
|
const id = uuid(value, "workflow");
|
|
@@ -28088,7 +28459,29 @@ var updateTemplateCommand = new Command149("update-template").description(
|
|
|
28088
28459
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28089
28460
|
);
|
|
28090
28461
|
});
|
|
28091
|
-
var
|
|
28462
|
+
var updateStepsCommand = new Command151("update-steps").description(
|
|
28463
|
+
"Replace a saved workflow's steps with a new JSON document (--file), as the project owner. The API checks it against the project as it checks a new workflow (step limit, worst case against the budget). Runs already started keep the steps they started with; the new steps apply to runs started afterwards. A workflow made from a template becomes hand-written, so update-template no longer applies to it. Get the current document with `workflow show`. Costs 0.001 in the payment token"
|
|
28464
|
+
).argument("<workflowId>", "Workflow id").option("--file <path>", "The new document, JSON").action(async (value, opts) => {
|
|
28465
|
+
const id = uuid(value, "workflow");
|
|
28466
|
+
if (typeof id !== "string") return void printError(id.error);
|
|
28467
|
+
const parsed = await readDocument(opts.file);
|
|
28468
|
+
if ("error" in parsed) return void printError(parsed.error);
|
|
28469
|
+
const result = validateWorkflowDocument(parsed.document, {
|
|
28470
|
+
stepLimit: WORKFLOW_STEP_LIMIT_MAX
|
|
28471
|
+
});
|
|
28472
|
+
if (!result.valid) {
|
|
28473
|
+
return void renderFailure(
|
|
28474
|
+
new Error(`The workflow document is invalid (${result.errors.length} errors)`),
|
|
28475
|
+
{ details: { errors: result.errors } }
|
|
28476
|
+
);
|
|
28477
|
+
}
|
|
28478
|
+
await postProjectWrite(
|
|
28479
|
+
`/api/project-workflows/${id}/update-steps`,
|
|
28480
|
+
{ workflowId: id, document: parsed.document },
|
|
28481
|
+
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28482
|
+
);
|
|
28483
|
+
});
|
|
28484
|
+
var runsCommand = new Command151("runs").description("Page through a workflow's runs, newest first (free)").argument("<workflowId>", "Workflow id").option("--limit <count>", "Runs per page (1-100, default 20)").option("--cursor <cursor>", "nextCursor from the previous page").action(async (value, opts) => {
|
|
28092
28485
|
const id = uuid(value, "workflow");
|
|
28093
28486
|
if (typeof id !== "string") return void printError(id.error);
|
|
28094
28487
|
if (opts.limit !== void 0 && !/^(100|[1-9][0-9]?)$/.test(opts.limit.trim())) {
|
|
@@ -28100,14 +28493,14 @@ var runsCommand = new Command149("runs").description("Page through a workflow's
|
|
|
28100
28493
|
const query4 = params.toString();
|
|
28101
28494
|
await read3(`/api/project-workflows/${id}/runs${query4 ? `?${query4}` : ""}`);
|
|
28102
28495
|
});
|
|
28103
|
-
var statusCommand3 = new
|
|
28496
|
+
var statusCommand3 = new Command151("status").description(
|
|
28104
28497
|
"Show a run: its outline, each step with its state (pending, open, accepted, failed or skipped), round, item or attempt, autoAccept for a gating review the runner accepts itself, and the next action (free)"
|
|
28105
28498
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
28106
28499
|
const id = uuid(value, "run");
|
|
28107
28500
|
if (typeof id !== "string") return void printError(id.error);
|
|
28108
28501
|
await read3(`/api/project-workflow-runs/${id}`);
|
|
28109
28502
|
});
|
|
28110
|
-
var runCommand2 = new
|
|
28503
|
+
var runCommand2 = new Command151("run").description(
|
|
28111
28504
|
"Start a run of a workflow, as the project's owner. The API checks the worst case against the budget and the runner grant's cap again; then the platform runner creates each step's task when it is ready and you review them as usual. Costs 0.001 in the payment token"
|
|
28112
28505
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
28113
28506
|
const id = uuid(value, "workflow");
|
|
@@ -28119,7 +28512,7 @@ var runCommand2 = new Command149("run").description(
|
|
|
28119
28512
|
);
|
|
28120
28513
|
});
|
|
28121
28514
|
function stepCommand(action, description) {
|
|
28122
|
-
return new
|
|
28515
|
+
return new Command151(action).description(description).argument("<runId>", "Run id").requiredOption(
|
|
28123
28516
|
"--step <key>",
|
|
28124
28517
|
"The step key the run shows, e.g. gate-1, review[round=2] or post[attempt=2]"
|
|
28125
28518
|
).action(async (value, opts) => {
|
|
@@ -28134,7 +28527,7 @@ function stepCommand(action, description) {
|
|
|
28134
28527
|
);
|
|
28135
28528
|
});
|
|
28136
28529
|
}
|
|
28137
|
-
var cancelCommand2 = new
|
|
28530
|
+
var cancelCommand2 = new Command151("cancel").description(
|
|
28138
28531
|
"Cancel a run, as the owner: nothing more is created, and tasks it opened stay open until they end or you cancel them. Costs 0.001 in the payment token"
|
|
28139
28532
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
28140
28533
|
const id = uuid(value, "run");
|
|
@@ -28145,7 +28538,7 @@ var cancelCommand2 = new Command149("cancel").description(
|
|
|
28145
28538
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28146
28539
|
);
|
|
28147
28540
|
});
|
|
28148
|
-
var stopAutoPayoutCommand = new
|
|
28541
|
+
var stopAutoPayoutCommand = new Command151("stop-auto-payout").description(
|
|
28149
28542
|
"Stop automatic payouts and automatic review acceptance on a run, as the owner, at once and for good: from then on every pending step's review waits for you to accept it and every payout becomes a proposal you confirm (`taskmarket workflow payout confirm`); the runner sends nothing. A second stop changes nothing; refused on a completed or cancelled run. Costs 0.001 in the payment token"
|
|
28150
28543
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
28151
28544
|
const id = uuid(value, "run");
|
|
@@ -28156,7 +28549,7 @@ var stopAutoPayoutCommand = new Command149("stop-auto-payout").description(
|
|
|
28156
28549
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28157
28550
|
);
|
|
28158
28551
|
});
|
|
28159
|
-
var deleteCommand3 = new
|
|
28552
|
+
var deleteCommand3 = new Command151("delete").description(
|
|
28160
28553
|
"Delete a workflow, as the owner, so it no longer counts toward the project limit of 50. Refused while a run is running or failed (cancel it first); ended runs go with it, and tasks they opened are not touched. Costs 0.001 in the payment token"
|
|
28161
28554
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
28162
28555
|
const id = uuid(value, "workflow");
|
|
@@ -28178,22 +28571,22 @@ async function ownerRead(path9) {
|
|
|
28178
28571
|
renderFailure(err);
|
|
28179
28572
|
}
|
|
28180
28573
|
}
|
|
28181
|
-
var payoutListCommand = new
|
|
28182
|
-
"A run's payout proposals: what each accepted gating review recommends paying on the task it gates, with the exact accept confirming sends; visible to the project's owner and operators only (signed with your wallet); status is pending, confirmed, auto_paid (payout: auto, with mode, txHash and intentId), accepted_by_owner (the gated task was accepted by hand before the automatic payout landed; the runner paid nothing) or unavailable (free)"
|
|
28574
|
+
var payoutListCommand = new Command151("list").description(
|
|
28575
|
+
"A run's payout proposals: what each accepted gating review recommends paying on the task it gates, with the exact accept confirming sends; visible to the project's owner and operators only (signed with your wallet); status is pending, confirmed, auto_paid (payout: auto, with mode, txHash and intentId), accepted_by_owner (the gated task was accepted by hand before the automatic payout landed; the runner paid nothing) or unavailable (free). `kind` is payout, or refund when the review recommended nothing (an empty payout): the entries are rejected and the task cancelled, `refund` lists the entries. A payout: auto proposal is held until `holdUntil` for entrants to object (`objections` lists each one); `evidence` holds the check results of the recommendation"
|
|
28183
28576
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
28184
28577
|
const id = uuid(value, "run");
|
|
28185
28578
|
if (typeof id !== "string") return void printError(id.error);
|
|
28186
28579
|
await ownerRead(withChainId(`/api/project-workflow-runs/${id}/payouts`));
|
|
28187
28580
|
});
|
|
28188
|
-
var payoutShowCommand = new
|
|
28189
|
-
|
|
28581
|
+
var payoutShowCommand = new Command151("show").description(
|
|
28582
|
+
'Show a payout proposal: its status (pending, confirmed, auto_paid, accepted_by_owner or unavailable), mode, txHash and intentId once sent, the ranking and rationale, and `accept`, the winners and shares (basis points) confirming sends. A `kind: "refund"` proposal has `refund` instead: the entries rejected before the gated task is cancelled, returning its reward to the project budget. `holdUntil` is when a held automatic payout is sent, `objections` the entrants who objected (worker, reason, at) and `evidence` the per-entry checks of the recommendation, log file names and hash. Owner and operators, and an entrant of the gated task while the proposal is held (free)'
|
|
28190
28583
|
).argument("<proposalId>", "Payout proposal id").action(async (value) => {
|
|
28191
28584
|
const id = uuid(value, "payout proposal");
|
|
28192
28585
|
if (typeof id !== "string") return void printError(id.error);
|
|
28193
28586
|
await ownerRead(withChainId(`/api/project-workflow-payouts/${id}`));
|
|
28194
28587
|
});
|
|
28195
|
-
var payoutConfirmCommand = new
|
|
28196
|
-
|
|
28588
|
+
var payoutConfirmCommand = new Command151("confirm").description(
|
|
28589
|
+
'Confirm a pending payout proposal, as the project\'s owner: sends exactly the accept it shows (`taskmarket workflow payout show` prints the winners and shares first), paying the gated task out. Refused unless the proposal is pending (an auto_paid one was already sent by the runner). Costs the accept, paid like `task accept-submissions`. A `kind: "refund"` proposal (the review recommended nothing) is confirmed the same way, but costs one action fee and the platform runner then rejects every active entry of the gated task and cancels it, returning the reward to the project budget; its status turns confirmed, then reads Refunded in `reason` once the task is cancelled'
|
|
28197
28590
|
).argument("<proposalId>", "Payout proposal id").action(async (value) => {
|
|
28198
28591
|
const id = uuid(value, "payout proposal");
|
|
28199
28592
|
if (typeof id !== "string") return void printError(id.error);
|
|
@@ -28204,21 +28597,49 @@ var payoutConfirmCommand = new Command149("confirm").description(
|
|
|
28204
28597
|
} catch (err) {
|
|
28205
28598
|
return void renderFailure(err);
|
|
28206
28599
|
}
|
|
28207
|
-
|
|
28600
|
+
const refund = view.kind === "refund";
|
|
28601
|
+
if (view.status !== "pending" || (refund ? !view.refund : view.accept === null)) {
|
|
28208
28602
|
return void printError(
|
|
28209
|
-
view.status === "unavailable" ? `Payout proposal ${id} is unavailable (${view.reason ?? "no valid recommendation"}); accept the gated task by hand with
|
|
28603
|
+
view.status === "unavailable" ? `Payout proposal ${id} is unavailable (${view.reason ?? "no valid recommendation"}); ${refund ? "reject the entries and cancel the gated task by hand with `taskmarket task reject-all-submissions` and `taskmarket task cancel`" : "accept the gated task by hand with `taskmarket task accept-submissions`"}` : `Payout proposal ${id} is ${view.status}, not pending; there is nothing to confirm`
|
|
28210
28604
|
);
|
|
28211
28605
|
}
|
|
28212
28606
|
await postProjectWrite(
|
|
28213
28607
|
`/api/project-workflow-payouts/${id}/confirm`,
|
|
28214
28608
|
{ proposalId: id },
|
|
28215
|
-
{
|
|
28609
|
+
{
|
|
28610
|
+
maxAmount: ACTION_FEE_MAX_AMOUNT,
|
|
28611
|
+
extra: refund ? { refund: view.refund } : { accept: view.accept }
|
|
28612
|
+
}
|
|
28216
28613
|
);
|
|
28217
28614
|
});
|
|
28218
|
-
var
|
|
28615
|
+
var payoutObjectCommand = new Command151("object").description(
|
|
28616
|
+
`Object to an automatic payout or refund held for objections, as an entrant of the gated task (a wallet with an active submission on it; \`payout.pending_auto\` tells you when a hold starts, with the proposal id). Once per proposal, while the hold is open (\`holdUntil\` in \`payout show\`). The proposal then waits for the owner to confirm it and the owner is told. Needs --reason (1 to ${WORKFLOW_OBJECTION_REASON_MAX} characters). Free; signed with your wallet`
|
|
28617
|
+
).argument("<proposalId>", "Payout proposal id").requiredOption("--reason <text>", "Why you object, shown to the owner").action(async (value, opts) => {
|
|
28618
|
+
const id = uuid(value, "payout proposal");
|
|
28619
|
+
if (typeof id !== "string") return void printError(id.error);
|
|
28620
|
+
const reason = opts.reason.trim();
|
|
28621
|
+
if (reason.length < 1 || reason.length > WORKFLOW_OBJECTION_REASON_MAX) {
|
|
28622
|
+
return void printError(`--reason must be 1 to ${WORKFLOW_OBJECTION_REASON_MAX} characters`);
|
|
28623
|
+
}
|
|
28624
|
+
const auth = await signReadAuth();
|
|
28625
|
+
if (!auth || Object.keys(auth.headers).length === 0) {
|
|
28626
|
+
return void printError("Objecting needs a wallet. Run `taskmarket init` first.");
|
|
28627
|
+
}
|
|
28628
|
+
try {
|
|
28629
|
+
const { data, idempotencyKey } = await apiPost(
|
|
28630
|
+
`/api/project-workflow-payouts/${id}/object`,
|
|
28631
|
+
{ proposalId: id, reason, chainId: selectedNetwork().chainId },
|
|
28632
|
+
{ headers: auth.headers }
|
|
28633
|
+
);
|
|
28634
|
+
printResult(data, { idempotencyKey });
|
|
28635
|
+
} catch (err) {
|
|
28636
|
+
renderFailure(err);
|
|
28637
|
+
}
|
|
28638
|
+
});
|
|
28639
|
+
var payoutCommand = new Command151("payout").description(
|
|
28219
28640
|
"Payout proposals: a gating review's recommended winners and shares for the task it gates, which the owner confirms"
|
|
28220
|
-
).addCommand(payoutListCommand).addCommand(payoutShowCommand).addCommand(payoutConfirmCommand);
|
|
28221
|
-
var settingsCommand2 = new
|
|
28641
|
+
).addCommand(payoutListCommand).addCommand(payoutShowCommand).addCommand(payoutConfirmCommand).addCommand(payoutObjectCommand);
|
|
28642
|
+
var settingsCommand2 = new Command151("settings").description(
|
|
28222
28643
|
`Read or set the project's workflow step limit, as its owner: the most task steps one workflow may hold (${WORKFLOW_STEP_LIMIT_MIN} to ${WORKFLOW_STEP_LIMIT_MAX}, default 6). Setting costs 0.001 in the payment token; reading is free`
|
|
28223
28644
|
).argument("<projectId>", "Project id").option("--step-limit <count>", "The most task steps per workflow").action(async (id, opts) => {
|
|
28224
28645
|
const projectId = parseProjectId(id);
|
|
@@ -28249,7 +28670,7 @@ var settingsCommand2 = new Command149("settings").description(
|
|
|
28249
28670
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28250
28671
|
);
|
|
28251
28672
|
});
|
|
28252
|
-
var workflowCommand = new
|
|
28673
|
+
var workflowCommand = new Command151("workflow").description(
|
|
28253
28674
|
"Workflows: project tasks composed from named patterns (sequence, parallel, forEach, reviewLoop, gate, contest, branch, fallback), run by the platform runner under your grant to it. A gate waits for your approval, a step verdict or a time. A workflow is the document; a run is one execution of it"
|
|
28254
28675
|
).addCommand(validateCommand).addCommand(createCommand5).addCommand(listCommand8).addCommand(showCommand6).addCommand(runsCommand).addCommand(runCommand2).addCommand(statusCommand3).addCommand(
|
|
28255
28676
|
stepCommand(
|
|
@@ -28261,11 +28682,11 @@ var workflowCommand = new Command149("workflow").description(
|
|
|
28261
28682
|
"retry",
|
|
28262
28683
|
"Retry a failed step the run waits on, as a new attempt, as the owner; a forEach that failed over_budget recounts its list, and one that failed too_many_items is refused (costs 0.001 in the payment token)"
|
|
28263
28684
|
)
|
|
28264
|
-
).addCommand(cancelCommand2).addCommand(stopAutoPayoutCommand).addCommand(updateTemplateCommand).addCommand(deleteCommand3).addCommand(settingsCommand2).addCommand(payoutCommand).addCommand(workflowTemplateCommand);
|
|
28685
|
+
).addCommand(cancelCommand2).addCommand(stopAutoPayoutCommand).addCommand(updateTemplateCommand).addCommand(updateStepsCommand).addCommand(deleteCommand3).addCommand(settingsCommand2).addCommand(payoutCommand).addCommand(workflowTemplateCommand);
|
|
28265
28686
|
|
|
28266
28687
|
// src/commands/drops.ts
|
|
28267
|
-
import { Command as
|
|
28268
|
-
var listCommand9 = new
|
|
28688
|
+
import { Command as Command152 } from "commander";
|
|
28689
|
+
var listCommand9 = new Command152("list").description("List public Task Drops, ones accepting work first").option("--limit <n>", "Maximum drops to return (1-48)", "24").option("--cursor <cursor>", "nextCursor from a previous page").option("--status <status>", "ended: only drops no longer accepting work, newest first").option("--worker <address>", "Only drops this wallet entered (a submission, pitch or bid)").option("--entered", "Only drops your wallet entered (--worker with your own address)").action(
|
|
28269
28690
|
async (opts) => {
|
|
28270
28691
|
try {
|
|
28271
28692
|
if (opts.worker && opts.entered) throw new Error("Pass --worker or --entered, not both");
|
|
@@ -28293,7 +28714,7 @@ var listCommand9 = new Command150("list").description("List public Task Drops, o
|
|
|
28293
28714
|
}
|
|
28294
28715
|
}
|
|
28295
28716
|
);
|
|
28296
|
-
var showCommand7 = new
|
|
28717
|
+
var showCommand7 = new Command152("show").description("Show a Task Drop and its discoverable tasks").argument("<taskDropId>", "Task Drop ID").action(async (taskDropId) => {
|
|
28297
28718
|
try {
|
|
28298
28719
|
const input = parseInput(TaskDropGetInputSchema, { taskDropId });
|
|
28299
28720
|
const result = await apiGet(`/api/task-drops/${encodeURIComponent(input.taskDropId)}`);
|
|
@@ -28305,7 +28726,7 @@ var showCommand7 = new Command150("show").description("Show a Task Drop and its
|
|
|
28305
28726
|
renderFailure(err);
|
|
28306
28727
|
}
|
|
28307
28728
|
});
|
|
28308
|
-
var subscribeCommand = new
|
|
28729
|
+
var subscribeCommand = new Command152("subscribe").description("Subscribe an email to one Task Drop, or with --official to every official drop").argument("[taskDropId]", "Task Drop ID (omit with --official)").requiredOption("--email <email>", "Email address to notify").option("--official", "Subscribe to all official Task Drops").option("--wallet <address>", "Wallet address to associate with the subscription").action(
|
|
28309
28730
|
async (taskDropId, opts) => {
|
|
28310
28731
|
try {
|
|
28311
28732
|
if (opts.official) {
|
|
@@ -28333,7 +28754,7 @@ var subscribeCommand = new Command150("subscribe").description("Subscribe an ema
|
|
|
28333
28754
|
}
|
|
28334
28755
|
}
|
|
28335
28756
|
);
|
|
28336
|
-
var statusCommand4 = new
|
|
28757
|
+
var statusCommand4 = new Command152("status").description("Check whether an email is subscribed to a Task Drop, or with --official to all").argument("[taskDropId]", "Task Drop ID (omit with --official)").requiredOption("--email <email>", "Email address to check").option("--official", "Check the all-official-drops subscription").action(async (taskDropId, opts) => {
|
|
28337
28758
|
try {
|
|
28338
28759
|
if (opts.official) {
|
|
28339
28760
|
if (taskDropId) throw new Error("Pass either a Task Drop ID or --official, not both");
|
|
@@ -28350,15 +28771,15 @@ var statusCommand4 = new Command150("status").description("Check whether an emai
|
|
|
28350
28771
|
renderFailure(err);
|
|
28351
28772
|
}
|
|
28352
28773
|
});
|
|
28353
|
-
var dropsCommand = new
|
|
28774
|
+
var dropsCommand = new Command152("drops").description("Browse Task Drops and manage email subscriptions to them").addCommand(listCommand9).addCommand(showCommand7).addCommand(subscribeCommand).addCommand(statusCommand4);
|
|
28354
28775
|
|
|
28355
28776
|
// src/commands/hooks.ts
|
|
28356
|
-
import { Command as
|
|
28777
|
+
import { Command as Command154 } from "commander";
|
|
28357
28778
|
import { BaseError, ContractFunctionRevertedError, ContractFunctionZeroDataError } from "viem";
|
|
28358
28779
|
|
|
28359
28780
|
// src/lib/listing-submissions.ts
|
|
28360
28781
|
import { readFile as readFile6 } from "fs/promises";
|
|
28361
|
-
import { Command as
|
|
28782
|
+
import { Command as Command153 } from "commander";
|
|
28362
28783
|
var NOTICE = "Submitted for staff review. The action fee is kept whether the submission is approved or rejected. Approval opens a review pull request; `listed` turns true once the entry is served.";
|
|
28363
28784
|
function prepareListingFile(kind, text) {
|
|
28364
28785
|
if (Buffer.byteLength(text, "utf8") > LISTING_SUBMISSION_MAX_BYTES) {
|
|
@@ -28415,7 +28836,7 @@ function prepareListingFile(kind, text) {
|
|
|
28415
28836
|
}
|
|
28416
28837
|
function submitCommandFor(kind) {
|
|
28417
28838
|
const what = kind === "catalog" ? "catalog entry (kind x402-endpoint)" : "hook manifest";
|
|
28418
|
-
return new
|
|
28839
|
+
return new Command153("submit").description(
|
|
28419
28840
|
`Submit a ${what} for staff review. Pays the standard action fee, kept either way; needs an ERC-8004 identity on the selected network`
|
|
28420
28841
|
).requiredOption("--file <path>", `Path to the ${what} JSON file`).action(async (opts) => {
|
|
28421
28842
|
let text;
|
|
@@ -28447,7 +28868,7 @@ function submitCommandFor(kind) {
|
|
|
28447
28868
|
});
|
|
28448
28869
|
}
|
|
28449
28870
|
function submissionsCommandFor(kind) {
|
|
28450
|
-
return new
|
|
28871
|
+
return new Command153("submissions").description(
|
|
28451
28872
|
`List the ${kind === "catalog" ? "catalog entries" : "hook listings"} you submitted and their status`
|
|
28452
28873
|
).option("--status <status>", `Only this status: ${LISTING_SUBMISSION_STATUSES.join(", ")}`).option("--limit <n>", "Maximum submissions to return (1-100)", "50").action(async (opts) => {
|
|
28453
28874
|
if (opts.status && !LISTING_SUBMISSION_STATUSES.includes(opts.status)) {
|
|
@@ -28513,7 +28934,7 @@ async function probeHookVersion(entry, chainId) {
|
|
|
28513
28934
|
return reverted ? { ...entry, hookVersion: 1 } : entry;
|
|
28514
28935
|
}
|
|
28515
28936
|
}
|
|
28516
|
-
var listCommand10 = new
|
|
28937
|
+
var listCommand10 = new Command154("list").description(
|
|
28517
28938
|
"List hooks listed (verified) in the hook registry on the selected --network, then observed hooks that are not listed"
|
|
28518
28939
|
).option("--limit <n>", "Maximum unlisted observed hooks to return (1-100)", "50").option("--observed", "Return the raw onchain observation index instead of the registry view").option(
|
|
28519
28940
|
"--cursor <cursor>",
|
|
@@ -28552,7 +28973,7 @@ var listCommand10 = new Command152("list").description(
|
|
|
28552
28973
|
}
|
|
28553
28974
|
}
|
|
28554
28975
|
);
|
|
28555
|
-
var showCommand8 = new
|
|
28976
|
+
var showCommand8 = new Command154("show").description(
|
|
28556
28977
|
"Show one hook on the selected --network: its registry listing, or its onchain observation marked unlisted"
|
|
28557
28978
|
).argument("<address>", "Hook contract address").action(async (address3) => {
|
|
28558
28979
|
try {
|
|
@@ -28572,7 +28993,7 @@ var showCommand8 = new Command152("show").description(
|
|
|
28572
28993
|
renderFailure(err);
|
|
28573
28994
|
}
|
|
28574
28995
|
});
|
|
28575
|
-
var encodeConfigCommand = new
|
|
28996
|
+
var encodeConfigCommand = new Command154("encode-config").description(
|
|
28576
28997
|
"Encode a V2 hook's typed configuration from its registry config schema, for --hook-config"
|
|
28577
28998
|
).argument("<address>", "Hook contract address").requiredOption(
|
|
28578
28999
|
"--values <json>",
|
|
@@ -28601,7 +29022,7 @@ var encodeConfigCommand = new Command152("encode-config").description(
|
|
|
28601
29022
|
renderFailure(err);
|
|
28602
29023
|
}
|
|
28603
29024
|
});
|
|
28604
|
-
var attachmentConfigCommand = new
|
|
29025
|
+
var attachmentConfigCommand = new Command154("attachment-config").description(
|
|
28605
29026
|
"Show the protocol-default hook order and maximum hooks per task on the selected --network"
|
|
28606
29027
|
).action(async () => {
|
|
28607
29028
|
try {
|
|
@@ -28610,16 +29031,16 @@ var attachmentConfigCommand = new Command152("attachment-config").description(
|
|
|
28610
29031
|
renderFailure(err);
|
|
28611
29032
|
}
|
|
28612
29033
|
});
|
|
28613
|
-
var hooksCommand = new
|
|
29034
|
+
var hooksCommand = new Command154("hooks").description("Browse the hook registry on the selected --network").addCommand(listCommand10).addCommand(showCommand8).addCommand(encodeConfigCommand).addCommand(attachmentConfigCommand).addCommand(submitCommandFor("hook")).addCommand(submissionsCommandFor("hook"));
|
|
28614
29035
|
|
|
28615
29036
|
// src/commands/catalog/index.ts
|
|
28616
|
-
import { Command as
|
|
28617
|
-
var catalogCommand = new
|
|
29037
|
+
import { Command as Command155 } from "commander";
|
|
29038
|
+
var catalogCommand = new Command155("catalog").description("Submit paid endpoints to the Taskmarket catalog and track your submissions").addCommand(submitCommandFor("catalog")).addCommand(submissionsCommandFor("catalog"));
|
|
28618
29039
|
|
|
28619
29040
|
// src/commands/tap.ts
|
|
28620
29041
|
import { promises as fs12 } from "fs";
|
|
28621
|
-
import { Command as
|
|
28622
|
-
var tapCommand = new
|
|
29042
|
+
import { Command as Command156 } from "commander";
|
|
29043
|
+
var tapCommand = new Command156("tap").description(
|
|
28623
29044
|
"Manage the TAP signing key used on tasks that require TAP verification"
|
|
28624
29045
|
);
|
|
28625
29046
|
tapCommand.command("import").description(
|
|
@@ -28778,7 +29199,7 @@ tapCommand.command("remove").description("Remove the TAP key from the keystore")
|
|
|
28778
29199
|
});
|
|
28779
29200
|
|
|
28780
29201
|
// src/commands/hire.ts
|
|
28781
|
-
import { Command as
|
|
29202
|
+
import { Command as Command157 } from "commander";
|
|
28782
29203
|
var OWN_FLAGS = /* @__PURE__ */ new Set(["--mode", "--hire-worker", "--service-id"]);
|
|
28783
29204
|
async function lookupListedService(worker, serviceId) {
|
|
28784
29205
|
let listing;
|
|
@@ -28810,7 +29231,7 @@ function hireEvaluatorError(opts, requiresEvaluator) {
|
|
|
28810
29231
|
}
|
|
28811
29232
|
return null;
|
|
28812
29233
|
}
|
|
28813
|
-
var hireCommand = new
|
|
29234
|
+
var hireCommand = new Command157("hire").description(
|
|
28814
29235
|
"Hire a worker, a human or an agent: create a claim task only that worker may accept or decline before the accept window ends (costs the reward, in the payment token). Private visibility and every settlement terms flag of task create apply."
|
|
28815
29236
|
).argument("<worker>", "The worker's wallet address (a human or an agent)").option("--service <id>", "The listed service this hire is for (from the worker's listing)").option(
|
|
28816
29237
|
"--requires-evaluator",
|
|
@@ -28873,7 +29294,7 @@ hireCommand.action(async (worker, opts) => {
|
|
|
28873
29294
|
// src/index.ts
|
|
28874
29295
|
var require2 = createRequire(import.meta.url);
|
|
28875
29296
|
var { version } = require2("../package.json");
|
|
28876
|
-
var program = new
|
|
29297
|
+
var program = new Command158();
|
|
28877
29298
|
setLastErrorCliVersion(version);
|
|
28878
29299
|
program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
|
|
28879
29300
|
program.option(
|