@lucid-agents/taskmarket 1.41.0 → 1.43.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-HZEK636T.js} +2 -2
- package/dist/{channels-4LHC2LND.js → channels-FWGJII6Y.js} +4 -4
- package/dist/{chunk-PNBVFBTB.js → chunk-B2PINQHQ.js} +8 -8
- package/dist/{chunk-Z66B234H.js → chunk-F532X4HL.js} +1 -1
- package/dist/{chunk-ORCB435L.js → chunk-FKQBRXQS.js} +1 -1
- package/dist/{chunk-6XMZQPS5.js → chunk-FN5FZ4RL.js} +3 -3
- package/dist/{chunk-HH2RBNNT.js → chunk-FNSX2KLZ.js} +2 -2
- package/dist/{chunk-PRKO232N.js → chunk-IRKICJEV.js} +1 -1
- package/dist/{chunk-7Y5S6QR7.js → chunk-MGDBSENK.js} +5114 -4006
- package/dist/{chunk-LIVNNQYQ.js → chunk-XEGCIN3K.js} +1 -1
- package/dist/{chunk-5VGLI7T4.js → chunk-XZZKUMHQ.js} +1 -1
- package/dist/{chunk-A6JG4LL5.js → chunk-YS3YH7U3.js} +3 -3
- package/dist/{chunk-HYYMYJV4.js → chunk-Z7MFEW73.js} +3 -3
- package/dist/{chunk-A37LXOBO.js → chunk-ZMPMQTQQ.js} +5 -5
- package/dist/{doctor-EII4X6TP.js → doctor-NTQ3ZJRU.js} +8 -8
- package/dist/index.js +842 -379
- package/dist/{launch-SV7PLTVI.js → launch-FOCL5JOR.js} +11 -11
- package/dist/{read-auth-SP6JR5V4.js → read-auth-UAZUJEEQ.js} +3 -3
- package/dist/{reconcile-FN727GXS.js → reconcile-IKPAKGH3.js} +4 -4
- package/dist/{status-ASLURNQV.js → status-A636ECTT.js} +8 -8
- package/dist/{sync-pull-NAO3WOFB.js → sync-pull-DVC4R6BN.js} +4 -4
- package/dist/{task-access-grants-2UQMMUAR.js → task-access-grants-5I7QQXZV.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-B2PINQHQ.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-YS3YH7U3.js";
|
|
41
41
|
import {
|
|
42
42
|
signReadAuth
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-FNSX2KLZ.js";
|
|
44
44
|
import {
|
|
45
45
|
saveTaskAccessGrant,
|
|
46
46
|
taskAccessGrantHeaders
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-FKQBRXQS.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-F532X4HL.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-XZZKUMHQ.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,9 @@ import {
|
|
|
358
368
|
splitUserSkill,
|
|
359
369
|
sponsoredVaultRelayKind,
|
|
360
370
|
svmChain,
|
|
371
|
+
taskCheckedFiles,
|
|
372
|
+
taskCheckedPatch,
|
|
373
|
+
taskChecksFailures,
|
|
361
374
|
taskTemplates,
|
|
362
375
|
taskmarketChain,
|
|
363
376
|
unknownCapabilityMessage,
|
|
@@ -365,17 +378,18 @@ import {
|
|
|
365
378
|
userSkillArchiveWriteChange,
|
|
366
379
|
userSkillCreateWriteChange,
|
|
367
380
|
userSkillVersionWriteChange,
|
|
381
|
+
validateTaskChecks,
|
|
368
382
|
validateWorkflowDocument,
|
|
369
383
|
validateWorkflowTemplate,
|
|
370
384
|
vaultCallGasLimit7702,
|
|
371
385
|
verifierProviderId,
|
|
372
386
|
verifiersUnsupportedOnChain,
|
|
373
387
|
viemChainFor
|
|
374
|
-
} from "./chunk-
|
|
388
|
+
} from "./chunk-MGDBSENK.js";
|
|
375
389
|
import "./chunk-S7SJMJ2I.js";
|
|
376
390
|
|
|
377
391
|
// src/index.ts
|
|
378
|
-
import { Command as
|
|
392
|
+
import { Command as Command157 } from "commander";
|
|
379
393
|
import { createRequire } from "module";
|
|
380
394
|
|
|
381
395
|
// src/commands/init.ts
|
|
@@ -3914,8 +3928,8 @@ function addRaceContender(contender) {
|
|
|
3914
3928
|
const record = { deferreds, settled: false };
|
|
3915
3929
|
Promise.resolve(contender).then(
|
|
3916
3930
|
(value) => {
|
|
3917
|
-
for (const { resolve } of deferreds) {
|
|
3918
|
-
|
|
3931
|
+
for (const { resolve: resolve2 } of deferreds) {
|
|
3932
|
+
resolve2(value);
|
|
3919
3933
|
}
|
|
3920
3934
|
deferreds.clear();
|
|
3921
3935
|
record.settled = true;
|
|
@@ -3933,11 +3947,11 @@ function addRaceContender(contender) {
|
|
|
3933
3947
|
var wm = /* @__PURE__ */ new WeakMap();
|
|
3934
3948
|
async function safeRace(contenders) {
|
|
3935
3949
|
let deferred;
|
|
3936
|
-
const result = new Promise((
|
|
3937
|
-
deferred = { reject, resolve };
|
|
3950
|
+
const result = new Promise((resolve2, reject) => {
|
|
3951
|
+
deferred = { reject, resolve: resolve2 };
|
|
3938
3952
|
for (const contender of contenders) {
|
|
3939
3953
|
if (!isObject(contender)) {
|
|
3940
|
-
Promise.resolve(contender).then(
|
|
3954
|
+
Promise.resolve(contender).then(resolve2, reject);
|
|
3941
3955
|
continue;
|
|
3942
3956
|
}
|
|
3943
3957
|
let record = wm.get(contender);
|
|
@@ -3946,7 +3960,7 @@ async function safeRace(contenders) {
|
|
|
3946
3960
|
record.deferreds.add(deferred);
|
|
3947
3961
|
wm.set(contender, record);
|
|
3948
3962
|
} else if (record.settled) {
|
|
3949
|
-
Promise.resolve(contender).then(
|
|
3963
|
+
Promise.resolve(contender).then(resolve2, reject);
|
|
3950
3964
|
} else {
|
|
3951
3965
|
record.deferreds.add(deferred);
|
|
3952
3966
|
}
|
|
@@ -5352,7 +5366,7 @@ function getRpcTransportWithRequestCoalescing(transport, getDeduplicationKey) {
|
|
|
5352
5366
|
coalescedRequest.numConsumers++;
|
|
5353
5367
|
if (signal) {
|
|
5354
5368
|
const responsePromise = coalescedRequest.responsePromise;
|
|
5355
|
-
return await new Promise((
|
|
5369
|
+
return await new Promise((resolve2, reject) => {
|
|
5356
5370
|
const handleAbort = () => {
|
|
5357
5371
|
signal.removeEventListener("abort", handleAbort);
|
|
5358
5372
|
coalescedRequest.numConsumers -= 1;
|
|
@@ -5365,7 +5379,7 @@ function getRpcTransportWithRequestCoalescing(transport, getDeduplicationKey) {
|
|
|
5365
5379
|
reject(signal.reason);
|
|
5366
5380
|
};
|
|
5367
5381
|
signal.addEventListener("abort", handleAbort);
|
|
5368
|
-
responsePromise.then(
|
|
5382
|
+
responsePromise.then(resolve2).catch(reject).finally(() => {
|
|
5369
5383
|
signal.removeEventListener("abort", handleAbort);
|
|
5370
5384
|
});
|
|
5371
5385
|
});
|
|
@@ -7485,11 +7499,11 @@ async function tryRegisterEmail(deviceId, apiToken, username, explicit, warnings
|
|
|
7485
7499
|
function terminalIo() {
|
|
7486
7500
|
return {
|
|
7487
7501
|
interactive: Boolean(process.stdin.isTTY && process.stderr.isTTY),
|
|
7488
|
-
ask: (question) => new Promise((
|
|
7502
|
+
ask: (question) => new Promise((resolve2) => {
|
|
7489
7503
|
const rl = createInterface2({ input: process.stdin, output: process.stderr });
|
|
7490
7504
|
rl.question(question, (answer) => {
|
|
7491
7505
|
rl.close();
|
|
7492
|
-
|
|
7506
|
+
resolve2(answer);
|
|
7493
7507
|
});
|
|
7494
7508
|
})
|
|
7495
7509
|
};
|
|
@@ -7947,7 +7961,7 @@ async function approveSponsoredTaskSpend(input) {
|
|
|
7947
7961
|
`Approval confirmed but the RPC endpoint still reports an allowance of ${allowance}; retry once the endpoint catches up`
|
|
7948
7962
|
);
|
|
7949
7963
|
}
|
|
7950
|
-
await new Promise((
|
|
7964
|
+
await new Promise((resolve2) => setTimeout(resolve2, pollIntervalMs));
|
|
7951
7965
|
}
|
|
7952
7966
|
}
|
|
7953
7967
|
|
|
@@ -8439,7 +8453,7 @@ var searchCommand = new Command8("search").description(
|
|
|
8439
8453
|
});
|
|
8440
8454
|
|
|
8441
8455
|
// src/commands/task/index.ts
|
|
8442
|
-
import { Command as
|
|
8456
|
+
import { Command as Command55 } from "commander";
|
|
8443
8457
|
|
|
8444
8458
|
// src/commands/task/review.ts
|
|
8445
8459
|
import { readFile, stat } from "fs/promises";
|
|
@@ -8468,7 +8482,7 @@ var taskPath = (taskId) => `/api/tasks/${encodeURIComponent(taskId)}`;
|
|
|
8468
8482
|
var runPath = (runId) => `/api/submission-reviews/${encodeURIComponent(runId)}`;
|
|
8469
8483
|
function createSubmissionReviewClient(options) {
|
|
8470
8484
|
const now = options.now ?? Date.now;
|
|
8471
|
-
const sleep4 = options.sleep ?? ((ms2) => new Promise((
|
|
8485
|
+
const sleep4 = options.sleep ?? ((ms2) => new Promise((resolve2) => setTimeout(resolve2, ms2)));
|
|
8472
8486
|
let headersPromise;
|
|
8473
8487
|
const headers = () => headersPromise ??= (async () => {
|
|
8474
8488
|
const signer = await options.signer();
|
|
@@ -9005,7 +9019,7 @@ function retryAfterMs(res) {
|
|
|
9005
9019
|
return Math.min(wait, MAX_RETRY_AFTER_SECONDS) * 1e3;
|
|
9006
9020
|
}
|
|
9007
9021
|
async function x402Post(path9, body, options) {
|
|
9008
|
-
const sleep4 = options?.sleep ?? ((ms2) => new Promise((
|
|
9022
|
+
const sleep4 = options?.sleep ?? ((ms2) => new Promise((resolve2) => setTimeout(resolve2, ms2)));
|
|
9009
9023
|
if (paymentProtocolOf(selectedNetwork().chainId) === "mpp")
|
|
9010
9024
|
return mppPost(path9, body, options);
|
|
9011
9025
|
const keystore = await loadKeystore();
|
|
@@ -9448,7 +9462,7 @@ function taskGateCandidates(task) {
|
|
|
9448
9462
|
// src/lib/recording.ts
|
|
9449
9463
|
var RECORDING_POLL_INTERVAL_MS = 3e3;
|
|
9450
9464
|
var RECORDING_POLL_TIMEOUT_MS = 75e3;
|
|
9451
|
-
var sleepFor = (ms2) => new Promise((
|
|
9465
|
+
var sleepFor = (ms2) => new Promise((resolve2) => setTimeout(resolve2, ms2));
|
|
9452
9466
|
async function settleRecording(data, idempotencyKey, options = {}) {
|
|
9453
9467
|
if (!isRecordingPendingResponse(data)) return {};
|
|
9454
9468
|
const { txHash, intentId } = data;
|
|
@@ -11107,6 +11121,264 @@ async function confirmUnverifiedHooks(action, taskId, accepted, task) {
|
|
|
11107
11121
|
return false;
|
|
11108
11122
|
}
|
|
11109
11123
|
|
|
11124
|
+
// src/lib/task-checks-run.ts
|
|
11125
|
+
import { spawnSync } from "child_process";
|
|
11126
|
+
import {
|
|
11127
|
+
cpSync,
|
|
11128
|
+
existsSync,
|
|
11129
|
+
mkdtempSync,
|
|
11130
|
+
readdirSync,
|
|
11131
|
+
readFileSync,
|
|
11132
|
+
rmSync,
|
|
11133
|
+
statSync
|
|
11134
|
+
} from "fs";
|
|
11135
|
+
import { tmpdir } from "os";
|
|
11136
|
+
import { basename, join, resolve } from "path";
|
|
11137
|
+
var OUTPUT_TAIL = 300;
|
|
11138
|
+
var MAX_BUFFER = 8 * 1024 * 1024;
|
|
11139
|
+
function tail(text) {
|
|
11140
|
+
const t = (text ?? "").trim();
|
|
11141
|
+
return t.length > OUTPUT_TAIL ? "..." + t.slice(-OUTPUT_TAIL) : t;
|
|
11142
|
+
}
|
|
11143
|
+
function patchApplies(dir, patch) {
|
|
11144
|
+
const run2 = spawnSync("git", ["apply", "--check", resolve(patch)], {
|
|
11145
|
+
cwd: dir,
|
|
11146
|
+
encoding: "utf8",
|
|
11147
|
+
maxBuffer: MAX_BUFFER
|
|
11148
|
+
});
|
|
11149
|
+
if (run2.error) return { applied: false, detail: `git could not run: ${run2.error.message}` };
|
|
11150
|
+
return run2.status === 0 ? { applied: true, detail: "the patch applies cleanly" } : { applied: false, detail: tail(run2.stderr) || `git apply --check exited ${run2.status}` };
|
|
11151
|
+
}
|
|
11152
|
+
function runCommandCheck(check, cwd, env = process.env) {
|
|
11153
|
+
const [cmd, ...args] = check.cmd;
|
|
11154
|
+
const run2 = spawnSync(cmd, args, {
|
|
11155
|
+
cwd,
|
|
11156
|
+
env,
|
|
11157
|
+
encoding: "utf8",
|
|
11158
|
+
timeout: check.timeoutS * 1e3,
|
|
11159
|
+
killSignal: "SIGKILL",
|
|
11160
|
+
maxBuffer: MAX_BUFFER
|
|
11161
|
+
});
|
|
11162
|
+
if (run2.error) {
|
|
11163
|
+
const code = run2.error.code;
|
|
11164
|
+
if (code === "ETIMEDOUT") {
|
|
11165
|
+
return { passed: false, detail: `timed out after ${check.timeoutS}s` };
|
|
11166
|
+
}
|
|
11167
|
+
return { passed: false, detail: `could not run: ${run2.error.message}` };
|
|
11168
|
+
}
|
|
11169
|
+
if (run2.status === 0) return { passed: true, detail: "exit 0" };
|
|
11170
|
+
const out = tail(run2.stderr) || tail(run2.stdout);
|
|
11171
|
+
return {
|
|
11172
|
+
passed: false,
|
|
11173
|
+
detail: `exit ${run2.status ?? run2.signal}${out ? `: ${out}` : ""}`
|
|
11174
|
+
};
|
|
11175
|
+
}
|
|
11176
|
+
function commandChecks(spec) {
|
|
11177
|
+
return spec.checks.filter(
|
|
11178
|
+
(c) => c.kind === "command"
|
|
11179
|
+
);
|
|
11180
|
+
}
|
|
11181
|
+
function runCliChecks(spec, engineResults, target, options) {
|
|
11182
|
+
const byId = /* @__PURE__ */ new Map();
|
|
11183
|
+
let work = null;
|
|
11184
|
+
let patchOk = null;
|
|
11185
|
+
try {
|
|
11186
|
+
const needsWork = options.yes && commandChecks(spec).length > 0;
|
|
11187
|
+
if (needsWork) {
|
|
11188
|
+
work = mkdtempSync(join(tmpdir(), "taskmarket-checks-"));
|
|
11189
|
+
if (target.dir) {
|
|
11190
|
+
cpSync(resolve(target.dir), work, { recursive: true });
|
|
11191
|
+
if (target.patch) {
|
|
11192
|
+
const run2 = spawnSync("git", ["apply", resolve(target.patch)], {
|
|
11193
|
+
cwd: work,
|
|
11194
|
+
encoding: "utf8"
|
|
11195
|
+
});
|
|
11196
|
+
patchOk = run2.status === 0 ? { applied: true, detail: "applied" } : { applied: false, detail: tail(run2.stderr) || "git apply failed" };
|
|
11197
|
+
}
|
|
11198
|
+
} else if (target.file) {
|
|
11199
|
+
cpSync(resolve(target.file), join(work, basename(target.file)));
|
|
11200
|
+
}
|
|
11201
|
+
}
|
|
11202
|
+
for (const check of spec.checks) {
|
|
11203
|
+
if (check.kind === "patch_applies") {
|
|
11204
|
+
let result;
|
|
11205
|
+
if (!target.dir || !target.patch) {
|
|
11206
|
+
result = {
|
|
11207
|
+
id: check.id,
|
|
11208
|
+
kind: check.kind,
|
|
11209
|
+
passed: false,
|
|
11210
|
+
skipped: true,
|
|
11211
|
+
detail: "pass --dir <checkout> and --patch <file> to test the patch"
|
|
11212
|
+
};
|
|
11213
|
+
} else {
|
|
11214
|
+
const r = patchApplies(target.dir, target.patch);
|
|
11215
|
+
result = { id: check.id, kind: check.kind, passed: r.applied, detail: r.detail };
|
|
11216
|
+
}
|
|
11217
|
+
byId.set(check.id, result);
|
|
11218
|
+
} else if (check.kind === "command") {
|
|
11219
|
+
if (!options.yes) {
|
|
11220
|
+
byId.set(check.id, {
|
|
11221
|
+
id: check.id,
|
|
11222
|
+
kind: check.kind,
|
|
11223
|
+
passed: false,
|
|
11224
|
+
skipped: true,
|
|
11225
|
+
detail: "pass --yes to run commands"
|
|
11226
|
+
});
|
|
11227
|
+
} else if (patchOk && !patchOk.applied) {
|
|
11228
|
+
byId.set(check.id, {
|
|
11229
|
+
id: check.id,
|
|
11230
|
+
kind: check.kind,
|
|
11231
|
+
passed: false,
|
|
11232
|
+
detail: `the patch did not apply, so the command did not run: ${patchOk.detail}`
|
|
11233
|
+
});
|
|
11234
|
+
} else {
|
|
11235
|
+
const env = {
|
|
11236
|
+
...process.env,
|
|
11237
|
+
...target.file ? { TASKMARKET_DELIVERABLE: join(work, basename(target.file)) } : {}
|
|
11238
|
+
};
|
|
11239
|
+
const r = runCommandCheck(check, work, env);
|
|
11240
|
+
byId.set(check.id, { id: check.id, kind: check.kind, ...r });
|
|
11241
|
+
}
|
|
11242
|
+
}
|
|
11243
|
+
}
|
|
11244
|
+
} finally {
|
|
11245
|
+
if (work && existsSync(work)) rmSync(work, { recursive: true, force: true });
|
|
11246
|
+
}
|
|
11247
|
+
return engineResults.map((r) => byId.get(r.id) ?? r);
|
|
11248
|
+
}
|
|
11249
|
+
function isDirectory(path9) {
|
|
11250
|
+
try {
|
|
11251
|
+
return statSync(path9).isDirectory();
|
|
11252
|
+
} catch {
|
|
11253
|
+
return false;
|
|
11254
|
+
}
|
|
11255
|
+
}
|
|
11256
|
+
var LITERAL_FILE_LIMIT = 2e3;
|
|
11257
|
+
var LITERAL_BYTES_LIMIT = 1024 * 1024;
|
|
11258
|
+
var SKIPPED_DIRS = /* @__PURE__ */ new Set([
|
|
11259
|
+
".git",
|
|
11260
|
+
"node_modules",
|
|
11261
|
+
"target",
|
|
11262
|
+
"dist",
|
|
11263
|
+
"build",
|
|
11264
|
+
".venv",
|
|
11265
|
+
"__pycache__"
|
|
11266
|
+
]);
|
|
11267
|
+
function collectTestLiterals(dir, paths) {
|
|
11268
|
+
const globs = paths ?? DEFAULT_TEST_GLOBS;
|
|
11269
|
+
const root = resolve(dir);
|
|
11270
|
+
const found = /* @__PURE__ */ new Set();
|
|
11271
|
+
let visited = 0;
|
|
11272
|
+
const walk2 = (rel) => {
|
|
11273
|
+
let names;
|
|
11274
|
+
try {
|
|
11275
|
+
names = readdirSync(join(root, rel)).sort();
|
|
11276
|
+
} catch {
|
|
11277
|
+
return;
|
|
11278
|
+
}
|
|
11279
|
+
for (const name of names) {
|
|
11280
|
+
if (visited >= LITERAL_FILE_LIMIT) return;
|
|
11281
|
+
const next = rel === "" ? name : `${rel}/${name}`;
|
|
11282
|
+
let info;
|
|
11283
|
+
try {
|
|
11284
|
+
info = statSync(join(root, next));
|
|
11285
|
+
} catch {
|
|
11286
|
+
continue;
|
|
11287
|
+
}
|
|
11288
|
+
if (info.isDirectory()) {
|
|
11289
|
+
if (!SKIPPED_DIRS.has(name)) walk2(next);
|
|
11290
|
+
} else if (info.isFile() && info.size <= LITERAL_BYTES_LIMIT && matchesAnyGlob(next, globs)) {
|
|
11291
|
+
visited++;
|
|
11292
|
+
try {
|
|
11293
|
+
for (const lit of extractLiterals(readFileSync(join(root, next), "utf8"))) found.add(lit);
|
|
11294
|
+
} catch {
|
|
11295
|
+
}
|
|
11296
|
+
}
|
|
11297
|
+
}
|
|
11298
|
+
};
|
|
11299
|
+
walk2("");
|
|
11300
|
+
return [...found].sort();
|
|
11301
|
+
}
|
|
11302
|
+
function taskChecksSpecOf(task) {
|
|
11303
|
+
if (task.checks) return { spec: task.checks };
|
|
11304
|
+
const found = extractTaskChecks(task.description ?? "");
|
|
11305
|
+
if (!found) return { spec: null };
|
|
11306
|
+
if (!found.ok) {
|
|
11307
|
+
return {
|
|
11308
|
+
error: `The task's taskmarket-checks block is invalid: ${formatTaskChecksErrors(found.errors)}`
|
|
11309
|
+
};
|
|
11310
|
+
}
|
|
11311
|
+
return { spec: found.spec };
|
|
11312
|
+
}
|
|
11313
|
+
var deliverableFiles = taskCheckedFiles;
|
|
11314
|
+
function deliverablePatch(files, patch) {
|
|
11315
|
+
return patch ?? taskCheckedPatch(files);
|
|
11316
|
+
}
|
|
11317
|
+
function runTaskChecks(spec, input) {
|
|
11318
|
+
const read4 = (path9, encoding) => {
|
|
11319
|
+
try {
|
|
11320
|
+
return encoding ? readFileSync(path9, encoding) : readFileSync(path9);
|
|
11321
|
+
} catch (error) {
|
|
11322
|
+
throw new Error(`Cannot read ${path9}: ${error.message}`);
|
|
11323
|
+
}
|
|
11324
|
+
};
|
|
11325
|
+
const results = [];
|
|
11326
|
+
if (spec.deliverable.type === "file") {
|
|
11327
|
+
const targets = deliverableFiles(spec, input.files);
|
|
11328
|
+
if (targets.length === 0) {
|
|
11329
|
+
throw new Error(
|
|
11330
|
+
`This task takes a ${spec.deliverable.format} file: pass it with --file <path>`
|
|
11331
|
+
);
|
|
11332
|
+
}
|
|
11333
|
+
for (const file of targets) {
|
|
11334
|
+
const engine = runDataChecks(spec, { bytes: read4(file) });
|
|
11335
|
+
const full = runCliChecks(spec, engine, { file }, { yes: input.yes });
|
|
11336
|
+
for (const r of full) results.push(targets.length > 1 ? { ...r, file } : r);
|
|
11337
|
+
}
|
|
11338
|
+
} else {
|
|
11339
|
+
if (input.dir && !isDirectory(input.dir)) throw new Error(`Not a directory: ${input.dir}`);
|
|
11340
|
+
const patch = deliverablePatch(input.files, input.patch);
|
|
11341
|
+
let engine;
|
|
11342
|
+
if (patch === void 0) {
|
|
11343
|
+
engine = runDataChecks(spec, { text: "" });
|
|
11344
|
+
} else {
|
|
11345
|
+
const specials = spec.checks.flatMap((c) => c.kind === "no_test_special_casing" ? [c] : []);
|
|
11346
|
+
const literals = /* @__PURE__ */ new Set();
|
|
11347
|
+
if (input.dir) {
|
|
11348
|
+
for (const c of specials) {
|
|
11349
|
+
for (const lit of collectTestLiterals(input.dir, c.paths)) literals.add(lit);
|
|
11350
|
+
}
|
|
11351
|
+
}
|
|
11352
|
+
engine = runPatchChecks(spec, {
|
|
11353
|
+
patch: read4(patch, "utf8"),
|
|
11354
|
+
testLiterals: input.dir && specials.length > 0 ? [...literals].sort() : void 0
|
|
11355
|
+
});
|
|
11356
|
+
}
|
|
11357
|
+
results.push(...runCliChecks(spec, engine, { dir: input.dir, patch }, { yes: input.yes }));
|
|
11358
|
+
}
|
|
11359
|
+
const hidden = hiddenChecksResult(spec);
|
|
11360
|
+
if (hidden) results.push(hidden);
|
|
11361
|
+
const failed = taskChecksFailures(results).length;
|
|
11362
|
+
return {
|
|
11363
|
+
passed: failed === 0,
|
|
11364
|
+
failed,
|
|
11365
|
+
skipped: results.filter((r) => r.skipped && r.kind !== "hidden").length,
|
|
11366
|
+
warnings: results.filter((r) => r.warning).length,
|
|
11367
|
+
results,
|
|
11368
|
+
...spec.environment?.image || spec.environment?.setup?.length ? {
|
|
11369
|
+
note: "The checks ran on this machine. The declared image and setup are not applied; the verifier runs the checks in that environment."
|
|
11370
|
+
} : {}
|
|
11371
|
+
};
|
|
11372
|
+
}
|
|
11373
|
+
function announceCommands(spec) {
|
|
11374
|
+
const commands = commandChecks(spec);
|
|
11375
|
+
if (commands.length === 0) return;
|
|
11376
|
+
process.stderr.write(
|
|
11377
|
+
"Running the requester's commands on this machine:\n" + commands.map((c) => ` ${c.id}: ${c.cmd.join(" ")}
|
|
11378
|
+
`).join("") + (spec.environment?.network === "none" ? "The task expects no network; this run does not enforce that.\n" : "")
|
|
11379
|
+
);
|
|
11380
|
+
}
|
|
11381
|
+
|
|
11110
11382
|
// src/lib/task-network.ts
|
|
11111
11383
|
var WRONG_NETWORK_CODE = "wrong_network";
|
|
11112
11384
|
async function confirmTaskOnSelectedNetwork(taskId, task) {
|
|
@@ -11139,6 +11411,9 @@ async function confirmTaskOnSelectedNetwork(taskId, task) {
|
|
|
11139
11411
|
}
|
|
11140
11412
|
|
|
11141
11413
|
// src/commands/task/submit.ts
|
|
11414
|
+
function checksSummary(run2) {
|
|
11415
|
+
return { passed: run2.passed, failed: run2.failed, skipped: run2.skipped, warnings: run2.warnings };
|
|
11416
|
+
}
|
|
11142
11417
|
function collectFile(value, previous) {
|
|
11143
11418
|
return [...previous, value];
|
|
11144
11419
|
}
|
|
@@ -11147,29 +11422,98 @@ var submitCmd = new Command14("submit").description("Submit work for a task").ar
|
|
|
11147
11422
|
).option(
|
|
11148
11423
|
"--accept-unverified-hooks",
|
|
11149
11424
|
"Proceed although the task has a hook the hook registry does not list (it can refuse every submission)"
|
|
11150
|
-
).
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11425
|
+
).option(
|
|
11426
|
+
"--dry-run",
|
|
11427
|
+
"Run the task's checks on your files and print the results; nothing is uploaded or paid"
|
|
11428
|
+
).option("--skip-checks", "Submit without running the task's checks").option("--yes", "Also run the task's command checks on this machine (they are the requester's)").option("--dir <path>", "A checked-out repository, for patch_applies and command checks").option("--patch <file>", "The patch to check, when it is not one of the --file files").action(async (taskId, opts) => {
|
|
11429
|
+
try {
|
|
11430
|
+
const patchOnly = opts.dryRun && (opts.dir || opts.patch);
|
|
11431
|
+
if ((!opts.file || opts.file.length === 0) && !patchOnly) {
|
|
11432
|
+
printError("--file is required");
|
|
11433
|
+
return;
|
|
11434
|
+
}
|
|
11435
|
+
if (opts.dryRun && opts.skipChecks) {
|
|
11436
|
+
printError("--dry-run runs the checks; it cannot be combined with --skip-checks");
|
|
11437
|
+
return;
|
|
11438
|
+
}
|
|
11439
|
+
let checks = null;
|
|
11440
|
+
if (!opts.skipChecks) {
|
|
11441
|
+
const task = await getTask(cliTaskReadContext(), { taskId });
|
|
11442
|
+
if (!task) {
|
|
11443
|
+
printError(
|
|
11444
|
+
`Task not found: ${taskId} (or this is a private task you don't have access to)`
|
|
11445
|
+
);
|
|
11155
11446
|
return;
|
|
11156
11447
|
}
|
|
11157
|
-
const
|
|
11158
|
-
if (
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11448
|
+
const found = taskChecksSpecOf(task);
|
|
11449
|
+
if ("error" in found) {
|
|
11450
|
+
printError(found.error);
|
|
11451
|
+
return;
|
|
11452
|
+
}
|
|
11453
|
+
if (found.spec) {
|
|
11454
|
+
if (opts.yes && commandChecks(found.spec).length > 0) announceCommands(found.spec);
|
|
11455
|
+
try {
|
|
11456
|
+
checks = runTaskChecks(found.spec, {
|
|
11457
|
+
files: opts.file ?? [],
|
|
11458
|
+
dir: opts.dir,
|
|
11459
|
+
patch: opts.patch,
|
|
11460
|
+
yes: opts.yes === true
|
|
11461
|
+
});
|
|
11462
|
+
} catch (error) {
|
|
11463
|
+
renderFailure(error);
|
|
11464
|
+
return;
|
|
11465
|
+
}
|
|
11466
|
+
} else if (opts.dryRun) {
|
|
11467
|
+
printResult({
|
|
11468
|
+
taskId,
|
|
11469
|
+
dryRun: true,
|
|
11470
|
+
checks: null,
|
|
11471
|
+
note: "This task publishes no checks"
|
|
11472
|
+
});
|
|
11473
|
+
return;
|
|
11474
|
+
}
|
|
11475
|
+
}
|
|
11476
|
+
if (opts.dryRun && checks) {
|
|
11477
|
+
printResult({ taskId, dryRun: true, ...checks });
|
|
11478
|
+
if (!checks.passed) process.exitCode = 1;
|
|
11479
|
+
return;
|
|
11480
|
+
}
|
|
11481
|
+
if (checks && !checks.passed) {
|
|
11482
|
+
renderFailure(
|
|
11483
|
+
Object.assign(
|
|
11484
|
+
new Error(
|
|
11485
|
+
`${checks.failed} of the task's checks failed, so nothing was submitted. Fix the work, or pass --skip-checks to submit anyway`
|
|
11486
|
+
),
|
|
11487
|
+
{ code: "checks_failed" }
|
|
11488
|
+
),
|
|
11489
|
+
{ details: { code: "checks_failed", checks } }
|
|
11166
11490
|
);
|
|
11167
|
-
|
|
11168
|
-
}
|
|
11169
|
-
|
|
11491
|
+
return;
|
|
11492
|
+
}
|
|
11493
|
+
const submissionKey = resolveIdempotencyKey();
|
|
11494
|
+
if (!await confirmTaskOnSelectedNetwork(taskId)) return;
|
|
11495
|
+
if (!await confirmUnverifiedHooks("submit", taskId, opts.acceptUnverifiedHooks)) return;
|
|
11496
|
+
const keystore = await loadKeystore();
|
|
11497
|
+
const { submissionId, idempotencyKey } = await submitTaskFiles(
|
|
11498
|
+
cliTaskWriteContext(keystore),
|
|
11499
|
+
{ taskId },
|
|
11500
|
+
opts.file.map((path9) => ({ path: path9, role: opts.role })),
|
|
11501
|
+
{ idempotencyKey: submissionKey }
|
|
11502
|
+
);
|
|
11503
|
+
printResult(
|
|
11504
|
+
{
|
|
11505
|
+
submissionId,
|
|
11506
|
+
...opts.skipChecks ? { checks: { skipped: true } } : checks ? { checks: checksSummary(checks) } : {}
|
|
11507
|
+
},
|
|
11508
|
+
{ idempotencyKey }
|
|
11509
|
+
);
|
|
11510
|
+
} finally {
|
|
11511
|
+
submitCmd.setOptionValue("file", []);
|
|
11512
|
+
for (const key of ["dryRun", "skipChecks", "yes", "dir", "patch"]) {
|
|
11513
|
+
submitCmd.setOptionValue(key, void 0);
|
|
11170
11514
|
}
|
|
11171
11515
|
}
|
|
11172
|
-
);
|
|
11516
|
+
});
|
|
11173
11517
|
|
|
11174
11518
|
// src/commands/task/accept.ts
|
|
11175
11519
|
import { Command as Command15 } from "commander";
|
|
@@ -12761,6 +13105,74 @@ var templateCmd = new Command53("template").description(
|
|
|
12761
13105
|
"Browse the curated task templates; create from one with `task create --template <id>`"
|
|
12762
13106
|
).addCommand(listCmd3).addCommand(showCmd);
|
|
12763
13107
|
|
|
13108
|
+
// src/commands/task/checks.ts
|
|
13109
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
13110
|
+
import { Command as Command54 } from "commander";
|
|
13111
|
+
|
|
13112
|
+
// src/lib/task-hidden-checks.ts
|
|
13113
|
+
import { createHash } from "crypto";
|
|
13114
|
+
function hiddenChecksCommitment(bytes) {
|
|
13115
|
+
return `sha256:${createHash("sha256").update(bytes).digest("hex")}`;
|
|
13116
|
+
}
|
|
13117
|
+
function readHiddenChecksFile(bytes) {
|
|
13118
|
+
let value;
|
|
13119
|
+
try {
|
|
13120
|
+
value = JSON.parse(new TextDecoder("utf-8").decode(bytes));
|
|
13121
|
+
} catch (error) {
|
|
13122
|
+
return { valid: false, error: `The file is not valid JSON: ${error.message}` };
|
|
13123
|
+
}
|
|
13124
|
+
if (typeof value === "object" && value !== null && "hiddenChecks" in value) {
|
|
13125
|
+
return { valid: false, error: "A hidden checks file cannot itself carry hiddenChecks" };
|
|
13126
|
+
}
|
|
13127
|
+
const result = validateTaskChecks(value);
|
|
13128
|
+
if (!result.ok) {
|
|
13129
|
+
return {
|
|
13130
|
+
valid: false,
|
|
13131
|
+
error: `Not a valid taskmarket.checks/1 spec: ${formatTaskChecksErrors(result.errors)}`
|
|
13132
|
+
};
|
|
13133
|
+
}
|
|
13134
|
+
return { valid: true, count: result.spec.checks.length };
|
|
13135
|
+
}
|
|
13136
|
+
function isCommitment(value) {
|
|
13137
|
+
return TASK_HIDDEN_CHECKS_COMMITMENT_PATTERN.test(value);
|
|
13138
|
+
}
|
|
13139
|
+
|
|
13140
|
+
// src/commands/task/checks.ts
|
|
13141
|
+
function readBytes(path9) {
|
|
13142
|
+
try {
|
|
13143
|
+
return readFileSync2(path9);
|
|
13144
|
+
} catch (error) {
|
|
13145
|
+
return `Cannot read ${path9}: ${error.message}`;
|
|
13146
|
+
}
|
|
13147
|
+
}
|
|
13148
|
+
var commitCmd = new Command54("commit").description(
|
|
13149
|
+
"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`"
|
|
13150
|
+
).requiredOption("--file <path>", "The hidden checks file (a taskmarket.checks/1 spec)").action((opts) => {
|
|
13151
|
+
const bytes = readBytes(opts.file);
|
|
13152
|
+
if (typeof bytes === "string") return void printError(bytes);
|
|
13153
|
+
const file = readHiddenChecksFile(bytes);
|
|
13154
|
+
if (!file.valid) return void printError(file.error);
|
|
13155
|
+
printResult({ commitment: hiddenChecksCommitment(bytes), count: file.count });
|
|
13156
|
+
});
|
|
13157
|
+
var verifyCmd = new Command54("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) => {
|
|
13158
|
+
if (!isCommitment(opts.commitment)) {
|
|
13159
|
+
return void printError("--commitment must look like sha256:<64 lowercase hex characters>");
|
|
13160
|
+
}
|
|
13161
|
+
const bytes = readBytes(opts.file);
|
|
13162
|
+
if (typeof bytes === "string") return void printError(bytes);
|
|
13163
|
+
const actual = hiddenChecksCommitment(bytes);
|
|
13164
|
+
const file = readHiddenChecksFile(bytes);
|
|
13165
|
+
printResult({
|
|
13166
|
+
matches: actual === opts.commitment,
|
|
13167
|
+
commitment: actual,
|
|
13168
|
+
expected: opts.commitment,
|
|
13169
|
+
count: file.valid ? file.count : null
|
|
13170
|
+
});
|
|
13171
|
+
});
|
|
13172
|
+
var checksCmd = new Command54("checks").description(
|
|
13173
|
+
"Hidden checks: commit to a private checks file and verify it against the commitment"
|
|
13174
|
+
).addCommand(commitCmd).addCommand(verifyCmd);
|
|
13175
|
+
|
|
12764
13176
|
// src/commands/task/settlement-actions.ts
|
|
12765
13177
|
var releaseCmd = settlementActionCommand({
|
|
12766
13178
|
name: "release",
|
|
@@ -12786,11 +13198,12 @@ var settleCmd = settlementActionCommand({
|
|
|
12786
13198
|
});
|
|
12787
13199
|
|
|
12788
13200
|
// src/commands/task/index.ts
|
|
12789
|
-
var taskCommand2 = new
|
|
13201
|
+
var taskCommand2 = new Command55("task").description("Manage tasks");
|
|
12790
13202
|
taskCommand2.addCommand(createCmd);
|
|
12791
13203
|
taskCommand2.addCommand(templateCmd);
|
|
12792
13204
|
taskCommand2.addCommand(listCmd);
|
|
12793
13205
|
taskCommand2.addCommand(getCmd);
|
|
13206
|
+
taskCommand2.addCommand(checksCmd);
|
|
12794
13207
|
taskCommand2.addCommand(payoutGateCmd);
|
|
12795
13208
|
taskCommand2.addCommand(linkGateCmd);
|
|
12796
13209
|
taskCommand2.addCommand(extendGateCmd);
|
|
@@ -12838,10 +13251,10 @@ taskCommand2.addCommand(reviewCmd, { hidden: true });
|
|
|
12838
13251
|
taskCommand2.addCommand(startReviewCmd);
|
|
12839
13252
|
|
|
12840
13253
|
// src/commands/agent/index.ts
|
|
12841
|
-
import { Command as
|
|
13254
|
+
import { Command as Command59, Option as Option4 } from "commander";
|
|
12842
13255
|
|
|
12843
13256
|
// src/commands/agent/credits.ts
|
|
12844
|
-
import { Command as
|
|
13257
|
+
import { Command as Command56 } from "commander";
|
|
12845
13258
|
|
|
12846
13259
|
// src/lib/tty-confirm.ts
|
|
12847
13260
|
import { createInterface as createInterface3 } from "readline";
|
|
@@ -12853,7 +13266,7 @@ async function confirmAtTerminal(lines, unattended) {
|
|
|
12853
13266
|
`);
|
|
12854
13267
|
const readline = createInterface3({ input: process.stdin, output: process.stderr });
|
|
12855
13268
|
const answer = await new Promise(
|
|
12856
|
-
(
|
|
13269
|
+
(resolve2) => readline.question("Type yes to approve: ", resolve2)
|
|
12857
13270
|
);
|
|
12858
13271
|
readline.close();
|
|
12859
13272
|
return answer.trim().toLowerCase() === "yes";
|
|
@@ -12894,7 +13307,7 @@ function setupLines(plan, pricing) {
|
|
|
12894
13307
|
...rateLines(pricing)
|
|
12895
13308
|
];
|
|
12896
13309
|
}
|
|
12897
|
-
var setupCommand = new
|
|
13310
|
+
var setupCommand = new Command56("setup").description(
|
|
12898
13311
|
"Approve the compute allocation that pays for sandboxes: daily and monthly caps, and optional auto-top-up"
|
|
12899
13312
|
).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
13313
|
"--auto-top-up-below <credits>",
|
|
@@ -12931,7 +13344,7 @@ var setupCommand = new Command55("setup").description(
|
|
|
12931
13344
|
printResult({ config, caps: plan.caps, autoTopUp: plan.autoTopUp ?? null });
|
|
12932
13345
|
}
|
|
12933
13346
|
);
|
|
12934
|
-
var buyCommand = new
|
|
13347
|
+
var buyCommand = new Command56("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
13348
|
const config = await loadComputeCreditConfig();
|
|
12936
13349
|
if (!config) {
|
|
12937
13350
|
throw new ComputeCreditError(
|
|
@@ -12961,17 +13374,17 @@ var buyCommand = new Command55("buy").description("Buy compute credit over x402
|
|
|
12961
13374
|
rate: { rateCardVersion: pricing.rateCardVersion, usdPerCredit: pricing.usdPerCredit }
|
|
12962
13375
|
});
|
|
12963
13376
|
});
|
|
12964
|
-
var statusCommand2 = new
|
|
13377
|
+
var statusCommand2 = new Command56("status").description(
|
|
12965
13378
|
"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
13379
|
).action(async () => {
|
|
12967
13380
|
printResult(await computeCreditStatus());
|
|
12968
13381
|
});
|
|
12969
|
-
var checkCommand = new
|
|
13382
|
+
var checkCommand = new Command56("check").description(
|
|
12970
13383
|
"Check the compute credit balance and, when auto-top-up was approved and the balance is low, buy one chunk"
|
|
12971
13384
|
).action(async () => {
|
|
12972
13385
|
printResult(await checkComputeBalance());
|
|
12973
13386
|
});
|
|
12974
|
-
var reconcileCommand = new
|
|
13387
|
+
var reconcileCommand = new Command56("reconcile").description(
|
|
12975
13388
|
"Settle purchases whose outcome was lost, by their idempotency key; never pays again"
|
|
12976
13389
|
).option(
|
|
12977
13390
|
"--release <key>",
|
|
@@ -13018,10 +13431,10 @@ var reconcileCommand = new Command55("reconcile").description(
|
|
|
13018
13431
|
...recoveryError === void 0 ? {} : { recoveryError }
|
|
13019
13432
|
});
|
|
13020
13433
|
});
|
|
13021
|
-
var disableAutoTopUpCommand = new
|
|
13434
|
+
var disableAutoTopUpCommand = new Command56("disable-auto-top-up").description("Turn off auto-top-up and close its allocation").action(async () => {
|
|
13022
13435
|
printResult({ config: await disableComputeAutoTopUp() });
|
|
13023
13436
|
});
|
|
13024
|
-
var agentCreditsCommand = new
|
|
13437
|
+
var agentCreditsCommand = new Command56("credits").description("Prepaid compute credit for agent sandboxes, bought over x402").addCommand(setupCommand).addCommand(buyCommand).addCommand(statusCommand2).addCommand(checkCommand).addCommand(reconcileCommand).addCommand(disableAutoTopUpCommand);
|
|
13025
13438
|
|
|
13026
13439
|
// src/commands/agent/launch.ts
|
|
13027
13440
|
var EXPERIMENTAL_AGENT_ENV = "TASKMARKET_EXPERIMENTAL_AGENT";
|
|
@@ -13043,7 +13456,7 @@ async function runAgentCommand(options) {
|
|
|
13043
13456
|
try {
|
|
13044
13457
|
const { assertAgentCompatibility } = await import("./compatibility-636WJOEX.js");
|
|
13045
13458
|
const pi = assertAgentCompatibility();
|
|
13046
|
-
const { runAgent } = await import("./launch-
|
|
13459
|
+
const { runAgent } = await import("./launch-FOCL5JOR.js");
|
|
13047
13460
|
result = await runAgent({
|
|
13048
13461
|
model: options.model,
|
|
13049
13462
|
pi,
|
|
@@ -13074,10 +13487,10 @@ async function runAgentCommand(options) {
|
|
|
13074
13487
|
}
|
|
13075
13488
|
|
|
13076
13489
|
// src/commands/agent/listing.ts
|
|
13077
|
-
import { createHash, randomBytes as randomBytes4 } from "crypto";
|
|
13490
|
+
import { createHash as createHash2, randomBytes as randomBytes4 } from "crypto";
|
|
13078
13491
|
import { readFile as readFile2 } from "fs/promises";
|
|
13079
13492
|
import { extname } from "path";
|
|
13080
|
-
import { Command as
|
|
13493
|
+
import { Command as Command57, Option as Option3 } from "commander";
|
|
13081
13494
|
var WRITE_TTL_SECONDS2 = 5 * 60;
|
|
13082
13495
|
var HOUR = 3600;
|
|
13083
13496
|
var LISTING_UNTRUSTED_FIELDS = [
|
|
@@ -13184,7 +13597,7 @@ async function sendAvatar(file) {
|
|
|
13184
13597
|
const bytes = await readFile2(file);
|
|
13185
13598
|
if (bytes.length > AGENT_AVATAR_MAX_BYTES) throw new Error("--avatar must be at most 1 MB");
|
|
13186
13599
|
image = bytes.toString("base64");
|
|
13187
|
-
imageSha256 =
|
|
13600
|
+
imageSha256 = createHash2("sha256").update(bytes).digest("hex");
|
|
13188
13601
|
}
|
|
13189
13602
|
const keystore = await loadKeystore();
|
|
13190
13603
|
const nonce = `0x${randomBytes4(32).toString("hex")}`;
|
|
@@ -13210,7 +13623,7 @@ async function ownListing() {
|
|
|
13210
13623
|
const keystore = await loadKeystore();
|
|
13211
13624
|
return fetchListing(keystore.walletAddress);
|
|
13212
13625
|
}
|
|
13213
|
-
var profileCommand = new
|
|
13626
|
+
var profileCommand = new Command57("profile").description(
|
|
13214
13627
|
"Your listing's profile: name, description, roles, specialties and capabilities"
|
|
13215
13628
|
);
|
|
13216
13629
|
profileCommand.command("set").description(
|
|
@@ -13362,7 +13775,7 @@ function addServiceOptions(command) {
|
|
|
13362
13775
|
"fixed or quote: a hire of this service must name an evaluator before it is accepted"
|
|
13363
13776
|
).option("--no-requires-evaluator", "fixed or quote: hires need no evaluator (the default)");
|
|
13364
13777
|
}
|
|
13365
|
-
var serviceCommand = new
|
|
13778
|
+
var serviceCommand = new Command57("service").description(
|
|
13366
13779
|
"Your listing services: the priced offers requesters hire you for"
|
|
13367
13780
|
);
|
|
13368
13781
|
addServiceOptions(
|
|
@@ -13404,7 +13817,7 @@ serviceCommand.command("remove").description("Remove a service from your listing
|
|
|
13404
13817
|
renderFailure(err);
|
|
13405
13818
|
}
|
|
13406
13819
|
});
|
|
13407
|
-
var availabilityCommand = new
|
|
13820
|
+
var availabilityCommand = new Command57("availability").description(
|
|
13408
13821
|
"Open your listing for hires or pause it (services stay visible but cannot be hired), and set your capacity"
|
|
13409
13822
|
).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
13823
|
try {
|
|
@@ -13424,7 +13837,7 @@ var availabilityCommand = new Command56("availability").description(
|
|
|
13424
13837
|
renderFailure(err);
|
|
13425
13838
|
}
|
|
13426
13839
|
});
|
|
13427
|
-
var listingCommand = new
|
|
13840
|
+
var listingCommand = new Command57("listing").description(
|
|
13428
13841
|
"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
13842
|
).argument("[address]", "Wallet address; your own when left out").action(async (address3) => {
|
|
13430
13843
|
try {
|
|
@@ -13451,7 +13864,7 @@ function agentListingCommands() {
|
|
|
13451
13864
|
}
|
|
13452
13865
|
|
|
13453
13866
|
// src/commands/agent/manage.ts
|
|
13454
|
-
import { Command as
|
|
13867
|
+
import { Command as Command58 } from "commander";
|
|
13455
13868
|
async function run(work) {
|
|
13456
13869
|
try {
|
|
13457
13870
|
const value = await work();
|
|
@@ -13474,27 +13887,27 @@ async function requireExperimental() {
|
|
|
13474
13887
|
);
|
|
13475
13888
|
}
|
|
13476
13889
|
function agentManagementCommands() {
|
|
13477
|
-
const status = new
|
|
13890
|
+
const status = new Command58("status").description(
|
|
13478
13891
|
"Show the agent channels (locked, charged, refundable), purchases with an unknown outcome, the sandbox and compute credit. Reads only."
|
|
13479
13892
|
).action(async () => {
|
|
13480
|
-
const { collectAgentStatus } = await import("./status-
|
|
13893
|
+
const { collectAgentStatus } = await import("./status-A636ECTT.js");
|
|
13481
13894
|
await run(() => collectAgentStatus());
|
|
13482
13895
|
});
|
|
13483
|
-
const doctor = new
|
|
13896
|
+
const doctor = new Command58("doctor").description(
|
|
13484
13897
|
"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
13898
|
).action(async () => {
|
|
13486
|
-
const { runDoctor } = await import("./doctor-
|
|
13899
|
+
const { runDoctor } = await import("./doctor-NTQ3ZJRU.js");
|
|
13487
13900
|
const report = await run(() => runDoctor());
|
|
13488
13901
|
if (report && !report.ok) process.exitCode = 1;
|
|
13489
13902
|
});
|
|
13490
|
-
const reconcile = new
|
|
13903
|
+
const reconcile = new Command58("reconcile").description(
|
|
13491
13904
|
"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
13905
|
).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
13906
|
"--channel <channel-id>",
|
|
13494
13907
|
"Reconcile the open purchases of this channel, as status lists it; also reaches retired channels"
|
|
13495
13908
|
).action(
|
|
13496
13909
|
async (invocationId, options) => {
|
|
13497
|
-
const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-
|
|
13910
|
+
const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-IKPAKGH3.js");
|
|
13498
13911
|
const choice = { rail: options.rail, channel: options.channel };
|
|
13499
13912
|
if (invocationId !== void 0) {
|
|
13500
13913
|
await run(() => reconcileInvocation(invocationId, { choice }));
|
|
@@ -13512,7 +13925,7 @@ function agentManagementCommands() {
|
|
|
13512
13925
|
});
|
|
13513
13926
|
}
|
|
13514
13927
|
);
|
|
13515
|
-
const topup = new
|
|
13928
|
+
const topup = new Command58("topup").description(
|
|
13516
13929
|
"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
13930
|
).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
13931
|
await run(async () => {
|
|
@@ -13526,7 +13939,7 @@ function agentManagementCommands() {
|
|
|
13526
13939
|
`Not a USDC amount: ${options.amount} (digits, at most 6 decimals)`
|
|
13527
13940
|
);
|
|
13528
13941
|
}
|
|
13529
|
-
const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-
|
|
13942
|
+
const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-FWGJII6Y.js");
|
|
13530
13943
|
const { rails } = await openAgentChannels();
|
|
13531
13944
|
const result = await requestTopUp(selectRail(rails, options.rail), amount);
|
|
13532
13945
|
return {
|
|
@@ -13537,7 +13950,7 @@ function agentManagementCommands() {
|
|
|
13537
13950
|
};
|
|
13538
13951
|
});
|
|
13539
13952
|
});
|
|
13540
|
-
const close = new
|
|
13953
|
+
const close = new Command58("close").description(
|
|
13541
13954
|
"Close the agent's channel and refund its unused balance cooperatively; checks an earlier close instead of sending it again"
|
|
13542
13955
|
).option("--rail <id>", "The rail to close (required when the policy has more than one)").option(
|
|
13543
13956
|
"--channel <channel-id>",
|
|
@@ -13546,8 +13959,8 @@ function agentManagementCommands() {
|
|
|
13546
13959
|
await run(async () => {
|
|
13547
13960
|
await requireExperimental();
|
|
13548
13961
|
const { AGENT_VIEW_VERSION } = await import("./budget-view-J6L7X6EY.js");
|
|
13549
|
-
const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-
|
|
13550
|
-
const { reconcileLeasedPurchase } = await import("./reconcile-
|
|
13962
|
+
const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-FWGJII6Y.js");
|
|
13963
|
+
const { reconcileLeasedPurchase } = await import("./reconcile-IKPAKGH3.js");
|
|
13551
13964
|
const opened = await openAgentChannels();
|
|
13552
13965
|
const { rail, retired } = selectChannel(opened, options);
|
|
13553
13966
|
const result = await closeChannel(
|
|
@@ -13578,7 +13991,7 @@ function agentManagementCommands() {
|
|
|
13578
13991
|
};
|
|
13579
13992
|
});
|
|
13580
13993
|
});
|
|
13581
|
-
const pull = new
|
|
13994
|
+
const pull = new Command58("pull").description(
|
|
13582
13995
|
"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
13996
|
).option("--diff", "Print the full diff").option("--apply", "Apply the clean changes without asking").option(
|
|
13584
13997
|
"--overwrite <path>",
|
|
@@ -13601,7 +14014,7 @@ function agentManagementCommands() {
|
|
|
13601
14014
|
async (options) => {
|
|
13602
14015
|
await run(async () => {
|
|
13603
14016
|
await requireExperimental();
|
|
13604
|
-
const { runPull } = await import("./sync-pull-
|
|
14017
|
+
const { runPull } = await import("./sync-pull-DVC4R6BN.js");
|
|
13605
14018
|
const { terminalPrompter } = await import("./prompter-LSICEYSQ.js");
|
|
13606
14019
|
return runPull(options, {
|
|
13607
14020
|
interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
@@ -13619,7 +14032,7 @@ function agentManagementCommands() {
|
|
|
13619
14032
|
|
|
13620
14033
|
// src/commands/agent/index.ts
|
|
13621
14034
|
var experimental = agentCommandEnabled();
|
|
13622
|
-
var agentCommand = new
|
|
14035
|
+
var agentCommand = new Command59("agent").description(
|
|
13623
14036
|
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
14037
|
).addOption(
|
|
13625
14038
|
new Option4("--model <id>", "Start on one model from your approved spending policy").hideHelp(
|
|
@@ -13656,7 +14069,7 @@ for (const command of agentManagementCommands()) {
|
|
|
13656
14069
|
}
|
|
13657
14070
|
|
|
13658
14071
|
// src/commands/agents.ts
|
|
13659
|
-
import { Command as
|
|
14072
|
+
import { Command as Command60 } from "commander";
|
|
13660
14073
|
var MIN_RATINGS = ["3", "4", "4.5"];
|
|
13661
14074
|
var MIN_TASKS = ["5", "10", "50"];
|
|
13662
14075
|
var AVAILABILITIES = ["available", "unavailable", "any"];
|
|
@@ -13666,7 +14079,7 @@ function allowListed(flag, value, allowed) {
|
|
|
13666
14079
|
throw new Error(`${flag} must be one of: ${allowed.join(", ")}`);
|
|
13667
14080
|
}
|
|
13668
14081
|
}
|
|
13669
|
-
var agentsCommand = new
|
|
14082
|
+
var agentsCommand = new Command60("agents").description("Browse the worker directory (agents and humans) on the selected --network").enablePositionalOptions().option(
|
|
13670
14083
|
"--sort <order>",
|
|
13671
14084
|
"Sort order: reputation (top rated), tasks, hires (most hired: completed reserved, quote and request hires) or volume (settled earnings)",
|
|
13672
14085
|
"reputation"
|
|
@@ -13912,7 +14325,7 @@ agentsCommand.command("report").description("Report a worker's listing, or one o
|
|
|
13912
14325
|
});
|
|
13913
14326
|
|
|
13914
14327
|
// src/commands/dashboard.ts
|
|
13915
|
-
import { Command as
|
|
14328
|
+
import { Command as Command61 } from "commander";
|
|
13916
14329
|
|
|
13917
14330
|
// src/lib/dashboard.ts
|
|
13918
14331
|
var DASHBOARD_LIST_LIMIT = 5;
|
|
@@ -14109,7 +14522,7 @@ async function settle(read4) {
|
|
|
14109
14522
|
return { value: null, error: error instanceof Error ? error.message : String(error) };
|
|
14110
14523
|
}
|
|
14111
14524
|
}
|
|
14112
|
-
var dashboardCommand = new
|
|
14525
|
+
var dashboardCommand = new Command61("dashboard").description(
|
|
14113
14526
|
"Show your home base: what needs you, your money, tasks you posted and work you do, projects and workflows, and recent activity"
|
|
14114
14527
|
).action(async () => {
|
|
14115
14528
|
const auth = await signReadAuth();
|
|
@@ -14218,8 +14631,8 @@ var dashboardCommand = new Command60("dashboard").description(
|
|
|
14218
14631
|
});
|
|
14219
14632
|
|
|
14220
14633
|
// src/commands/inbox.ts
|
|
14221
|
-
import { Command as
|
|
14222
|
-
var inboxCommand = new
|
|
14634
|
+
import { Command as Command62 } from "commander";
|
|
14635
|
+
var inboxCommand = new Command62("inbox").description(
|
|
14223
14636
|
"Show what you need to do now, then tasks you created, tasks you are working on, and private tasks you were invited to"
|
|
14224
14637
|
).option(
|
|
14225
14638
|
"--limit <n>",
|
|
@@ -14362,7 +14775,7 @@ var inboxCommand = new Command61("inbox").description(
|
|
|
14362
14775
|
);
|
|
14363
14776
|
|
|
14364
14777
|
// src/commands/deposit.ts
|
|
14365
|
-
import { Command as
|
|
14778
|
+
import { Command as Command63 } from "commander";
|
|
14366
14779
|
|
|
14367
14780
|
// src/lib/relay-bridge.ts
|
|
14368
14781
|
import { z as z4 } from "zod";
|
|
@@ -14445,7 +14858,7 @@ async function fundingOptionsFor(chainId) {
|
|
|
14445
14858
|
note: "Run `taskmarket deposit --relay-route <routeId> --amount <n>` for a Relay deposit address. Fiat funding: see issue #2720."
|
|
14446
14859
|
};
|
|
14447
14860
|
}
|
|
14448
|
-
var depositCommand = new
|
|
14861
|
+
var depositCommand = new Command63("deposit").description(
|
|
14449
14862
|
"Show wallet address, network info and cross-chain funding options for the selected --network"
|
|
14450
14863
|
).option(
|
|
14451
14864
|
"--relay-route <routeId>",
|
|
@@ -14535,10 +14948,10 @@ var depositCommand = new Command62("deposit").description(
|
|
|
14535
14948
|
});
|
|
14536
14949
|
|
|
14537
14950
|
// src/commands/wallet/index.ts
|
|
14538
|
-
import { Command as
|
|
14951
|
+
import { Command as Command74 } from "commander";
|
|
14539
14952
|
|
|
14540
14953
|
// src/commands/wallet/balance.ts
|
|
14541
|
-
import { Command as
|
|
14954
|
+
import { Command as Command64 } from "commander";
|
|
14542
14955
|
function balancePath(address3, chainId) {
|
|
14543
14956
|
return `/api/wallet/balance?address=${address3}&chainId=${chainId}`;
|
|
14544
14957
|
}
|
|
@@ -14572,7 +14985,7 @@ async function allChainBalances(address3) {
|
|
|
14572
14985
|
);
|
|
14573
14986
|
return { address: address3, chains };
|
|
14574
14987
|
}
|
|
14575
|
-
var walletBalanceCommand = new
|
|
14988
|
+
var walletBalanceCommand = new Command64("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
14989
|
"--all-chains",
|
|
14577
14990
|
"Show the balance on every chain the selected deployment serves, one entry per chain"
|
|
14578
14991
|
).option(
|
|
@@ -14612,7 +15025,7 @@ var walletBalanceCommand = new Command63("balance").description("Show the wallet
|
|
|
14612
15025
|
);
|
|
14613
15026
|
|
|
14614
15027
|
// src/commands/wallet/import.ts
|
|
14615
|
-
import { Command as
|
|
15028
|
+
import { Command as Command65 } from "commander";
|
|
14616
15029
|
import { createInterface as createInterface4 } from "readline";
|
|
14617
15030
|
import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
|
|
14618
15031
|
function normalizePrivateKey(raw) {
|
|
@@ -14623,7 +15036,7 @@ function normalizePrivateKey(raw) {
|
|
|
14623
15036
|
return `0x${hex3}`;
|
|
14624
15037
|
}
|
|
14625
15038
|
function promptHiddenInput(prompt) {
|
|
14626
|
-
return new Promise((
|
|
15039
|
+
return new Promise((resolve2) => {
|
|
14627
15040
|
const rl = createInterface4({
|
|
14628
15041
|
input: process.stdin,
|
|
14629
15042
|
output: process.stderr,
|
|
@@ -14643,7 +15056,7 @@ function promptHiddenInput(prompt) {
|
|
|
14643
15056
|
muted.muted = false;
|
|
14644
15057
|
process.stderr.write("\n");
|
|
14645
15058
|
rl.close();
|
|
14646
|
-
|
|
15059
|
+
resolve2(answer);
|
|
14647
15060
|
});
|
|
14648
15061
|
});
|
|
14649
15062
|
}
|
|
@@ -14686,7 +15099,7 @@ async function importSolanaWallet(flagKey) {
|
|
|
14686
15099
|
{ warnings: argvKeyWarnings(keySource) }
|
|
14687
15100
|
);
|
|
14688
15101
|
}
|
|
14689
|
-
var walletImportCommand = new
|
|
15102
|
+
var walletImportCommand = new Command65("import").description("Import an existing private key as the agent wallet").option(
|
|
14690
15103
|
"--key <privateKey>",
|
|
14691
15104
|
"Private key to import (64 hex chars, with or without 0x prefix; with --solana, a base58 or JSON-array Solana secret key)"
|
|
14692
15105
|
).option(
|
|
@@ -14777,7 +15190,7 @@ var walletImportCommand = new Command64("import").description("Import an existin
|
|
|
14777
15190
|
|
|
14778
15191
|
// src/commands/wallet/set-withdrawal-address.ts
|
|
14779
15192
|
import { randomBytes as randomBytes5 } from "crypto";
|
|
14780
|
-
import { Command as
|
|
15193
|
+
import { Command as Command66 } from "commander";
|
|
14781
15194
|
|
|
14782
15195
|
// src/lib/withdrawal-pin.ts
|
|
14783
15196
|
var WithdrawalAddressMismatchError = class extends Error {
|
|
@@ -14854,7 +15267,7 @@ var SIGNATURE_TTL_SECONDS = 5 * 60;
|
|
|
14854
15267
|
function isValidAddress(addr) {
|
|
14855
15268
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
14856
15269
|
}
|
|
14857
|
-
var setWithdrawalAddressCommand = new
|
|
15270
|
+
var setWithdrawalAddressCommand = new Command66("set-withdrawal-address").description(
|
|
14858
15271
|
"Set the withdrawal address for payment-token withdrawals on the selected network (once per chain, free)"
|
|
14859
15272
|
).argument("<address>", "Ethereum address to receive withdrawals").action(async (address3) => {
|
|
14860
15273
|
if (!isValidAddress(address3)) {
|
|
@@ -14915,8 +15328,8 @@ var setWithdrawalAddressCommand = new Command65("set-withdrawal-address").descri
|
|
|
14915
15328
|
});
|
|
14916
15329
|
|
|
14917
15330
|
// src/commands/wallet/get-withdrawal-address.ts
|
|
14918
|
-
import { Command as
|
|
14919
|
-
var getWithdrawalAddressCommand = new
|
|
15331
|
+
import { Command as Command67 } from "commander";
|
|
15332
|
+
var getWithdrawalAddressCommand = new Command67("get-withdrawal-address").description(
|
|
14920
15333
|
"Show the withdrawal address registered on the selected network, if any (the address is per chain)"
|
|
14921
15334
|
).option("--address <addr>", "Wallet address to check (defaults to own wallet)").action(async (opts) => {
|
|
14922
15335
|
let address3 = opts.address;
|
|
@@ -14932,14 +15345,14 @@ var getWithdrawalAddressCommand = new Command66("get-withdrawal-address").descri
|
|
|
14932
15345
|
});
|
|
14933
15346
|
|
|
14934
15347
|
// src/commands/wallet/change-withdrawal-address.ts
|
|
14935
|
-
import { Command as
|
|
15348
|
+
import { Command as Command68 } from "commander";
|
|
14936
15349
|
function isValidAddress2(addr) {
|
|
14937
15350
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
14938
15351
|
}
|
|
14939
15352
|
function isValidRecoveryCode(code) {
|
|
14940
15353
|
return /^\d{8}$/.test(code);
|
|
14941
15354
|
}
|
|
14942
|
-
var changeWithdrawalAddressCommand = new
|
|
15355
|
+
var changeWithdrawalAddressCommand = new Command68("change-withdrawal-address").description(
|
|
14943
15356
|
"Change the selected network's withdrawal address using that chain's account recovery code (RFC-0012)"
|
|
14944
15357
|
).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
15358
|
if (!isValidRecoveryCode(recoveryCode)) {
|
|
@@ -14991,8 +15404,8 @@ var changeWithdrawalAddressCommand = new Command67("change-withdrawal-address").
|
|
|
14991
15404
|
});
|
|
14992
15405
|
|
|
14993
15406
|
// src/commands/wallet/sync-withdrawal-address.ts
|
|
14994
|
-
import { Command as
|
|
14995
|
-
var syncWithdrawalAddressCommand = new
|
|
15407
|
+
import { Command as Command69 } from "commander";
|
|
15408
|
+
var syncWithdrawalAddressCommand = new Command69("sync-withdrawal-address").description(
|
|
14996
15409
|
"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
15410
|
).action(async () => {
|
|
14998
15411
|
let keystore;
|
|
@@ -15025,8 +15438,8 @@ var syncWithdrawalAddressCommand = new Command68("sync-withdrawal-address").desc
|
|
|
15025
15438
|
});
|
|
15026
15439
|
|
|
15027
15440
|
// src/commands/wallet/reveal-recovery-code.ts
|
|
15028
|
-
import { Command as
|
|
15029
|
-
var revealRecoveryCodeCommand = new
|
|
15441
|
+
import { Command as Command70 } from "commander";
|
|
15442
|
+
var revealRecoveryCodeCommand = new Command70("reveal-recovery-code").description(
|
|
15030
15443
|
"One-time reveal of the selected network's account recovery code, if one has not been generated yet"
|
|
15031
15444
|
).action(async () => {
|
|
15032
15445
|
let keystore;
|
|
@@ -15065,8 +15478,8 @@ var revealRecoveryCodeCommand = new Command69("reveal-recovery-code").descriptio
|
|
|
15065
15478
|
});
|
|
15066
15479
|
|
|
15067
15480
|
// src/commands/wallet/publish-key.ts
|
|
15068
|
-
import { Command as
|
|
15069
|
-
var publishKeyCommand = new
|
|
15481
|
+
import { Command as Command71 } from "commander";
|
|
15482
|
+
var publishKeyCommand = new Command71("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
|
|
15070
15483
|
let keystore;
|
|
15071
15484
|
try {
|
|
15072
15485
|
keystore = await loadKeystore();
|
|
@@ -15086,7 +15499,7 @@ var publishKeyCommand = new Command70("publish-key").description("Publish your s
|
|
|
15086
15499
|
});
|
|
15087
15500
|
|
|
15088
15501
|
// src/commands/wallet/withdraw-dreams.ts
|
|
15089
|
-
import { Command as
|
|
15502
|
+
import { Command as Command72 } from "commander";
|
|
15090
15503
|
import { toHex } from "viem";
|
|
15091
15504
|
var AUTHORIZATION_VALIDITY_SECONDS = 300;
|
|
15092
15505
|
function isValidAddress3(addr) {
|
|
@@ -15108,7 +15521,7 @@ function withdrawalTargets(balance, hook) {
|
|
|
15108
15521
|
targets: hooks.filter((entry) => BigInt(entry.claimableBaseUnits) > 0n).map((entry) => ({ hookAddress: entry.hookAddress, send: true }))
|
|
15109
15522
|
};
|
|
15110
15523
|
}
|
|
15111
|
-
var withdrawDreamsCommand = new
|
|
15524
|
+
var withdrawDreamsCommand = new Command72("withdraw-dreams").description(
|
|
15112
15525
|
"Withdraw accumulated DREAMS rewards to the withdrawal address: one signed withdrawal from each reward hook holding a balance, or from --hook alone"
|
|
15113
15526
|
).option("--destination <addr>", "Destination address (defaults to registered withdrawal address)").option("--hook <address>", "Withdraw from this reward hook only").action(async (opts) => {
|
|
15114
15527
|
let keystore;
|
|
@@ -15229,7 +15642,7 @@ var withdrawDreamsCommand = new Command71("withdraw-dreams").description(
|
|
|
15229
15642
|
});
|
|
15230
15643
|
|
|
15231
15644
|
// src/commands/wallet/bridge.ts
|
|
15232
|
-
import { Command as
|
|
15645
|
+
import { Command as Command73 } from "commander";
|
|
15233
15646
|
import { toHex as toHex2 } from "viem";
|
|
15234
15647
|
var USDC_TYPES = {
|
|
15235
15648
|
TransferWithAuthorization: [
|
|
@@ -15247,7 +15660,7 @@ function progress(message) {
|
|
|
15247
15660
|
`);
|
|
15248
15661
|
}
|
|
15249
15662
|
function sleep(ms2) {
|
|
15250
|
-
return new Promise((
|
|
15663
|
+
return new Promise((resolve2) => setTimeout(resolve2, ms2));
|
|
15251
15664
|
}
|
|
15252
15665
|
function sameAddress2(a, b) {
|
|
15253
15666
|
return a.toLowerCase() === b.toLowerCase();
|
|
@@ -15273,7 +15686,7 @@ async function pollBridgeStatus(requestId) {
|
|
|
15273
15686
|
await sleep(bridgeTiming.intervalMs);
|
|
15274
15687
|
}
|
|
15275
15688
|
}
|
|
15276
|
-
var walletBridgeCommand = new
|
|
15689
|
+
var walletBridgeCommand = new Command73("bridge").description(
|
|
15277
15690
|
"Move free USDC on Base to OUSD at the same address on Tempo (gasless, through Relay)"
|
|
15278
15691
|
).requiredOption("--to <chain>", 'Destination chain (only "tempo")').option(
|
|
15279
15692
|
"--recipient <address>",
|
|
@@ -15412,7 +15825,7 @@ var walletBridgeCommand = new Command72("bridge").description(
|
|
|
15412
15825
|
});
|
|
15413
15826
|
|
|
15414
15827
|
// src/commands/wallet/index.ts
|
|
15415
|
-
var walletCommand = new
|
|
15828
|
+
var walletCommand = new Command74("wallet").description("Wallet management commands");
|
|
15416
15829
|
walletCommand.addCommand(walletBalanceCommand);
|
|
15417
15830
|
walletCommand.addCommand(walletImportCommand);
|
|
15418
15831
|
walletCommand.addCommand(setWithdrawalAddressCommand);
|
|
@@ -15425,7 +15838,7 @@ walletCommand.addCommand(withdrawDreamsCommand);
|
|
|
15425
15838
|
walletCommand.addCommand(walletBridgeCommand);
|
|
15426
15839
|
|
|
15427
15840
|
// src/commands/withdraw.ts
|
|
15428
|
-
import { Command as
|
|
15841
|
+
import { Command as Command75 } from "commander";
|
|
15429
15842
|
import { toHex as toHex3 } from "viem";
|
|
15430
15843
|
|
|
15431
15844
|
// src/lib/solana-relay.ts
|
|
@@ -15483,7 +15896,7 @@ async function waitForSolanaSignature(rpc, signature, { timeoutMs = CONFIRM_TIME
|
|
|
15483
15896
|
if (status?.confirmationStatus === "confirmed" || status?.confirmationStatus === "finalized")
|
|
15484
15897
|
return true;
|
|
15485
15898
|
if (Date.now() >= deadline) return false;
|
|
15486
|
-
await new Promise((
|
|
15899
|
+
await new Promise((resolve2) => setTimeout(resolve2, pollMs));
|
|
15487
15900
|
}
|
|
15488
15901
|
}
|
|
15489
15902
|
async function relaySolanaInstructions(input) {
|
|
@@ -15604,7 +16017,7 @@ var USDC_TYPES2 = {
|
|
|
15604
16017
|
{ name: "nonce", type: "bytes32" }
|
|
15605
16018
|
]
|
|
15606
16019
|
};
|
|
15607
|
-
var withdrawCommand = new
|
|
16020
|
+
var withdrawCommand = new Command75("withdraw").description(
|
|
15608
16021
|
"Withdraw the payment token (USDC on Base, OUSD on Tempo) to the registered withdrawal address"
|
|
15609
16022
|
).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
16023
|
if (opts.solana) {
|
|
@@ -15693,9 +16106,9 @@ var withdrawCommand = new Command74("withdraw").description(
|
|
|
15693
16106
|
});
|
|
15694
16107
|
|
|
15695
16108
|
// src/commands/encrypt.ts
|
|
15696
|
-
import { Command as
|
|
16109
|
+
import { Command as Command76 } from "commander";
|
|
15697
16110
|
import { promises as fs2 } from "fs";
|
|
15698
|
-
var encryptCommand = new
|
|
16111
|
+
var encryptCommand = new Command76("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
16112
|
let plaintext;
|
|
15700
16113
|
try {
|
|
15701
16114
|
plaintext = await fs2.readFile(file);
|
|
@@ -15743,9 +16156,9 @@ var encryptCommand = new Command75("encrypt").description("Encrypt a file with E
|
|
|
15743
16156
|
});
|
|
15744
16157
|
|
|
15745
16158
|
// src/commands/decrypt.ts
|
|
15746
|
-
import { Command as
|
|
16159
|
+
import { Command as Command77 } from "commander";
|
|
15747
16160
|
import { promises as fs3 } from "fs";
|
|
15748
|
-
var decryptCommand = new
|
|
16161
|
+
var decryptCommand = new Command77("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
16162
|
let ciphertext;
|
|
15750
16163
|
try {
|
|
15751
16164
|
ciphertext = await fs3.readFile(file);
|
|
@@ -15785,7 +16198,7 @@ var decryptCommand = new Command76("decrypt").description("Decrypt a file using
|
|
|
15785
16198
|
});
|
|
15786
16199
|
|
|
15787
16200
|
// src/commands/xmtp.ts
|
|
15788
|
-
import { Command as
|
|
16201
|
+
import { Command as Command78 } from "commander";
|
|
15789
16202
|
|
|
15790
16203
|
// src/lib/xmtp-client.ts
|
|
15791
16204
|
import fs6 from "fs";
|
|
@@ -15823,12 +16236,12 @@ function decodeEnvelope(raw) {
|
|
|
15823
16236
|
var XmtpQueryManager = class {
|
|
15824
16237
|
pending = /* @__PURE__ */ new Map();
|
|
15825
16238
|
waitForResponse(requestId, timeoutMs) {
|
|
15826
|
-
return new Promise((
|
|
16239
|
+
return new Promise((resolve2, reject) => {
|
|
15827
16240
|
const timeout = setTimeout(() => {
|
|
15828
16241
|
this.pending.delete(requestId);
|
|
15829
16242
|
reject(new Error(`XMTP query timed out after ${timeoutMs}ms`));
|
|
15830
16243
|
}, timeoutMs);
|
|
15831
|
-
this.pending.set(requestId, { resolve, reject, timeout });
|
|
16244
|
+
this.pending.set(requestId, { resolve: resolve2, reject, timeout });
|
|
15832
16245
|
});
|
|
15833
16246
|
}
|
|
15834
16247
|
resolveResponse(envelope) {
|
|
@@ -16094,7 +16507,7 @@ function shouldHandleEnvelope(envelope, options) {
|
|
|
16094
16507
|
return true;
|
|
16095
16508
|
}
|
|
16096
16509
|
function sleep2(ms2) {
|
|
16097
|
-
return new Promise((
|
|
16510
|
+
return new Promise((resolve2) => setTimeout(resolve2, ms2));
|
|
16098
16511
|
}
|
|
16099
16512
|
async function runStreamWithReconnect(options) {
|
|
16100
16513
|
const maxReconnectAttempts = options.maxReconnectAttempts ?? Number.POSITIVE_INFINITY;
|
|
@@ -16248,7 +16661,7 @@ async function createDevClient(input) {
|
|
|
16248
16661
|
live = true;
|
|
16249
16662
|
options?.onLive?.();
|
|
16250
16663
|
}
|
|
16251
|
-
await new Promise((
|
|
16664
|
+
await new Promise((resolve2) => setTimeout(resolve2, 100));
|
|
16252
16665
|
}
|
|
16253
16666
|
return;
|
|
16254
16667
|
}
|
|
@@ -16263,7 +16676,7 @@ async function createDevClient(input) {
|
|
|
16263
16676
|
}
|
|
16264
16677
|
continue;
|
|
16265
16678
|
}
|
|
16266
|
-
await new Promise((
|
|
16679
|
+
await new Promise((resolve2) => setTimeout(resolve2, 250));
|
|
16267
16680
|
}
|
|
16268
16681
|
},
|
|
16269
16682
|
async setConsentState(_inboxId, _state) {
|
|
@@ -16394,7 +16807,7 @@ function toTransportError(error, fallbackMessage) {
|
|
|
16394
16807
|
return new XmtpTransportError(message, category, error);
|
|
16395
16808
|
}
|
|
16396
16809
|
function sleep3(ms2) {
|
|
16397
|
-
return new Promise((
|
|
16810
|
+
return new Promise((resolve2) => setTimeout(resolve2, ms2));
|
|
16398
16811
|
}
|
|
16399
16812
|
function parseRetryAttempts() {
|
|
16400
16813
|
const raw = process.env.TASKMARKET_XMTP_SEND_MAX_ATTEMPTS;
|
|
@@ -16493,7 +16906,7 @@ async function sendViaConversation(client, toInboxId, body) {
|
|
|
16493
16906
|
);
|
|
16494
16907
|
}
|
|
16495
16908
|
function callAsync(operation) {
|
|
16496
|
-
return new Promise((
|
|
16909
|
+
return new Promise((resolve2) => resolve2(operation()));
|
|
16497
16910
|
}
|
|
16498
16911
|
async function sendWithSdkClient(client, toInboxId, body) {
|
|
16499
16912
|
const clientObject = asObject(client);
|
|
@@ -17199,7 +17612,7 @@ function senderInboxIdFor(keystore, client) {
|
|
|
17199
17612
|
}
|
|
17200
17613
|
return client.inboxId;
|
|
17201
17614
|
}
|
|
17202
|
-
var xmtpCommand = new
|
|
17615
|
+
var xmtpCommand = new Command78("xmtp").description("Manage XMTP messaging for this agent");
|
|
17203
17616
|
xmtpCommand.hook("preAction", () => {
|
|
17204
17617
|
if (resolveXmtpEnv() !== "memory") assertXmtpSupported();
|
|
17205
17618
|
});
|
|
@@ -17464,7 +17877,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
|
|
|
17464
17877
|
});
|
|
17465
17878
|
|
|
17466
17879
|
// src/commands/daemon.ts
|
|
17467
|
-
import { Command as
|
|
17880
|
+
import { Command as Command80 } from "commander";
|
|
17468
17881
|
|
|
17469
17882
|
// src/lib/market-event-settings-auth.ts
|
|
17470
17883
|
function signMarketEventSettingsWrite(change) {
|
|
@@ -17472,7 +17885,7 @@ function signMarketEventSettingsWrite(change) {
|
|
|
17472
17885
|
}
|
|
17473
17886
|
|
|
17474
17887
|
// src/commands/events.ts
|
|
17475
|
-
import { Command as
|
|
17888
|
+
import { Command as Command79 } from "commander";
|
|
17476
17889
|
|
|
17477
17890
|
// src/lib/market-event-cursor.ts
|
|
17478
17891
|
import { promises as fs7 } from "fs";
|
|
@@ -17582,15 +17995,15 @@ function warn(message) {
|
|
|
17582
17995
|
`);
|
|
17583
17996
|
}
|
|
17584
17997
|
function abortableSleep(ms2, signal) {
|
|
17585
|
-
return new Promise((
|
|
17998
|
+
return new Promise((resolve2) => {
|
|
17586
17999
|
if (signal?.aborted) {
|
|
17587
|
-
|
|
18000
|
+
resolve2();
|
|
17588
18001
|
return;
|
|
17589
18002
|
}
|
|
17590
18003
|
const done = () => {
|
|
17591
18004
|
clearTimeout(timer);
|
|
17592
18005
|
signal?.removeEventListener("abort", done);
|
|
17593
|
-
|
|
18006
|
+
resolve2();
|
|
17594
18007
|
};
|
|
17595
18008
|
const timer = setTimeout(done, ms2);
|
|
17596
18009
|
signal?.addEventListener("abort", done, { once: true });
|
|
@@ -17868,14 +18281,14 @@ async function readOrMarkSeen(options) {
|
|
|
17868
18281
|
printResult(data, { idempotencyKey });
|
|
17869
18282
|
}
|
|
17870
18283
|
function createSeenCommand() {
|
|
17871
|
-
return new
|
|
18284
|
+
return new Command79("seen").description(
|
|
17872
18285
|
"Show the newest event you have seen and how many are unread (the web Inbox's Activity count); --mark moves it forward"
|
|
17873
18286
|
).option("--mark <id>", "Mark events up to this event id as seen, or `latest` for all of them").action(async (options) => {
|
|
17874
18287
|
await readOrMarkSeen(options);
|
|
17875
18288
|
});
|
|
17876
18289
|
}
|
|
17877
18290
|
function createEventsCommand() {
|
|
17878
|
-
return new
|
|
18291
|
+
return new Command79("events").description(
|
|
17879
18292
|
"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
18293
|
).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
18294
|
"--task <taskId>",
|
|
@@ -17969,15 +18382,15 @@ var EMAIL_POLL_INTERVAL_MS = 6e4;
|
|
|
17969
18382
|
var EMAIL_RETRY_MAX_MS = 15 * 6e4;
|
|
17970
18383
|
var MAX_CURSOR_IDS = 100;
|
|
17971
18384
|
function abortableSleep2(ms2, signal) {
|
|
17972
|
-
return new Promise((
|
|
18385
|
+
return new Promise((resolve2) => {
|
|
17973
18386
|
if (signal?.aborted) {
|
|
17974
|
-
|
|
18387
|
+
resolve2();
|
|
17975
18388
|
return;
|
|
17976
18389
|
}
|
|
17977
18390
|
const done = () => {
|
|
17978
18391
|
clearTimeout(timer);
|
|
17979
18392
|
signal?.removeEventListener("abort", done);
|
|
17980
|
-
|
|
18393
|
+
resolve2();
|
|
17981
18394
|
};
|
|
17982
18395
|
const timer = setTimeout(done, ms2);
|
|
17983
18396
|
signal?.addEventListener("abort", done, { once: true });
|
|
@@ -18241,20 +18654,20 @@ async function storeTaskFilters(json) {
|
|
|
18241
18654
|
printResult({ source: "market", type: "discovery.filter", ...data }, { idempotencyKey });
|
|
18242
18655
|
}
|
|
18243
18656
|
function sleepOrAbort(ms2, signal) {
|
|
18244
|
-
return new Promise((
|
|
18245
|
-
const id = setTimeout(
|
|
18657
|
+
return new Promise((resolve2) => {
|
|
18658
|
+
const id = setTimeout(resolve2, ms2);
|
|
18246
18659
|
signal.addEventListener(
|
|
18247
18660
|
"abort",
|
|
18248
18661
|
() => {
|
|
18249
18662
|
clearTimeout(id);
|
|
18250
|
-
|
|
18663
|
+
resolve2();
|
|
18251
18664
|
},
|
|
18252
18665
|
{ once: true }
|
|
18253
18666
|
);
|
|
18254
18667
|
});
|
|
18255
18668
|
}
|
|
18256
18669
|
function createDaemonCommand(seams = {}) {
|
|
18257
|
-
return new
|
|
18670
|
+
return new Command80("daemon").description(
|
|
18258
18671
|
"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
18672
|
).option("--heartbeat-interval <ms>", "Heartbeat interval in milliseconds", "1800000").option(
|
|
18260
18673
|
"--task-filters <json>",
|
|
@@ -18433,10 +18846,10 @@ function createDaemonCommand(seams = {}) {
|
|
|
18433
18846
|
var daemonCommand = createDaemonCommand();
|
|
18434
18847
|
|
|
18435
18848
|
// src/commands/events-filter.ts
|
|
18436
|
-
import { Command as
|
|
18849
|
+
import { Command as Command82 } from "commander";
|
|
18437
18850
|
|
|
18438
18851
|
// src/commands/events-settings.ts
|
|
18439
|
-
import { Command as
|
|
18852
|
+
import { Command as Command81 } from "commander";
|
|
18440
18853
|
var PREFERENCES_PATH = "/api/market-events/preferences";
|
|
18441
18854
|
var CHANNEL_OPTION = [
|
|
18442
18855
|
"--channel <channel>",
|
|
@@ -18454,7 +18867,7 @@ async function walletHeaders() {
|
|
|
18454
18867
|
function parseChannel(channel) {
|
|
18455
18868
|
return parseInput(MarketEventWalletChannelSchema, channel ?? "email");
|
|
18456
18869
|
}
|
|
18457
|
-
var listCommand = new
|
|
18870
|
+
var listCommand = new Command81("list").description(
|
|
18458
18871
|
"Show which event types reach this wallet on one channel (email by default); locked types cannot be turned off"
|
|
18459
18872
|
).option(...CHANNEL_OPTION).action(async (options) => {
|
|
18460
18873
|
try {
|
|
@@ -18468,7 +18881,7 @@ var listCommand = new Command80("list").description(
|
|
|
18468
18881
|
}
|
|
18469
18882
|
});
|
|
18470
18883
|
function setCommand(name, enabled, description) {
|
|
18471
|
-
return new
|
|
18884
|
+
return new Command81(name).description(description).argument("<type>", "Event type, e.g. task.invited (see `taskmarket events settings list`)").option(...CHANNEL_OPTION).action(async (type, options) => {
|
|
18472
18885
|
try {
|
|
18473
18886
|
const channel = parseChannel(options.channel);
|
|
18474
18887
|
const body = parseInput(SetMarketEventPreferenceInputSchema, { type, enabled });
|
|
@@ -18488,7 +18901,7 @@ function setCommand(name, enabled, description) {
|
|
|
18488
18901
|
}
|
|
18489
18902
|
});
|
|
18490
18903
|
}
|
|
18491
|
-
var eventsSettingsCommand = new
|
|
18904
|
+
var eventsSettingsCommand = new Command81("settings").description(
|
|
18492
18905
|
"Choose which market events reach this wallet by email or as in-app notices in the web app"
|
|
18493
18906
|
).addCommand(listCommand).addCommand(setCommand("on", true, "Turn an event type on for this wallet on one channel")).addCommand(
|
|
18494
18907
|
setCommand(
|
|
@@ -18542,7 +18955,7 @@ function mergeFilter(current, options) {
|
|
|
18542
18955
|
}
|
|
18543
18956
|
return { filter: parsed.data };
|
|
18544
18957
|
}
|
|
18545
|
-
var eventsFilterCommand = new
|
|
18958
|
+
var eventsFilterCommand = new Command82("filter").description(
|
|
18546
18959
|
"Read or set this wallet's discovery filter: which newly listed tasks are announced to it as task.listed events"
|
|
18547
18960
|
).option("--enable", "Turn discovery on").option("--disable", "Turn discovery off: no task.listed events at all").option(
|
|
18548
18961
|
"--modes <list>",
|
|
@@ -18604,11 +19017,11 @@ function attachEventsFilter(program2) {
|
|
|
18604
19017
|
}
|
|
18605
19018
|
|
|
18606
19019
|
// src/commands/email/index.ts
|
|
18607
|
-
import { Command as
|
|
19020
|
+
import { Command as Command91 } from "commander";
|
|
18608
19021
|
|
|
18609
19022
|
// src/commands/email/register.ts
|
|
18610
|
-
import { Command as
|
|
18611
|
-
var registerCommand = new
|
|
19023
|
+
import { Command as Command83 } from "commander";
|
|
19024
|
+
var registerCommand = new Command83("register").description("Register an email address for this agent").requiredOption("--username <name>", "Desired username (e.g. myagent)").action(async (opts) => {
|
|
18612
19025
|
const check = await apiGet(
|
|
18613
19026
|
`/api/emails/check-username?username=${encodeURIComponent(opts.username)}`
|
|
18614
19027
|
);
|
|
@@ -18629,8 +19042,8 @@ var registerCommand = new Command82("register").description("Register an email a
|
|
|
18629
19042
|
});
|
|
18630
19043
|
|
|
18631
19044
|
// src/commands/email/inbox.ts
|
|
18632
|
-
import { Command as
|
|
18633
|
-
var inboxCommand2 = new
|
|
19045
|
+
import { Command as Command84 } from "commander";
|
|
19046
|
+
var inboxCommand2 = new Command84("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
19047
|
const keystore = await loadKeystore();
|
|
18635
19048
|
const params = new URLSearchParams({
|
|
18636
19049
|
deviceId: keystore.deviceId,
|
|
@@ -18646,8 +19059,8 @@ var inboxCommand2 = new Command83("inbox").description("List emails in your inbo
|
|
|
18646
19059
|
});
|
|
18647
19060
|
|
|
18648
19061
|
// src/commands/email/read.ts
|
|
18649
|
-
import { Command as
|
|
18650
|
-
var readCommand = new
|
|
19062
|
+
import { Command as Command85 } from "commander";
|
|
19063
|
+
var readCommand = new Command85("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
|
|
18651
19064
|
const keystore = await loadKeystore();
|
|
18652
19065
|
const params = new URLSearchParams({
|
|
18653
19066
|
deviceId: keystore.deviceId,
|
|
@@ -18660,8 +19073,8 @@ var readCommand = new Command84("read").description("Read an email by ID (marks
|
|
|
18660
19073
|
});
|
|
18661
19074
|
|
|
18662
19075
|
// src/commands/email/send.ts
|
|
18663
|
-
import { Command as
|
|
18664
|
-
var sendCommand = new
|
|
19076
|
+
import { Command as Command86 } from "commander";
|
|
19077
|
+
var sendCommand = new Command86("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
19078
|
const keystore = await loadKeystore();
|
|
18666
19079
|
const { data: result, idempotencyKey } = await apiPost("/api/emails/send", {
|
|
18667
19080
|
deviceId: keystore.deviceId,
|
|
@@ -18674,8 +19087,8 @@ var sendCommand = new Command85("send").description("Send an email").requiredOpt
|
|
|
18674
19087
|
});
|
|
18675
19088
|
|
|
18676
19089
|
// src/commands/email/reply.ts
|
|
18677
|
-
import { Command as
|
|
18678
|
-
var replyCommand = new
|
|
19090
|
+
import { Command as Command87 } from "commander";
|
|
19091
|
+
var replyCommand = new Command87("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").action(async (id, opts) => {
|
|
18679
19092
|
const keystore = await loadKeystore();
|
|
18680
19093
|
const params = new URLSearchParams({
|
|
18681
19094
|
deviceId: keystore.deviceId,
|
|
@@ -18701,8 +19114,8 @@ var replyCommand = new Command86("reply").description("Reply to an email").argum
|
|
|
18701
19114
|
});
|
|
18702
19115
|
|
|
18703
19116
|
// src/commands/email/delete.ts
|
|
18704
|
-
import { Command as
|
|
18705
|
-
var deleteCommand = new
|
|
19117
|
+
import { Command as Command88 } from "commander";
|
|
19118
|
+
var deleteCommand = new Command88("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
|
|
18706
19119
|
const keystore = await loadKeystore();
|
|
18707
19120
|
const { data: result, idempotencyKey } = await apiPost(
|
|
18708
19121
|
"/api/emails/delete",
|
|
@@ -18716,15 +19129,15 @@ var deleteCommand = new Command87("delete").description("Delete an email by ID")
|
|
|
18716
19129
|
});
|
|
18717
19130
|
|
|
18718
19131
|
// src/commands/email/address.ts
|
|
18719
|
-
import { Command as
|
|
18720
|
-
var addressCommand3 = new
|
|
19132
|
+
import { Command as Command89 } from "commander";
|
|
19133
|
+
var addressCommand3 = new Command89("address").description("Show your registered email address").action(async () => {
|
|
18721
19134
|
const keystore = await loadKeystore();
|
|
18722
19135
|
const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
|
|
18723
19136
|
printResult({ emailAddress: result.emailAddress ?? null });
|
|
18724
19137
|
});
|
|
18725
19138
|
|
|
18726
19139
|
// src/commands/email/mark-read.ts
|
|
18727
|
-
import { Command as
|
|
19140
|
+
import { Command as Command90 } from "commander";
|
|
18728
19141
|
async function setReadStatus(id, read4) {
|
|
18729
19142
|
const keystore = await loadKeystore();
|
|
18730
19143
|
const { data: result, idempotencyKey } = await apiPost(
|
|
@@ -18738,12 +19151,12 @@ async function setReadStatus(id, read4) {
|
|
|
18738
19151
|
);
|
|
18739
19152
|
printResult({ id: result.id, isRead: result.isRead }, { idempotencyKey });
|
|
18740
19153
|
}
|
|
18741
|
-
var markReadCommand = new
|
|
19154
|
+
var markReadCommand = new Command90("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
19155
|
await setReadStatus(id, !opts.unread);
|
|
18743
19156
|
});
|
|
18744
19157
|
|
|
18745
19158
|
// src/commands/email/index.ts
|
|
18746
|
-
var emailCommand = new
|
|
19159
|
+
var emailCommand = new Command91("email").description("Email management commands");
|
|
18747
19160
|
emailCommand.addCommand(registerCommand);
|
|
18748
19161
|
emailCommand.addCommand(inboxCommand2);
|
|
18749
19162
|
emailCommand.addCommand(readCommand);
|
|
@@ -18754,10 +19167,10 @@ emailCommand.addCommand(addressCommand3);
|
|
|
18754
19167
|
emailCommand.addCommand(markReadCommand);
|
|
18755
19168
|
|
|
18756
19169
|
// src/commands/bug/index.ts
|
|
18757
|
-
import { Command as
|
|
19170
|
+
import { Command as Command100 } from "commander";
|
|
18758
19171
|
|
|
18759
19172
|
// src/commands/bug/browse.ts
|
|
18760
|
-
import { Command as
|
|
19173
|
+
import { Command as Command92 } from "commander";
|
|
18761
19174
|
|
|
18762
19175
|
// src/commands/bug/known-problem.ts
|
|
18763
19176
|
async function fetchKnownProblem() {
|
|
@@ -18770,7 +19183,7 @@ async function fetchKnownProblem() {
|
|
|
18770
19183
|
}
|
|
18771
19184
|
|
|
18772
19185
|
// src/commands/bug/browse.ts
|
|
18773
|
-
var browseCommand = new
|
|
19186
|
+
var browseCommand = new Command92("browse").description(
|
|
18774
19187
|
"Browse public bug reports, to check whether a bug is already known; no wallet needed"
|
|
18775
19188
|
).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
19189
|
async (opts) => {
|
|
@@ -18817,7 +19230,7 @@ var browseCommand = new Command91("browse").description(
|
|
|
18817
19230
|
);
|
|
18818
19231
|
|
|
18819
19232
|
// src/commands/bug/comment.ts
|
|
18820
|
-
import { Command as
|
|
19233
|
+
import { Command as Command93 } from "commander";
|
|
18821
19234
|
|
|
18822
19235
|
// src/lib/stdin.ts
|
|
18823
19236
|
var STDIN_FIRST_BYTE_MS = 5e3;
|
|
@@ -18827,7 +19240,7 @@ async function readStdin(firstByteMs) {
|
|
|
18827
19240
|
let timer;
|
|
18828
19241
|
const first = await Promise.race([
|
|
18829
19242
|
iterator.next(),
|
|
18830
|
-
...firstByteMs === void 0 ? [] : [new Promise((
|
|
19243
|
+
...firstByteMs === void 0 ? [] : [new Promise((resolve2) => timer = setTimeout(() => resolve2(null), firstByteMs))]
|
|
18831
19244
|
]);
|
|
18832
19245
|
clearTimeout(timer);
|
|
18833
19246
|
if (first === null) {
|
|
@@ -18871,7 +19284,7 @@ async function resolveBugReportId(ref) {
|
|
|
18871
19284
|
}
|
|
18872
19285
|
|
|
18873
19286
|
// src/commands/bug/comment.ts
|
|
18874
|
-
var commentCommand = new
|
|
19287
|
+
var commentCommand = new Command93("comment").description(
|
|
18875
19288
|
"Comment on a public bug report. Comments are public: never include keys, seed phrases or other private data"
|
|
18876
19289
|
).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
19290
|
const ref = parseBugReportRef(report);
|
|
@@ -18917,8 +19330,8 @@ var commentCommand = new Command92("comment").description(
|
|
|
18917
19330
|
});
|
|
18918
19331
|
|
|
18919
19332
|
// src/commands/bug/list.ts
|
|
18920
|
-
import { Command as
|
|
18921
|
-
var listCommand2 = new
|
|
19333
|
+
import { Command as Command94 } from "commander";
|
|
19334
|
+
var listCommand2 = new Command94("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
19335
|
if (opts.status && !BUG_REPORT_STATUSES.includes(opts.status)) {
|
|
18923
19336
|
printError(`--status must be one of ${BUG_REPORT_STATUSES.join(", ")}`);
|
|
18924
19337
|
return;
|
|
@@ -18949,8 +19362,8 @@ var listCommand2 = new Command93("list").description("List the bug reports you s
|
|
|
18949
19362
|
});
|
|
18950
19363
|
|
|
18951
19364
|
// src/commands/bug/me-too.ts
|
|
18952
|
-
import { Command as
|
|
18953
|
-
var meTooCommand = new
|
|
19365
|
+
import { Command as Command95 } from "commander";
|
|
19366
|
+
var meTooCommand = new Command95("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
19367
|
const ref = parseBugReportRef(report);
|
|
18955
19368
|
if (!ref) {
|
|
18956
19369
|
printError(BUG_REPORT_REF_ERROR);
|
|
@@ -18974,8 +19387,8 @@ var meTooCommand = new Command94("me-too").description("Say you hit a public bug
|
|
|
18974
19387
|
});
|
|
18975
19388
|
|
|
18976
19389
|
// src/commands/bug/reply.ts
|
|
18977
|
-
import { Command as
|
|
18978
|
-
var replyCommand2 = new
|
|
19390
|
+
import { Command as Command96 } from "commander";
|
|
19391
|
+
var replyCommand2 = new Command96("reply").description(
|
|
18979
19392
|
"Reply to Taskmarket staff on one of your bug reports; a reply does not change its status"
|
|
18980
19393
|
).argument("<id>", "Bug report id").argument("[message]", 'Your reply; read from stdin when omitted or "-"').action(async (id, message) => {
|
|
18981
19394
|
const body = await textOrStdin(message);
|
|
@@ -19009,8 +19422,8 @@ var replyCommand2 = new Command95("reply").description(
|
|
|
19009
19422
|
});
|
|
19010
19423
|
|
|
19011
19424
|
// src/commands/bug/show.ts
|
|
19012
|
-
import { Command as
|
|
19013
|
-
var showCommand = new
|
|
19425
|
+
import { Command as Command97 } from "commander";
|
|
19426
|
+
var showCommand = new Command97("show").description(
|
|
19014
19427
|
"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
19428
|
).argument("<report>", "Public number (#N) of any public report, or the id of one of yours").action(async (report) => {
|
|
19016
19429
|
const ref = parseBugReportRef(report);
|
|
@@ -19038,7 +19451,7 @@ var showCommand = new Command96("show").description(
|
|
|
19038
19451
|
});
|
|
19039
19452
|
|
|
19040
19453
|
// src/commands/bug/submit.ts
|
|
19041
|
-
import { Command as
|
|
19454
|
+
import { Command as Command98 } from "commander";
|
|
19042
19455
|
|
|
19043
19456
|
// src/commands/bug/context.ts
|
|
19044
19457
|
import os from "os";
|
|
@@ -19062,7 +19475,7 @@ function cliVersionOf(command) {
|
|
|
19062
19475
|
var LAST_COMMAND_MAX_CHARS = 2048;
|
|
19063
19476
|
var LAST_ERROR_MAX_CHARS = 16 * 1024;
|
|
19064
19477
|
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
|
|
19478
|
+
var submitCommand = new Command98("submit").description(
|
|
19066
19479
|
"Report a Taskmarket bug; CLI version, OS, Node version and network are attached. Reports are public unless --private"
|
|
19067
19480
|
).requiredOption("--title <text>", "Short summary (at most 200 characters)").option(
|
|
19068
19481
|
"--description <text>",
|
|
@@ -19138,8 +19551,8 @@ var submitCommand = new Command97("submit").description(
|
|
|
19138
19551
|
});
|
|
19139
19552
|
|
|
19140
19553
|
// src/commands/bug/visibility.ts
|
|
19141
|
-
import { Command as
|
|
19142
|
-
var visibilityCommand = new
|
|
19554
|
+
import { Command as Command99 } from "commander";
|
|
19555
|
+
var visibilityCommand = new Command99("visibility").description(
|
|
19143
19556
|
"Make one of your bug reports public or private; a private report is seen only by you and staff"
|
|
19144
19557
|
).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
19558
|
const ref = parseBugReportRef(report);
|
|
@@ -19174,7 +19587,7 @@ var visibilityCommand = new Command98("visibility").description(
|
|
|
19174
19587
|
});
|
|
19175
19588
|
|
|
19176
19589
|
// src/commands/bug/index.ts
|
|
19177
|
-
var bugCommand = new
|
|
19590
|
+
var bugCommand = new Command100("bug").description(
|
|
19178
19591
|
"Report Taskmarket bugs, browse public reports, follow their status and reply to staff"
|
|
19179
19592
|
);
|
|
19180
19593
|
bugCommand.addCommand(submitCommand);
|
|
@@ -19187,7 +19600,7 @@ bugCommand.addCommand(commentCommand);
|
|
|
19187
19600
|
bugCommand.addCommand(visibilityCommand);
|
|
19188
19601
|
|
|
19189
19602
|
// src/commands/bookmark/index.ts
|
|
19190
|
-
import { Command as
|
|
19603
|
+
import { Command as Command102 } from "commander";
|
|
19191
19604
|
|
|
19192
19605
|
// src/commands/bookmark/auth.ts
|
|
19193
19606
|
async function bookmarkAuth(action) {
|
|
@@ -19200,8 +19613,8 @@ async function bookmarkAuth(action) {
|
|
|
19200
19613
|
}
|
|
19201
19614
|
|
|
19202
19615
|
// src/commands/bookmark/collection.ts
|
|
19203
|
-
import { Command as
|
|
19204
|
-
var createCommand = new
|
|
19616
|
+
import { Command as Command101 } from "commander";
|
|
19617
|
+
var createCommand = new Command101("create").description("Create a private collection").argument("<name>", "Collection name, up to 120 characters").action(async (name) => {
|
|
19205
19618
|
const trimmed = name.trim();
|
|
19206
19619
|
if (trimmed.length === 0 || trimmed.length > 120) {
|
|
19207
19620
|
printError("Collection name must be 1 to 120 characters");
|
|
@@ -19220,7 +19633,7 @@ var createCommand = new Command100("create").description("Create a private colle
|
|
|
19220
19633
|
return renderFailure(error);
|
|
19221
19634
|
}
|
|
19222
19635
|
});
|
|
19223
|
-
var listCommand3 = new
|
|
19636
|
+
var listCommand3 = new Command101("list").description("List your collections; a published one carries its publishedSlug (/c/<slug>)").action(async () => {
|
|
19224
19637
|
const auth = await bookmarkAuth("Listing collections");
|
|
19225
19638
|
if (!auth) return;
|
|
19226
19639
|
try {
|
|
@@ -19230,7 +19643,7 @@ var listCommand3 = new Command100("list").description("List your collections; a
|
|
|
19230
19643
|
}
|
|
19231
19644
|
});
|
|
19232
19645
|
function publishToggle(name, description, action) {
|
|
19233
|
-
return new
|
|
19646
|
+
return new Command101(name).description(description).argument("<collection-id>", "Collection id (from `taskmarket bookmark collection list`)").action(async (collectionId) => {
|
|
19234
19647
|
const auth = await bookmarkAuth(action);
|
|
19235
19648
|
if (!auth) return;
|
|
19236
19649
|
try {
|
|
@@ -19246,7 +19659,7 @@ function publishToggle(name, description, action) {
|
|
|
19246
19659
|
}
|
|
19247
19660
|
});
|
|
19248
19661
|
}
|
|
19249
|
-
var collectionCommand = new
|
|
19662
|
+
var collectionCommand = new Command101("collection").description(
|
|
19250
19663
|
"Create, list, publish and unpublish bookmark collections"
|
|
19251
19664
|
);
|
|
19252
19665
|
collectionCommand.addCommand(createCommand);
|
|
@@ -19277,7 +19690,7 @@ function parseEntityType(value, flag) {
|
|
|
19277
19690
|
function chainFor(entityType) {
|
|
19278
19691
|
return entityType === "agent" ? { chainId: selectedNetwork().chainId } : {};
|
|
19279
19692
|
}
|
|
19280
|
-
var addCommand = new
|
|
19693
|
+
var addCommand = new Command102("add").description(
|
|
19281
19694
|
"Bookmark a task, submission or agent; an agent is saved on the selected network (--network)"
|
|
19282
19695
|
).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
19696
|
const entityType = parseEntityType(type, "<type>");
|
|
@@ -19305,7 +19718,7 @@ var addCommand = new Command101("add").description(
|
|
|
19305
19718
|
return renderFailure(error);
|
|
19306
19719
|
}
|
|
19307
19720
|
});
|
|
19308
|
-
var removeCommand = new
|
|
19721
|
+
var removeCommand = new Command102("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
19722
|
const entityType = parseEntityType(type, "<type>");
|
|
19310
19723
|
if (!entityType) return;
|
|
19311
19724
|
const auth = await bookmarkAuth("Removing a bookmark");
|
|
@@ -19321,7 +19734,7 @@ var removeCommand = new Command101("remove").description("Remove a bookmark; an
|
|
|
19321
19734
|
return renderFailure(error);
|
|
19322
19735
|
}
|
|
19323
19736
|
});
|
|
19324
|
-
var listCommand4 = new
|
|
19737
|
+
var listCommand4 = new Command102("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
19738
|
async (opts) => {
|
|
19326
19739
|
const entityType = opts.type === void 0 ? void 0 : parseEntityType(opts.type, "--type");
|
|
19327
19740
|
if (entityType === null) return;
|
|
@@ -19345,7 +19758,7 @@ var listCommand4 = new Command101("list").description("List your bookmarks, newe
|
|
|
19345
19758
|
}
|
|
19346
19759
|
);
|
|
19347
19760
|
function pinToggle(name, description, action) {
|
|
19348
|
-
return new
|
|
19761
|
+
return new Command102(name).description(description).argument("<id>", "Bookmark id (from `taskmarket bookmark list`)").action(async (id) => {
|
|
19349
19762
|
const auth = await bookmarkAuth(action);
|
|
19350
19763
|
if (!auth) return;
|
|
19351
19764
|
try {
|
|
@@ -19360,7 +19773,7 @@ function pinToggle(name, description, action) {
|
|
|
19360
19773
|
}
|
|
19361
19774
|
});
|
|
19362
19775
|
}
|
|
19363
|
-
var countCommand = new
|
|
19776
|
+
var countCommand = new Command102("count").description("Count your saved bookmarks").option("--pinned", "Count only pinned bookmarks").action(async (opts) => {
|
|
19364
19777
|
const auth = await bookmarkAuth("Counting bookmarks");
|
|
19365
19778
|
if (!auth) return;
|
|
19366
19779
|
const params = new URLSearchParams();
|
|
@@ -19374,7 +19787,7 @@ var countCommand = new Command101("count").description("Count your saved bookmar
|
|
|
19374
19787
|
return renderFailure(error);
|
|
19375
19788
|
}
|
|
19376
19789
|
});
|
|
19377
|
-
var bookmarkCommand = new
|
|
19790
|
+
var bookmarkCommand = new Command102("bookmark").description(
|
|
19378
19791
|
"Save tasks, submissions and agents to your private list, and share collections of them"
|
|
19379
19792
|
);
|
|
19380
19793
|
bookmarkCommand.addCommand(addCommand);
|
|
@@ -19391,18 +19804,18 @@ bookmarkCommand.addCommand(collectionCommand);
|
|
|
19391
19804
|
|
|
19392
19805
|
// src/commands/skills/index.ts
|
|
19393
19806
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
19394
|
-
import { Command as
|
|
19807
|
+
import { Command as Command103 } from "commander";
|
|
19395
19808
|
|
|
19396
19809
|
// src/lib/skill-directory.ts
|
|
19397
19810
|
import { lstat, readdir, readFile as readFile3 } from "fs/promises";
|
|
19398
|
-
import { join, relative, sep } from "path";
|
|
19811
|
+
import { join as join2, relative, sep } from "path";
|
|
19399
19812
|
var MAX_ENTRIES = USER_SKILL_LIMITS.files + USER_SKILL_SANDBOX_LIMITS.files + 300;
|
|
19400
19813
|
async function walk(root) {
|
|
19401
19814
|
const entries = [];
|
|
19402
19815
|
const visit = async (dir) => {
|
|
19403
19816
|
const names = (await readdir(dir)).sort();
|
|
19404
19817
|
for (const name of names) {
|
|
19405
|
-
const full =
|
|
19818
|
+
const full = join2(dir, name);
|
|
19406
19819
|
const path9 = relative(root, full).split(sep).join("/");
|
|
19407
19820
|
const info = await lstat(full);
|
|
19408
19821
|
if (info.isDirectory()) {
|
|
@@ -19531,7 +19944,7 @@ var bundleOptions = (command) => command.requiredOption("--agent <agentId>", "Th
|
|
|
19531
19944
|
).option("--request-key <uuid>", "Reuse to resend the same write without applying it twice");
|
|
19532
19945
|
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
19946
|
var createCommand2 = bundleOptions(
|
|
19534
|
-
new
|
|
19947
|
+
new Command103("create").description(
|
|
19535
19948
|
`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
19949
|
).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
19950
|
).action(async (dir, opts) => {
|
|
@@ -19549,7 +19962,7 @@ var createCommand2 = bundleOptions(
|
|
|
19549
19962
|
}
|
|
19550
19963
|
});
|
|
19551
19964
|
var versionCommand = bundleOptions(
|
|
19552
|
-
new
|
|
19965
|
+
new Command103("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
19966
|
).action(async (skillId, dir, opts) => {
|
|
19554
19967
|
try {
|
|
19555
19968
|
const { body, excluded } = await bundleWrite("version", dir, skillId, opts);
|
|
@@ -19566,7 +19979,7 @@ var versionCommand = bundleOptions(
|
|
|
19566
19979
|
return fail(error);
|
|
19567
19980
|
}
|
|
19568
19981
|
});
|
|
19569
|
-
var archiveCommand = new
|
|
19982
|
+
var archiveCommand = new Command103("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
19983
|
"--remove-assignments",
|
|
19571
19984
|
"Also remove the skill from this agent's assignments; archiving is refused while other agents have it assigned"
|
|
19572
19985
|
).option("--request-key <uuid>", "Reuse to resend the same write without applying it twice").action(
|
|
@@ -19592,7 +20005,7 @@ var archiveCommand = new Command102("archive").description("Archive a skill you
|
|
|
19592
20005
|
}
|
|
19593
20006
|
}
|
|
19594
20007
|
);
|
|
19595
|
-
var skillsCommand = new
|
|
20008
|
+
var skillsCommand = new Command103("skills").description(
|
|
19596
20009
|
"Skills in your owner's library that you, a hosted agent, author: create, version and archive"
|
|
19597
20010
|
);
|
|
19598
20011
|
skillsCommand.addCommand(createCommand2);
|
|
@@ -19603,7 +20016,7 @@ skillsCommand.addCommand(archiveCommand);
|
|
|
19603
20016
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
19604
20017
|
import fs10 from "fs/promises";
|
|
19605
20018
|
import path8 from "path";
|
|
19606
|
-
import { Command as
|
|
20019
|
+
import { Command as Command104 } from "commander";
|
|
19607
20020
|
var BRIEF_COOKIE = "taskmarket_brief";
|
|
19608
20021
|
var CREDENTIAL_PATTERN = /^[0-9a-f-]{36}\.[0-9a-f]{64}$/;
|
|
19609
20022
|
var credentialFile = () => path8.join(getTaskmarketHome(), "brief.json");
|
|
@@ -19693,7 +20106,7 @@ async function sendTurn(credential, message, current, turnId = randomUUID5()) {
|
|
|
19693
20106
|
)).data
|
|
19694
20107
|
);
|
|
19695
20108
|
}
|
|
19696
|
-
var briefCommand = new
|
|
20109
|
+
var briefCommand = new Command104("brief").description(
|
|
19697
20110
|
"Draft a task brief in conversation with the drafting assistant"
|
|
19698
20111
|
);
|
|
19699
20112
|
briefCommand.command("start").description(
|
|
@@ -19747,11 +20160,11 @@ briefCommand.command("discard").description("Delete the saved brief").action(asy
|
|
|
19747
20160
|
});
|
|
19748
20161
|
|
|
19749
20162
|
// src/commands/requester/index.ts
|
|
19750
|
-
import { Command as
|
|
20163
|
+
import { Command as Command106 } from "commander";
|
|
19751
20164
|
|
|
19752
20165
|
// src/commands/requester/stats.ts
|
|
19753
|
-
import { Command as
|
|
19754
|
-
var requesterStatsCmd = new
|
|
20166
|
+
import { Command as Command105 } from "commander";
|
|
20167
|
+
var requesterStatsCmd = new Command105("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address3) => {
|
|
19755
20168
|
if (!/^0x[0-9a-fA-F]{40}$/.test(address3)) {
|
|
19756
20169
|
printError("Address must be a 0x-prefixed 20-byte hex string");
|
|
19757
20170
|
return;
|
|
@@ -19765,23 +20178,23 @@ var requesterStatsCmd = new Command104("stats").description("Get requester reput
|
|
|
19765
20178
|
});
|
|
19766
20179
|
|
|
19767
20180
|
// src/commands/requester/index.ts
|
|
19768
|
-
var requesterCmd = new
|
|
20181
|
+
var requesterCmd = new Command106("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
|
|
19769
20182
|
|
|
19770
20183
|
// src/commands/capabilities.ts
|
|
19771
|
-
import { Command as
|
|
20184
|
+
import { Command as Command107 } from "commander";
|
|
19772
20185
|
async function fetchCapabilities(category) {
|
|
19773
20186
|
const input = parseInput(CapabilitiesListInputSchema, { category });
|
|
19774
20187
|
const query4 = input.category ? `?category=${encodeURIComponent(input.category)}` : "";
|
|
19775
20188
|
return CapabilitiesListResponseSchema.parse(await apiGet(`/api/capabilities${query4}`));
|
|
19776
20189
|
}
|
|
19777
|
-
var listCommand5 = new
|
|
20190
|
+
var listCommand5 = new Command107("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
20191
|
try {
|
|
19779
20192
|
printResult(await fetchCapabilities(opts.category));
|
|
19780
20193
|
} catch (err) {
|
|
19781
20194
|
renderFailure(err);
|
|
19782
20195
|
}
|
|
19783
20196
|
});
|
|
19784
|
-
var showCommand2 = new
|
|
20197
|
+
var showCommand2 = new Command107("show").description("Show one capability by slug").argument("<slug>", "Capability slug, for example web-search").action(async (slug) => {
|
|
19785
20198
|
try {
|
|
19786
20199
|
const { capabilities } = await fetchCapabilities();
|
|
19787
20200
|
const entry = capabilities.find((item) => item.slug === slug);
|
|
@@ -19791,13 +20204,13 @@ var showCommand2 = new Command106("show").description("Show one capability by sl
|
|
|
19791
20204
|
renderFailure(err);
|
|
19792
20205
|
}
|
|
19793
20206
|
});
|
|
19794
|
-
var capabilitiesCommand = new
|
|
20207
|
+
var capabilitiesCommand = new Command107("capabilities").description("Read the listing capability registry").addCommand(listCommand5).addCommand(showCommand2);
|
|
19795
20208
|
|
|
19796
20209
|
// src/commands/x402/index.ts
|
|
19797
|
-
import { Command as
|
|
20210
|
+
import { Command as Command111 } from "commander";
|
|
19798
20211
|
|
|
19799
20212
|
// src/commands/x402/payments.ts
|
|
19800
|
-
import { Command as
|
|
20213
|
+
import { Command as Command108, Option as Option5 } from "commander";
|
|
19801
20214
|
import { createInterface as createInterface5 } from "readline";
|
|
19802
20215
|
var PAYMENT_STATES = [
|
|
19803
20216
|
"reserved",
|
|
@@ -19815,15 +20228,15 @@ async function confirmManualResolution() {
|
|
|
19815
20228
|
if (!process.stdin.isTTY) throw new Error("Manual resolution requires an interactive TTY");
|
|
19816
20229
|
const readline = createInterface5({ input: process.stdin, output: process.stderr });
|
|
19817
20230
|
const answer = await new Promise(
|
|
19818
|
-
(
|
|
20231
|
+
(resolve2) => readline.question(
|
|
19819
20232
|
"Manual resolution changes local spending accounting. Type resolve to continue: ",
|
|
19820
|
-
|
|
20233
|
+
resolve2
|
|
19821
20234
|
)
|
|
19822
20235
|
);
|
|
19823
20236
|
readline.close();
|
|
19824
20237
|
return answer.trim().toLowerCase() === "resolve";
|
|
19825
20238
|
}
|
|
19826
|
-
var x402PaymentsCommand = new
|
|
20239
|
+
var x402PaymentsCommand = new Command108("payments").description(
|
|
19827
20240
|
"Inspect and reconcile X402 Pay payment records"
|
|
19828
20241
|
);
|
|
19829
20242
|
x402PaymentsCommand.command("list").description("List current payment records").addOption(new Option5("--state <state>", "Filter by state").choices(PAYMENT_STATES)).action(async (options) => {
|
|
@@ -19852,7 +20265,7 @@ x402PaymentsCommand.command("resolve").description("Manually record an externall
|
|
|
19852
20265
|
|
|
19853
20266
|
// src/commands/x402/policy.ts
|
|
19854
20267
|
import { promises as fs11 } from "fs";
|
|
19855
|
-
import { Command as
|
|
20268
|
+
import { Command as Command109 } from "commander";
|
|
19856
20269
|
import { createInterface as createInterface6 } from "readline";
|
|
19857
20270
|
async function confirmUnattendedRule(rule) {
|
|
19858
20271
|
if (!process.stdin.isTTY) {
|
|
@@ -19873,12 +20286,12 @@ async function confirmUnattendedRule(rule) {
|
|
|
19873
20286
|
);
|
|
19874
20287
|
const readline = createInterface6({ input: process.stdin, output: process.stderr });
|
|
19875
20288
|
const answer = await new Promise(
|
|
19876
|
-
(
|
|
20289
|
+
(resolve2) => readline.question("Type authorize to grant unattended spending: ", resolve2)
|
|
19877
20290
|
);
|
|
19878
20291
|
readline.close();
|
|
19879
20292
|
return answer.trim().toLowerCase() === "authorize";
|
|
19880
20293
|
}
|
|
19881
|
-
var x402PolicyCommand = new
|
|
20294
|
+
var x402PolicyCommand = new Command109("policy").description(
|
|
19882
20295
|
"Manage local X402 Pay spending policy"
|
|
19883
20296
|
);
|
|
19884
20297
|
x402PolicyCommand.command("init").description("Create a deny-all policy file").action(async () => {
|
|
@@ -19914,14 +20327,14 @@ for (const enabled of [true, false]) {
|
|
|
19914
20327
|
}
|
|
19915
20328
|
|
|
19916
20329
|
// src/commands/x402/request.ts
|
|
19917
|
-
import { Command as
|
|
20330
|
+
import { Command as Command110, Option as Option6 } from "commander";
|
|
19918
20331
|
function collect4(value, previous) {
|
|
19919
20332
|
return [...previous, value];
|
|
19920
20333
|
}
|
|
19921
20334
|
function confirm(lines) {
|
|
19922
20335
|
return confirmAtTerminal(lines, "use --non-interactive with policy");
|
|
19923
20336
|
}
|
|
19924
|
-
var x402RequestCommand = new
|
|
20337
|
+
var x402RequestCommand = new Command110("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
20338
|
"--header-env <header=ENV_VAR>",
|
|
19926
20339
|
"Read one request header from an environment variable (repeatable)",
|
|
19927
20340
|
collect4,
|
|
@@ -19969,7 +20382,7 @@ var x402RequestCommand = new Command109("request").description("Request and pay
|
|
|
19969
20382
|
);
|
|
19970
20383
|
|
|
19971
20384
|
// src/commands/x402/index.ts
|
|
19972
|
-
var x402Command = new
|
|
20385
|
+
var x402Command = new Command111("x402").description(
|
|
19973
20386
|
"Pay x402 services with local spending policies (X402 Pay)"
|
|
19974
20387
|
);
|
|
19975
20388
|
x402Command.addCommand(x402RequestCommand);
|
|
@@ -19977,10 +20390,10 @@ x402Command.addCommand(x402PolicyCommand);
|
|
|
19977
20390
|
x402Command.addCommand(x402PaymentsCommand);
|
|
19978
20391
|
|
|
19979
20392
|
// src/commands/sponsored-task/index.ts
|
|
19980
|
-
import { Command as
|
|
20393
|
+
import { Command as Command127 } from "commander";
|
|
19981
20394
|
|
|
19982
20395
|
// src/commands/sponsored-task/create.ts
|
|
19983
|
-
import { Command as
|
|
20396
|
+
import { Command as Command112 } from "commander";
|
|
19984
20397
|
import { toHex as toHex4 } from "viem";
|
|
19985
20398
|
|
|
19986
20399
|
// ../../packages/contracts/evm/abi/generated/SponsoredTasksVaultV2.ts
|
|
@@ -24391,7 +24804,7 @@ async function createOnSolana(opts, keystore) {
|
|
|
24391
24804
|
renderFailure(err);
|
|
24392
24805
|
}
|
|
24393
24806
|
}
|
|
24394
|
-
var sponsoredTaskCreateCommand = new
|
|
24807
|
+
var sponsoredTaskCreateCommand = new Command112("create").description("Create a new Sponsored Task vault for a project token").option(
|
|
24395
24808
|
"--factory <address>",
|
|
24396
24809
|
"SponsoredTaskFactory contract address (EVM chains; defaults to the chain's newest factory, or the settler-mode factory on Robinhood Chain)"
|
|
24397
24810
|
).requiredOption(
|
|
@@ -24514,7 +24927,7 @@ Token risk: ${TOKEN_RISK}`
|
|
|
24514
24927
|
);
|
|
24515
24928
|
|
|
24516
24929
|
// src/commands/sponsored-task/fund.ts
|
|
24517
|
-
import { Command as
|
|
24930
|
+
import { Command as Command113 } from "commander";
|
|
24518
24931
|
function isValidAddress5(addr) {
|
|
24519
24932
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
24520
24933
|
}
|
|
@@ -24548,7 +24961,7 @@ async function fundOnSolana(opts, keystore) {
|
|
|
24548
24961
|
renderFailure(err);
|
|
24549
24962
|
}
|
|
24550
24963
|
}
|
|
24551
|
-
var sponsoredTaskFundCommand = new
|
|
24964
|
+
var sponsoredTaskFundCommand = new Command113("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
24965
|
"--token <address>",
|
|
24553
24966
|
"Project ERC-20 token address (EVM chains; Solana reads the vault's mint)"
|
|
24554
24967
|
).requiredOption(
|
|
@@ -24622,7 +25035,7 @@ var sponsoredTaskFundCommand = new Command112("fund").description("Fund a Sponso
|
|
|
24622
25035
|
});
|
|
24623
25036
|
|
|
24624
25037
|
// src/commands/sponsored-task/managers.ts
|
|
24625
|
-
import { Command as
|
|
25038
|
+
import { Command as Command114 } from "commander";
|
|
24626
25039
|
|
|
24627
25040
|
// src/lib/solana-payout-binding.ts
|
|
24628
25041
|
var PROGRAM_ID_ENV = "TASKMARKET_SOLANA_SPONSORED_TASKS_PROGRAM_ID";
|
|
@@ -24956,7 +25369,7 @@ async function configure(opts) {
|
|
|
24956
25369
|
active: opts.active
|
|
24957
25370
|
});
|
|
24958
25371
|
}
|
|
24959
|
-
var sponsoredTaskManagersCommand = new
|
|
25372
|
+
var sponsoredTaskManagersCommand = new Command114("managers").description(
|
|
24960
25373
|
"Manage authorized managers for a Sponsored Task vault"
|
|
24961
25374
|
);
|
|
24962
25375
|
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 +25396,8 @@ sponsoredTaskManagersCommand.command("list").description("List a vault authorize
|
|
|
24983
25396
|
});
|
|
24984
25397
|
|
|
24985
25398
|
// src/commands/sponsored-task/managed.ts
|
|
24986
|
-
import { Command as
|
|
24987
|
-
var sponsoredTaskManagedCommand = new
|
|
25399
|
+
import { Command as Command115 } from "commander";
|
|
25400
|
+
var sponsoredTaskManagedCommand = new Command115("managed").description(
|
|
24988
25401
|
"List the active Sponsored Task vaults an address can fund tasks from as an active manager (defaults to your wallet)"
|
|
24989
25402
|
).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
25403
|
let address3 = opts.address;
|
|
@@ -25014,8 +25427,8 @@ var sponsoredTaskManagedCommand = new Command114("managed").description(
|
|
|
25014
25427
|
});
|
|
25015
25428
|
|
|
25016
25429
|
// src/commands/sponsored-task/creation-fee.ts
|
|
25017
|
-
import { Command as
|
|
25018
|
-
var sponsoredTaskCreationFeeCommand = new
|
|
25430
|
+
import { Command as Command116 } from "commander";
|
|
25431
|
+
var sponsoredTaskCreationFeeCommand = new Command116("creation-fee").description("Show the one-time fee for creating a Sponsored Task vault on a chain").requiredOption(
|
|
25019
25432
|
"--chain-id <chain>",
|
|
25020
25433
|
"EVM chain the vault would be created on: a network name or chain id (e.g. base, 8453)",
|
|
25021
25434
|
chainOption("--chain-id", "evm-vault")
|
|
@@ -25059,8 +25472,8 @@ var sponsoredTaskCreationFeeCommand = new Command115("creation-fee").description
|
|
|
25059
25472
|
});
|
|
25060
25473
|
|
|
25061
25474
|
// src/commands/sponsored-task/list.ts
|
|
25062
|
-
import { Command as
|
|
25063
|
-
var sponsoredTaskListCommand = new
|
|
25475
|
+
import { Command as Command117 } from "commander";
|
|
25476
|
+
var sponsoredTaskListCommand = new Command117("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
25477
|
async (opts) => {
|
|
25065
25478
|
if (opts.owner && opts.mine) {
|
|
25066
25479
|
printError("Pass --owner or --mine, not both");
|
|
@@ -25089,8 +25502,8 @@ var sponsoredTaskListCommand = new Command116("list").description("List Sponsore
|
|
|
25089
25502
|
);
|
|
25090
25503
|
|
|
25091
25504
|
// src/commands/sponsored-task/settlements.ts
|
|
25092
|
-
import { Command as
|
|
25093
|
-
var sponsoredTaskSettlementsCommand = new
|
|
25505
|
+
import { Command as Command118 } from "commander";
|
|
25506
|
+
var sponsoredTaskSettlementsCommand = new Command118("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
25507
|
const limit = Number(opts.limit);
|
|
25095
25508
|
if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
|
|
25096
25509
|
printError("--limit must be an integer from 1 to 100");
|
|
@@ -25105,17 +25518,17 @@ var sponsoredTaskSettlementsCommand = new Command117("settlements").description(
|
|
|
25105
25518
|
});
|
|
25106
25519
|
|
|
25107
25520
|
// src/commands/sponsored-task/show.ts
|
|
25108
|
-
import { Command as
|
|
25109
|
-
var sponsoredTaskShowCommand = new
|
|
25521
|
+
import { Command as Command119 } from "commander";
|
|
25522
|
+
var sponsoredTaskShowCommand = new Command119("show").description("Show a Sponsored Task vault by id").argument("<vaultId>", "Vault id").action(async (vaultId) => {
|
|
25110
25523
|
const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}`);
|
|
25111
25524
|
printResult(result);
|
|
25112
25525
|
});
|
|
25113
25526
|
|
|
25114
25527
|
// src/commands/sponsored-task/request-review.ts
|
|
25115
25528
|
import { randomBytes as randomBytes6 } from "crypto";
|
|
25116
|
-
import { Command as
|
|
25529
|
+
import { Command as Command120 } from "commander";
|
|
25117
25530
|
var REQUEST_TTL_SECONDS = 5 * 60;
|
|
25118
|
-
var sponsoredTaskRequestReviewCommand = new
|
|
25531
|
+
var sponsoredTaskRequestReviewCommand = new Command120("request-review").description("Ask Taskmarket curators to review a Sponsored Task vault (vault owner only)").argument("<vaultId>", "Vault id").action(async (vaultId) => {
|
|
25119
25532
|
let keystore;
|
|
25120
25533
|
try {
|
|
25121
25534
|
keystore = await loadKeystore();
|
|
@@ -25172,18 +25585,18 @@ var sponsoredTaskRequestReviewCommand = new Command119("request-review").descrip
|
|
|
25172
25585
|
});
|
|
25173
25586
|
|
|
25174
25587
|
// src/commands/sponsored-task/balance.ts
|
|
25175
|
-
import { Command as
|
|
25176
|
-
var sponsoredTaskBalanceCommand = new
|
|
25588
|
+
import { Command as Command121 } from "commander";
|
|
25589
|
+
var sponsoredTaskBalanceCommand = new Command121("balance").description("Show a Sponsored Task vault funded/available/reserved balances").argument("<vaultId>", "Vault id").action(async (vaultId) => {
|
|
25177
25590
|
const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}/balance`);
|
|
25178
25591
|
printResult(result);
|
|
25179
25592
|
});
|
|
25180
25593
|
|
|
25181
25594
|
// src/commands/sponsored-task/withdraw.ts
|
|
25182
|
-
import { Command as
|
|
25595
|
+
import { Command as Command122 } from "commander";
|
|
25183
25596
|
function isValidAddress7(addr) {
|
|
25184
25597
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
25185
25598
|
}
|
|
25186
|
-
var sponsoredTaskWithdrawCommand = new
|
|
25599
|
+
var sponsoredTaskWithdrawCommand = new Command122("withdraw").description("Withdraw unreserved project tokens from a vault (owner only)").requiredOption("--vault <address>", "Vault address").requiredOption(
|
|
25187
25600
|
"--chain-id <chain>",
|
|
25188
25601
|
"EVM chain the vault is deployed on: a network name or chain id (e.g. base, robinhood, 8453)",
|
|
25189
25602
|
chainOption("--chain-id", "evm-vault")
|
|
@@ -25219,11 +25632,11 @@ var sponsoredTaskWithdrawCommand = new Command121("withdraw").description("Withd
|
|
|
25219
25632
|
});
|
|
25220
25633
|
|
|
25221
25634
|
// src/commands/sponsored-task/exit.ts
|
|
25222
|
-
import { Command as
|
|
25635
|
+
import { Command as Command123 } from "commander";
|
|
25223
25636
|
function isValidAddress8(addr) {
|
|
25224
25637
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
25225
25638
|
}
|
|
25226
|
-
var sponsoredTaskExitCommand = new
|
|
25639
|
+
var sponsoredTaskExitCommand = new Command123("exit").description(
|
|
25227
25640
|
"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
25641
|
).requiredOption("--vault <address>", "Vault address (base58 for a Solana vault)").requiredOption(
|
|
25229
25642
|
"--chain-id <chain>",
|
|
@@ -25299,7 +25712,7 @@ var sponsoredTaskExitCommand = new Command122("exit").description(
|
|
|
25299
25712
|
});
|
|
25300
25713
|
|
|
25301
25714
|
// src/commands/sponsored-task/claim.ts
|
|
25302
|
-
import { Command as
|
|
25715
|
+
import { Command as Command124 } from "commander";
|
|
25303
25716
|
var CLAIM_TO_TYPES = {
|
|
25304
25717
|
ClaimTo: [
|
|
25305
25718
|
{ name: "vaultId", type: "bytes32" },
|
|
@@ -25364,7 +25777,7 @@ async function findEntitlement(vaultId, workerAddress, taskId, options = {}) {
|
|
|
25364
25777
|
await sleep4(3e3);
|
|
25365
25778
|
}
|
|
25366
25779
|
}
|
|
25367
|
-
var sponsoredTaskClaimCommand = new
|
|
25780
|
+
var sponsoredTaskClaimCommand = new Command124("claim").description("Claim your unclaimed Sponsored Task reward for a vault task").argument("<vaultId>", "Vault id").option(
|
|
25368
25781
|
"--task-id <id>",
|
|
25369
25782
|
"Claim the entitlement for a specific task (defaults to the first unclaimed one)"
|
|
25370
25783
|
).action(async (vaultId, opts) => {
|
|
@@ -25480,10 +25893,10 @@ var sponsoredTaskClaimCommand = new Command123("claim").description("Claim your
|
|
|
25480
25893
|
});
|
|
25481
25894
|
|
|
25482
25895
|
// src/commands/sponsored-task/rewards.ts
|
|
25483
|
-
import { Command as
|
|
25896
|
+
import { Command as Command125 } from "commander";
|
|
25484
25897
|
var REWARD_STATES = SponsoredTaskRewardStateSchema.options;
|
|
25485
25898
|
var CLAIM_STATUSES = SponsoredTaskWorkerRewardClaimStatusSchema.options;
|
|
25486
|
-
var sponsoredTaskRewardsCommand = new
|
|
25899
|
+
var sponsoredTaskRewardsCommand = new Command125("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
25900
|
async (opts) => {
|
|
25488
25901
|
let address3 = opts.address;
|
|
25489
25902
|
if (address3 === void 0) {
|
|
@@ -25523,7 +25936,7 @@ var sponsoredTaskRewardsCommand = new Command124("rewards").description("List Sp
|
|
|
25523
25936
|
);
|
|
25524
25937
|
|
|
25525
25938
|
// src/commands/sponsored-task/bind-payout.ts
|
|
25526
|
-
import { Command as
|
|
25939
|
+
import { Command as Command126 } from "commander";
|
|
25527
25940
|
async function solanaRewards(agent) {
|
|
25528
25941
|
try {
|
|
25529
25942
|
const result = await apiGet(
|
|
@@ -25534,7 +25947,7 @@ async function solanaRewards(agent) {
|
|
|
25534
25947
|
return [];
|
|
25535
25948
|
}
|
|
25536
25949
|
}
|
|
25537
|
-
var sponsoredTaskBindPayoutCommand = new
|
|
25950
|
+
var sponsoredTaskBindPayoutCommand = new Command126("bind-payout").description(
|
|
25538
25951
|
"Bind the Solana address that receives your Solana Sponsored Task awards (once; rebinding replaces it)"
|
|
25539
25952
|
).option(
|
|
25540
25953
|
"--address <solana-address>",
|
|
@@ -25673,7 +26086,7 @@ function bindingTaskChainIds(requested, connection, everyChain) {
|
|
|
25673
26086
|
}
|
|
25674
26087
|
|
|
25675
26088
|
// src/commands/sponsored-task/index.ts
|
|
25676
|
-
var sponsoredTaskCommand = new
|
|
26089
|
+
var sponsoredTaskCommand = new Command127("sponsored-task").description(
|
|
25677
26090
|
"Sponsored Task vault administration and reward claims"
|
|
25678
26091
|
);
|
|
25679
26092
|
sponsoredTaskCommand.addCommand(sponsoredTaskCreateCommand);
|
|
@@ -25693,10 +26106,10 @@ sponsoredTaskCommand.addCommand(sponsoredTaskRewardsCommand);
|
|
|
25693
26106
|
sponsoredTaskCommand.addCommand(sponsoredTaskBindPayoutCommand);
|
|
25694
26107
|
|
|
25695
26108
|
// src/commands/project/index.ts
|
|
25696
|
-
import { Command as
|
|
26109
|
+
import { Command as Command149 } from "commander";
|
|
25697
26110
|
|
|
25698
26111
|
// src/commands/project/accept.ts
|
|
25699
|
-
import { Command as
|
|
26112
|
+
import { Command as Command128 } from "commander";
|
|
25700
26113
|
|
|
25701
26114
|
// src/commands/project/shared.ts
|
|
25702
26115
|
var ADDRESS = /^0x[0-9a-fA-F]{40}$/;
|
|
@@ -25821,7 +26234,7 @@ async function postProjectWrite(path9, body, options) {
|
|
|
25821
26234
|
|
|
25822
26235
|
// src/commands/project/accept.ts
|
|
25823
26236
|
var TERMS_HASH = /^0x[0-9a-fA-F]{64}$/;
|
|
25824
|
-
var projectAcceptCommand = new
|
|
26237
|
+
var projectAcceptCommand = new Command128("accept").description(
|
|
25825
26238
|
"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
26239
|
).argument("<projectId>", "Project id").option(
|
|
25827
26240
|
"--terms-hash <hash>",
|
|
@@ -25853,7 +26266,7 @@ var projectAcceptCommand = new Command127("accept").description(
|
|
|
25853
26266
|
});
|
|
25854
26267
|
|
|
25855
26268
|
// src/commands/project/add-task.ts
|
|
25856
|
-
import { Command as
|
|
26269
|
+
import { Command as Command129 } from "commander";
|
|
25857
26270
|
function deadlineCheck(durationHours, project, now = /* @__PURE__ */ new Date()) {
|
|
25858
26271
|
if (!project?.endsAt || !Number.isFinite(durationHours)) return null;
|
|
25859
26272
|
const endsAt = new Date(project.endsAt);
|
|
@@ -25915,7 +26328,7 @@ function parseContinuation(flags) {
|
|
|
25915
26328
|
function collect5(value, previous = []) {
|
|
25916
26329
|
return [...previous, value];
|
|
25917
26330
|
}
|
|
25918
|
-
var projectAddTaskCommand = new
|
|
26331
|
+
var projectAddTaskCommand = new Command129("add-task").description(
|
|
25919
26332
|
"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
26333
|
).argument("<projectId>", "Project id");
|
|
25921
26334
|
for (const option of createCmd.options) {
|
|
@@ -25967,7 +26380,7 @@ projectAddTaskCommand.action(async (id, opts) => {
|
|
|
25967
26380
|
});
|
|
25968
26381
|
|
|
25969
26382
|
// src/commands/project/automations.ts
|
|
25970
|
-
import { Command as
|
|
26383
|
+
import { Command as Command130 } from "commander";
|
|
25971
26384
|
function automationsOnBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
25972
26385
|
if (opts.cap === void 0) {
|
|
25973
26386
|
return { error: "--cap is required: the most the automations may draw from the budget" };
|
|
@@ -25996,7 +26409,7 @@ function automationsOnBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
|
25996
26409
|
}
|
|
25997
26410
|
return body;
|
|
25998
26411
|
}
|
|
25999
|
-
var projectAutomationsOnCommand = new
|
|
26412
|
+
var projectAutomationsOnCommand = new Command130("on").description(
|
|
26000
26413
|
"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
26414
|
).argument("<projectId>", "Project id").option(
|
|
26002
26415
|
"--cap <amount>",
|
|
@@ -26024,7 +26437,7 @@ var projectAutomationsOnCommand = new Command129("on").description(
|
|
|
26024
26437
|
});
|
|
26025
26438
|
}
|
|
26026
26439
|
);
|
|
26027
|
-
var projectAutomationsOffCommand = new
|
|
26440
|
+
var projectAutomationsOffCommand = new Command130("off").description(
|
|
26028
26441
|
"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
26442
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
26030
26443
|
const projectId = parseProjectId(id);
|
|
@@ -26035,7 +26448,7 @@ var projectAutomationsOffCommand = new Command129("off").description(
|
|
|
26035
26448
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26036
26449
|
);
|
|
26037
26450
|
});
|
|
26038
|
-
var projectAutomationsStatusCommand = new
|
|
26451
|
+
var projectAutomationsStatusCommand = new Command130("status").description(
|
|
26039
26452
|
"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
26453
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
26041
26454
|
const projectId = parseProjectId(id);
|
|
@@ -26046,13 +26459,13 @@ var projectAutomationsStatusCommand = new Command129("status").description(
|
|
|
26046
26459
|
renderFailure(err);
|
|
26047
26460
|
}
|
|
26048
26461
|
});
|
|
26049
|
-
var projectAutomationsCommand = new
|
|
26462
|
+
var projectAutomationsCommand = new Command130("automations").description(
|
|
26050
26463
|
"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
26464
|
).addCommand(projectAutomationsOnCommand).addCommand(projectAutomationsOffCommand).addCommand(projectAutomationsStatusCommand);
|
|
26052
26465
|
|
|
26053
26466
|
// src/commands/project/claim.ts
|
|
26054
|
-
import { Command as
|
|
26055
|
-
var projectClaimCommand = new
|
|
26467
|
+
import { Command as Command131 } from "commander";
|
|
26468
|
+
var projectClaimCommand = new Command131("claim").description(
|
|
26056
26469
|
"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
26470
|
).argument("<projectId>", "Project id").option("--backer <address>", "The backer to pay (default: your wallet)").action(async (id, opts) => {
|
|
26058
26471
|
const projectId = parseProjectId(id);
|
|
@@ -26072,8 +26485,8 @@ var projectClaimCommand = new Command130("claim").description(
|
|
|
26072
26485
|
});
|
|
26073
26486
|
|
|
26074
26487
|
// src/commands/project/close.ts
|
|
26075
|
-
import { Command as
|
|
26076
|
-
var projectCloseCommand = new
|
|
26488
|
+
import { Command as Command132 } from "commander";
|
|
26489
|
+
var projectCloseCommand = new Command132("close").description(
|
|
26077
26490
|
"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
26491
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
26079
26492
|
const projectId = parseProjectId(id);
|
|
@@ -26086,13 +26499,13 @@ var projectCloseCommand = new Command131("close").description(
|
|
|
26086
26499
|
});
|
|
26087
26500
|
|
|
26088
26501
|
// src/commands/project/create.ts
|
|
26089
|
-
import { Command as
|
|
26502
|
+
import { Command as Command135 } from "commander";
|
|
26090
26503
|
|
|
26091
26504
|
// src/commands/project/suggestions.ts
|
|
26092
|
-
import { Command as
|
|
26505
|
+
import { Command as Command134 } from "commander";
|
|
26093
26506
|
|
|
26094
26507
|
// src/commands/project/suggestion-proposals.ts
|
|
26095
|
-
import { Command as
|
|
26508
|
+
import { Command as Command133 } from "commander";
|
|
26096
26509
|
var QUERY_ERRORS = {
|
|
26097
26510
|
status: "--status must be pending, closed or expired",
|
|
26098
26511
|
limit: "--limit must be an integer from 1 to 50",
|
|
@@ -26143,7 +26556,7 @@ async function read(path9) {
|
|
|
26143
26556
|
function collectSuggestion(value, previous) {
|
|
26144
26557
|
return [...previous, value];
|
|
26145
26558
|
}
|
|
26146
|
-
var projectSuggestionProposalsCommand = new
|
|
26559
|
+
var projectSuggestionProposalsCommand = new Command133("proposals").description(
|
|
26147
26560
|
"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
26561
|
).argument("<projectId>", "Project id").option(
|
|
26149
26562
|
"--status <status>",
|
|
@@ -26158,7 +26571,7 @@ var projectSuggestionProposalsCommand = new Command132("proposals").description(
|
|
|
26158
26571
|
if (typeof query4 !== "string") return void printError(query4.error);
|
|
26159
26572
|
await read(`/api/projects/${projectId}/suggestion-proposals${query4 ? `?${query4}` : ""}`);
|
|
26160
26573
|
});
|
|
26161
|
-
var proposalShowCommand = new
|
|
26574
|
+
var proposalShowCommand = new Command133("show").description(
|
|
26162
26575
|
"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
26576
|
).argument("<proposalId>", "Proposal id").action(async (value) => {
|
|
26164
26577
|
const id = parseProposalId(value);
|
|
@@ -26166,7 +26579,7 @@ var proposalShowCommand = new Command132("show").description(
|
|
|
26166
26579
|
await read(`/api/suggestion-proposals/${id}`);
|
|
26167
26580
|
});
|
|
26168
26581
|
function decisionCommand(action, description) {
|
|
26169
|
-
return new
|
|
26582
|
+
return new Command133(action).description(description).argument("<proposalId>", "Proposal id").option(
|
|
26170
26583
|
"--suggestion <suggestionId>",
|
|
26171
26584
|
`Only this pick; repeat it for each (default: every pending pick)`,
|
|
26172
26585
|
collectSuggestion,
|
|
@@ -26183,7 +26596,7 @@ function decisionCommand(action, description) {
|
|
|
26183
26596
|
);
|
|
26184
26597
|
});
|
|
26185
26598
|
}
|
|
26186
|
-
var projectSuggestionProposalCommand = new
|
|
26599
|
+
var projectSuggestionProposalCommand = new Command133("proposal").description(
|
|
26187
26600
|
"One suggestion proposal, as the project's owner: show it, confirm its picks so the platform runner creates their tasks, or drop them"
|
|
26188
26601
|
).addCommand(proposalShowCommand).addCommand(
|
|
26189
26602
|
decisionCommand(
|
|
@@ -26297,7 +26710,7 @@ async function signedRead(path9) {
|
|
|
26297
26710
|
renderFailure(err);
|
|
26298
26711
|
}
|
|
26299
26712
|
}
|
|
26300
|
-
var projectSuggestCommand = new
|
|
26713
|
+
var projectSuggestCommand = new Command134("suggest").description(
|
|
26301
26714
|
"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
26715
|
).argument("<projectId>", "Project id").option("--title <text>", "Required: one line, 1 to 120 characters").option(
|
|
26303
26716
|
"--brief <text>",
|
|
@@ -26317,7 +26730,7 @@ var projectSuggestCommand = new Command133("suggest").description(
|
|
|
26317
26730
|
maxAmount: ACTION_FEE_MAX_AMOUNT
|
|
26318
26731
|
});
|
|
26319
26732
|
});
|
|
26320
|
-
var projectSuggestionsCommand = new
|
|
26733
|
+
var projectSuggestionsCommand = new Command134("suggestions").description(
|
|
26321
26734
|
"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
26735
|
).argument("<projectId>", "Project id").option(
|
|
26323
26736
|
"--status <status>",
|
|
@@ -26335,7 +26748,7 @@ var projectSuggestionsCommand = new Command133("suggestions").description(
|
|
|
26335
26748
|
if (typeof query4 !== "string") return void printError(query4.error);
|
|
26336
26749
|
await signedRead(`/api/projects/${projectId}/suggestions${query4 ? `?${query4}` : ""}`);
|
|
26337
26750
|
});
|
|
26338
|
-
var showCommand3 = new
|
|
26751
|
+
var showCommand3 = new Command134("show").description("Show a suggestion with its status, votes and backedShares (free)").argument("<suggestionId>", "Suggestion id").action(async (value) => {
|
|
26339
26752
|
const id = parseSuggestionId(value);
|
|
26340
26753
|
if (typeof id !== "string") return void printError(id.error);
|
|
26341
26754
|
await signedRead(`/api/project-suggestions/${id}`);
|
|
@@ -26349,7 +26762,7 @@ async function readAuthFor(what) {
|
|
|
26349
26762
|
return { headers: auth.headers };
|
|
26350
26763
|
}
|
|
26351
26764
|
function voteCommand(action, description) {
|
|
26352
|
-
return new
|
|
26765
|
+
return new Command134(action).description(description).argument("<suggestionId>", "Suggestion id").action(async (value) => {
|
|
26353
26766
|
const suggestionId = parseSuggestionId(value);
|
|
26354
26767
|
if (typeof suggestionId !== "string") return void printError(suggestionId.error);
|
|
26355
26768
|
const auth = await readAuthFor(action === "vote" ? "Voting" : "Taking back a vote");
|
|
@@ -26372,7 +26785,7 @@ function voteCommand(action, description) {
|
|
|
26372
26785
|
}
|
|
26373
26786
|
});
|
|
26374
26787
|
}
|
|
26375
|
-
var reportCommand = new
|
|
26788
|
+
var reportCommand = new Command134("report").description(
|
|
26376
26789
|
"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
26790
|
).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
26791
|
const suggestionId = parseSuggestionId(value);
|
|
@@ -26411,7 +26824,7 @@ var reportCommand = new Command133("report").description(
|
|
|
26411
26824
|
renderFailure(err);
|
|
26412
26825
|
}
|
|
26413
26826
|
});
|
|
26414
|
-
var withdrawCommand2 = new
|
|
26827
|
+
var withdrawCommand2 = new Command134("withdraw").description("Withdraw your open suggestion, as its author (costs 0.001 in the payment token)").argument("<suggestionId>", "Suggestion id").action(async (value) => {
|
|
26415
26828
|
const suggestionId = parseSuggestionId(value);
|
|
26416
26829
|
if (typeof suggestionId !== "string") return void printError(suggestionId.error);
|
|
26417
26830
|
await postProjectWrite(
|
|
@@ -26420,7 +26833,7 @@ var withdrawCommand2 = new Command133("withdraw").description("Withdraw your ope
|
|
|
26420
26833
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26421
26834
|
);
|
|
26422
26835
|
});
|
|
26423
|
-
var declineCommand = new
|
|
26836
|
+
var declineCommand = new Command134("decline").description(
|
|
26424
26837
|
"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
26838
|
).argument("<suggestionId>", "Suggestion id").option("--reason <text>", "Why, shown to everyone: up to 500 characters").action(async (value, opts) => {
|
|
26426
26839
|
const suggestionId = parseSuggestionId(value);
|
|
@@ -26435,7 +26848,7 @@ var declineCommand = new Command133("decline").description(
|
|
|
26435
26848
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26436
26849
|
);
|
|
26437
26850
|
});
|
|
26438
|
-
var projectSuggestionCommand = new
|
|
26851
|
+
var projectSuggestionCommand = new Command134("suggestion").description(
|
|
26439
26852
|
"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
26853
|
).addCommand(showCommand3).addCommand(
|
|
26441
26854
|
voteCommand(
|
|
@@ -26445,7 +26858,7 @@ var projectSuggestionCommand = new Command133("suggestion").description(
|
|
|
26445
26858
|
).addCommand(
|
|
26446
26859
|
voteCommand("unvote", "Take back your upvote on a suggestion (free, signed by your wallet)")
|
|
26447
26860
|
).addCommand(reportCommand).addCommand(withdrawCommand2).addCommand(declineCommand).addCommand(projectSuggestionProposalsCommand).addCommand(projectSuggestionProposalCommand);
|
|
26448
|
-
var projectSuggestionSettingsCommand = new
|
|
26861
|
+
var projectSuggestionSettingsCommand = new Command134("suggestion-settings").description(
|
|
26449
26862
|
"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
26863
|
).argument("<projectId>", "Project id").option(
|
|
26451
26864
|
"--suggestions <setting>",
|
|
@@ -26480,7 +26893,7 @@ var projectSuggestionSettingsCommand = new Command133("suggestion-settings").des
|
|
|
26480
26893
|
});
|
|
26481
26894
|
|
|
26482
26895
|
// src/commands/project/create.ts
|
|
26483
|
-
var projectCreateCommand = new
|
|
26896
|
+
var projectCreateCommand = new Command135("create").description(
|
|
26484
26897
|
"Open a project: one budget that funds tasks of any mode (costs the budget, in the payment token)"
|
|
26485
26898
|
).requiredOption("--budget <amount>", "Opening budget in the payment token (e.g. 50)").requiredOption(
|
|
26486
26899
|
"--ends-at <time>",
|
|
@@ -26529,9 +26942,9 @@ var projectCreateCommand = new Command134("create").description(
|
|
|
26529
26942
|
);
|
|
26530
26943
|
|
|
26531
26944
|
// src/commands/project/extend.ts
|
|
26532
|
-
import { Command as
|
|
26945
|
+
import { Command as Command136 } from "commander";
|
|
26533
26946
|
var MAX_EXTENSION_MS = 365 * 24 * 3600 * 1e3;
|
|
26534
|
-
var projectExtendCommand = new
|
|
26947
|
+
var projectExtendCommand = new Command136("extend").description(
|
|
26535
26948
|
"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
26949
|
).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
26950
|
const projectId = parseProjectId(id);
|
|
@@ -26549,8 +26962,8 @@ var projectExtendCommand = new Command135("extend").description(
|
|
|
26549
26962
|
});
|
|
26550
26963
|
|
|
26551
26964
|
// src/commands/project/fund.ts
|
|
26552
|
-
import { Command as
|
|
26553
|
-
var projectFundCommand = new
|
|
26965
|
+
import { Command as Command137 } from "commander";
|
|
26966
|
+
var projectFundCommand = new Command137("fund").description(
|
|
26554
26967
|
"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
26968
|
).argument("<projectId>", "Project id").requiredOption("--amount <amount>", "Amount in the payment token (e.g. 10)").option(
|
|
26556
26969
|
"--on-behalf-of <address>",
|
|
@@ -26572,7 +26985,7 @@ var projectFundCommand = new Command136("fund").description(
|
|
|
26572
26985
|
});
|
|
26573
26986
|
|
|
26574
26987
|
// src/commands/project/grant.ts
|
|
26575
|
-
import { Command as
|
|
26988
|
+
import { Command as Command138 } from "commander";
|
|
26576
26989
|
function grantBody(projectId, opts) {
|
|
26577
26990
|
if (!ADDRESS.test(opts.operator)) {
|
|
26578
26991
|
return { error: "--operator must be a wallet address (0x + 40 hex chars)" };
|
|
@@ -26595,7 +27008,7 @@ function grantBody(projectId, opts) {
|
|
|
26595
27008
|
revokeRemovesControl: opts.revokeRemovesControl
|
|
26596
27009
|
};
|
|
26597
27010
|
}
|
|
26598
|
-
var projectGrantCommand = new
|
|
27011
|
+
var projectGrantCommand = new Command138("grant").description(
|
|
26599
27012
|
"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
27013
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The wallet granted the right to spend the budget").option(
|
|
26601
27014
|
"--cap <amount>",
|
|
@@ -26621,7 +27034,7 @@ var projectGrantCommand = new Command137("grant").description(
|
|
|
26621
27034
|
});
|
|
26622
27035
|
|
|
26623
27036
|
// src/commands/project/review.ts
|
|
26624
|
-
import { Command as
|
|
27037
|
+
import { Command as Command139 } from "commander";
|
|
26625
27038
|
function reviewEvaluator(opts) {
|
|
26626
27039
|
if (opts.evaluator !== void 0 && opts.off) {
|
|
26627
27040
|
return { error: "Pass --evaluator <address> or --off, not both" };
|
|
@@ -26636,7 +27049,7 @@ function reviewEvaluator(opts) {
|
|
|
26636
27049
|
}
|
|
26637
27050
|
return opts.evaluator;
|
|
26638
27051
|
}
|
|
26639
|
-
var projectReviewCommand = new
|
|
27052
|
+
var projectReviewCommand = new Command139("review").description(
|
|
26640
27053
|
"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
27054
|
).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
27055
|
const projectId = parseProjectId(id);
|
|
@@ -26678,8 +27091,8 @@ async function ownerEvaluatorWarnings(evaluator) {
|
|
|
26678
27091
|
}
|
|
26679
27092
|
|
|
26680
27093
|
// src/commands/project/raise-cap.ts
|
|
26681
|
-
import { Command as
|
|
26682
|
-
var projectRaiseCapCommand = new
|
|
27094
|
+
import { Command as Command140 } from "commander";
|
|
27095
|
+
var projectRaiseCapCommand = new Command140("raise-cap").description(
|
|
26683
27096
|
"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
27097
|
).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
27098
|
const projectId = parseProjectId(id);
|
|
@@ -26697,8 +27110,8 @@ var projectRaiseCapCommand = new Command139("raise-cap").description(
|
|
|
26697
27110
|
});
|
|
26698
27111
|
|
|
26699
27112
|
// src/commands/project/lower-cap.ts
|
|
26700
|
-
import { Command as
|
|
26701
|
-
var projectLowerCapCommand = new
|
|
27113
|
+
import { Command as Command141 } from "commander";
|
|
27114
|
+
var projectLowerCapCommand = new Command141("lower-cap").description(
|
|
26702
27115
|
"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
27116
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose cap to lower").requiredOption(
|
|
26704
27117
|
"--cap <amount>",
|
|
@@ -26720,7 +27133,7 @@ var projectLowerCapCommand = new Command140("lower-cap").description(
|
|
|
26720
27133
|
});
|
|
26721
27134
|
|
|
26722
27135
|
// src/commands/project/limits.ts
|
|
26723
|
-
import { Command as
|
|
27136
|
+
import { Command as Command142 } from "commander";
|
|
26724
27137
|
function limitsBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
26725
27138
|
if (!ADDRESS.test(opts.operator)) {
|
|
26726
27139
|
return { error: "--operator must be a wallet address (0x + 40 hex chars)" };
|
|
@@ -26760,7 +27173,7 @@ function limitsBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
|
26760
27173
|
}
|
|
26761
27174
|
return body;
|
|
26762
27175
|
}
|
|
26763
|
-
var projectLimitsCommand = new
|
|
27176
|
+
var projectLimitsCommand = new Command142("limits").description(
|
|
26764
27177
|
"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
27178
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose limits to set").option(
|
|
26766
27179
|
"--expires <time>",
|
|
@@ -26782,8 +27195,8 @@ var projectLimitsCommand = new Command141("limits").description(
|
|
|
26782
27195
|
});
|
|
26783
27196
|
|
|
26784
27197
|
// src/commands/project/revoke.ts
|
|
26785
|
-
import { Command as
|
|
26786
|
-
var projectRevokeCommand = new
|
|
27198
|
+
import { Command as Command143 } from "commander";
|
|
27199
|
+
var projectRevokeCommand = new Command143("revoke").description(
|
|
26787
27200
|
"End an operator's right to create tasks from the project, as its owner (costs 0.001 in the payment token)"
|
|
26788
27201
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator to revoke").action(async (id, opts) => {
|
|
26789
27202
|
const projectId = parseProjectId(id);
|
|
@@ -26802,7 +27215,7 @@ var projectRevokeCommand = new Command142("revoke").description(
|
|
|
26802
27215
|
});
|
|
26803
27216
|
|
|
26804
27217
|
// src/commands/project/schedule.ts
|
|
26805
|
-
import { Command as
|
|
27218
|
+
import { Command as Command146 } from "commander";
|
|
26806
27219
|
|
|
26807
27220
|
// src/lib/owner-list.ts
|
|
26808
27221
|
import { getAddress as getAddress2, isAddress as isAddress5 } from "viem";
|
|
@@ -26842,7 +27255,7 @@ function ownerListQuery(owner, opts, statuses) {
|
|
|
26842
27255
|
}
|
|
26843
27256
|
|
|
26844
27257
|
// src/commands/project/suggestion-schedule.ts
|
|
26845
|
-
import { Command as
|
|
27258
|
+
import { Command as Command144 } from "commander";
|
|
26846
27259
|
var SUGGESTION_ONLY_FLAGS = [
|
|
26847
27260
|
["--rank", "rank"],
|
|
26848
27261
|
["--min-backed-share", "minBackedShare"],
|
|
@@ -27033,7 +27446,7 @@ function addSuggestionScheduleOptions(command) {
|
|
|
27033
27446
|
).option("--no-email-picks", "Suggestions schedules: do not email when picks are waiting");
|
|
27034
27447
|
}
|
|
27035
27448
|
var suggestionScheduleSettingsCommand = addSuggestionScheduleOptions(
|
|
27036
|
-
new
|
|
27449
|
+
new Command144("suggestion-settings").description(
|
|
27037
27450
|
"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
27451
|
).argument("<scheduleId>", "Schedule id").option(
|
|
27039
27452
|
"--mode <mode>",
|
|
@@ -27067,7 +27480,7 @@ var suggestionScheduleSettingsCommand = addSuggestionScheduleOptions(
|
|
|
27067
27480
|
|
|
27068
27481
|
// src/commands/workflow-template.ts
|
|
27069
27482
|
import { readFile as readFile4 } from "fs/promises";
|
|
27070
|
-
import { Command as
|
|
27483
|
+
import { Command as Command145 } from "commander";
|
|
27071
27484
|
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
27485
|
var ADDRESS2 = /^0x[0-9a-fA-F]{40}$/;
|
|
27073
27486
|
var FILE_MAX_BYTES = 256 * 1024;
|
|
@@ -27161,7 +27574,7 @@ async function readValidTemplate(path9) {
|
|
|
27161
27574
|
}
|
|
27162
27575
|
return parsed.document;
|
|
27163
27576
|
}
|
|
27164
|
-
var createCommand3 = new
|
|
27577
|
+
var createCommand3 = new Command145("create").description(
|
|
27165
27578
|
"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
27579
|
).requiredOption("--file <path>", "The template, JSON").action(async (opts) => {
|
|
27167
27580
|
const template = await readValidTemplate(opts.file);
|
|
@@ -27172,7 +27585,7 @@ var createCommand3 = new Command144("create").description(
|
|
|
27172
27585
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27173
27586
|
);
|
|
27174
27587
|
});
|
|
27175
|
-
var updateCommand = new
|
|
27588
|
+
var updateCommand = new Command145("update").description(
|
|
27176
27589
|
"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
27590
|
).argument("<templateId>", "Template id").requiredOption("--file <path>", "The template, JSON").action(async (value, opts) => {
|
|
27178
27591
|
const choice = templateChoice(value);
|
|
@@ -27226,7 +27639,7 @@ function parseTemplateSearch(opts) {
|
|
|
27226
27639
|
}
|
|
27227
27640
|
return { query: query4 };
|
|
27228
27641
|
}
|
|
27229
|
-
var listCommand6 = new
|
|
27642
|
+
var listCommand6 = new Command145("list").description(
|
|
27230
27643
|
"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
27644
|
).option("--owner <address>", "The wallet whose templates to list").option(
|
|
27232
27645
|
"--mine",
|
|
@@ -27311,7 +27724,7 @@ var listCommand6 = new Command144("list").description(
|
|
|
27311
27724
|
}
|
|
27312
27725
|
}
|
|
27313
27726
|
);
|
|
27314
|
-
var showCommand4 = new
|
|
27727
|
+
var showCommand4 = new Command145("show").description(
|
|
27315
27728
|
"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
27729
|
).argument("<template>", "Template id, official template id or preset name").action(async (value) => {
|
|
27317
27730
|
const choice = templateChoice(value);
|
|
@@ -27334,7 +27747,7 @@ function savedTemplateId(value, verb) {
|
|
|
27334
27747
|
}
|
|
27335
27748
|
return choice.templateId;
|
|
27336
27749
|
}
|
|
27337
|
-
var publishCommand = new
|
|
27750
|
+
var publishCommand = new Command145("publish").description(
|
|
27338
27751
|
"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
27752
|
).argument("<templateId>", "Saved template id").action(async (value) => {
|
|
27340
27753
|
const id = savedTemplateId(value, "publish");
|
|
@@ -27345,7 +27758,7 @@ var publishCommand = new Command144("publish").description(
|
|
|
27345
27758
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27346
27759
|
);
|
|
27347
27760
|
});
|
|
27348
|
-
var unpublishCommand = new
|
|
27761
|
+
var unpublishCommand = new Command145("unpublish").description(
|
|
27349
27762
|
"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
27763
|
).argument("<templateId>", "Saved template id").action(async (value) => {
|
|
27351
27764
|
const id = savedTemplateId(value, "unpublish");
|
|
@@ -27356,7 +27769,7 @@ var unpublishCommand = new Command144("unpublish").description(
|
|
|
27356
27769
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27357
27770
|
);
|
|
27358
27771
|
});
|
|
27359
|
-
var deleteCommand2 = new
|
|
27772
|
+
var deleteCommand2 = new Command145("delete").description(
|
|
27360
27773
|
"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
27774
|
).argument("<templateId>", "Template id").action(async (value) => {
|
|
27362
27775
|
const choice = templateChoice(value);
|
|
@@ -27373,7 +27786,7 @@ var deleteCommand2 = new Command144("delete").description(
|
|
|
27373
27786
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27374
27787
|
);
|
|
27375
27788
|
});
|
|
27376
|
-
var workflowTemplateCommand = new
|
|
27789
|
+
var workflowTemplateCommand = new Command145("template").description(
|
|
27377
27790
|
"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
27791
|
).addCommand(createCommand3).addCommand(updateCommand).addCommand(listCommand6).addCommand(showCommand4).addCommand(publishCommand).addCommand(unpublishCommand).addCommand(deleteCommand2);
|
|
27379
27792
|
async function createWorkflowFromTemplate(projectId, template, pairs) {
|
|
@@ -27573,7 +27986,7 @@ async function read2(path9) {
|
|
|
27573
27986
|
}
|
|
27574
27987
|
}
|
|
27575
27988
|
var createCommand4 = addSuggestionScheduleOptions(
|
|
27576
|
-
new
|
|
27989
|
+
new Command146("create").description(
|
|
27577
27990
|
"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
27991
|
).argument("<projectId>", "Project id").requiredOption(
|
|
27579
27992
|
"--cadence <cadence>",
|
|
@@ -27622,7 +28035,7 @@ var createCommand4 = addSuggestionScheduleOptions(
|
|
|
27622
28035
|
});
|
|
27623
28036
|
});
|
|
27624
28037
|
var OWNER_SCHEDULE_STATUSES = [...STATUSES, "needs_action", "all"];
|
|
27625
|
-
var listCommand7 = new
|
|
28038
|
+
var listCommand7 = new Command146("list").description(
|
|
27626
28039
|
"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
28040
|
).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
28041
|
"--status <status>",
|
|
@@ -27655,7 +28068,7 @@ var listCommand7 = new Command145("list").description(
|
|
|
27655
28068
|
const query4 = params.toString();
|
|
27656
28069
|
await read2(withChainId(`/api/projects/${projectId}/schedules${query4 ? `?${query4}` : ""}`));
|
|
27657
28070
|
});
|
|
27658
|
-
var showCommand5 = new
|
|
28071
|
+
var showCommand5 = new Command146("show").description(
|
|
27659
28072
|
"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
28073
|
).argument("<scheduleId>", "Schedule id").action(async (value) => {
|
|
27661
28074
|
const id = parseScheduleId(value);
|
|
@@ -27663,7 +28076,7 @@ var showCommand5 = new Command145("show").description(
|
|
|
27663
28076
|
await read2(`/api/project-schedules/${id}`);
|
|
27664
28077
|
});
|
|
27665
28078
|
function actionCommand(action, description) {
|
|
27666
|
-
return new
|
|
28079
|
+
return new Command146(action).description(description).argument("<scheduleId>", "Schedule id").action(async (value) => {
|
|
27667
28080
|
const id = parseScheduleId(value);
|
|
27668
28081
|
if (typeof id !== "string") return void printError(id.error);
|
|
27669
28082
|
await postProjectWrite(
|
|
@@ -27673,7 +28086,7 @@ function actionCommand(action, description) {
|
|
|
27673
28086
|
);
|
|
27674
28087
|
});
|
|
27675
28088
|
}
|
|
27676
|
-
var settingsCommand = new
|
|
28089
|
+
var settingsCommand = new Command146("settings").description(
|
|
27677
28090
|
"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
28091
|
).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
28092
|
const projectId = parseProjectId(id);
|
|
@@ -27695,7 +28108,7 @@ var settingsCommand = new Command145("settings").description(
|
|
|
27695
28108
|
maxAmount: ACTION_FEE_MAX_AMOUNT
|
|
27696
28109
|
});
|
|
27697
28110
|
});
|
|
27698
|
-
var projectScheduleCommand = new
|
|
28111
|
+
var projectScheduleCommand = new Command146("schedule").description(
|
|
27699
28112
|
"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
28113
|
).addCommand(createCommand4).addCommand(listCommand7).addCommand(showCommand5).addCommand(
|
|
27701
28114
|
actionCommand(
|
|
@@ -27718,15 +28131,15 @@ var projectScheduleCommand = new Command145("schedule").description(
|
|
|
27718
28131
|
"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
28132
|
)
|
|
27720
28133
|
).addCommand(settingsCommand).addCommand(suggestionScheduleSettingsCommand);
|
|
27721
|
-
var projectRunnerCommand = new
|
|
28134
|
+
var projectRunnerCommand = new Command146("runner").description(
|
|
27722
28135
|
"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
28136
|
).action(async () => {
|
|
27724
28137
|
await read2(withChainId("/api/project-runner"));
|
|
27725
28138
|
});
|
|
27726
28139
|
|
|
27727
28140
|
// src/commands/project/transfer.ts
|
|
27728
|
-
import { Command as
|
|
27729
|
-
var proposeCommand = new
|
|
28141
|
+
import { Command as Command147 } from "commander";
|
|
28142
|
+
var proposeCommand = new Command147("propose").description(
|
|
27730
28143
|
"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
28144
|
).argument("<projectId>", "Project id").requiredOption("--to <address>", "The wallet that will own the project once it accepts").action(async (id, opts) => {
|
|
27732
28145
|
const projectId = parseProjectId(id);
|
|
@@ -27740,7 +28153,7 @@ var proposeCommand = new Command146("propose").description(
|
|
|
27740
28153
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27741
28154
|
);
|
|
27742
28155
|
});
|
|
27743
|
-
var acceptCommand2 = new
|
|
28156
|
+
var acceptCommand2 = new Command147("accept").description(
|
|
27744
28157
|
"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
28158
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
27746
28159
|
const projectId = parseProjectId(id);
|
|
@@ -27751,7 +28164,7 @@ var acceptCommand2 = new Command146("accept").description(
|
|
|
27751
28164
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27752
28165
|
);
|
|
27753
28166
|
});
|
|
27754
|
-
var cancelCommand = new
|
|
28167
|
+
var cancelCommand = new Command147("cancel").description(
|
|
27755
28168
|
"Withdraw the pending ownership proposal, as the project owner (costs 0.001 in the payment token)"
|
|
27756
28169
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
27757
28170
|
const projectId = parseProjectId(id);
|
|
@@ -27762,13 +28175,13 @@ var cancelCommand = new Command146("cancel").description(
|
|
|
27762
28175
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27763
28176
|
);
|
|
27764
28177
|
});
|
|
27765
|
-
var projectTransferCommand = new
|
|
28178
|
+
var projectTransferCommand = new Command147("transfer").description(
|
|
27766
28179
|
"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
28180
|
).addCommand(proposeCommand).addCommand(acceptCommand2).addCommand(cancelCommand);
|
|
27768
28181
|
|
|
27769
28182
|
// src/commands/project/show.ts
|
|
27770
|
-
import { Command as
|
|
27771
|
-
var projectShowCommand = new
|
|
28183
|
+
import { Command as Command148 } from "commander";
|
|
28184
|
+
var projectShowCommand = new Command148("show").description(
|
|
27772
28185
|
"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
28186
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
27774
28187
|
const projectId = parseProjectId(id);
|
|
@@ -27777,7 +28190,7 @@ var projectShowCommand = new Command147("show").description(
|
|
|
27777
28190
|
printResult(await apiGet(withChainId(`/api/projects/${projectId}`), { headers }));
|
|
27778
28191
|
});
|
|
27779
28192
|
var BACKERS_CURSOR = /^\d{1,20}-\d{1,9}$/;
|
|
27780
|
-
var projectBackersCommand = new
|
|
28193
|
+
var projectBackersCommand = new Command148("backers").description(
|
|
27781
28194
|
"List a project's backers, newest first, with each one's contribution, shares, claims and claimable share (free)"
|
|
27782
28195
|
).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
28196
|
const projectId = parseProjectId(id);
|
|
@@ -27796,13 +28209,13 @@ var projectBackersCommand = new Command147("backers").description(
|
|
|
27796
28209
|
await apiGet(withChainId(`/api/projects/${projectId}/backers${query4 ? `?${query4}` : ""}`))
|
|
27797
28210
|
);
|
|
27798
28211
|
});
|
|
27799
|
-
var projectForTaskCommand = new
|
|
28212
|
+
var projectForTaskCommand = new Command148("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
28213
|
if (!/^0x[0-9a-fA-F]{1,78}$/.test(taskId.trim())) {
|
|
27801
28214
|
return void printError("The task id must be 0x-prefixed hex");
|
|
27802
28215
|
}
|
|
27803
28216
|
printResult(await apiGet(`/api/projects/by-task/${encodeURIComponent(taskId.trim())}`));
|
|
27804
28217
|
});
|
|
27805
|
-
var projectListCommand = new
|
|
28218
|
+
var projectListCommand = new Command148("list").description(
|
|
27806
28219
|
"List a wallet's projects, as owner, operator or backer, or with --funding the projects open for backing now (free; default: your wallet)"
|
|
27807
28220
|
).option(
|
|
27808
28221
|
"--funding",
|
|
@@ -27853,7 +28266,7 @@ var projectListCommand = new Command147("list").description(
|
|
|
27853
28266
|
);
|
|
27854
28267
|
|
|
27855
28268
|
// src/commands/project/index.ts
|
|
27856
|
-
var projectCommand = new
|
|
28269
|
+
var projectCommand = new Command149("project").description(
|
|
27857
28270
|
"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
28271
|
);
|
|
27859
28272
|
projectCommand.addCommand(projectCreateCommand);
|
|
@@ -27884,7 +28297,7 @@ projectCommand.addCommand(projectForTaskCommand);
|
|
|
27884
28297
|
|
|
27885
28298
|
// src/commands/workflow.ts
|
|
27886
28299
|
import { readFile as readFile5 } from "fs/promises";
|
|
27887
|
-
import { Command as
|
|
28300
|
+
import { Command as Command150 } from "commander";
|
|
27888
28301
|
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
28302
|
var FILE_MAX_BYTES2 = 256 * 1024;
|
|
27890
28303
|
function parseWorkflowText(text) {
|
|
@@ -27948,7 +28361,7 @@ async function projectContext(projectId) {
|
|
|
27948
28361
|
runner
|
|
27949
28362
|
};
|
|
27950
28363
|
}
|
|
27951
|
-
var validateCommand = new
|
|
28364
|
+
var validateCommand = new Command150("validate").description(
|
|
27952
28365
|
"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
28366
|
).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
28367
|
const parsed = await readDocument(opts.file ?? file);
|
|
@@ -27991,7 +28404,7 @@ var validateCommand = new Command149("validate").description(
|
|
|
27991
28404
|
document: result.document
|
|
27992
28405
|
});
|
|
27993
28406
|
});
|
|
27994
|
-
var createCommand5 = new
|
|
28407
|
+
var createCommand5 = new Command150("create").description(
|
|
27995
28408
|
"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
28409
|
).argument("<projectId>", "Project id").option("--file <path>", "The document, JSON").option(
|
|
27997
28410
|
"--template <template>",
|
|
@@ -28034,7 +28447,7 @@ var createCommand5 = new Command149("create").description(
|
|
|
28034
28447
|
);
|
|
28035
28448
|
});
|
|
28036
28449
|
var OWNER_WORKFLOW_STATUSES = ["needs_action", "running", "failed", "idle", "all"];
|
|
28037
|
-
var listCommand8 = new
|
|
28450
|
+
var listCommand8 = new Command150("list").description(
|
|
28038
28451
|
"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
28452
|
).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
28453
|
"--status <status>",
|
|
@@ -28064,7 +28477,7 @@ var listCommand8 = new Command149("list").description(
|
|
|
28064
28477
|
const query4 = params.toString();
|
|
28065
28478
|
await read3(withChainId(`/api/projects/${projectId}/workflows${query4 ? `?${query4}` : ""}`));
|
|
28066
28479
|
});
|
|
28067
|
-
var showCommand6 = new
|
|
28480
|
+
var showCommand6 = new Command150("show").description(
|
|
28068
28481
|
"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
28482
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
28070
28483
|
const id = uuid(value, "workflow");
|
|
@@ -28077,7 +28490,7 @@ var showCommand6 = new Command149("show").description(
|
|
|
28077
28490
|
renderFailure(err);
|
|
28078
28491
|
}
|
|
28079
28492
|
});
|
|
28080
|
-
var updateTemplateCommand = new
|
|
28493
|
+
var updateTemplateCommand = new Command150("update-template").description(
|
|
28081
28494
|
"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
28495
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
28083
28496
|
const id = uuid(value, "workflow");
|
|
@@ -28088,7 +28501,29 @@ var updateTemplateCommand = new Command149("update-template").description(
|
|
|
28088
28501
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28089
28502
|
);
|
|
28090
28503
|
});
|
|
28091
|
-
var
|
|
28504
|
+
var updateStepsCommand = new Command150("update-steps").description(
|
|
28505
|
+
"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"
|
|
28506
|
+
).argument("<workflowId>", "Workflow id").option("--file <path>", "The new document, JSON").action(async (value, opts) => {
|
|
28507
|
+
const id = uuid(value, "workflow");
|
|
28508
|
+
if (typeof id !== "string") return void printError(id.error);
|
|
28509
|
+
const parsed = await readDocument(opts.file);
|
|
28510
|
+
if ("error" in parsed) return void printError(parsed.error);
|
|
28511
|
+
const result = validateWorkflowDocument(parsed.document, {
|
|
28512
|
+
stepLimit: WORKFLOW_STEP_LIMIT_MAX
|
|
28513
|
+
});
|
|
28514
|
+
if (!result.valid) {
|
|
28515
|
+
return void renderFailure(
|
|
28516
|
+
new Error(`The workflow document is invalid (${result.errors.length} errors)`),
|
|
28517
|
+
{ details: { errors: result.errors } }
|
|
28518
|
+
);
|
|
28519
|
+
}
|
|
28520
|
+
await postProjectWrite(
|
|
28521
|
+
`/api/project-workflows/${id}/update-steps`,
|
|
28522
|
+
{ workflowId: id, document: parsed.document },
|
|
28523
|
+
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28524
|
+
);
|
|
28525
|
+
});
|
|
28526
|
+
var runsCommand = new Command150("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
28527
|
const id = uuid(value, "workflow");
|
|
28093
28528
|
if (typeof id !== "string") return void printError(id.error);
|
|
28094
28529
|
if (opts.limit !== void 0 && !/^(100|[1-9][0-9]?)$/.test(opts.limit.trim())) {
|
|
@@ -28100,14 +28535,14 @@ var runsCommand = new Command149("runs").description("Page through a workflow's
|
|
|
28100
28535
|
const query4 = params.toString();
|
|
28101
28536
|
await read3(`/api/project-workflows/${id}/runs${query4 ? `?${query4}` : ""}`);
|
|
28102
28537
|
});
|
|
28103
|
-
var statusCommand3 = new
|
|
28538
|
+
var statusCommand3 = new Command150("status").description(
|
|
28104
28539
|
"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
28540
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
28106
28541
|
const id = uuid(value, "run");
|
|
28107
28542
|
if (typeof id !== "string") return void printError(id.error);
|
|
28108
28543
|
await read3(`/api/project-workflow-runs/${id}`);
|
|
28109
28544
|
});
|
|
28110
|
-
var runCommand2 = new
|
|
28545
|
+
var runCommand2 = new Command150("run").description(
|
|
28111
28546
|
"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
28547
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
28113
28548
|
const id = uuid(value, "workflow");
|
|
@@ -28119,7 +28554,7 @@ var runCommand2 = new Command149("run").description(
|
|
|
28119
28554
|
);
|
|
28120
28555
|
});
|
|
28121
28556
|
function stepCommand(action, description) {
|
|
28122
|
-
return new
|
|
28557
|
+
return new Command150(action).description(description).argument("<runId>", "Run id").requiredOption(
|
|
28123
28558
|
"--step <key>",
|
|
28124
28559
|
"The step key the run shows, e.g. gate-1, review[round=2] or post[attempt=2]"
|
|
28125
28560
|
).action(async (value, opts) => {
|
|
@@ -28134,7 +28569,7 @@ function stepCommand(action, description) {
|
|
|
28134
28569
|
);
|
|
28135
28570
|
});
|
|
28136
28571
|
}
|
|
28137
|
-
var cancelCommand2 = new
|
|
28572
|
+
var cancelCommand2 = new Command150("cancel").description(
|
|
28138
28573
|
"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
28574
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
28140
28575
|
const id = uuid(value, "run");
|
|
@@ -28145,7 +28580,7 @@ var cancelCommand2 = new Command149("cancel").description(
|
|
|
28145
28580
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28146
28581
|
);
|
|
28147
28582
|
});
|
|
28148
|
-
var stopAutoPayoutCommand = new
|
|
28583
|
+
var stopAutoPayoutCommand = new Command150("stop-auto-payout").description(
|
|
28149
28584
|
"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
28585
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
28151
28586
|
const id = uuid(value, "run");
|
|
@@ -28156,7 +28591,7 @@ var stopAutoPayoutCommand = new Command149("stop-auto-payout").description(
|
|
|
28156
28591
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28157
28592
|
);
|
|
28158
28593
|
});
|
|
28159
|
-
var deleteCommand3 = new
|
|
28594
|
+
var deleteCommand3 = new Command150("delete").description(
|
|
28160
28595
|
"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
28596
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
28162
28597
|
const id = uuid(value, "workflow");
|
|
@@ -28178,22 +28613,22 @@ async function ownerRead(path9) {
|
|
|
28178
28613
|
renderFailure(err);
|
|
28179
28614
|
}
|
|
28180
28615
|
}
|
|
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)"
|
|
28616
|
+
var payoutListCommand = new Command150("list").description(
|
|
28617
|
+
"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
28618
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
28184
28619
|
const id = uuid(value, "run");
|
|
28185
28620
|
if (typeof id !== "string") return void printError(id.error);
|
|
28186
28621
|
await ownerRead(withChainId(`/api/project-workflow-runs/${id}/payouts`));
|
|
28187
28622
|
});
|
|
28188
|
-
var payoutShowCommand = new
|
|
28189
|
-
|
|
28623
|
+
var payoutShowCommand = new Command150("show").description(
|
|
28624
|
+
'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
28625
|
).argument("<proposalId>", "Payout proposal id").action(async (value) => {
|
|
28191
28626
|
const id = uuid(value, "payout proposal");
|
|
28192
28627
|
if (typeof id !== "string") return void printError(id.error);
|
|
28193
28628
|
await ownerRead(withChainId(`/api/project-workflow-payouts/${id}`));
|
|
28194
28629
|
});
|
|
28195
|
-
var payoutConfirmCommand = new
|
|
28196
|
-
|
|
28630
|
+
var payoutConfirmCommand = new Command150("confirm").description(
|
|
28631
|
+
'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
28632
|
).argument("<proposalId>", "Payout proposal id").action(async (value) => {
|
|
28198
28633
|
const id = uuid(value, "payout proposal");
|
|
28199
28634
|
if (typeof id !== "string") return void printError(id.error);
|
|
@@ -28204,21 +28639,49 @@ var payoutConfirmCommand = new Command149("confirm").description(
|
|
|
28204
28639
|
} catch (err) {
|
|
28205
28640
|
return void renderFailure(err);
|
|
28206
28641
|
}
|
|
28207
|
-
|
|
28642
|
+
const refund = view.kind === "refund";
|
|
28643
|
+
if (view.status !== "pending" || (refund ? !view.refund : view.accept === null)) {
|
|
28208
28644
|
return void printError(
|
|
28209
|
-
view.status === "unavailable" ? `Payout proposal ${id} is unavailable (${view.reason ?? "no valid recommendation"}); accept the gated task by hand with
|
|
28645
|
+
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
28646
|
);
|
|
28211
28647
|
}
|
|
28212
28648
|
await postProjectWrite(
|
|
28213
28649
|
`/api/project-workflow-payouts/${id}/confirm`,
|
|
28214
28650
|
{ proposalId: id },
|
|
28215
|
-
{
|
|
28651
|
+
{
|
|
28652
|
+
maxAmount: ACTION_FEE_MAX_AMOUNT,
|
|
28653
|
+
extra: refund ? { refund: view.refund } : { accept: view.accept }
|
|
28654
|
+
}
|
|
28216
28655
|
);
|
|
28217
28656
|
});
|
|
28218
|
-
var
|
|
28657
|
+
var payoutObjectCommand = new Command150("object").description(
|
|
28658
|
+
`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`
|
|
28659
|
+
).argument("<proposalId>", "Payout proposal id").requiredOption("--reason <text>", "Why you object, shown to the owner").action(async (value, opts) => {
|
|
28660
|
+
const id = uuid(value, "payout proposal");
|
|
28661
|
+
if (typeof id !== "string") return void printError(id.error);
|
|
28662
|
+
const reason = opts.reason.trim();
|
|
28663
|
+
if (reason.length < 1 || reason.length > WORKFLOW_OBJECTION_REASON_MAX) {
|
|
28664
|
+
return void printError(`--reason must be 1 to ${WORKFLOW_OBJECTION_REASON_MAX} characters`);
|
|
28665
|
+
}
|
|
28666
|
+
const auth = await signReadAuth();
|
|
28667
|
+
if (!auth || Object.keys(auth.headers).length === 0) {
|
|
28668
|
+
return void printError("Objecting needs a wallet. Run `taskmarket init` first.");
|
|
28669
|
+
}
|
|
28670
|
+
try {
|
|
28671
|
+
const { data, idempotencyKey } = await apiPost(
|
|
28672
|
+
`/api/project-workflow-payouts/${id}/object`,
|
|
28673
|
+
{ proposalId: id, reason, chainId: selectedNetwork().chainId },
|
|
28674
|
+
{ headers: auth.headers }
|
|
28675
|
+
);
|
|
28676
|
+
printResult(data, { idempotencyKey });
|
|
28677
|
+
} catch (err) {
|
|
28678
|
+
renderFailure(err);
|
|
28679
|
+
}
|
|
28680
|
+
});
|
|
28681
|
+
var payoutCommand = new Command150("payout").description(
|
|
28219
28682
|
"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
|
|
28683
|
+
).addCommand(payoutListCommand).addCommand(payoutShowCommand).addCommand(payoutConfirmCommand).addCommand(payoutObjectCommand);
|
|
28684
|
+
var settingsCommand2 = new Command150("settings").description(
|
|
28222
28685
|
`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
28686
|
).argument("<projectId>", "Project id").option("--step-limit <count>", "The most task steps per workflow").action(async (id, opts) => {
|
|
28224
28687
|
const projectId = parseProjectId(id);
|
|
@@ -28249,7 +28712,7 @@ var settingsCommand2 = new Command149("settings").description(
|
|
|
28249
28712
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28250
28713
|
);
|
|
28251
28714
|
});
|
|
28252
|
-
var workflowCommand = new
|
|
28715
|
+
var workflowCommand = new Command150("workflow").description(
|
|
28253
28716
|
"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
28717
|
).addCommand(validateCommand).addCommand(createCommand5).addCommand(listCommand8).addCommand(showCommand6).addCommand(runsCommand).addCommand(runCommand2).addCommand(statusCommand3).addCommand(
|
|
28255
28718
|
stepCommand(
|
|
@@ -28261,11 +28724,11 @@ var workflowCommand = new Command149("workflow").description(
|
|
|
28261
28724
|
"retry",
|
|
28262
28725
|
"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
28726
|
)
|
|
28264
|
-
).addCommand(cancelCommand2).addCommand(stopAutoPayoutCommand).addCommand(updateTemplateCommand).addCommand(deleteCommand3).addCommand(settingsCommand2).addCommand(payoutCommand).addCommand(workflowTemplateCommand);
|
|
28727
|
+
).addCommand(cancelCommand2).addCommand(stopAutoPayoutCommand).addCommand(updateTemplateCommand).addCommand(updateStepsCommand).addCommand(deleteCommand3).addCommand(settingsCommand2).addCommand(payoutCommand).addCommand(workflowTemplateCommand);
|
|
28265
28728
|
|
|
28266
28729
|
// src/commands/drops.ts
|
|
28267
|
-
import { Command as
|
|
28268
|
-
var listCommand9 = new
|
|
28730
|
+
import { Command as Command151 } from "commander";
|
|
28731
|
+
var listCommand9 = new Command151("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
28732
|
async (opts) => {
|
|
28270
28733
|
try {
|
|
28271
28734
|
if (opts.worker && opts.entered) throw new Error("Pass --worker or --entered, not both");
|
|
@@ -28293,7 +28756,7 @@ var listCommand9 = new Command150("list").description("List public Task Drops, o
|
|
|
28293
28756
|
}
|
|
28294
28757
|
}
|
|
28295
28758
|
);
|
|
28296
|
-
var showCommand7 = new
|
|
28759
|
+
var showCommand7 = new Command151("show").description("Show a Task Drop and its discoverable tasks").argument("<taskDropId>", "Task Drop ID").action(async (taskDropId) => {
|
|
28297
28760
|
try {
|
|
28298
28761
|
const input = parseInput(TaskDropGetInputSchema, { taskDropId });
|
|
28299
28762
|
const result = await apiGet(`/api/task-drops/${encodeURIComponent(input.taskDropId)}`);
|
|
@@ -28305,7 +28768,7 @@ var showCommand7 = new Command150("show").description("Show a Task Drop and its
|
|
|
28305
28768
|
renderFailure(err);
|
|
28306
28769
|
}
|
|
28307
28770
|
});
|
|
28308
|
-
var subscribeCommand = new
|
|
28771
|
+
var subscribeCommand = new Command151("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
28772
|
async (taskDropId, opts) => {
|
|
28310
28773
|
try {
|
|
28311
28774
|
if (opts.official) {
|
|
@@ -28333,7 +28796,7 @@ var subscribeCommand = new Command150("subscribe").description("Subscribe an ema
|
|
|
28333
28796
|
}
|
|
28334
28797
|
}
|
|
28335
28798
|
);
|
|
28336
|
-
var statusCommand4 = new
|
|
28799
|
+
var statusCommand4 = new Command151("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
28800
|
try {
|
|
28338
28801
|
if (opts.official) {
|
|
28339
28802
|
if (taskDropId) throw new Error("Pass either a Task Drop ID or --official, not both");
|
|
@@ -28350,15 +28813,15 @@ var statusCommand4 = new Command150("status").description("Check whether an emai
|
|
|
28350
28813
|
renderFailure(err);
|
|
28351
28814
|
}
|
|
28352
28815
|
});
|
|
28353
|
-
var dropsCommand = new
|
|
28816
|
+
var dropsCommand = new Command151("drops").description("Browse Task Drops and manage email subscriptions to them").addCommand(listCommand9).addCommand(showCommand7).addCommand(subscribeCommand).addCommand(statusCommand4);
|
|
28354
28817
|
|
|
28355
28818
|
// src/commands/hooks.ts
|
|
28356
|
-
import { Command as
|
|
28819
|
+
import { Command as Command153 } from "commander";
|
|
28357
28820
|
import { BaseError, ContractFunctionRevertedError, ContractFunctionZeroDataError } from "viem";
|
|
28358
28821
|
|
|
28359
28822
|
// src/lib/listing-submissions.ts
|
|
28360
28823
|
import { readFile as readFile6 } from "fs/promises";
|
|
28361
|
-
import { Command as
|
|
28824
|
+
import { Command as Command152 } from "commander";
|
|
28362
28825
|
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
28826
|
function prepareListingFile(kind, text) {
|
|
28364
28827
|
if (Buffer.byteLength(text, "utf8") > LISTING_SUBMISSION_MAX_BYTES) {
|
|
@@ -28415,7 +28878,7 @@ function prepareListingFile(kind, text) {
|
|
|
28415
28878
|
}
|
|
28416
28879
|
function submitCommandFor(kind) {
|
|
28417
28880
|
const what = kind === "catalog" ? "catalog entry (kind x402-endpoint)" : "hook manifest";
|
|
28418
|
-
return new
|
|
28881
|
+
return new Command152("submit").description(
|
|
28419
28882
|
`Submit a ${what} for staff review. Pays the standard action fee, kept either way; needs an ERC-8004 identity on the selected network`
|
|
28420
28883
|
).requiredOption("--file <path>", `Path to the ${what} JSON file`).action(async (opts) => {
|
|
28421
28884
|
let text;
|
|
@@ -28447,7 +28910,7 @@ function submitCommandFor(kind) {
|
|
|
28447
28910
|
});
|
|
28448
28911
|
}
|
|
28449
28912
|
function submissionsCommandFor(kind) {
|
|
28450
|
-
return new
|
|
28913
|
+
return new Command152("submissions").description(
|
|
28451
28914
|
`List the ${kind === "catalog" ? "catalog entries" : "hook listings"} you submitted and their status`
|
|
28452
28915
|
).option("--status <status>", `Only this status: ${LISTING_SUBMISSION_STATUSES.join(", ")}`).option("--limit <n>", "Maximum submissions to return (1-100)", "50").action(async (opts) => {
|
|
28453
28916
|
if (opts.status && !LISTING_SUBMISSION_STATUSES.includes(opts.status)) {
|
|
@@ -28513,7 +28976,7 @@ async function probeHookVersion(entry, chainId) {
|
|
|
28513
28976
|
return reverted ? { ...entry, hookVersion: 1 } : entry;
|
|
28514
28977
|
}
|
|
28515
28978
|
}
|
|
28516
|
-
var listCommand10 = new
|
|
28979
|
+
var listCommand10 = new Command153("list").description(
|
|
28517
28980
|
"List hooks listed (verified) in the hook registry on the selected --network, then observed hooks that are not listed"
|
|
28518
28981
|
).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
28982
|
"--cursor <cursor>",
|
|
@@ -28552,7 +29015,7 @@ var listCommand10 = new Command152("list").description(
|
|
|
28552
29015
|
}
|
|
28553
29016
|
}
|
|
28554
29017
|
);
|
|
28555
|
-
var showCommand8 = new
|
|
29018
|
+
var showCommand8 = new Command153("show").description(
|
|
28556
29019
|
"Show one hook on the selected --network: its registry listing, or its onchain observation marked unlisted"
|
|
28557
29020
|
).argument("<address>", "Hook contract address").action(async (address3) => {
|
|
28558
29021
|
try {
|
|
@@ -28572,7 +29035,7 @@ var showCommand8 = new Command152("show").description(
|
|
|
28572
29035
|
renderFailure(err);
|
|
28573
29036
|
}
|
|
28574
29037
|
});
|
|
28575
|
-
var encodeConfigCommand = new
|
|
29038
|
+
var encodeConfigCommand = new Command153("encode-config").description(
|
|
28576
29039
|
"Encode a V2 hook's typed configuration from its registry config schema, for --hook-config"
|
|
28577
29040
|
).argument("<address>", "Hook contract address").requiredOption(
|
|
28578
29041
|
"--values <json>",
|
|
@@ -28601,7 +29064,7 @@ var encodeConfigCommand = new Command152("encode-config").description(
|
|
|
28601
29064
|
renderFailure(err);
|
|
28602
29065
|
}
|
|
28603
29066
|
});
|
|
28604
|
-
var attachmentConfigCommand = new
|
|
29067
|
+
var attachmentConfigCommand = new Command153("attachment-config").description(
|
|
28605
29068
|
"Show the protocol-default hook order and maximum hooks per task on the selected --network"
|
|
28606
29069
|
).action(async () => {
|
|
28607
29070
|
try {
|
|
@@ -28610,16 +29073,16 @@ var attachmentConfigCommand = new Command152("attachment-config").description(
|
|
|
28610
29073
|
renderFailure(err);
|
|
28611
29074
|
}
|
|
28612
29075
|
});
|
|
28613
|
-
var hooksCommand = new
|
|
29076
|
+
var hooksCommand = new Command153("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
29077
|
|
|
28615
29078
|
// src/commands/catalog/index.ts
|
|
28616
|
-
import { Command as
|
|
28617
|
-
var catalogCommand = new
|
|
29079
|
+
import { Command as Command154 } from "commander";
|
|
29080
|
+
var catalogCommand = new Command154("catalog").description("Submit paid endpoints to the Taskmarket catalog and track your submissions").addCommand(submitCommandFor("catalog")).addCommand(submissionsCommandFor("catalog"));
|
|
28618
29081
|
|
|
28619
29082
|
// src/commands/tap.ts
|
|
28620
29083
|
import { promises as fs12 } from "fs";
|
|
28621
|
-
import { Command as
|
|
28622
|
-
var tapCommand = new
|
|
29084
|
+
import { Command as Command155 } from "commander";
|
|
29085
|
+
var tapCommand = new Command155("tap").description(
|
|
28623
29086
|
"Manage the TAP signing key used on tasks that require TAP verification"
|
|
28624
29087
|
);
|
|
28625
29088
|
tapCommand.command("import").description(
|
|
@@ -28778,7 +29241,7 @@ tapCommand.command("remove").description("Remove the TAP key from the keystore")
|
|
|
28778
29241
|
});
|
|
28779
29242
|
|
|
28780
29243
|
// src/commands/hire.ts
|
|
28781
|
-
import { Command as
|
|
29244
|
+
import { Command as Command156 } from "commander";
|
|
28782
29245
|
var OWN_FLAGS = /* @__PURE__ */ new Set(["--mode", "--hire-worker", "--service-id"]);
|
|
28783
29246
|
async function lookupListedService(worker, serviceId) {
|
|
28784
29247
|
let listing;
|
|
@@ -28810,7 +29273,7 @@ function hireEvaluatorError(opts, requiresEvaluator) {
|
|
|
28810
29273
|
}
|
|
28811
29274
|
return null;
|
|
28812
29275
|
}
|
|
28813
|
-
var hireCommand = new
|
|
29276
|
+
var hireCommand = new Command156("hire").description(
|
|
28814
29277
|
"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
29278
|
).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
29279
|
"--requires-evaluator",
|
|
@@ -28873,7 +29336,7 @@ hireCommand.action(async (worker, opts) => {
|
|
|
28873
29336
|
// src/index.ts
|
|
28874
29337
|
var require2 = createRequire(import.meta.url);
|
|
28875
29338
|
var { version } = require2("../package.json");
|
|
28876
|
-
var program = new
|
|
29339
|
+
var program = new Command157();
|
|
28877
29340
|
setLastErrorCliVersion(version);
|
|
28878
29341
|
program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
|
|
28879
29342
|
program.option(
|