@lucid-agents/taskmarket 1.42.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-4I33LJ7A.js → api-HZEK636T.js} +2 -2
- package/dist/{channels-456WXKVT.js → channels-FWGJII6Y.js} +4 -4
- package/dist/{chunk-I7OL2FMA.js → chunk-B2PINQHQ.js} +8 -8
- package/dist/{chunk-5IOQEQH3.js → chunk-F532X4HL.js} +1 -1
- package/dist/{chunk-L67V45XI.js → chunk-FKQBRXQS.js} +1 -1
- package/dist/{chunk-QRMNHEUF.js → chunk-FN5FZ4RL.js} +3 -3
- package/dist/{chunk-ASZ3YR77.js → chunk-FNSX2KLZ.js} +2 -2
- package/dist/{chunk-HWDFJ5N7.js → chunk-IRKICJEV.js} +1 -1
- package/dist/{chunk-JOVLOWPY.js → chunk-MGDBSENK.js} +28 -6
- package/dist/{chunk-UTTATTGM.js → chunk-XEGCIN3K.js} +1 -1
- package/dist/{chunk-3FI5KV44.js → chunk-XZZKUMHQ.js} +1 -1
- package/dist/{chunk-UXZ5ZDBF.js → chunk-YS3YH7U3.js} +3 -3
- package/dist/{chunk-IN6WPBUK.js → chunk-Z7MFEW73.js} +3 -3
- package/dist/{chunk-4Q67KT6T.js → chunk-ZMPMQTQQ.js} +5 -5
- package/dist/{doctor-K4RKUTXL.js → doctor-NTQ3ZJRU.js} +8 -8
- package/dist/index.js +702 -660
- package/dist/{launch-RL4BS22J.js → launch-FOCL5JOR.js} +11 -11
- package/dist/{read-auth-YC7ZM7J3.js → read-auth-UAZUJEEQ.js} +3 -3
- package/dist/{reconcile-ZFFNXOD7.js → reconcile-IKPAKGH3.js} +4 -4
- package/dist/{status-IZ7ZTA5D.js → status-A636ECTT.js} +8 -8
- package/dist/{sync-pull-Q7W6IPWN.js → sync-pull-DVC4R6BN.js} +4 -4
- package/dist/{task-access-grants-4T4IPSVF.js → task-access-grants-5I7QQXZV.js} +2 -2
- package/package.json +1 -1
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,
|
|
@@ -368,7 +368,9 @@ import {
|
|
|
368
368
|
splitUserSkill,
|
|
369
369
|
sponsoredVaultRelayKind,
|
|
370
370
|
svmChain,
|
|
371
|
-
|
|
371
|
+
taskCheckedFiles,
|
|
372
|
+
taskCheckedPatch,
|
|
373
|
+
taskChecksFailures,
|
|
372
374
|
taskTemplates,
|
|
373
375
|
taskmarketChain,
|
|
374
376
|
unknownCapabilityMessage,
|
|
@@ -383,11 +385,11 @@ import {
|
|
|
383
385
|
verifierProviderId,
|
|
384
386
|
verifiersUnsupportedOnChain,
|
|
385
387
|
viemChainFor
|
|
386
|
-
} from "./chunk-
|
|
388
|
+
} from "./chunk-MGDBSENK.js";
|
|
387
389
|
import "./chunk-S7SJMJ2I.js";
|
|
388
390
|
|
|
389
391
|
// src/index.ts
|
|
390
|
-
import { Command as
|
|
392
|
+
import { Command as Command157 } from "commander";
|
|
391
393
|
import { createRequire } from "module";
|
|
392
394
|
|
|
393
395
|
// src/commands/init.ts
|
|
@@ -8451,7 +8453,7 @@ var searchCommand = new Command8("search").description(
|
|
|
8451
8453
|
});
|
|
8452
8454
|
|
|
8453
8455
|
// src/commands/task/index.ts
|
|
8454
|
-
import { Command as
|
|
8456
|
+
import { Command as Command55 } from "commander";
|
|
8455
8457
|
|
|
8456
8458
|
// src/commands/task/review.ts
|
|
8457
8459
|
import { readFile, stat } from "fs/promises";
|
|
@@ -11119,6 +11121,264 @@ async function confirmUnverifiedHooks(action, taskId, accepted, task) {
|
|
|
11119
11121
|
return false;
|
|
11120
11122
|
}
|
|
11121
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
|
+
|
|
11122
11382
|
// src/lib/task-network.ts
|
|
11123
11383
|
var WRONG_NETWORK_CODE = "wrong_network";
|
|
11124
11384
|
async function confirmTaskOnSelectedNetwork(taskId, task) {
|
|
@@ -11151,6 +11411,9 @@ async function confirmTaskOnSelectedNetwork(taskId, task) {
|
|
|
11151
11411
|
}
|
|
11152
11412
|
|
|
11153
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
|
+
}
|
|
11154
11417
|
function collectFile(value, previous) {
|
|
11155
11418
|
return [...previous, value];
|
|
11156
11419
|
}
|
|
@@ -11159,29 +11422,98 @@ var submitCmd = new Command14("submit").description("Submit work for a task").ar
|
|
|
11159
11422
|
).option(
|
|
11160
11423
|
"--accept-unverified-hooks",
|
|
11161
11424
|
"Proceed although the task has a hook the hook registry does not list (it can refuse every submission)"
|
|
11162
|
-
).
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
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
|
+
);
|
|
11167
11446
|
return;
|
|
11168
11447
|
}
|
|
11169
|
-
const
|
|
11170
|
-
if (
|
|
11171
|
-
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
|
|
11177
|
-
|
|
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 } }
|
|
11178
11490
|
);
|
|
11179
|
-
|
|
11180
|
-
}
|
|
11181
|
-
|
|
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);
|
|
11182
11514
|
}
|
|
11183
11515
|
}
|
|
11184
|
-
);
|
|
11516
|
+
});
|
|
11185
11517
|
|
|
11186
11518
|
// src/commands/task/accept.ts
|
|
11187
11519
|
import { Command as Command15 } from "commander";
|
|
@@ -12737,334 +13069,45 @@ var viewersCmd = new Command51("viewers").description("List a private task's wal
|
|
|
12737
13069
|
renderFailure(err, { fallback: "Failed to list viewers." });
|
|
12738
13070
|
}
|
|
12739
13071
|
});
|
|
12740
|
-
|
|
12741
|
-
// src/commands/task/terms.ts
|
|
12742
|
-
import { Command as Command52 } from "commander";
|
|
12743
|
-
var termsCmd = new Command52("terms").description(
|
|
12744
|
-
"Show a task's settlement terms: stake, review window, reject fee and outcome, revisions, release cost now and deadlines"
|
|
12745
|
-
).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
12746
|
-
const detail = await getTaskTerms(cliTaskReadContext(), { taskId });
|
|
12747
|
-
if (!detail) {
|
|
12748
|
-
printError(
|
|
12749
|
-
`Task not found: ${taskId} (or this is a private task you don't have access to -- if you have a password for it, run: taskmarket task unlock ${taskId} --password <password>)`
|
|
12750
|
-
);
|
|
12751
|
-
return;
|
|
12752
|
-
}
|
|
12753
|
-
printResult(detail);
|
|
12754
|
-
});
|
|
12755
|
-
|
|
12756
|
-
// src/commands/task/template.ts
|
|
12757
|
-
import { Command as Command53 } from "commander";
|
|
12758
|
-
var listCmd3 = new Command53("list").description("List the curated task templates (id, mode, what it is for, what the brief covers)").option(
|
|
12759
|
-
"--mode <mode>",
|
|
12760
|
-
"Only templates for one task mode: bounty, claim, pitch, benchmark, auction"
|
|
12761
|
-
).action((opts) => {
|
|
12762
|
-
if (opts.mode !== void 0 && !TaskMode.safeParse(opts.mode).success) {
|
|
12763
|
-
return void printError("--mode must be one of: bounty, claim, pitch, benchmark, auction");
|
|
12764
|
-
}
|
|
12765
|
-
printResult({ templates: listTemplates(opts.mode) });
|
|
12766
|
-
});
|
|
12767
|
-
var showCmd = new Command53("show").description("Show one template: its fields, mode terms and full brief").argument("<id>", "Template id (see `taskmarket task template list`)").action((id) => {
|
|
12768
|
-
const template = findTemplate(id);
|
|
12769
|
-
if (!template) return void printError(templateNotFound(id));
|
|
12770
|
-
printResult(templateDetail(template));
|
|
12771
|
-
});
|
|
12772
|
-
var templateCmd = new Command53("template").description(
|
|
12773
|
-
"Browse the curated task templates; create from one with `task create --template <id>`"
|
|
12774
|
-
).addCommand(listCmd3).addCommand(showCmd);
|
|
12775
|
-
|
|
12776
|
-
// src/commands/task/precheck.ts
|
|
12777
|
-
import { readFileSync as readFileSync2 } from "fs";
|
|
12778
|
-
import { Command as Command54 } from "commander";
|
|
12779
|
-
|
|
12780
|
-
// src/lib/task-precheck.ts
|
|
12781
|
-
import { spawnSync } from "child_process";
|
|
12782
|
-
import {
|
|
12783
|
-
cpSync,
|
|
12784
|
-
existsSync,
|
|
12785
|
-
mkdtempSync,
|
|
12786
|
-
readdirSync,
|
|
12787
|
-
readFileSync,
|
|
12788
|
-
rmSync,
|
|
12789
|
-
statSync
|
|
12790
|
-
} from "fs";
|
|
12791
|
-
import { tmpdir } from "os";
|
|
12792
|
-
import { basename, join, resolve } from "path";
|
|
12793
|
-
var OUTPUT_TAIL = 300;
|
|
12794
|
-
var MAX_BUFFER = 8 * 1024 * 1024;
|
|
12795
|
-
function tail(text) {
|
|
12796
|
-
const t = (text ?? "").trim();
|
|
12797
|
-
return t.length > OUTPUT_TAIL ? "..." + t.slice(-OUTPUT_TAIL) : t;
|
|
12798
|
-
}
|
|
12799
|
-
function patchApplies(dir, patch) {
|
|
12800
|
-
const run2 = spawnSync("git", ["apply", "--check", resolve(patch)], {
|
|
12801
|
-
cwd: dir,
|
|
12802
|
-
encoding: "utf8",
|
|
12803
|
-
maxBuffer: MAX_BUFFER
|
|
12804
|
-
});
|
|
12805
|
-
if (run2.error) return { applied: false, detail: `git could not run: ${run2.error.message}` };
|
|
12806
|
-
return run2.status === 0 ? { applied: true, detail: "the patch applies cleanly" } : { applied: false, detail: tail(run2.stderr) || `git apply --check exited ${run2.status}` };
|
|
12807
|
-
}
|
|
12808
|
-
function runCommandCheck(check, cwd, env = process.env) {
|
|
12809
|
-
const [cmd, ...args] = check.cmd;
|
|
12810
|
-
const run2 = spawnSync(cmd, args, {
|
|
12811
|
-
cwd,
|
|
12812
|
-
env,
|
|
12813
|
-
encoding: "utf8",
|
|
12814
|
-
timeout: check.timeoutS * 1e3,
|
|
12815
|
-
killSignal: "SIGKILL",
|
|
12816
|
-
maxBuffer: MAX_BUFFER
|
|
12817
|
-
});
|
|
12818
|
-
if (run2.error) {
|
|
12819
|
-
const code = run2.error.code;
|
|
12820
|
-
if (code === "ETIMEDOUT") {
|
|
12821
|
-
return { passed: false, detail: `timed out after ${check.timeoutS}s` };
|
|
12822
|
-
}
|
|
12823
|
-
return { passed: false, detail: `could not run: ${run2.error.message}` };
|
|
12824
|
-
}
|
|
12825
|
-
if (run2.status === 0) return { passed: true, detail: "exit 0" };
|
|
12826
|
-
const out = tail(run2.stderr) || tail(run2.stdout);
|
|
12827
|
-
return {
|
|
12828
|
-
passed: false,
|
|
12829
|
-
detail: `exit ${run2.status ?? run2.signal}${out ? `: ${out}` : ""}`
|
|
12830
|
-
};
|
|
12831
|
-
}
|
|
12832
|
-
function commandChecks(spec) {
|
|
12833
|
-
return spec.checks.filter(
|
|
12834
|
-
(c) => c.kind === "command"
|
|
12835
|
-
);
|
|
12836
|
-
}
|
|
12837
|
-
function runCliChecks(spec, engineResults, target, options) {
|
|
12838
|
-
const byId = /* @__PURE__ */ new Map();
|
|
12839
|
-
let work = null;
|
|
12840
|
-
let patchOk = null;
|
|
12841
|
-
try {
|
|
12842
|
-
const needsWork = options.yes && commandChecks(spec).length > 0;
|
|
12843
|
-
if (needsWork) {
|
|
12844
|
-
work = mkdtempSync(join(tmpdir(), "taskmarket-precheck-"));
|
|
12845
|
-
if (target.dir) {
|
|
12846
|
-
cpSync(resolve(target.dir), work, { recursive: true });
|
|
12847
|
-
if (target.patch) {
|
|
12848
|
-
const run2 = spawnSync("git", ["apply", resolve(target.patch)], {
|
|
12849
|
-
cwd: work,
|
|
12850
|
-
encoding: "utf8"
|
|
12851
|
-
});
|
|
12852
|
-
patchOk = run2.status === 0 ? { applied: true, detail: "applied" } : { applied: false, detail: tail(run2.stderr) || "git apply failed" };
|
|
12853
|
-
}
|
|
12854
|
-
} else if (target.file) {
|
|
12855
|
-
cpSync(resolve(target.file), join(work, basename(target.file)));
|
|
12856
|
-
}
|
|
12857
|
-
}
|
|
12858
|
-
for (const check of spec.checks) {
|
|
12859
|
-
if (check.kind === "patch_applies") {
|
|
12860
|
-
let result;
|
|
12861
|
-
if (!target.dir || !target.patch) {
|
|
12862
|
-
result = {
|
|
12863
|
-
id: check.id,
|
|
12864
|
-
kind: check.kind,
|
|
12865
|
-
passed: false,
|
|
12866
|
-
skipped: true,
|
|
12867
|
-
detail: "pass --dir <checkout> and --patch <file> to test the patch"
|
|
12868
|
-
};
|
|
12869
|
-
} else {
|
|
12870
|
-
const r = patchApplies(target.dir, target.patch);
|
|
12871
|
-
result = { id: check.id, kind: check.kind, passed: r.applied, detail: r.detail };
|
|
12872
|
-
}
|
|
12873
|
-
byId.set(check.id, result);
|
|
12874
|
-
} else if (check.kind === "command") {
|
|
12875
|
-
if (!options.yes) {
|
|
12876
|
-
byId.set(check.id, {
|
|
12877
|
-
id: check.id,
|
|
12878
|
-
kind: check.kind,
|
|
12879
|
-
passed: false,
|
|
12880
|
-
skipped: true,
|
|
12881
|
-
detail: "pass --yes to run commands"
|
|
12882
|
-
});
|
|
12883
|
-
} else if (patchOk && !patchOk.applied) {
|
|
12884
|
-
byId.set(check.id, {
|
|
12885
|
-
id: check.id,
|
|
12886
|
-
kind: check.kind,
|
|
12887
|
-
passed: false,
|
|
12888
|
-
detail: `the patch did not apply, so the command did not run: ${patchOk.detail}`
|
|
12889
|
-
});
|
|
12890
|
-
} else {
|
|
12891
|
-
const env = {
|
|
12892
|
-
...process.env,
|
|
12893
|
-
...target.file ? { TASKMARKET_DELIVERABLE: join(work, basename(target.file)) } : {}
|
|
12894
|
-
};
|
|
12895
|
-
const r = runCommandCheck(check, work, env);
|
|
12896
|
-
byId.set(check.id, { id: check.id, kind: check.kind, ...r });
|
|
12897
|
-
}
|
|
12898
|
-
}
|
|
12899
|
-
}
|
|
12900
|
-
} finally {
|
|
12901
|
-
if (work && existsSync(work)) rmSync(work, { recursive: true, force: true });
|
|
12902
|
-
}
|
|
12903
|
-
return engineResults.map((r) => byId.get(r.id) ?? r);
|
|
12904
|
-
}
|
|
12905
|
-
function isDirectory(path9) {
|
|
12906
|
-
try {
|
|
12907
|
-
return statSync(path9).isDirectory();
|
|
12908
|
-
} catch {
|
|
12909
|
-
return false;
|
|
12910
|
-
}
|
|
12911
|
-
}
|
|
12912
|
-
var LITERAL_FILE_LIMIT = 2e3;
|
|
12913
|
-
var LITERAL_BYTES_LIMIT = 1024 * 1024;
|
|
12914
|
-
var SKIPPED_DIRS = /* @__PURE__ */ new Set([
|
|
12915
|
-
".git",
|
|
12916
|
-
"node_modules",
|
|
12917
|
-
"target",
|
|
12918
|
-
"dist",
|
|
12919
|
-
"build",
|
|
12920
|
-
".venv",
|
|
12921
|
-
"__pycache__"
|
|
12922
|
-
]);
|
|
12923
|
-
function collectTestLiterals(dir, paths) {
|
|
12924
|
-
const globs = paths ?? DEFAULT_TEST_GLOBS;
|
|
12925
|
-
const root = resolve(dir);
|
|
12926
|
-
const found = /* @__PURE__ */ new Set();
|
|
12927
|
-
let visited = 0;
|
|
12928
|
-
const walk2 = (rel) => {
|
|
12929
|
-
let names;
|
|
12930
|
-
try {
|
|
12931
|
-
names = readdirSync(join(root, rel)).sort();
|
|
12932
|
-
} catch {
|
|
12933
|
-
return;
|
|
12934
|
-
}
|
|
12935
|
-
for (const name of names) {
|
|
12936
|
-
if (visited >= LITERAL_FILE_LIMIT) return;
|
|
12937
|
-
const next = rel === "" ? name : `${rel}/${name}`;
|
|
12938
|
-
let info;
|
|
12939
|
-
try {
|
|
12940
|
-
info = statSync(join(root, next));
|
|
12941
|
-
} catch {
|
|
12942
|
-
continue;
|
|
12943
|
-
}
|
|
12944
|
-
if (info.isDirectory()) {
|
|
12945
|
-
if (!SKIPPED_DIRS.has(name)) walk2(next);
|
|
12946
|
-
} else if (info.isFile() && info.size <= LITERAL_BYTES_LIMIT && matchesAnyGlob(next, globs)) {
|
|
12947
|
-
visited++;
|
|
12948
|
-
try {
|
|
12949
|
-
for (const lit of extractLiterals(readFileSync(join(root, next), "utf8"))) found.add(lit);
|
|
12950
|
-
} catch {
|
|
12951
|
-
}
|
|
12952
|
-
}
|
|
12953
|
-
}
|
|
12954
|
-
};
|
|
12955
|
-
walk2("");
|
|
12956
|
-
return [...found].sort();
|
|
12957
|
-
}
|
|
12958
|
-
|
|
12959
|
-
// src/commands/task/precheck.ts
|
|
12960
|
-
async function specOf(taskId) {
|
|
12961
|
-
const task = await getTask(cliTaskReadContext(), { taskId });
|
|
12962
|
-
if (!task) {
|
|
12963
|
-
return `Task not found: ${taskId} (or this is a private task you don't have access to)`;
|
|
12964
|
-
}
|
|
12965
|
-
if (task.checks) return task.checks;
|
|
12966
|
-
const found = extractTaskChecks(task.description ?? "");
|
|
12967
|
-
if (found && !found.ok) {
|
|
12968
|
-
return `The task's taskmarket-checks block is invalid: ${formatTaskChecksErrors(found.errors)}`;
|
|
13072
|
+
|
|
13073
|
+
// src/commands/task/terms.ts
|
|
13074
|
+
import { Command as Command52 } from "commander";
|
|
13075
|
+
var termsCmd = new Command52("terms").description(
|
|
13076
|
+
"Show a task's settlement terms: stake, review window, reject fee and outcome, revisions, release cost now and deadlines"
|
|
13077
|
+
).argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
13078
|
+
const detail = await getTaskTerms(cliTaskReadContext(), { taskId });
|
|
13079
|
+
if (!detail) {
|
|
13080
|
+
printError(
|
|
13081
|
+
`Task not found: ${taskId} (or this is a private task you don't have access to -- if you have a password for it, run: taskmarket task unlock ${taskId} --password <password>)`
|
|
13082
|
+
);
|
|
13083
|
+
return;
|
|
12969
13084
|
}
|
|
12970
|
-
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
12975
|
-
|
|
12976
|
-
|
|
12977
|
-
|
|
12978
|
-
|
|
12979
|
-
|
|
12980
|
-
|
|
12981
|
-
let engine;
|
|
12982
|
-
if (deliverable.type === "file") {
|
|
12983
|
-
if (!opts.file)
|
|
12984
|
-
return printError("This task takes a file deliverable: pass --file <path>");
|
|
12985
|
-
if (opts.dir || opts.patch) {
|
|
12986
|
-
return printError(
|
|
12987
|
-
"--dir and --patch are for patch deliverables; this task takes a file"
|
|
12988
|
-
);
|
|
12989
|
-
}
|
|
12990
|
-
let bytes;
|
|
12991
|
-
try {
|
|
12992
|
-
bytes = readFileSync2(opts.file);
|
|
12993
|
-
} catch (error) {
|
|
12994
|
-
return renderFailure(
|
|
12995
|
-
new Error(`Cannot read ${opts.file}: ${error.message}`)
|
|
12996
|
-
);
|
|
12997
|
-
}
|
|
12998
|
-
engine = runDataChecks(spec, { bytes });
|
|
12999
|
-
} else {
|
|
13000
|
-
if (!opts.dir) {
|
|
13001
|
-
return printError(
|
|
13002
|
-
"This task takes a patch deliverable: pass --dir <checkout> and --patch <file>"
|
|
13003
|
-
);
|
|
13004
|
-
}
|
|
13005
|
-
if (opts.file)
|
|
13006
|
-
return printError("--file is for file deliverables; this task takes a patch");
|
|
13007
|
-
if (!isDirectory(opts.dir)) return printError(`Not a directory: ${opts.dir}`);
|
|
13008
|
-
let patchText = null;
|
|
13009
|
-
if (opts.patch) {
|
|
13010
|
-
try {
|
|
13011
|
-
patchText = readFileSync2(opts.patch, "utf8");
|
|
13012
|
-
} catch (error) {
|
|
13013
|
-
return renderFailure(
|
|
13014
|
-
new Error(`Cannot read ${opts.patch}: ${error.message}`)
|
|
13015
|
-
);
|
|
13016
|
-
}
|
|
13017
|
-
}
|
|
13018
|
-
if (patchText === null) {
|
|
13019
|
-
engine = runDataChecks(spec, { text: "" });
|
|
13020
|
-
} else {
|
|
13021
|
-
const specials = spec.checks.flatMap(
|
|
13022
|
-
(c) => c.kind === "no_test_special_casing" ? [c] : []
|
|
13023
|
-
);
|
|
13024
|
-
const literals = /* @__PURE__ */ new Set();
|
|
13025
|
-
for (const c of specials) {
|
|
13026
|
-
for (const lit of collectTestLiterals(opts.dir, c.paths)) literals.add(lit);
|
|
13027
|
-
}
|
|
13028
|
-
engine = runPatchChecks(spec, {
|
|
13029
|
-
patch: patchText,
|
|
13030
|
-
testLiterals: specials.length > 0 ? [...literals].sort() : void 0
|
|
13031
|
-
});
|
|
13032
|
-
}
|
|
13033
|
-
}
|
|
13034
|
-
const commands = commandChecks(spec);
|
|
13035
|
-
if (opts.yes && commands.length > 0) {
|
|
13036
|
-
process.stderr.write(
|
|
13037
|
-
"Running the requester's commands on this machine:\n" + commands.map((c) => ` ${c.id}: ${c.cmd.join(" ")}
|
|
13038
|
-
`).join("") + (spec.environment?.network === "none" ? "The task expects no network; this run does not enforce that.\n" : "")
|
|
13039
|
-
);
|
|
13040
|
-
}
|
|
13041
|
-
const results = runCliChecks(
|
|
13042
|
-
spec,
|
|
13043
|
-
engine,
|
|
13044
|
-
{ file: opts.file, dir: opts.dir, patch: opts.patch },
|
|
13045
|
-
{ yes: opts.yes === true }
|
|
13046
|
-
);
|
|
13047
|
-
const hidden = hiddenChecksResult(spec);
|
|
13048
|
-
const all = hidden ? [...results, hidden] : results;
|
|
13049
|
-
printResult({
|
|
13050
|
-
taskId,
|
|
13051
|
-
passed: taskChecksPassed(all),
|
|
13052
|
-
skipped: results.filter((r) => r.skipped).length,
|
|
13053
|
-
warnings: results.filter((r) => r.warning).length,
|
|
13054
|
-
results: all,
|
|
13055
|
-
...spec.environment?.image || spec.environment?.setup?.length ? {
|
|
13056
|
-
note: "Precheck runs on this machine. The declared image and setup are not applied; the verifier runs the checks in that environment."
|
|
13057
|
-
} : {}
|
|
13058
|
-
});
|
|
13059
|
-
} catch (error) {
|
|
13060
|
-
renderFailure(error, { fallback: "Precheck failed." });
|
|
13061
|
-
}
|
|
13085
|
+
printResult(detail);
|
|
13086
|
+
});
|
|
13087
|
+
|
|
13088
|
+
// src/commands/task/template.ts
|
|
13089
|
+
import { Command as Command53 } from "commander";
|
|
13090
|
+
var listCmd3 = new Command53("list").description("List the curated task templates (id, mode, what it is for, what the brief covers)").option(
|
|
13091
|
+
"--mode <mode>",
|
|
13092
|
+
"Only templates for one task mode: bounty, claim, pitch, benchmark, auction"
|
|
13093
|
+
).action((opts) => {
|
|
13094
|
+
if (opts.mode !== void 0 && !TaskMode.safeParse(opts.mode).success) {
|
|
13095
|
+
return void printError("--mode must be one of: bounty, claim, pitch, benchmark, auction");
|
|
13062
13096
|
}
|
|
13063
|
-
);
|
|
13097
|
+
printResult({ templates: listTemplates(opts.mode) });
|
|
13098
|
+
});
|
|
13099
|
+
var showCmd = new Command53("show").description("Show one template: its fields, mode terms and full brief").argument("<id>", "Template id (see `taskmarket task template list`)").action((id) => {
|
|
13100
|
+
const template = findTemplate(id);
|
|
13101
|
+
if (!template) return void printError(templateNotFound(id));
|
|
13102
|
+
printResult(templateDetail(template));
|
|
13103
|
+
});
|
|
13104
|
+
var templateCmd = new Command53("template").description(
|
|
13105
|
+
"Browse the curated task templates; create from one with `task create --template <id>`"
|
|
13106
|
+
).addCommand(listCmd3).addCommand(showCmd);
|
|
13064
13107
|
|
|
13065
13108
|
// src/commands/task/checks.ts
|
|
13066
|
-
import { readFileSync as
|
|
13067
|
-
import { Command as
|
|
13109
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
13110
|
+
import { Command as Command54 } from "commander";
|
|
13068
13111
|
|
|
13069
13112
|
// src/lib/task-hidden-checks.ts
|
|
13070
13113
|
import { createHash } from "crypto";
|
|
@@ -13097,12 +13140,12 @@ function isCommitment(value) {
|
|
|
13097
13140
|
// src/commands/task/checks.ts
|
|
13098
13141
|
function readBytes(path9) {
|
|
13099
13142
|
try {
|
|
13100
|
-
return
|
|
13143
|
+
return readFileSync2(path9);
|
|
13101
13144
|
} catch (error) {
|
|
13102
13145
|
return `Cannot read ${path9}: ${error.message}`;
|
|
13103
13146
|
}
|
|
13104
13147
|
}
|
|
13105
|
-
var commitCmd = new
|
|
13148
|
+
var commitCmd = new Command54("commit").description(
|
|
13106
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`"
|
|
13107
13150
|
).requiredOption("--file <path>", "The hidden checks file (a taskmarket.checks/1 spec)").action((opts) => {
|
|
13108
13151
|
const bytes = readBytes(opts.file);
|
|
@@ -13111,7 +13154,7 @@ var commitCmd = new Command55("commit").description(
|
|
|
13111
13154
|
if (!file.valid) return void printError(file.error);
|
|
13112
13155
|
printResult({ commitment: hiddenChecksCommitment(bytes), count: file.count });
|
|
13113
13156
|
});
|
|
13114
|
-
var verifyCmd = new
|
|
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) => {
|
|
13115
13158
|
if (!isCommitment(opts.commitment)) {
|
|
13116
13159
|
return void printError("--commitment must look like sha256:<64 lowercase hex characters>");
|
|
13117
13160
|
}
|
|
@@ -13126,7 +13169,7 @@ var verifyCmd = new Command55("verify").description("Check a decrypted hidden ch
|
|
|
13126
13169
|
count: file.valid ? file.count : null
|
|
13127
13170
|
});
|
|
13128
13171
|
});
|
|
13129
|
-
var checksCmd = new
|
|
13172
|
+
var checksCmd = new Command54("checks").description(
|
|
13130
13173
|
"Hidden checks: commit to a private checks file and verify it against the commitment"
|
|
13131
13174
|
).addCommand(commitCmd).addCommand(verifyCmd);
|
|
13132
13175
|
|
|
@@ -13155,12 +13198,11 @@ var settleCmd = settlementActionCommand({
|
|
|
13155
13198
|
});
|
|
13156
13199
|
|
|
13157
13200
|
// src/commands/task/index.ts
|
|
13158
|
-
var taskCommand2 = new
|
|
13201
|
+
var taskCommand2 = new Command55("task").description("Manage tasks");
|
|
13159
13202
|
taskCommand2.addCommand(createCmd);
|
|
13160
13203
|
taskCommand2.addCommand(templateCmd);
|
|
13161
13204
|
taskCommand2.addCommand(listCmd);
|
|
13162
13205
|
taskCommand2.addCommand(getCmd);
|
|
13163
|
-
taskCommand2.addCommand(precheckCmd);
|
|
13164
13206
|
taskCommand2.addCommand(checksCmd);
|
|
13165
13207
|
taskCommand2.addCommand(payoutGateCmd);
|
|
13166
13208
|
taskCommand2.addCommand(linkGateCmd);
|
|
@@ -13209,10 +13251,10 @@ taskCommand2.addCommand(reviewCmd, { hidden: true });
|
|
|
13209
13251
|
taskCommand2.addCommand(startReviewCmd);
|
|
13210
13252
|
|
|
13211
13253
|
// src/commands/agent/index.ts
|
|
13212
|
-
import { Command as
|
|
13254
|
+
import { Command as Command59, Option as Option4 } from "commander";
|
|
13213
13255
|
|
|
13214
13256
|
// src/commands/agent/credits.ts
|
|
13215
|
-
import { Command as
|
|
13257
|
+
import { Command as Command56 } from "commander";
|
|
13216
13258
|
|
|
13217
13259
|
// src/lib/tty-confirm.ts
|
|
13218
13260
|
import { createInterface as createInterface3 } from "readline";
|
|
@@ -13265,7 +13307,7 @@ function setupLines(plan, pricing) {
|
|
|
13265
13307
|
...rateLines(pricing)
|
|
13266
13308
|
];
|
|
13267
13309
|
}
|
|
13268
|
-
var setupCommand = new
|
|
13310
|
+
var setupCommand = new Command56("setup").description(
|
|
13269
13311
|
"Approve the compute allocation that pays for sandboxes: daily and monthly caps, and optional auto-top-up"
|
|
13270
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(
|
|
13271
13313
|
"--auto-top-up-below <credits>",
|
|
@@ -13302,7 +13344,7 @@ var setupCommand = new Command57("setup").description(
|
|
|
13302
13344
|
printResult({ config, caps: plan.caps, autoTopUp: plan.autoTopUp ?? null });
|
|
13303
13345
|
}
|
|
13304
13346
|
);
|
|
13305
|
-
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) => {
|
|
13306
13348
|
const config = await loadComputeCreditConfig();
|
|
13307
13349
|
if (!config) {
|
|
13308
13350
|
throw new ComputeCreditError(
|
|
@@ -13332,17 +13374,17 @@ var buyCommand = new Command57("buy").description("Buy compute credit over x402
|
|
|
13332
13374
|
rate: { rateCardVersion: pricing.rateCardVersion, usdPerCredit: pricing.usdPerCredit }
|
|
13333
13375
|
});
|
|
13334
13376
|
});
|
|
13335
|
-
var statusCommand2 = new
|
|
13377
|
+
var statusCommand2 = new Command56("status").description(
|
|
13336
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"
|
|
13337
13379
|
).action(async () => {
|
|
13338
13380
|
printResult(await computeCreditStatus());
|
|
13339
13381
|
});
|
|
13340
|
-
var checkCommand = new
|
|
13382
|
+
var checkCommand = new Command56("check").description(
|
|
13341
13383
|
"Check the compute credit balance and, when auto-top-up was approved and the balance is low, buy one chunk"
|
|
13342
13384
|
).action(async () => {
|
|
13343
13385
|
printResult(await checkComputeBalance());
|
|
13344
13386
|
});
|
|
13345
|
-
var reconcileCommand = new
|
|
13387
|
+
var reconcileCommand = new Command56("reconcile").description(
|
|
13346
13388
|
"Settle purchases whose outcome was lost, by their idempotency key; never pays again"
|
|
13347
13389
|
).option(
|
|
13348
13390
|
"--release <key>",
|
|
@@ -13389,10 +13431,10 @@ var reconcileCommand = new Command57("reconcile").description(
|
|
|
13389
13431
|
...recoveryError === void 0 ? {} : { recoveryError }
|
|
13390
13432
|
});
|
|
13391
13433
|
});
|
|
13392
|
-
var disableAutoTopUpCommand = new
|
|
13434
|
+
var disableAutoTopUpCommand = new Command56("disable-auto-top-up").description("Turn off auto-top-up and close its allocation").action(async () => {
|
|
13393
13435
|
printResult({ config: await disableComputeAutoTopUp() });
|
|
13394
13436
|
});
|
|
13395
|
-
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);
|
|
13396
13438
|
|
|
13397
13439
|
// src/commands/agent/launch.ts
|
|
13398
13440
|
var EXPERIMENTAL_AGENT_ENV = "TASKMARKET_EXPERIMENTAL_AGENT";
|
|
@@ -13414,7 +13456,7 @@ async function runAgentCommand(options) {
|
|
|
13414
13456
|
try {
|
|
13415
13457
|
const { assertAgentCompatibility } = await import("./compatibility-636WJOEX.js");
|
|
13416
13458
|
const pi = assertAgentCompatibility();
|
|
13417
|
-
const { runAgent } = await import("./launch-
|
|
13459
|
+
const { runAgent } = await import("./launch-FOCL5JOR.js");
|
|
13418
13460
|
result = await runAgent({
|
|
13419
13461
|
model: options.model,
|
|
13420
13462
|
pi,
|
|
@@ -13448,7 +13490,7 @@ async function runAgentCommand(options) {
|
|
|
13448
13490
|
import { createHash as createHash2, randomBytes as randomBytes4 } from "crypto";
|
|
13449
13491
|
import { readFile as readFile2 } from "fs/promises";
|
|
13450
13492
|
import { extname } from "path";
|
|
13451
|
-
import { Command as
|
|
13493
|
+
import { Command as Command57, Option as Option3 } from "commander";
|
|
13452
13494
|
var WRITE_TTL_SECONDS2 = 5 * 60;
|
|
13453
13495
|
var HOUR = 3600;
|
|
13454
13496
|
var LISTING_UNTRUSTED_FIELDS = [
|
|
@@ -13581,7 +13623,7 @@ async function ownListing() {
|
|
|
13581
13623
|
const keystore = await loadKeystore();
|
|
13582
13624
|
return fetchListing(keystore.walletAddress);
|
|
13583
13625
|
}
|
|
13584
|
-
var profileCommand = new
|
|
13626
|
+
var profileCommand = new Command57("profile").description(
|
|
13585
13627
|
"Your listing's profile: name, description, roles, specialties and capabilities"
|
|
13586
13628
|
);
|
|
13587
13629
|
profileCommand.command("set").description(
|
|
@@ -13733,7 +13775,7 @@ function addServiceOptions(command) {
|
|
|
13733
13775
|
"fixed or quote: a hire of this service must name an evaluator before it is accepted"
|
|
13734
13776
|
).option("--no-requires-evaluator", "fixed or quote: hires need no evaluator (the default)");
|
|
13735
13777
|
}
|
|
13736
|
-
var serviceCommand = new
|
|
13778
|
+
var serviceCommand = new Command57("service").description(
|
|
13737
13779
|
"Your listing services: the priced offers requesters hire you for"
|
|
13738
13780
|
);
|
|
13739
13781
|
addServiceOptions(
|
|
@@ -13775,7 +13817,7 @@ serviceCommand.command("remove").description("Remove a service from your listing
|
|
|
13775
13817
|
renderFailure(err);
|
|
13776
13818
|
}
|
|
13777
13819
|
});
|
|
13778
|
-
var availabilityCommand = new
|
|
13820
|
+
var availabilityCommand = new Command57("availability").description(
|
|
13779
13821
|
"Open your listing for hires or pause it (services stay visible but cannot be hired), and set your capacity"
|
|
13780
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) => {
|
|
13781
13823
|
try {
|
|
@@ -13795,7 +13837,7 @@ var availabilityCommand = new Command58("availability").description(
|
|
|
13795
13837
|
renderFailure(err);
|
|
13796
13838
|
}
|
|
13797
13839
|
});
|
|
13798
|
-
var listingCommand = new
|
|
13840
|
+
var listingCommand = new Command57("listing").description(
|
|
13799
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"
|
|
13800
13842
|
).argument("[address]", "Wallet address; your own when left out").action(async (address3) => {
|
|
13801
13843
|
try {
|
|
@@ -13822,7 +13864,7 @@ function agentListingCommands() {
|
|
|
13822
13864
|
}
|
|
13823
13865
|
|
|
13824
13866
|
// src/commands/agent/manage.ts
|
|
13825
|
-
import { Command as
|
|
13867
|
+
import { Command as Command58 } from "commander";
|
|
13826
13868
|
async function run(work) {
|
|
13827
13869
|
try {
|
|
13828
13870
|
const value = await work();
|
|
@@ -13845,27 +13887,27 @@ async function requireExperimental() {
|
|
|
13845
13887
|
);
|
|
13846
13888
|
}
|
|
13847
13889
|
function agentManagementCommands() {
|
|
13848
|
-
const status = new
|
|
13890
|
+
const status = new Command58("status").description(
|
|
13849
13891
|
"Show the agent channels (locked, charged, refundable), purchases with an unknown outcome, the sandbox and compute credit. Reads only."
|
|
13850
13892
|
).action(async () => {
|
|
13851
|
-
const { collectAgentStatus } = await import("./status-
|
|
13893
|
+
const { collectAgentStatus } = await import("./status-A636ECTT.js");
|
|
13852
13894
|
await run(() => collectAgentStatus());
|
|
13853
13895
|
});
|
|
13854
|
-
const doctor = new
|
|
13896
|
+
const doctor = new Command58("doctor").description(
|
|
13855
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."
|
|
13856
13898
|
).action(async () => {
|
|
13857
|
-
const { runDoctor } = await import("./doctor-
|
|
13899
|
+
const { runDoctor } = await import("./doctor-NTQ3ZJRU.js");
|
|
13858
13900
|
const report = await run(() => runDoctor());
|
|
13859
13901
|
if (report && !report.ok) process.exitCode = 1;
|
|
13860
13902
|
});
|
|
13861
|
-
const reconcile = new
|
|
13903
|
+
const reconcile = new Command58("reconcile").description(
|
|
13862
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."
|
|
13863
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(
|
|
13864
13906
|
"--channel <channel-id>",
|
|
13865
13907
|
"Reconcile the open purchases of this channel, as status lists it; also reaches retired channels"
|
|
13866
13908
|
).action(
|
|
13867
13909
|
async (invocationId, options) => {
|
|
13868
|
-
const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-
|
|
13910
|
+
const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-IKPAKGH3.js");
|
|
13869
13911
|
const choice = { rail: options.rail, channel: options.channel };
|
|
13870
13912
|
if (invocationId !== void 0) {
|
|
13871
13913
|
await run(() => reconcileInvocation(invocationId, { choice }));
|
|
@@ -13883,7 +13925,7 @@ function agentManagementCommands() {
|
|
|
13883
13925
|
});
|
|
13884
13926
|
}
|
|
13885
13927
|
);
|
|
13886
|
-
const topup = new
|
|
13928
|
+
const topup = new Command58("topup").description(
|
|
13887
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"
|
|
13888
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) => {
|
|
13889
13931
|
await run(async () => {
|
|
@@ -13897,7 +13939,7 @@ function agentManagementCommands() {
|
|
|
13897
13939
|
`Not a USDC amount: ${options.amount} (digits, at most 6 decimals)`
|
|
13898
13940
|
);
|
|
13899
13941
|
}
|
|
13900
|
-
const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-
|
|
13942
|
+
const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-FWGJII6Y.js");
|
|
13901
13943
|
const { rails } = await openAgentChannels();
|
|
13902
13944
|
const result = await requestTopUp(selectRail(rails, options.rail), amount);
|
|
13903
13945
|
return {
|
|
@@ -13908,7 +13950,7 @@ function agentManagementCommands() {
|
|
|
13908
13950
|
};
|
|
13909
13951
|
});
|
|
13910
13952
|
});
|
|
13911
|
-
const close = new
|
|
13953
|
+
const close = new Command58("close").description(
|
|
13912
13954
|
"Close the agent's channel and refund its unused balance cooperatively; checks an earlier close instead of sending it again"
|
|
13913
13955
|
).option("--rail <id>", "The rail to close (required when the policy has more than one)").option(
|
|
13914
13956
|
"--channel <channel-id>",
|
|
@@ -13917,8 +13959,8 @@ function agentManagementCommands() {
|
|
|
13917
13959
|
await run(async () => {
|
|
13918
13960
|
await requireExperimental();
|
|
13919
13961
|
const { AGENT_VIEW_VERSION } = await import("./budget-view-J6L7X6EY.js");
|
|
13920
|
-
const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-
|
|
13921
|
-
const { reconcileLeasedPurchase } = await import("./reconcile-
|
|
13962
|
+
const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-FWGJII6Y.js");
|
|
13963
|
+
const { reconcileLeasedPurchase } = await import("./reconcile-IKPAKGH3.js");
|
|
13922
13964
|
const opened = await openAgentChannels();
|
|
13923
13965
|
const { rail, retired } = selectChannel(opened, options);
|
|
13924
13966
|
const result = await closeChannel(
|
|
@@ -13949,7 +13991,7 @@ function agentManagementCommands() {
|
|
|
13949
13991
|
};
|
|
13950
13992
|
});
|
|
13951
13993
|
});
|
|
13952
|
-
const pull = new
|
|
13994
|
+
const pull = new Command58("pull").description(
|
|
13953
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."
|
|
13954
13996
|
).option("--diff", "Print the full diff").option("--apply", "Apply the clean changes without asking").option(
|
|
13955
13997
|
"--overwrite <path>",
|
|
@@ -13972,7 +14014,7 @@ function agentManagementCommands() {
|
|
|
13972
14014
|
async (options) => {
|
|
13973
14015
|
await run(async () => {
|
|
13974
14016
|
await requireExperimental();
|
|
13975
|
-
const { runPull } = await import("./sync-pull-
|
|
14017
|
+
const { runPull } = await import("./sync-pull-DVC4R6BN.js");
|
|
13976
14018
|
const { terminalPrompter } = await import("./prompter-LSICEYSQ.js");
|
|
13977
14019
|
return runPull(options, {
|
|
13978
14020
|
interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
@@ -13990,7 +14032,7 @@ function agentManagementCommands() {
|
|
|
13990
14032
|
|
|
13991
14033
|
// src/commands/agent/index.ts
|
|
13992
14034
|
var experimental = agentCommandEnabled();
|
|
13993
|
-
var agentCommand = new
|
|
14035
|
+
var agentCommand = new Command59("agent").description(
|
|
13994
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"
|
|
13995
14037
|
).addOption(
|
|
13996
14038
|
new Option4("--model <id>", "Start on one model from your approved spending policy").hideHelp(
|
|
@@ -14027,7 +14069,7 @@ for (const command of agentManagementCommands()) {
|
|
|
14027
14069
|
}
|
|
14028
14070
|
|
|
14029
14071
|
// src/commands/agents.ts
|
|
14030
|
-
import { Command as
|
|
14072
|
+
import { Command as Command60 } from "commander";
|
|
14031
14073
|
var MIN_RATINGS = ["3", "4", "4.5"];
|
|
14032
14074
|
var MIN_TASKS = ["5", "10", "50"];
|
|
14033
14075
|
var AVAILABILITIES = ["available", "unavailable", "any"];
|
|
@@ -14037,7 +14079,7 @@ function allowListed(flag, value, allowed) {
|
|
|
14037
14079
|
throw new Error(`${flag} must be one of: ${allowed.join(", ")}`);
|
|
14038
14080
|
}
|
|
14039
14081
|
}
|
|
14040
|
-
var agentsCommand = new
|
|
14082
|
+
var agentsCommand = new Command60("agents").description("Browse the worker directory (agents and humans) on the selected --network").enablePositionalOptions().option(
|
|
14041
14083
|
"--sort <order>",
|
|
14042
14084
|
"Sort order: reputation (top rated), tasks, hires (most hired: completed reserved, quote and request hires) or volume (settled earnings)",
|
|
14043
14085
|
"reputation"
|
|
@@ -14283,7 +14325,7 @@ agentsCommand.command("report").description("Report a worker's listing, or one o
|
|
|
14283
14325
|
});
|
|
14284
14326
|
|
|
14285
14327
|
// src/commands/dashboard.ts
|
|
14286
|
-
import { Command as
|
|
14328
|
+
import { Command as Command61 } from "commander";
|
|
14287
14329
|
|
|
14288
14330
|
// src/lib/dashboard.ts
|
|
14289
14331
|
var DASHBOARD_LIST_LIMIT = 5;
|
|
@@ -14480,7 +14522,7 @@ async function settle(read4) {
|
|
|
14480
14522
|
return { value: null, error: error instanceof Error ? error.message : String(error) };
|
|
14481
14523
|
}
|
|
14482
14524
|
}
|
|
14483
|
-
var dashboardCommand = new
|
|
14525
|
+
var dashboardCommand = new Command61("dashboard").description(
|
|
14484
14526
|
"Show your home base: what needs you, your money, tasks you posted and work you do, projects and workflows, and recent activity"
|
|
14485
14527
|
).action(async () => {
|
|
14486
14528
|
const auth = await signReadAuth();
|
|
@@ -14589,8 +14631,8 @@ var dashboardCommand = new Command62("dashboard").description(
|
|
|
14589
14631
|
});
|
|
14590
14632
|
|
|
14591
14633
|
// src/commands/inbox.ts
|
|
14592
|
-
import { Command as
|
|
14593
|
-
var inboxCommand = new
|
|
14634
|
+
import { Command as Command62 } from "commander";
|
|
14635
|
+
var inboxCommand = new Command62("inbox").description(
|
|
14594
14636
|
"Show what you need to do now, then tasks you created, tasks you are working on, and private tasks you were invited to"
|
|
14595
14637
|
).option(
|
|
14596
14638
|
"--limit <n>",
|
|
@@ -14733,7 +14775,7 @@ var inboxCommand = new Command63("inbox").description(
|
|
|
14733
14775
|
);
|
|
14734
14776
|
|
|
14735
14777
|
// src/commands/deposit.ts
|
|
14736
|
-
import { Command as
|
|
14778
|
+
import { Command as Command63 } from "commander";
|
|
14737
14779
|
|
|
14738
14780
|
// src/lib/relay-bridge.ts
|
|
14739
14781
|
import { z as z4 } from "zod";
|
|
@@ -14816,7 +14858,7 @@ async function fundingOptionsFor(chainId) {
|
|
|
14816
14858
|
note: "Run `taskmarket deposit --relay-route <routeId> --amount <n>` for a Relay deposit address. Fiat funding: see issue #2720."
|
|
14817
14859
|
};
|
|
14818
14860
|
}
|
|
14819
|
-
var depositCommand = new
|
|
14861
|
+
var depositCommand = new Command63("deposit").description(
|
|
14820
14862
|
"Show wallet address, network info and cross-chain funding options for the selected --network"
|
|
14821
14863
|
).option(
|
|
14822
14864
|
"--relay-route <routeId>",
|
|
@@ -14906,10 +14948,10 @@ var depositCommand = new Command64("deposit").description(
|
|
|
14906
14948
|
});
|
|
14907
14949
|
|
|
14908
14950
|
// src/commands/wallet/index.ts
|
|
14909
|
-
import { Command as
|
|
14951
|
+
import { Command as Command74 } from "commander";
|
|
14910
14952
|
|
|
14911
14953
|
// src/commands/wallet/balance.ts
|
|
14912
|
-
import { Command as
|
|
14954
|
+
import { Command as Command64 } from "commander";
|
|
14913
14955
|
function balancePath(address3, chainId) {
|
|
14914
14956
|
return `/api/wallet/balance?address=${address3}&chainId=${chainId}`;
|
|
14915
14957
|
}
|
|
@@ -14943,7 +14985,7 @@ async function allChainBalances(address3) {
|
|
|
14943
14985
|
);
|
|
14944
14986
|
return { address: address3, chains };
|
|
14945
14987
|
}
|
|
14946
|
-
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(
|
|
14947
14989
|
"--all-chains",
|
|
14948
14990
|
"Show the balance on every chain the selected deployment serves, one entry per chain"
|
|
14949
14991
|
).option(
|
|
@@ -14983,7 +15025,7 @@ var walletBalanceCommand = new Command65("balance").description("Show the wallet
|
|
|
14983
15025
|
);
|
|
14984
15026
|
|
|
14985
15027
|
// src/commands/wallet/import.ts
|
|
14986
|
-
import { Command as
|
|
15028
|
+
import { Command as Command65 } from "commander";
|
|
14987
15029
|
import { createInterface as createInterface4 } from "readline";
|
|
14988
15030
|
import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
|
|
14989
15031
|
function normalizePrivateKey(raw) {
|
|
@@ -15057,7 +15099,7 @@ async function importSolanaWallet(flagKey) {
|
|
|
15057
15099
|
{ warnings: argvKeyWarnings(keySource) }
|
|
15058
15100
|
);
|
|
15059
15101
|
}
|
|
15060
|
-
var walletImportCommand = new
|
|
15102
|
+
var walletImportCommand = new Command65("import").description("Import an existing private key as the agent wallet").option(
|
|
15061
15103
|
"--key <privateKey>",
|
|
15062
15104
|
"Private key to import (64 hex chars, with or without 0x prefix; with --solana, a base58 or JSON-array Solana secret key)"
|
|
15063
15105
|
).option(
|
|
@@ -15148,7 +15190,7 @@ var walletImportCommand = new Command66("import").description("Import an existin
|
|
|
15148
15190
|
|
|
15149
15191
|
// src/commands/wallet/set-withdrawal-address.ts
|
|
15150
15192
|
import { randomBytes as randomBytes5 } from "crypto";
|
|
15151
|
-
import { Command as
|
|
15193
|
+
import { Command as Command66 } from "commander";
|
|
15152
15194
|
|
|
15153
15195
|
// src/lib/withdrawal-pin.ts
|
|
15154
15196
|
var WithdrawalAddressMismatchError = class extends Error {
|
|
@@ -15225,7 +15267,7 @@ var SIGNATURE_TTL_SECONDS = 5 * 60;
|
|
|
15225
15267
|
function isValidAddress(addr) {
|
|
15226
15268
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
15227
15269
|
}
|
|
15228
|
-
var setWithdrawalAddressCommand = new
|
|
15270
|
+
var setWithdrawalAddressCommand = new Command66("set-withdrawal-address").description(
|
|
15229
15271
|
"Set the withdrawal address for payment-token withdrawals on the selected network (once per chain, free)"
|
|
15230
15272
|
).argument("<address>", "Ethereum address to receive withdrawals").action(async (address3) => {
|
|
15231
15273
|
if (!isValidAddress(address3)) {
|
|
@@ -15286,8 +15328,8 @@ var setWithdrawalAddressCommand = new Command67("set-withdrawal-address").descri
|
|
|
15286
15328
|
});
|
|
15287
15329
|
|
|
15288
15330
|
// src/commands/wallet/get-withdrawal-address.ts
|
|
15289
|
-
import { Command as
|
|
15290
|
-
var getWithdrawalAddressCommand = new
|
|
15331
|
+
import { Command as Command67 } from "commander";
|
|
15332
|
+
var getWithdrawalAddressCommand = new Command67("get-withdrawal-address").description(
|
|
15291
15333
|
"Show the withdrawal address registered on the selected network, if any (the address is per chain)"
|
|
15292
15334
|
).option("--address <addr>", "Wallet address to check (defaults to own wallet)").action(async (opts) => {
|
|
15293
15335
|
let address3 = opts.address;
|
|
@@ -15303,14 +15345,14 @@ var getWithdrawalAddressCommand = new Command68("get-withdrawal-address").descri
|
|
|
15303
15345
|
});
|
|
15304
15346
|
|
|
15305
15347
|
// src/commands/wallet/change-withdrawal-address.ts
|
|
15306
|
-
import { Command as
|
|
15348
|
+
import { Command as Command68 } from "commander";
|
|
15307
15349
|
function isValidAddress2(addr) {
|
|
15308
15350
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
15309
15351
|
}
|
|
15310
15352
|
function isValidRecoveryCode(code) {
|
|
15311
15353
|
return /^\d{8}$/.test(code);
|
|
15312
15354
|
}
|
|
15313
|
-
var changeWithdrawalAddressCommand = new
|
|
15355
|
+
var changeWithdrawalAddressCommand = new Command68("change-withdrawal-address").description(
|
|
15314
15356
|
"Change the selected network's withdrawal address using that chain's account recovery code (RFC-0012)"
|
|
15315
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) => {
|
|
15316
15358
|
if (!isValidRecoveryCode(recoveryCode)) {
|
|
@@ -15362,8 +15404,8 @@ var changeWithdrawalAddressCommand = new Command69("change-withdrawal-address").
|
|
|
15362
15404
|
});
|
|
15363
15405
|
|
|
15364
15406
|
// src/commands/wallet/sync-withdrawal-address.ts
|
|
15365
|
-
import { Command as
|
|
15366
|
-
var syncWithdrawalAddressCommand = new
|
|
15407
|
+
import { Command as Command69 } from "commander";
|
|
15408
|
+
var syncWithdrawalAddressCommand = new Command69("sync-withdrawal-address").description(
|
|
15367
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)"
|
|
15368
15410
|
).action(async () => {
|
|
15369
15411
|
let keystore;
|
|
@@ -15396,8 +15438,8 @@ var syncWithdrawalAddressCommand = new Command70("sync-withdrawal-address").desc
|
|
|
15396
15438
|
});
|
|
15397
15439
|
|
|
15398
15440
|
// src/commands/wallet/reveal-recovery-code.ts
|
|
15399
|
-
import { Command as
|
|
15400
|
-
var revealRecoveryCodeCommand = new
|
|
15441
|
+
import { Command as Command70 } from "commander";
|
|
15442
|
+
var revealRecoveryCodeCommand = new Command70("reveal-recovery-code").description(
|
|
15401
15443
|
"One-time reveal of the selected network's account recovery code, if one has not been generated yet"
|
|
15402
15444
|
).action(async () => {
|
|
15403
15445
|
let keystore;
|
|
@@ -15436,8 +15478,8 @@ var revealRecoveryCodeCommand = new Command71("reveal-recovery-code").descriptio
|
|
|
15436
15478
|
});
|
|
15437
15479
|
|
|
15438
15480
|
// src/commands/wallet/publish-key.ts
|
|
15439
|
-
import { Command as
|
|
15440
|
-
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 () => {
|
|
15441
15483
|
let keystore;
|
|
15442
15484
|
try {
|
|
15443
15485
|
keystore = await loadKeystore();
|
|
@@ -15457,7 +15499,7 @@ var publishKeyCommand = new Command72("publish-key").description("Publish your s
|
|
|
15457
15499
|
});
|
|
15458
15500
|
|
|
15459
15501
|
// src/commands/wallet/withdraw-dreams.ts
|
|
15460
|
-
import { Command as
|
|
15502
|
+
import { Command as Command72 } from "commander";
|
|
15461
15503
|
import { toHex } from "viem";
|
|
15462
15504
|
var AUTHORIZATION_VALIDITY_SECONDS = 300;
|
|
15463
15505
|
function isValidAddress3(addr) {
|
|
@@ -15479,7 +15521,7 @@ function withdrawalTargets(balance, hook) {
|
|
|
15479
15521
|
targets: hooks.filter((entry) => BigInt(entry.claimableBaseUnits) > 0n).map((entry) => ({ hookAddress: entry.hookAddress, send: true }))
|
|
15480
15522
|
};
|
|
15481
15523
|
}
|
|
15482
|
-
var withdrawDreamsCommand = new
|
|
15524
|
+
var withdrawDreamsCommand = new Command72("withdraw-dreams").description(
|
|
15483
15525
|
"Withdraw accumulated DREAMS rewards to the withdrawal address: one signed withdrawal from each reward hook holding a balance, or from --hook alone"
|
|
15484
15526
|
).option("--destination <addr>", "Destination address (defaults to registered withdrawal address)").option("--hook <address>", "Withdraw from this reward hook only").action(async (opts) => {
|
|
15485
15527
|
let keystore;
|
|
@@ -15600,7 +15642,7 @@ var withdrawDreamsCommand = new Command73("withdraw-dreams").description(
|
|
|
15600
15642
|
});
|
|
15601
15643
|
|
|
15602
15644
|
// src/commands/wallet/bridge.ts
|
|
15603
|
-
import { Command as
|
|
15645
|
+
import { Command as Command73 } from "commander";
|
|
15604
15646
|
import { toHex as toHex2 } from "viem";
|
|
15605
15647
|
var USDC_TYPES = {
|
|
15606
15648
|
TransferWithAuthorization: [
|
|
@@ -15644,7 +15686,7 @@ async function pollBridgeStatus(requestId) {
|
|
|
15644
15686
|
await sleep(bridgeTiming.intervalMs);
|
|
15645
15687
|
}
|
|
15646
15688
|
}
|
|
15647
|
-
var walletBridgeCommand = new
|
|
15689
|
+
var walletBridgeCommand = new Command73("bridge").description(
|
|
15648
15690
|
"Move free USDC on Base to OUSD at the same address on Tempo (gasless, through Relay)"
|
|
15649
15691
|
).requiredOption("--to <chain>", 'Destination chain (only "tempo")').option(
|
|
15650
15692
|
"--recipient <address>",
|
|
@@ -15783,7 +15825,7 @@ var walletBridgeCommand = new Command74("bridge").description(
|
|
|
15783
15825
|
});
|
|
15784
15826
|
|
|
15785
15827
|
// src/commands/wallet/index.ts
|
|
15786
|
-
var walletCommand = new
|
|
15828
|
+
var walletCommand = new Command74("wallet").description("Wallet management commands");
|
|
15787
15829
|
walletCommand.addCommand(walletBalanceCommand);
|
|
15788
15830
|
walletCommand.addCommand(walletImportCommand);
|
|
15789
15831
|
walletCommand.addCommand(setWithdrawalAddressCommand);
|
|
@@ -15796,7 +15838,7 @@ walletCommand.addCommand(withdrawDreamsCommand);
|
|
|
15796
15838
|
walletCommand.addCommand(walletBridgeCommand);
|
|
15797
15839
|
|
|
15798
15840
|
// src/commands/withdraw.ts
|
|
15799
|
-
import { Command as
|
|
15841
|
+
import { Command as Command75 } from "commander";
|
|
15800
15842
|
import { toHex as toHex3 } from "viem";
|
|
15801
15843
|
|
|
15802
15844
|
// src/lib/solana-relay.ts
|
|
@@ -15975,7 +16017,7 @@ var USDC_TYPES2 = {
|
|
|
15975
16017
|
{ name: "nonce", type: "bytes32" }
|
|
15976
16018
|
]
|
|
15977
16019
|
};
|
|
15978
|
-
var withdrawCommand = new
|
|
16020
|
+
var withdrawCommand = new Command75("withdraw").description(
|
|
15979
16021
|
"Withdraw the payment token (USDC on Base, OUSD on Tempo) to the registered withdrawal address"
|
|
15980
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) => {
|
|
15981
16023
|
if (opts.solana) {
|
|
@@ -16064,9 +16106,9 @@ var withdrawCommand = new Command76("withdraw").description(
|
|
|
16064
16106
|
});
|
|
16065
16107
|
|
|
16066
16108
|
// src/commands/encrypt.ts
|
|
16067
|
-
import { Command as
|
|
16109
|
+
import { Command as Command76 } from "commander";
|
|
16068
16110
|
import { promises as fs2 } from "fs";
|
|
16069
|
-
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) => {
|
|
16070
16112
|
let plaintext;
|
|
16071
16113
|
try {
|
|
16072
16114
|
plaintext = await fs2.readFile(file);
|
|
@@ -16114,9 +16156,9 @@ var encryptCommand = new Command77("encrypt").description("Encrypt a file with E
|
|
|
16114
16156
|
});
|
|
16115
16157
|
|
|
16116
16158
|
// src/commands/decrypt.ts
|
|
16117
|
-
import { Command as
|
|
16159
|
+
import { Command as Command77 } from "commander";
|
|
16118
16160
|
import { promises as fs3 } from "fs";
|
|
16119
|
-
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) => {
|
|
16120
16162
|
let ciphertext;
|
|
16121
16163
|
try {
|
|
16122
16164
|
ciphertext = await fs3.readFile(file);
|
|
@@ -16156,7 +16198,7 @@ var decryptCommand = new Command78("decrypt").description("Decrypt a file using
|
|
|
16156
16198
|
});
|
|
16157
16199
|
|
|
16158
16200
|
// src/commands/xmtp.ts
|
|
16159
|
-
import { Command as
|
|
16201
|
+
import { Command as Command78 } from "commander";
|
|
16160
16202
|
|
|
16161
16203
|
// src/lib/xmtp-client.ts
|
|
16162
16204
|
import fs6 from "fs";
|
|
@@ -17570,7 +17612,7 @@ function senderInboxIdFor(keystore, client) {
|
|
|
17570
17612
|
}
|
|
17571
17613
|
return client.inboxId;
|
|
17572
17614
|
}
|
|
17573
|
-
var xmtpCommand = new
|
|
17615
|
+
var xmtpCommand = new Command78("xmtp").description("Manage XMTP messaging for this agent");
|
|
17574
17616
|
xmtpCommand.hook("preAction", () => {
|
|
17575
17617
|
if (resolveXmtpEnv() !== "memory") assertXmtpSupported();
|
|
17576
17618
|
});
|
|
@@ -17835,7 +17877,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
|
|
|
17835
17877
|
});
|
|
17836
17878
|
|
|
17837
17879
|
// src/commands/daemon.ts
|
|
17838
|
-
import { Command as
|
|
17880
|
+
import { Command as Command80 } from "commander";
|
|
17839
17881
|
|
|
17840
17882
|
// src/lib/market-event-settings-auth.ts
|
|
17841
17883
|
function signMarketEventSettingsWrite(change) {
|
|
@@ -17843,7 +17885,7 @@ function signMarketEventSettingsWrite(change) {
|
|
|
17843
17885
|
}
|
|
17844
17886
|
|
|
17845
17887
|
// src/commands/events.ts
|
|
17846
|
-
import { Command as
|
|
17888
|
+
import { Command as Command79 } from "commander";
|
|
17847
17889
|
|
|
17848
17890
|
// src/lib/market-event-cursor.ts
|
|
17849
17891
|
import { promises as fs7 } from "fs";
|
|
@@ -18239,14 +18281,14 @@ async function readOrMarkSeen(options) {
|
|
|
18239
18281
|
printResult(data, { idempotencyKey });
|
|
18240
18282
|
}
|
|
18241
18283
|
function createSeenCommand() {
|
|
18242
|
-
return new
|
|
18284
|
+
return new Command79("seen").description(
|
|
18243
18285
|
"Show the newest event you have seen and how many are unread (the web Inbox's Activity count); --mark moves it forward"
|
|
18244
18286
|
).option("--mark <id>", "Mark events up to this event id as seen, or `latest` for all of them").action(async (options) => {
|
|
18245
18287
|
await readOrMarkSeen(options);
|
|
18246
18288
|
});
|
|
18247
18289
|
}
|
|
18248
18290
|
function createEventsCommand() {
|
|
18249
|
-
return new
|
|
18291
|
+
return new Command79("events").description(
|
|
18250
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"
|
|
18251
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(
|
|
18252
18294
|
"--task <taskId>",
|
|
@@ -18625,7 +18667,7 @@ function sleepOrAbort(ms2, signal) {
|
|
|
18625
18667
|
});
|
|
18626
18668
|
}
|
|
18627
18669
|
function createDaemonCommand(seams = {}) {
|
|
18628
|
-
return new
|
|
18670
|
+
return new Command80("daemon").description(
|
|
18629
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"
|
|
18630
18672
|
).option("--heartbeat-interval <ms>", "Heartbeat interval in milliseconds", "1800000").option(
|
|
18631
18673
|
"--task-filters <json>",
|
|
@@ -18804,10 +18846,10 @@ function createDaemonCommand(seams = {}) {
|
|
|
18804
18846
|
var daemonCommand = createDaemonCommand();
|
|
18805
18847
|
|
|
18806
18848
|
// src/commands/events-filter.ts
|
|
18807
|
-
import { Command as
|
|
18849
|
+
import { Command as Command82 } from "commander";
|
|
18808
18850
|
|
|
18809
18851
|
// src/commands/events-settings.ts
|
|
18810
|
-
import { Command as
|
|
18852
|
+
import { Command as Command81 } from "commander";
|
|
18811
18853
|
var PREFERENCES_PATH = "/api/market-events/preferences";
|
|
18812
18854
|
var CHANNEL_OPTION = [
|
|
18813
18855
|
"--channel <channel>",
|
|
@@ -18825,7 +18867,7 @@ async function walletHeaders() {
|
|
|
18825
18867
|
function parseChannel(channel) {
|
|
18826
18868
|
return parseInput(MarketEventWalletChannelSchema, channel ?? "email");
|
|
18827
18869
|
}
|
|
18828
|
-
var listCommand = new
|
|
18870
|
+
var listCommand = new Command81("list").description(
|
|
18829
18871
|
"Show which event types reach this wallet on one channel (email by default); locked types cannot be turned off"
|
|
18830
18872
|
).option(...CHANNEL_OPTION).action(async (options) => {
|
|
18831
18873
|
try {
|
|
@@ -18839,7 +18881,7 @@ var listCommand = new Command82("list").description(
|
|
|
18839
18881
|
}
|
|
18840
18882
|
});
|
|
18841
18883
|
function setCommand(name, enabled, description) {
|
|
18842
|
-
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) => {
|
|
18843
18885
|
try {
|
|
18844
18886
|
const channel = parseChannel(options.channel);
|
|
18845
18887
|
const body = parseInput(SetMarketEventPreferenceInputSchema, { type, enabled });
|
|
@@ -18859,7 +18901,7 @@ function setCommand(name, enabled, description) {
|
|
|
18859
18901
|
}
|
|
18860
18902
|
});
|
|
18861
18903
|
}
|
|
18862
|
-
var eventsSettingsCommand = new
|
|
18904
|
+
var eventsSettingsCommand = new Command81("settings").description(
|
|
18863
18905
|
"Choose which market events reach this wallet by email or as in-app notices in the web app"
|
|
18864
18906
|
).addCommand(listCommand).addCommand(setCommand("on", true, "Turn an event type on for this wallet on one channel")).addCommand(
|
|
18865
18907
|
setCommand(
|
|
@@ -18913,7 +18955,7 @@ function mergeFilter(current, options) {
|
|
|
18913
18955
|
}
|
|
18914
18956
|
return { filter: parsed.data };
|
|
18915
18957
|
}
|
|
18916
|
-
var eventsFilterCommand = new
|
|
18958
|
+
var eventsFilterCommand = new Command82("filter").description(
|
|
18917
18959
|
"Read or set this wallet's discovery filter: which newly listed tasks are announced to it as task.listed events"
|
|
18918
18960
|
).option("--enable", "Turn discovery on").option("--disable", "Turn discovery off: no task.listed events at all").option(
|
|
18919
18961
|
"--modes <list>",
|
|
@@ -18975,11 +19017,11 @@ function attachEventsFilter(program2) {
|
|
|
18975
19017
|
}
|
|
18976
19018
|
|
|
18977
19019
|
// src/commands/email/index.ts
|
|
18978
|
-
import { Command as
|
|
19020
|
+
import { Command as Command91 } from "commander";
|
|
18979
19021
|
|
|
18980
19022
|
// src/commands/email/register.ts
|
|
18981
|
-
import { Command as
|
|
18982
|
-
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) => {
|
|
18983
19025
|
const check = await apiGet(
|
|
18984
19026
|
`/api/emails/check-username?username=${encodeURIComponent(opts.username)}`
|
|
18985
19027
|
);
|
|
@@ -19000,8 +19042,8 @@ var registerCommand = new Command84("register").description("Register an email a
|
|
|
19000
19042
|
});
|
|
19001
19043
|
|
|
19002
19044
|
// src/commands/email/inbox.ts
|
|
19003
|
-
import { Command as
|
|
19004
|
-
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) => {
|
|
19005
19047
|
const keystore = await loadKeystore();
|
|
19006
19048
|
const params = new URLSearchParams({
|
|
19007
19049
|
deviceId: keystore.deviceId,
|
|
@@ -19017,8 +19059,8 @@ var inboxCommand2 = new Command85("inbox").description("List emails in your inbo
|
|
|
19017
19059
|
});
|
|
19018
19060
|
|
|
19019
19061
|
// src/commands/email/read.ts
|
|
19020
|
-
import { Command as
|
|
19021
|
-
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) => {
|
|
19022
19064
|
const keystore = await loadKeystore();
|
|
19023
19065
|
const params = new URLSearchParams({
|
|
19024
19066
|
deviceId: keystore.deviceId,
|
|
@@ -19031,8 +19073,8 @@ var readCommand = new Command86("read").description("Read an email by ID (marks
|
|
|
19031
19073
|
});
|
|
19032
19074
|
|
|
19033
19075
|
// src/commands/email/send.ts
|
|
19034
|
-
import { Command as
|
|
19035
|
-
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) => {
|
|
19036
19078
|
const keystore = await loadKeystore();
|
|
19037
19079
|
const { data: result, idempotencyKey } = await apiPost("/api/emails/send", {
|
|
19038
19080
|
deviceId: keystore.deviceId,
|
|
@@ -19045,8 +19087,8 @@ var sendCommand = new Command87("send").description("Send an email").requiredOpt
|
|
|
19045
19087
|
});
|
|
19046
19088
|
|
|
19047
19089
|
// src/commands/email/reply.ts
|
|
19048
|
-
import { Command as
|
|
19049
|
-
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) => {
|
|
19050
19092
|
const keystore = await loadKeystore();
|
|
19051
19093
|
const params = new URLSearchParams({
|
|
19052
19094
|
deviceId: keystore.deviceId,
|
|
@@ -19072,8 +19114,8 @@ var replyCommand = new Command88("reply").description("Reply to an email").argum
|
|
|
19072
19114
|
});
|
|
19073
19115
|
|
|
19074
19116
|
// src/commands/email/delete.ts
|
|
19075
|
-
import { Command as
|
|
19076
|
-
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) => {
|
|
19077
19119
|
const keystore = await loadKeystore();
|
|
19078
19120
|
const { data: result, idempotencyKey } = await apiPost(
|
|
19079
19121
|
"/api/emails/delete",
|
|
@@ -19087,15 +19129,15 @@ var deleteCommand = new Command89("delete").description("Delete an email by ID")
|
|
|
19087
19129
|
});
|
|
19088
19130
|
|
|
19089
19131
|
// src/commands/email/address.ts
|
|
19090
|
-
import { Command as
|
|
19091
|
-
var addressCommand3 = new
|
|
19132
|
+
import { Command as Command89 } from "commander";
|
|
19133
|
+
var addressCommand3 = new Command89("address").description("Show your registered email address").action(async () => {
|
|
19092
19134
|
const keystore = await loadKeystore();
|
|
19093
19135
|
const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
|
|
19094
19136
|
printResult({ emailAddress: result.emailAddress ?? null });
|
|
19095
19137
|
});
|
|
19096
19138
|
|
|
19097
19139
|
// src/commands/email/mark-read.ts
|
|
19098
|
-
import { Command as
|
|
19140
|
+
import { Command as Command90 } from "commander";
|
|
19099
19141
|
async function setReadStatus(id, read4) {
|
|
19100
19142
|
const keystore = await loadKeystore();
|
|
19101
19143
|
const { data: result, idempotencyKey } = await apiPost(
|
|
@@ -19109,12 +19151,12 @@ async function setReadStatus(id, read4) {
|
|
|
19109
19151
|
);
|
|
19110
19152
|
printResult({ id: result.id, isRead: result.isRead }, { idempotencyKey });
|
|
19111
19153
|
}
|
|
19112
|
-
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) => {
|
|
19113
19155
|
await setReadStatus(id, !opts.unread);
|
|
19114
19156
|
});
|
|
19115
19157
|
|
|
19116
19158
|
// src/commands/email/index.ts
|
|
19117
|
-
var emailCommand = new
|
|
19159
|
+
var emailCommand = new Command91("email").description("Email management commands");
|
|
19118
19160
|
emailCommand.addCommand(registerCommand);
|
|
19119
19161
|
emailCommand.addCommand(inboxCommand2);
|
|
19120
19162
|
emailCommand.addCommand(readCommand);
|
|
@@ -19125,10 +19167,10 @@ emailCommand.addCommand(addressCommand3);
|
|
|
19125
19167
|
emailCommand.addCommand(markReadCommand);
|
|
19126
19168
|
|
|
19127
19169
|
// src/commands/bug/index.ts
|
|
19128
|
-
import { Command as
|
|
19170
|
+
import { Command as Command100 } from "commander";
|
|
19129
19171
|
|
|
19130
19172
|
// src/commands/bug/browse.ts
|
|
19131
|
-
import { Command as
|
|
19173
|
+
import { Command as Command92 } from "commander";
|
|
19132
19174
|
|
|
19133
19175
|
// src/commands/bug/known-problem.ts
|
|
19134
19176
|
async function fetchKnownProblem() {
|
|
@@ -19141,7 +19183,7 @@ async function fetchKnownProblem() {
|
|
|
19141
19183
|
}
|
|
19142
19184
|
|
|
19143
19185
|
// src/commands/bug/browse.ts
|
|
19144
|
-
var browseCommand = new
|
|
19186
|
+
var browseCommand = new Command92("browse").description(
|
|
19145
19187
|
"Browse public bug reports, to check whether a bug is already known; no wallet needed"
|
|
19146
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(
|
|
19147
19189
|
async (opts) => {
|
|
@@ -19188,7 +19230,7 @@ var browseCommand = new Command93("browse").description(
|
|
|
19188
19230
|
);
|
|
19189
19231
|
|
|
19190
19232
|
// src/commands/bug/comment.ts
|
|
19191
|
-
import { Command as
|
|
19233
|
+
import { Command as Command93 } from "commander";
|
|
19192
19234
|
|
|
19193
19235
|
// src/lib/stdin.ts
|
|
19194
19236
|
var STDIN_FIRST_BYTE_MS = 5e3;
|
|
@@ -19242,7 +19284,7 @@ async function resolveBugReportId(ref) {
|
|
|
19242
19284
|
}
|
|
19243
19285
|
|
|
19244
19286
|
// src/commands/bug/comment.ts
|
|
19245
|
-
var commentCommand = new
|
|
19287
|
+
var commentCommand = new Command93("comment").description(
|
|
19246
19288
|
"Comment on a public bug report. Comments are public: never include keys, seed phrases or other private data"
|
|
19247
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) => {
|
|
19248
19290
|
const ref = parseBugReportRef(report);
|
|
@@ -19288,8 +19330,8 @@ var commentCommand = new Command94("comment").description(
|
|
|
19288
19330
|
});
|
|
19289
19331
|
|
|
19290
19332
|
// src/commands/bug/list.ts
|
|
19291
|
-
import { Command as
|
|
19292
|
-
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) => {
|
|
19293
19335
|
if (opts.status && !BUG_REPORT_STATUSES.includes(opts.status)) {
|
|
19294
19336
|
printError(`--status must be one of ${BUG_REPORT_STATUSES.join(", ")}`);
|
|
19295
19337
|
return;
|
|
@@ -19320,8 +19362,8 @@ var listCommand2 = new Command95("list").description("List the bug reports you s
|
|
|
19320
19362
|
});
|
|
19321
19363
|
|
|
19322
19364
|
// src/commands/bug/me-too.ts
|
|
19323
|
-
import { Command as
|
|
19324
|
-
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) => {
|
|
19325
19367
|
const ref = parseBugReportRef(report);
|
|
19326
19368
|
if (!ref) {
|
|
19327
19369
|
printError(BUG_REPORT_REF_ERROR);
|
|
@@ -19345,8 +19387,8 @@ var meTooCommand = new Command96("me-too").description("Say you hit a public bug
|
|
|
19345
19387
|
});
|
|
19346
19388
|
|
|
19347
19389
|
// src/commands/bug/reply.ts
|
|
19348
|
-
import { Command as
|
|
19349
|
-
var replyCommand2 = new
|
|
19390
|
+
import { Command as Command96 } from "commander";
|
|
19391
|
+
var replyCommand2 = new Command96("reply").description(
|
|
19350
19392
|
"Reply to Taskmarket staff on one of your bug reports; a reply does not change its status"
|
|
19351
19393
|
).argument("<id>", "Bug report id").argument("[message]", 'Your reply; read from stdin when omitted or "-"').action(async (id, message) => {
|
|
19352
19394
|
const body = await textOrStdin(message);
|
|
@@ -19380,8 +19422,8 @@ var replyCommand2 = new Command97("reply").description(
|
|
|
19380
19422
|
});
|
|
19381
19423
|
|
|
19382
19424
|
// src/commands/bug/show.ts
|
|
19383
|
-
import { Command as
|
|
19384
|
-
var showCommand = new
|
|
19425
|
+
import { Command as Command97 } from "commander";
|
|
19426
|
+
var showCommand = new Command97("show").description(
|
|
19385
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"
|
|
19386
19428
|
).argument("<report>", "Public number (#N) of any public report, or the id of one of yours").action(async (report) => {
|
|
19387
19429
|
const ref = parseBugReportRef(report);
|
|
@@ -19409,7 +19451,7 @@ var showCommand = new Command98("show").description(
|
|
|
19409
19451
|
});
|
|
19410
19452
|
|
|
19411
19453
|
// src/commands/bug/submit.ts
|
|
19412
|
-
import { Command as
|
|
19454
|
+
import { Command as Command98 } from "commander";
|
|
19413
19455
|
|
|
19414
19456
|
// src/commands/bug/context.ts
|
|
19415
19457
|
import os from "os";
|
|
@@ -19433,7 +19475,7 @@ function cliVersionOf(command) {
|
|
|
19433
19475
|
var LAST_COMMAND_MAX_CHARS = 2048;
|
|
19434
19476
|
var LAST_ERROR_MAX_CHARS = 16 * 1024;
|
|
19435
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`.";
|
|
19436
|
-
var submitCommand = new
|
|
19478
|
+
var submitCommand = new Command98("submit").description(
|
|
19437
19479
|
"Report a Taskmarket bug; CLI version, OS, Node version and network are attached. Reports are public unless --private"
|
|
19438
19480
|
).requiredOption("--title <text>", "Short summary (at most 200 characters)").option(
|
|
19439
19481
|
"--description <text>",
|
|
@@ -19509,8 +19551,8 @@ var submitCommand = new Command99("submit").description(
|
|
|
19509
19551
|
});
|
|
19510
19552
|
|
|
19511
19553
|
// src/commands/bug/visibility.ts
|
|
19512
|
-
import { Command as
|
|
19513
|
-
var visibilityCommand = new
|
|
19554
|
+
import { Command as Command99 } from "commander";
|
|
19555
|
+
var visibilityCommand = new Command99("visibility").description(
|
|
19514
19556
|
"Make one of your bug reports public or private; a private report is seen only by you and staff"
|
|
19515
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) => {
|
|
19516
19558
|
const ref = parseBugReportRef(report);
|
|
@@ -19545,7 +19587,7 @@ var visibilityCommand = new Command100("visibility").description(
|
|
|
19545
19587
|
});
|
|
19546
19588
|
|
|
19547
19589
|
// src/commands/bug/index.ts
|
|
19548
|
-
var bugCommand = new
|
|
19590
|
+
var bugCommand = new Command100("bug").description(
|
|
19549
19591
|
"Report Taskmarket bugs, browse public reports, follow their status and reply to staff"
|
|
19550
19592
|
);
|
|
19551
19593
|
bugCommand.addCommand(submitCommand);
|
|
@@ -19558,7 +19600,7 @@ bugCommand.addCommand(commentCommand);
|
|
|
19558
19600
|
bugCommand.addCommand(visibilityCommand);
|
|
19559
19601
|
|
|
19560
19602
|
// src/commands/bookmark/index.ts
|
|
19561
|
-
import { Command as
|
|
19603
|
+
import { Command as Command102 } from "commander";
|
|
19562
19604
|
|
|
19563
19605
|
// src/commands/bookmark/auth.ts
|
|
19564
19606
|
async function bookmarkAuth(action) {
|
|
@@ -19571,8 +19613,8 @@ async function bookmarkAuth(action) {
|
|
|
19571
19613
|
}
|
|
19572
19614
|
|
|
19573
19615
|
// src/commands/bookmark/collection.ts
|
|
19574
|
-
import { Command as
|
|
19575
|
-
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) => {
|
|
19576
19618
|
const trimmed = name.trim();
|
|
19577
19619
|
if (trimmed.length === 0 || trimmed.length > 120) {
|
|
19578
19620
|
printError("Collection name must be 1 to 120 characters");
|
|
@@ -19591,7 +19633,7 @@ var createCommand = new Command102("create").description("Create a private colle
|
|
|
19591
19633
|
return renderFailure(error);
|
|
19592
19634
|
}
|
|
19593
19635
|
});
|
|
19594
|
-
var listCommand3 = new
|
|
19636
|
+
var listCommand3 = new Command101("list").description("List your collections; a published one carries its publishedSlug (/c/<slug>)").action(async () => {
|
|
19595
19637
|
const auth = await bookmarkAuth("Listing collections");
|
|
19596
19638
|
if (!auth) return;
|
|
19597
19639
|
try {
|
|
@@ -19601,7 +19643,7 @@ var listCommand3 = new Command102("list").description("List your collections; a
|
|
|
19601
19643
|
}
|
|
19602
19644
|
});
|
|
19603
19645
|
function publishToggle(name, description, action) {
|
|
19604
|
-
return new
|
|
19646
|
+
return new Command101(name).description(description).argument("<collection-id>", "Collection id (from `taskmarket bookmark collection list`)").action(async (collectionId) => {
|
|
19605
19647
|
const auth = await bookmarkAuth(action);
|
|
19606
19648
|
if (!auth) return;
|
|
19607
19649
|
try {
|
|
@@ -19617,7 +19659,7 @@ function publishToggle(name, description, action) {
|
|
|
19617
19659
|
}
|
|
19618
19660
|
});
|
|
19619
19661
|
}
|
|
19620
|
-
var collectionCommand = new
|
|
19662
|
+
var collectionCommand = new Command101("collection").description(
|
|
19621
19663
|
"Create, list, publish and unpublish bookmark collections"
|
|
19622
19664
|
);
|
|
19623
19665
|
collectionCommand.addCommand(createCommand);
|
|
@@ -19648,7 +19690,7 @@ function parseEntityType(value, flag) {
|
|
|
19648
19690
|
function chainFor(entityType) {
|
|
19649
19691
|
return entityType === "agent" ? { chainId: selectedNetwork().chainId } : {};
|
|
19650
19692
|
}
|
|
19651
|
-
var addCommand = new
|
|
19693
|
+
var addCommand = new Command102("add").description(
|
|
19652
19694
|
"Bookmark a task, submission or agent; an agent is saved on the selected network (--network)"
|
|
19653
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) => {
|
|
19654
19696
|
const entityType = parseEntityType(type, "<type>");
|
|
@@ -19676,7 +19718,7 @@ var addCommand = new Command103("add").description(
|
|
|
19676
19718
|
return renderFailure(error);
|
|
19677
19719
|
}
|
|
19678
19720
|
});
|
|
19679
|
-
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) => {
|
|
19680
19722
|
const entityType = parseEntityType(type, "<type>");
|
|
19681
19723
|
if (!entityType) return;
|
|
19682
19724
|
const auth = await bookmarkAuth("Removing a bookmark");
|
|
@@ -19692,7 +19734,7 @@ var removeCommand = new Command103("remove").description("Remove a bookmark; an
|
|
|
19692
19734
|
return renderFailure(error);
|
|
19693
19735
|
}
|
|
19694
19736
|
});
|
|
19695
|
-
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(
|
|
19696
19738
|
async (opts) => {
|
|
19697
19739
|
const entityType = opts.type === void 0 ? void 0 : parseEntityType(opts.type, "--type");
|
|
19698
19740
|
if (entityType === null) return;
|
|
@@ -19716,7 +19758,7 @@ var listCommand4 = new Command103("list").description("List your bookmarks, newe
|
|
|
19716
19758
|
}
|
|
19717
19759
|
);
|
|
19718
19760
|
function pinToggle(name, description, action) {
|
|
19719
|
-
return new
|
|
19761
|
+
return new Command102(name).description(description).argument("<id>", "Bookmark id (from `taskmarket bookmark list`)").action(async (id) => {
|
|
19720
19762
|
const auth = await bookmarkAuth(action);
|
|
19721
19763
|
if (!auth) return;
|
|
19722
19764
|
try {
|
|
@@ -19731,7 +19773,7 @@ function pinToggle(name, description, action) {
|
|
|
19731
19773
|
}
|
|
19732
19774
|
});
|
|
19733
19775
|
}
|
|
19734
|
-
var countCommand = new
|
|
19776
|
+
var countCommand = new Command102("count").description("Count your saved bookmarks").option("--pinned", "Count only pinned bookmarks").action(async (opts) => {
|
|
19735
19777
|
const auth = await bookmarkAuth("Counting bookmarks");
|
|
19736
19778
|
if (!auth) return;
|
|
19737
19779
|
const params = new URLSearchParams();
|
|
@@ -19745,7 +19787,7 @@ var countCommand = new Command103("count").description("Count your saved bookmar
|
|
|
19745
19787
|
return renderFailure(error);
|
|
19746
19788
|
}
|
|
19747
19789
|
});
|
|
19748
|
-
var bookmarkCommand = new
|
|
19790
|
+
var bookmarkCommand = new Command102("bookmark").description(
|
|
19749
19791
|
"Save tasks, submissions and agents to your private list, and share collections of them"
|
|
19750
19792
|
);
|
|
19751
19793
|
bookmarkCommand.addCommand(addCommand);
|
|
@@ -19762,7 +19804,7 @@ bookmarkCommand.addCommand(collectionCommand);
|
|
|
19762
19804
|
|
|
19763
19805
|
// src/commands/skills/index.ts
|
|
19764
19806
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
19765
|
-
import { Command as
|
|
19807
|
+
import { Command as Command103 } from "commander";
|
|
19766
19808
|
|
|
19767
19809
|
// src/lib/skill-directory.ts
|
|
19768
19810
|
import { lstat, readdir, readFile as readFile3 } from "fs/promises";
|
|
@@ -19902,7 +19944,7 @@ var bundleOptions = (command) => command.requiredOption("--agent <agentId>", "Th
|
|
|
19902
19944
|
).option("--request-key <uuid>", "Reuse to resend the same write without applying it twice");
|
|
19903
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";
|
|
19904
19946
|
var createCommand2 = bundleOptions(
|
|
19905
|
-
new
|
|
19947
|
+
new Command103("create").description(
|
|
19906
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}`
|
|
19907
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)")
|
|
19908
19950
|
).action(async (dir, opts) => {
|
|
@@ -19920,7 +19962,7 @@ var createCommand2 = bundleOptions(
|
|
|
19920
19962
|
}
|
|
19921
19963
|
});
|
|
19922
19964
|
var versionCommand = bundleOptions(
|
|
19923
|
-
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")
|
|
19924
19966
|
).action(async (skillId, dir, opts) => {
|
|
19925
19967
|
try {
|
|
19926
19968
|
const { body, excluded } = await bundleWrite("version", dir, skillId, opts);
|
|
@@ -19937,7 +19979,7 @@ var versionCommand = bundleOptions(
|
|
|
19937
19979
|
return fail(error);
|
|
19938
19980
|
}
|
|
19939
19981
|
});
|
|
19940
|
-
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(
|
|
19941
19983
|
"--remove-assignments",
|
|
19942
19984
|
"Also remove the skill from this agent's assignments; archiving is refused while other agents have it assigned"
|
|
19943
19985
|
).option("--request-key <uuid>", "Reuse to resend the same write without applying it twice").action(
|
|
@@ -19963,7 +20005,7 @@ var archiveCommand = new Command104("archive").description("Archive a skill you
|
|
|
19963
20005
|
}
|
|
19964
20006
|
}
|
|
19965
20007
|
);
|
|
19966
|
-
var skillsCommand = new
|
|
20008
|
+
var skillsCommand = new Command103("skills").description(
|
|
19967
20009
|
"Skills in your owner's library that you, a hosted agent, author: create, version and archive"
|
|
19968
20010
|
);
|
|
19969
20011
|
skillsCommand.addCommand(createCommand2);
|
|
@@ -19974,7 +20016,7 @@ skillsCommand.addCommand(archiveCommand);
|
|
|
19974
20016
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
19975
20017
|
import fs10 from "fs/promises";
|
|
19976
20018
|
import path8 from "path";
|
|
19977
|
-
import { Command as
|
|
20019
|
+
import { Command as Command104 } from "commander";
|
|
19978
20020
|
var BRIEF_COOKIE = "taskmarket_brief";
|
|
19979
20021
|
var CREDENTIAL_PATTERN = /^[0-9a-f-]{36}\.[0-9a-f]{64}$/;
|
|
19980
20022
|
var credentialFile = () => path8.join(getTaskmarketHome(), "brief.json");
|
|
@@ -20064,7 +20106,7 @@ async function sendTurn(credential, message, current, turnId = randomUUID5()) {
|
|
|
20064
20106
|
)).data
|
|
20065
20107
|
);
|
|
20066
20108
|
}
|
|
20067
|
-
var briefCommand = new
|
|
20109
|
+
var briefCommand = new Command104("brief").description(
|
|
20068
20110
|
"Draft a task brief in conversation with the drafting assistant"
|
|
20069
20111
|
);
|
|
20070
20112
|
briefCommand.command("start").description(
|
|
@@ -20118,11 +20160,11 @@ briefCommand.command("discard").description("Delete the saved brief").action(asy
|
|
|
20118
20160
|
});
|
|
20119
20161
|
|
|
20120
20162
|
// src/commands/requester/index.ts
|
|
20121
|
-
import { Command as
|
|
20163
|
+
import { Command as Command106 } from "commander";
|
|
20122
20164
|
|
|
20123
20165
|
// src/commands/requester/stats.ts
|
|
20124
|
-
import { Command as
|
|
20125
|
-
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) => {
|
|
20126
20168
|
if (!/^0x[0-9a-fA-F]{40}$/.test(address3)) {
|
|
20127
20169
|
printError("Address must be a 0x-prefixed 20-byte hex string");
|
|
20128
20170
|
return;
|
|
@@ -20136,23 +20178,23 @@ var requesterStatsCmd = new Command106("stats").description("Get requester reput
|
|
|
20136
20178
|
});
|
|
20137
20179
|
|
|
20138
20180
|
// src/commands/requester/index.ts
|
|
20139
|
-
var requesterCmd = new
|
|
20181
|
+
var requesterCmd = new Command106("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
|
|
20140
20182
|
|
|
20141
20183
|
// src/commands/capabilities.ts
|
|
20142
|
-
import { Command as
|
|
20184
|
+
import { Command as Command107 } from "commander";
|
|
20143
20185
|
async function fetchCapabilities(category) {
|
|
20144
20186
|
const input = parseInput(CapabilitiesListInputSchema, { category });
|
|
20145
20187
|
const query4 = input.category ? `?category=${encodeURIComponent(input.category)}` : "";
|
|
20146
20188
|
return CapabilitiesListResponseSchema.parse(await apiGet(`/api/capabilities${query4}`));
|
|
20147
20189
|
}
|
|
20148
|
-
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) => {
|
|
20149
20191
|
try {
|
|
20150
20192
|
printResult(await fetchCapabilities(opts.category));
|
|
20151
20193
|
} catch (err) {
|
|
20152
20194
|
renderFailure(err);
|
|
20153
20195
|
}
|
|
20154
20196
|
});
|
|
20155
|
-
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) => {
|
|
20156
20198
|
try {
|
|
20157
20199
|
const { capabilities } = await fetchCapabilities();
|
|
20158
20200
|
const entry = capabilities.find((item) => item.slug === slug);
|
|
@@ -20162,13 +20204,13 @@ var showCommand2 = new Command108("show").description("Show one capability by sl
|
|
|
20162
20204
|
renderFailure(err);
|
|
20163
20205
|
}
|
|
20164
20206
|
});
|
|
20165
|
-
var capabilitiesCommand = new
|
|
20207
|
+
var capabilitiesCommand = new Command107("capabilities").description("Read the listing capability registry").addCommand(listCommand5).addCommand(showCommand2);
|
|
20166
20208
|
|
|
20167
20209
|
// src/commands/x402/index.ts
|
|
20168
|
-
import { Command as
|
|
20210
|
+
import { Command as Command111 } from "commander";
|
|
20169
20211
|
|
|
20170
20212
|
// src/commands/x402/payments.ts
|
|
20171
|
-
import { Command as
|
|
20213
|
+
import { Command as Command108, Option as Option5 } from "commander";
|
|
20172
20214
|
import { createInterface as createInterface5 } from "readline";
|
|
20173
20215
|
var PAYMENT_STATES = [
|
|
20174
20216
|
"reserved",
|
|
@@ -20194,7 +20236,7 @@ async function confirmManualResolution() {
|
|
|
20194
20236
|
readline.close();
|
|
20195
20237
|
return answer.trim().toLowerCase() === "resolve";
|
|
20196
20238
|
}
|
|
20197
|
-
var x402PaymentsCommand = new
|
|
20239
|
+
var x402PaymentsCommand = new Command108("payments").description(
|
|
20198
20240
|
"Inspect and reconcile X402 Pay payment records"
|
|
20199
20241
|
);
|
|
20200
20242
|
x402PaymentsCommand.command("list").description("List current payment records").addOption(new Option5("--state <state>", "Filter by state").choices(PAYMENT_STATES)).action(async (options) => {
|
|
@@ -20223,7 +20265,7 @@ x402PaymentsCommand.command("resolve").description("Manually record an externall
|
|
|
20223
20265
|
|
|
20224
20266
|
// src/commands/x402/policy.ts
|
|
20225
20267
|
import { promises as fs11 } from "fs";
|
|
20226
|
-
import { Command as
|
|
20268
|
+
import { Command as Command109 } from "commander";
|
|
20227
20269
|
import { createInterface as createInterface6 } from "readline";
|
|
20228
20270
|
async function confirmUnattendedRule(rule) {
|
|
20229
20271
|
if (!process.stdin.isTTY) {
|
|
@@ -20249,7 +20291,7 @@ async function confirmUnattendedRule(rule) {
|
|
|
20249
20291
|
readline.close();
|
|
20250
20292
|
return answer.trim().toLowerCase() === "authorize";
|
|
20251
20293
|
}
|
|
20252
|
-
var x402PolicyCommand = new
|
|
20294
|
+
var x402PolicyCommand = new Command109("policy").description(
|
|
20253
20295
|
"Manage local X402 Pay spending policy"
|
|
20254
20296
|
);
|
|
20255
20297
|
x402PolicyCommand.command("init").description("Create a deny-all policy file").action(async () => {
|
|
@@ -20285,14 +20327,14 @@ for (const enabled of [true, false]) {
|
|
|
20285
20327
|
}
|
|
20286
20328
|
|
|
20287
20329
|
// src/commands/x402/request.ts
|
|
20288
|
-
import { Command as
|
|
20330
|
+
import { Command as Command110, Option as Option6 } from "commander";
|
|
20289
20331
|
function collect4(value, previous) {
|
|
20290
20332
|
return [...previous, value];
|
|
20291
20333
|
}
|
|
20292
20334
|
function confirm(lines) {
|
|
20293
20335
|
return confirmAtTerminal(lines, "use --non-interactive with policy");
|
|
20294
20336
|
}
|
|
20295
|
-
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(
|
|
20296
20338
|
"--header-env <header=ENV_VAR>",
|
|
20297
20339
|
"Read one request header from an environment variable (repeatable)",
|
|
20298
20340
|
collect4,
|
|
@@ -20340,7 +20382,7 @@ var x402RequestCommand = new Command111("request").description("Request and pay
|
|
|
20340
20382
|
);
|
|
20341
20383
|
|
|
20342
20384
|
// src/commands/x402/index.ts
|
|
20343
|
-
var x402Command = new
|
|
20385
|
+
var x402Command = new Command111("x402").description(
|
|
20344
20386
|
"Pay x402 services with local spending policies (X402 Pay)"
|
|
20345
20387
|
);
|
|
20346
20388
|
x402Command.addCommand(x402RequestCommand);
|
|
@@ -20348,10 +20390,10 @@ x402Command.addCommand(x402PolicyCommand);
|
|
|
20348
20390
|
x402Command.addCommand(x402PaymentsCommand);
|
|
20349
20391
|
|
|
20350
20392
|
// src/commands/sponsored-task/index.ts
|
|
20351
|
-
import { Command as
|
|
20393
|
+
import { Command as Command127 } from "commander";
|
|
20352
20394
|
|
|
20353
20395
|
// src/commands/sponsored-task/create.ts
|
|
20354
|
-
import { Command as
|
|
20396
|
+
import { Command as Command112 } from "commander";
|
|
20355
20397
|
import { toHex as toHex4 } from "viem";
|
|
20356
20398
|
|
|
20357
20399
|
// ../../packages/contracts/evm/abi/generated/SponsoredTasksVaultV2.ts
|
|
@@ -24762,7 +24804,7 @@ async function createOnSolana(opts, keystore) {
|
|
|
24762
24804
|
renderFailure(err);
|
|
24763
24805
|
}
|
|
24764
24806
|
}
|
|
24765
|
-
var sponsoredTaskCreateCommand = new
|
|
24807
|
+
var sponsoredTaskCreateCommand = new Command112("create").description("Create a new Sponsored Task vault for a project token").option(
|
|
24766
24808
|
"--factory <address>",
|
|
24767
24809
|
"SponsoredTaskFactory contract address (EVM chains; defaults to the chain's newest factory, or the settler-mode factory on Robinhood Chain)"
|
|
24768
24810
|
).requiredOption(
|
|
@@ -24885,7 +24927,7 @@ Token risk: ${TOKEN_RISK}`
|
|
|
24885
24927
|
);
|
|
24886
24928
|
|
|
24887
24929
|
// src/commands/sponsored-task/fund.ts
|
|
24888
|
-
import { Command as
|
|
24930
|
+
import { Command as Command113 } from "commander";
|
|
24889
24931
|
function isValidAddress5(addr) {
|
|
24890
24932
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
24891
24933
|
}
|
|
@@ -24919,7 +24961,7 @@ async function fundOnSolana(opts, keystore) {
|
|
|
24919
24961
|
renderFailure(err);
|
|
24920
24962
|
}
|
|
24921
24963
|
}
|
|
24922
|
-
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(
|
|
24923
24965
|
"--token <address>",
|
|
24924
24966
|
"Project ERC-20 token address (EVM chains; Solana reads the vault's mint)"
|
|
24925
24967
|
).requiredOption(
|
|
@@ -24993,7 +25035,7 @@ var sponsoredTaskFundCommand = new Command114("fund").description("Fund a Sponso
|
|
|
24993
25035
|
});
|
|
24994
25036
|
|
|
24995
25037
|
// src/commands/sponsored-task/managers.ts
|
|
24996
|
-
import { Command as
|
|
25038
|
+
import { Command as Command114 } from "commander";
|
|
24997
25039
|
|
|
24998
25040
|
// src/lib/solana-payout-binding.ts
|
|
24999
25041
|
var PROGRAM_ID_ENV = "TASKMARKET_SOLANA_SPONSORED_TASKS_PROGRAM_ID";
|
|
@@ -25327,7 +25369,7 @@ async function configure(opts) {
|
|
|
25327
25369
|
active: opts.active
|
|
25328
25370
|
});
|
|
25329
25371
|
}
|
|
25330
|
-
var sponsoredTaskManagersCommand = new
|
|
25372
|
+
var sponsoredTaskManagersCommand = new Command114("managers").description(
|
|
25331
25373
|
"Manage authorized managers for a Sponsored Task vault"
|
|
25332
25374
|
);
|
|
25333
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(
|
|
@@ -25354,8 +25396,8 @@ sponsoredTaskManagersCommand.command("list").description("List a vault authorize
|
|
|
25354
25396
|
});
|
|
25355
25397
|
|
|
25356
25398
|
// src/commands/sponsored-task/managed.ts
|
|
25357
|
-
import { Command as
|
|
25358
|
-
var sponsoredTaskManagedCommand = new
|
|
25399
|
+
import { Command as Command115 } from "commander";
|
|
25400
|
+
var sponsoredTaskManagedCommand = new Command115("managed").description(
|
|
25359
25401
|
"List the active Sponsored Task vaults an address can fund tasks from as an active manager (defaults to your wallet)"
|
|
25360
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) => {
|
|
25361
25403
|
let address3 = opts.address;
|
|
@@ -25385,8 +25427,8 @@ var sponsoredTaskManagedCommand = new Command116("managed").description(
|
|
|
25385
25427
|
});
|
|
25386
25428
|
|
|
25387
25429
|
// src/commands/sponsored-task/creation-fee.ts
|
|
25388
|
-
import { Command as
|
|
25389
|
-
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(
|
|
25390
25432
|
"--chain-id <chain>",
|
|
25391
25433
|
"EVM chain the vault would be created on: a network name or chain id (e.g. base, 8453)",
|
|
25392
25434
|
chainOption("--chain-id", "evm-vault")
|
|
@@ -25430,8 +25472,8 @@ var sponsoredTaskCreationFeeCommand = new Command117("creation-fee").description
|
|
|
25430
25472
|
});
|
|
25431
25473
|
|
|
25432
25474
|
// src/commands/sponsored-task/list.ts
|
|
25433
|
-
import { Command as
|
|
25434
|
-
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(
|
|
25435
25477
|
async (opts) => {
|
|
25436
25478
|
if (opts.owner && opts.mine) {
|
|
25437
25479
|
printError("Pass --owner or --mine, not both");
|
|
@@ -25460,8 +25502,8 @@ var sponsoredTaskListCommand = new Command118("list").description("List Sponsore
|
|
|
25460
25502
|
);
|
|
25461
25503
|
|
|
25462
25504
|
// src/commands/sponsored-task/settlements.ts
|
|
25463
|
-
import { Command as
|
|
25464
|
-
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) => {
|
|
25465
25507
|
const limit = Number(opts.limit);
|
|
25466
25508
|
if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
|
|
25467
25509
|
printError("--limit must be an integer from 1 to 100");
|
|
@@ -25476,17 +25518,17 @@ var sponsoredTaskSettlementsCommand = new Command119("settlements").description(
|
|
|
25476
25518
|
});
|
|
25477
25519
|
|
|
25478
25520
|
// src/commands/sponsored-task/show.ts
|
|
25479
|
-
import { Command as
|
|
25480
|
-
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) => {
|
|
25481
25523
|
const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}`);
|
|
25482
25524
|
printResult(result);
|
|
25483
25525
|
});
|
|
25484
25526
|
|
|
25485
25527
|
// src/commands/sponsored-task/request-review.ts
|
|
25486
25528
|
import { randomBytes as randomBytes6 } from "crypto";
|
|
25487
|
-
import { Command as
|
|
25529
|
+
import { Command as Command120 } from "commander";
|
|
25488
25530
|
var REQUEST_TTL_SECONDS = 5 * 60;
|
|
25489
|
-
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) => {
|
|
25490
25532
|
let keystore;
|
|
25491
25533
|
try {
|
|
25492
25534
|
keystore = await loadKeystore();
|
|
@@ -25543,18 +25585,18 @@ var sponsoredTaskRequestReviewCommand = new Command121("request-review").descrip
|
|
|
25543
25585
|
});
|
|
25544
25586
|
|
|
25545
25587
|
// src/commands/sponsored-task/balance.ts
|
|
25546
|
-
import { Command as
|
|
25547
|
-
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) => {
|
|
25548
25590
|
const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}/balance`);
|
|
25549
25591
|
printResult(result);
|
|
25550
25592
|
});
|
|
25551
25593
|
|
|
25552
25594
|
// src/commands/sponsored-task/withdraw.ts
|
|
25553
|
-
import { Command as
|
|
25595
|
+
import { Command as Command122 } from "commander";
|
|
25554
25596
|
function isValidAddress7(addr) {
|
|
25555
25597
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
25556
25598
|
}
|
|
25557
|
-
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(
|
|
25558
25600
|
"--chain-id <chain>",
|
|
25559
25601
|
"EVM chain the vault is deployed on: a network name or chain id (e.g. base, robinhood, 8453)",
|
|
25560
25602
|
chainOption("--chain-id", "evm-vault")
|
|
@@ -25590,11 +25632,11 @@ var sponsoredTaskWithdrawCommand = new Command123("withdraw").description("Withd
|
|
|
25590
25632
|
});
|
|
25591
25633
|
|
|
25592
25634
|
// src/commands/sponsored-task/exit.ts
|
|
25593
|
-
import { Command as
|
|
25635
|
+
import { Command as Command123 } from "commander";
|
|
25594
25636
|
function isValidAddress8(addr) {
|
|
25595
25637
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
25596
25638
|
}
|
|
25597
|
-
var sponsoredTaskExitCommand = new
|
|
25639
|
+
var sponsoredTaskExitCommand = new Command123("exit").description(
|
|
25598
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."
|
|
25599
25641
|
).requiredOption("--vault <address>", "Vault address (base58 for a Solana vault)").requiredOption(
|
|
25600
25642
|
"--chain-id <chain>",
|
|
@@ -25670,7 +25712,7 @@ var sponsoredTaskExitCommand = new Command124("exit").description(
|
|
|
25670
25712
|
});
|
|
25671
25713
|
|
|
25672
25714
|
// src/commands/sponsored-task/claim.ts
|
|
25673
|
-
import { Command as
|
|
25715
|
+
import { Command as Command124 } from "commander";
|
|
25674
25716
|
var CLAIM_TO_TYPES = {
|
|
25675
25717
|
ClaimTo: [
|
|
25676
25718
|
{ name: "vaultId", type: "bytes32" },
|
|
@@ -25735,7 +25777,7 @@ async function findEntitlement(vaultId, workerAddress, taskId, options = {}) {
|
|
|
25735
25777
|
await sleep4(3e3);
|
|
25736
25778
|
}
|
|
25737
25779
|
}
|
|
25738
|
-
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(
|
|
25739
25781
|
"--task-id <id>",
|
|
25740
25782
|
"Claim the entitlement for a specific task (defaults to the first unclaimed one)"
|
|
25741
25783
|
).action(async (vaultId, opts) => {
|
|
@@ -25851,10 +25893,10 @@ var sponsoredTaskClaimCommand = new Command125("claim").description("Claim your
|
|
|
25851
25893
|
});
|
|
25852
25894
|
|
|
25853
25895
|
// src/commands/sponsored-task/rewards.ts
|
|
25854
|
-
import { Command as
|
|
25896
|
+
import { Command as Command125 } from "commander";
|
|
25855
25897
|
var REWARD_STATES = SponsoredTaskRewardStateSchema.options;
|
|
25856
25898
|
var CLAIM_STATUSES = SponsoredTaskWorkerRewardClaimStatusSchema.options;
|
|
25857
|
-
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(
|
|
25858
25900
|
async (opts) => {
|
|
25859
25901
|
let address3 = opts.address;
|
|
25860
25902
|
if (address3 === void 0) {
|
|
@@ -25894,7 +25936,7 @@ var sponsoredTaskRewardsCommand = new Command126("rewards").description("List Sp
|
|
|
25894
25936
|
);
|
|
25895
25937
|
|
|
25896
25938
|
// src/commands/sponsored-task/bind-payout.ts
|
|
25897
|
-
import { Command as
|
|
25939
|
+
import { Command as Command126 } from "commander";
|
|
25898
25940
|
async function solanaRewards(agent) {
|
|
25899
25941
|
try {
|
|
25900
25942
|
const result = await apiGet(
|
|
@@ -25905,7 +25947,7 @@ async function solanaRewards(agent) {
|
|
|
25905
25947
|
return [];
|
|
25906
25948
|
}
|
|
25907
25949
|
}
|
|
25908
|
-
var sponsoredTaskBindPayoutCommand = new
|
|
25950
|
+
var sponsoredTaskBindPayoutCommand = new Command126("bind-payout").description(
|
|
25909
25951
|
"Bind the Solana address that receives your Solana Sponsored Task awards (once; rebinding replaces it)"
|
|
25910
25952
|
).option(
|
|
25911
25953
|
"--address <solana-address>",
|
|
@@ -26044,7 +26086,7 @@ function bindingTaskChainIds(requested, connection, everyChain) {
|
|
|
26044
26086
|
}
|
|
26045
26087
|
|
|
26046
26088
|
// src/commands/sponsored-task/index.ts
|
|
26047
|
-
var sponsoredTaskCommand = new
|
|
26089
|
+
var sponsoredTaskCommand = new Command127("sponsored-task").description(
|
|
26048
26090
|
"Sponsored Task vault administration and reward claims"
|
|
26049
26091
|
);
|
|
26050
26092
|
sponsoredTaskCommand.addCommand(sponsoredTaskCreateCommand);
|
|
@@ -26064,10 +26106,10 @@ sponsoredTaskCommand.addCommand(sponsoredTaskRewardsCommand);
|
|
|
26064
26106
|
sponsoredTaskCommand.addCommand(sponsoredTaskBindPayoutCommand);
|
|
26065
26107
|
|
|
26066
26108
|
// src/commands/project/index.ts
|
|
26067
|
-
import { Command as
|
|
26109
|
+
import { Command as Command149 } from "commander";
|
|
26068
26110
|
|
|
26069
26111
|
// src/commands/project/accept.ts
|
|
26070
|
-
import { Command as
|
|
26112
|
+
import { Command as Command128 } from "commander";
|
|
26071
26113
|
|
|
26072
26114
|
// src/commands/project/shared.ts
|
|
26073
26115
|
var ADDRESS = /^0x[0-9a-fA-F]{40}$/;
|
|
@@ -26192,7 +26234,7 @@ async function postProjectWrite(path9, body, options) {
|
|
|
26192
26234
|
|
|
26193
26235
|
// src/commands/project/accept.ts
|
|
26194
26236
|
var TERMS_HASH = /^0x[0-9a-fA-F]{64}$/;
|
|
26195
|
-
var projectAcceptCommand = new
|
|
26237
|
+
var projectAcceptCommand = new Command128("accept").description(
|
|
26196
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)"
|
|
26197
26239
|
).argument("<projectId>", "Project id").option(
|
|
26198
26240
|
"--terms-hash <hash>",
|
|
@@ -26224,7 +26266,7 @@ var projectAcceptCommand = new Command129("accept").description(
|
|
|
26224
26266
|
});
|
|
26225
26267
|
|
|
26226
26268
|
// src/commands/project/add-task.ts
|
|
26227
|
-
import { Command as
|
|
26269
|
+
import { Command as Command129 } from "commander";
|
|
26228
26270
|
function deadlineCheck(durationHours, project, now = /* @__PURE__ */ new Date()) {
|
|
26229
26271
|
if (!project?.endsAt || !Number.isFinite(durationHours)) return null;
|
|
26230
26272
|
const endsAt = new Date(project.endsAt);
|
|
@@ -26286,7 +26328,7 @@ function parseContinuation(flags) {
|
|
|
26286
26328
|
function collect5(value, previous = []) {
|
|
26287
26329
|
return [...previous, value];
|
|
26288
26330
|
}
|
|
26289
|
-
var projectAddTaskCommand = new
|
|
26331
|
+
var projectAddTaskCommand = new Command129("add-task").description(
|
|
26290
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)"
|
|
26291
26333
|
).argument("<projectId>", "Project id");
|
|
26292
26334
|
for (const option of createCmd.options) {
|
|
@@ -26338,7 +26380,7 @@ projectAddTaskCommand.action(async (id, opts) => {
|
|
|
26338
26380
|
});
|
|
26339
26381
|
|
|
26340
26382
|
// src/commands/project/automations.ts
|
|
26341
|
-
import { Command as
|
|
26383
|
+
import { Command as Command130 } from "commander";
|
|
26342
26384
|
function automationsOnBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
26343
26385
|
if (opts.cap === void 0) {
|
|
26344
26386
|
return { error: "--cap is required: the most the automations may draw from the budget" };
|
|
@@ -26367,7 +26409,7 @@ function automationsOnBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
|
26367
26409
|
}
|
|
26368
26410
|
return body;
|
|
26369
26411
|
}
|
|
26370
|
-
var projectAutomationsOnCommand = new
|
|
26412
|
+
var projectAutomationsOnCommand = new Command130("on").description(
|
|
26371
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)"
|
|
26372
26414
|
).argument("<projectId>", "Project id").option(
|
|
26373
26415
|
"--cap <amount>",
|
|
@@ -26395,7 +26437,7 @@ var projectAutomationsOnCommand = new Command131("on").description(
|
|
|
26395
26437
|
});
|
|
26396
26438
|
}
|
|
26397
26439
|
);
|
|
26398
|
-
var projectAutomationsOffCommand = new
|
|
26440
|
+
var projectAutomationsOffCommand = new Command130("off").description(
|
|
26399
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)"
|
|
26400
26442
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
26401
26443
|
const projectId = parseProjectId(id);
|
|
@@ -26406,7 +26448,7 @@ var projectAutomationsOffCommand = new Command131("off").description(
|
|
|
26406
26448
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26407
26449
|
);
|
|
26408
26450
|
});
|
|
26409
|
-
var projectAutomationsStatusCommand = new
|
|
26451
|
+
var projectAutomationsStatusCommand = new Command130("status").description(
|
|
26410
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)"
|
|
26411
26453
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
26412
26454
|
const projectId = parseProjectId(id);
|
|
@@ -26417,13 +26459,13 @@ var projectAutomationsStatusCommand = new Command131("status").description(
|
|
|
26417
26459
|
renderFailure(err);
|
|
26418
26460
|
}
|
|
26419
26461
|
});
|
|
26420
|
-
var projectAutomationsCommand = new
|
|
26462
|
+
var projectAutomationsCommand = new Command130("automations").description(
|
|
26421
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"
|
|
26422
26464
|
).addCommand(projectAutomationsOnCommand).addCommand(projectAutomationsOffCommand).addCommand(projectAutomationsStatusCommand);
|
|
26423
26465
|
|
|
26424
26466
|
// src/commands/project/claim.ts
|
|
26425
|
-
import { Command as
|
|
26426
|
-
var projectClaimCommand = new
|
|
26467
|
+
import { Command as Command131 } from "commander";
|
|
26468
|
+
var projectClaimCommand = new Command131("claim").description(
|
|
26427
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)"
|
|
26428
26470
|
).argument("<projectId>", "Project id").option("--backer <address>", "The backer to pay (default: your wallet)").action(async (id, opts) => {
|
|
26429
26471
|
const projectId = parseProjectId(id);
|
|
@@ -26443,8 +26485,8 @@ var projectClaimCommand = new Command132("claim").description(
|
|
|
26443
26485
|
});
|
|
26444
26486
|
|
|
26445
26487
|
// src/commands/project/close.ts
|
|
26446
|
-
import { Command as
|
|
26447
|
-
var projectCloseCommand = new
|
|
26488
|
+
import { Command as Command132 } from "commander";
|
|
26489
|
+
var projectCloseCommand = new Command132("close").description(
|
|
26448
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)"
|
|
26449
26491
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
26450
26492
|
const projectId = parseProjectId(id);
|
|
@@ -26457,13 +26499,13 @@ var projectCloseCommand = new Command133("close").description(
|
|
|
26457
26499
|
});
|
|
26458
26500
|
|
|
26459
26501
|
// src/commands/project/create.ts
|
|
26460
|
-
import { Command as
|
|
26502
|
+
import { Command as Command135 } from "commander";
|
|
26461
26503
|
|
|
26462
26504
|
// src/commands/project/suggestions.ts
|
|
26463
|
-
import { Command as
|
|
26505
|
+
import { Command as Command134 } from "commander";
|
|
26464
26506
|
|
|
26465
26507
|
// src/commands/project/suggestion-proposals.ts
|
|
26466
|
-
import { Command as
|
|
26508
|
+
import { Command as Command133 } from "commander";
|
|
26467
26509
|
var QUERY_ERRORS = {
|
|
26468
26510
|
status: "--status must be pending, closed or expired",
|
|
26469
26511
|
limit: "--limit must be an integer from 1 to 50",
|
|
@@ -26514,7 +26556,7 @@ async function read(path9) {
|
|
|
26514
26556
|
function collectSuggestion(value, previous) {
|
|
26515
26557
|
return [...previous, value];
|
|
26516
26558
|
}
|
|
26517
|
-
var projectSuggestionProposalsCommand = new
|
|
26559
|
+
var projectSuggestionProposalsCommand = new Command133("proposals").description(
|
|
26518
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)"
|
|
26519
26561
|
).argument("<projectId>", "Project id").option(
|
|
26520
26562
|
"--status <status>",
|
|
@@ -26529,7 +26571,7 @@ var projectSuggestionProposalsCommand = new Command134("proposals").description(
|
|
|
26529
26571
|
if (typeof query4 !== "string") return void printError(query4.error);
|
|
26530
26572
|
await read(`/api/projects/${projectId}/suggestion-proposals${query4 ? `?${query4}` : ""}`);
|
|
26531
26573
|
});
|
|
26532
|
-
var proposalShowCommand = new
|
|
26574
|
+
var proposalShowCommand = new Command133("show").description(
|
|
26533
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)"
|
|
26534
26576
|
).argument("<proposalId>", "Proposal id").action(async (value) => {
|
|
26535
26577
|
const id = parseProposalId(value);
|
|
@@ -26537,7 +26579,7 @@ var proposalShowCommand = new Command134("show").description(
|
|
|
26537
26579
|
await read(`/api/suggestion-proposals/${id}`);
|
|
26538
26580
|
});
|
|
26539
26581
|
function decisionCommand(action, description) {
|
|
26540
|
-
return new
|
|
26582
|
+
return new Command133(action).description(description).argument("<proposalId>", "Proposal id").option(
|
|
26541
26583
|
"--suggestion <suggestionId>",
|
|
26542
26584
|
`Only this pick; repeat it for each (default: every pending pick)`,
|
|
26543
26585
|
collectSuggestion,
|
|
@@ -26554,7 +26596,7 @@ function decisionCommand(action, description) {
|
|
|
26554
26596
|
);
|
|
26555
26597
|
});
|
|
26556
26598
|
}
|
|
26557
|
-
var projectSuggestionProposalCommand = new
|
|
26599
|
+
var projectSuggestionProposalCommand = new Command133("proposal").description(
|
|
26558
26600
|
"One suggestion proposal, as the project's owner: show it, confirm its picks so the platform runner creates their tasks, or drop them"
|
|
26559
26601
|
).addCommand(proposalShowCommand).addCommand(
|
|
26560
26602
|
decisionCommand(
|
|
@@ -26668,7 +26710,7 @@ async function signedRead(path9) {
|
|
|
26668
26710
|
renderFailure(err);
|
|
26669
26711
|
}
|
|
26670
26712
|
}
|
|
26671
|
-
var projectSuggestCommand = new
|
|
26713
|
+
var projectSuggestCommand = new Command134("suggest").description(
|
|
26672
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"
|
|
26673
26715
|
).argument("<projectId>", "Project id").option("--title <text>", "Required: one line, 1 to 120 characters").option(
|
|
26674
26716
|
"--brief <text>",
|
|
@@ -26688,7 +26730,7 @@ var projectSuggestCommand = new Command135("suggest").description(
|
|
|
26688
26730
|
maxAmount: ACTION_FEE_MAX_AMOUNT
|
|
26689
26731
|
});
|
|
26690
26732
|
});
|
|
26691
|
-
var projectSuggestionsCommand = new
|
|
26733
|
+
var projectSuggestionsCommand = new Command134("suggestions").description(
|
|
26692
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)"
|
|
26693
26735
|
).argument("<projectId>", "Project id").option(
|
|
26694
26736
|
"--status <status>",
|
|
@@ -26706,7 +26748,7 @@ var projectSuggestionsCommand = new Command135("suggestions").description(
|
|
|
26706
26748
|
if (typeof query4 !== "string") return void printError(query4.error);
|
|
26707
26749
|
await signedRead(`/api/projects/${projectId}/suggestions${query4 ? `?${query4}` : ""}`);
|
|
26708
26750
|
});
|
|
26709
|
-
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) => {
|
|
26710
26752
|
const id = parseSuggestionId(value);
|
|
26711
26753
|
if (typeof id !== "string") return void printError(id.error);
|
|
26712
26754
|
await signedRead(`/api/project-suggestions/${id}`);
|
|
@@ -26720,7 +26762,7 @@ async function readAuthFor(what) {
|
|
|
26720
26762
|
return { headers: auth.headers };
|
|
26721
26763
|
}
|
|
26722
26764
|
function voteCommand(action, description) {
|
|
26723
|
-
return new
|
|
26765
|
+
return new Command134(action).description(description).argument("<suggestionId>", "Suggestion id").action(async (value) => {
|
|
26724
26766
|
const suggestionId = parseSuggestionId(value);
|
|
26725
26767
|
if (typeof suggestionId !== "string") return void printError(suggestionId.error);
|
|
26726
26768
|
const auth = await readAuthFor(action === "vote" ? "Voting" : "Taking back a vote");
|
|
@@ -26743,7 +26785,7 @@ function voteCommand(action, description) {
|
|
|
26743
26785
|
}
|
|
26744
26786
|
});
|
|
26745
26787
|
}
|
|
26746
|
-
var reportCommand = new
|
|
26788
|
+
var reportCommand = new Command134("report").description(
|
|
26747
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"
|
|
26748
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) => {
|
|
26749
26791
|
const suggestionId = parseSuggestionId(value);
|
|
@@ -26782,7 +26824,7 @@ var reportCommand = new Command135("report").description(
|
|
|
26782
26824
|
renderFailure(err);
|
|
26783
26825
|
}
|
|
26784
26826
|
});
|
|
26785
|
-
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) => {
|
|
26786
26828
|
const suggestionId = parseSuggestionId(value);
|
|
26787
26829
|
if (typeof suggestionId !== "string") return void printError(suggestionId.error);
|
|
26788
26830
|
await postProjectWrite(
|
|
@@ -26791,7 +26833,7 @@ var withdrawCommand2 = new Command135("withdraw").description("Withdraw your ope
|
|
|
26791
26833
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26792
26834
|
);
|
|
26793
26835
|
});
|
|
26794
|
-
var declineCommand = new
|
|
26836
|
+
var declineCommand = new Command134("decline").description(
|
|
26795
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"
|
|
26796
26838
|
).argument("<suggestionId>", "Suggestion id").option("--reason <text>", "Why, shown to everyone: up to 500 characters").action(async (value, opts) => {
|
|
26797
26839
|
const suggestionId = parseSuggestionId(value);
|
|
@@ -26806,7 +26848,7 @@ var declineCommand = new Command135("decline").description(
|
|
|
26806
26848
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26807
26849
|
);
|
|
26808
26850
|
});
|
|
26809
|
-
var projectSuggestionCommand = new
|
|
26851
|
+
var projectSuggestionCommand = new Command134("suggestion").description(
|
|
26810
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"
|
|
26811
26853
|
).addCommand(showCommand3).addCommand(
|
|
26812
26854
|
voteCommand(
|
|
@@ -26816,7 +26858,7 @@ var projectSuggestionCommand = new Command135("suggestion").description(
|
|
|
26816
26858
|
).addCommand(
|
|
26817
26859
|
voteCommand("unvote", "Take back your upvote on a suggestion (free, signed by your wallet)")
|
|
26818
26860
|
).addCommand(reportCommand).addCommand(withdrawCommand2).addCommand(declineCommand).addCommand(projectSuggestionProposalsCommand).addCommand(projectSuggestionProposalCommand);
|
|
26819
|
-
var projectSuggestionSettingsCommand = new
|
|
26861
|
+
var projectSuggestionSettingsCommand = new Command134("suggestion-settings").description(
|
|
26820
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"
|
|
26821
26863
|
).argument("<projectId>", "Project id").option(
|
|
26822
26864
|
"--suggestions <setting>",
|
|
@@ -26851,7 +26893,7 @@ var projectSuggestionSettingsCommand = new Command135("suggestion-settings").des
|
|
|
26851
26893
|
});
|
|
26852
26894
|
|
|
26853
26895
|
// src/commands/project/create.ts
|
|
26854
|
-
var projectCreateCommand = new
|
|
26896
|
+
var projectCreateCommand = new Command135("create").description(
|
|
26855
26897
|
"Open a project: one budget that funds tasks of any mode (costs the budget, in the payment token)"
|
|
26856
26898
|
).requiredOption("--budget <amount>", "Opening budget in the payment token (e.g. 50)").requiredOption(
|
|
26857
26899
|
"--ends-at <time>",
|
|
@@ -26900,9 +26942,9 @@ var projectCreateCommand = new Command136("create").description(
|
|
|
26900
26942
|
);
|
|
26901
26943
|
|
|
26902
26944
|
// src/commands/project/extend.ts
|
|
26903
|
-
import { Command as
|
|
26945
|
+
import { Command as Command136 } from "commander";
|
|
26904
26946
|
var MAX_EXTENSION_MS = 365 * 24 * 3600 * 1e3;
|
|
26905
|
-
var projectExtendCommand = new
|
|
26947
|
+
var projectExtendCommand = new Command136("extend").description(
|
|
26906
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"
|
|
26907
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) => {
|
|
26908
26950
|
const projectId = parseProjectId(id);
|
|
@@ -26920,8 +26962,8 @@ var projectExtendCommand = new Command137("extend").description(
|
|
|
26920
26962
|
});
|
|
26921
26963
|
|
|
26922
26964
|
// src/commands/project/fund.ts
|
|
26923
|
-
import { Command as
|
|
26924
|
-
var projectFundCommand = new
|
|
26965
|
+
import { Command as Command137 } from "commander";
|
|
26966
|
+
var projectFundCommand = new Command137("fund").description(
|
|
26925
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)"
|
|
26926
26968
|
).argument("<projectId>", "Project id").requiredOption("--amount <amount>", "Amount in the payment token (e.g. 10)").option(
|
|
26927
26969
|
"--on-behalf-of <address>",
|
|
@@ -26943,7 +26985,7 @@ var projectFundCommand = new Command138("fund").description(
|
|
|
26943
26985
|
});
|
|
26944
26986
|
|
|
26945
26987
|
// src/commands/project/grant.ts
|
|
26946
|
-
import { Command as
|
|
26988
|
+
import { Command as Command138 } from "commander";
|
|
26947
26989
|
function grantBody(projectId, opts) {
|
|
26948
26990
|
if (!ADDRESS.test(opts.operator)) {
|
|
26949
26991
|
return { error: "--operator must be a wallet address (0x + 40 hex chars)" };
|
|
@@ -26966,7 +27008,7 @@ function grantBody(projectId, opts) {
|
|
|
26966
27008
|
revokeRemovesControl: opts.revokeRemovesControl
|
|
26967
27009
|
};
|
|
26968
27010
|
}
|
|
26969
|
-
var projectGrantCommand = new
|
|
27011
|
+
var projectGrantCommand = new Command138("grant").description(
|
|
26970
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)"
|
|
26971
27013
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The wallet granted the right to spend the budget").option(
|
|
26972
27014
|
"--cap <amount>",
|
|
@@ -26992,7 +27034,7 @@ var projectGrantCommand = new Command139("grant").description(
|
|
|
26992
27034
|
});
|
|
26993
27035
|
|
|
26994
27036
|
// src/commands/project/review.ts
|
|
26995
|
-
import { Command as
|
|
27037
|
+
import { Command as Command139 } from "commander";
|
|
26996
27038
|
function reviewEvaluator(opts) {
|
|
26997
27039
|
if (opts.evaluator !== void 0 && opts.off) {
|
|
26998
27040
|
return { error: "Pass --evaluator <address> or --off, not both" };
|
|
@@ -27007,7 +27049,7 @@ function reviewEvaluator(opts) {
|
|
|
27007
27049
|
}
|
|
27008
27050
|
return opts.evaluator;
|
|
27009
27051
|
}
|
|
27010
|
-
var projectReviewCommand = new
|
|
27052
|
+
var projectReviewCommand = new Command139("review").description(
|
|
27011
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"
|
|
27012
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) => {
|
|
27013
27055
|
const projectId = parseProjectId(id);
|
|
@@ -27049,8 +27091,8 @@ async function ownerEvaluatorWarnings(evaluator) {
|
|
|
27049
27091
|
}
|
|
27050
27092
|
|
|
27051
27093
|
// src/commands/project/raise-cap.ts
|
|
27052
|
-
import { Command as
|
|
27053
|
-
var projectRaiseCapCommand = new
|
|
27094
|
+
import { Command as Command140 } from "commander";
|
|
27095
|
+
var projectRaiseCapCommand = new Command140("raise-cap").description(
|
|
27054
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"
|
|
27055
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) => {
|
|
27056
27098
|
const projectId = parseProjectId(id);
|
|
@@ -27068,8 +27110,8 @@ var projectRaiseCapCommand = new Command141("raise-cap").description(
|
|
|
27068
27110
|
});
|
|
27069
27111
|
|
|
27070
27112
|
// src/commands/project/lower-cap.ts
|
|
27071
|
-
import { Command as
|
|
27072
|
-
var projectLowerCapCommand = new
|
|
27113
|
+
import { Command as Command141 } from "commander";
|
|
27114
|
+
var projectLowerCapCommand = new Command141("lower-cap").description(
|
|
27073
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`"
|
|
27074
27116
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose cap to lower").requiredOption(
|
|
27075
27117
|
"--cap <amount>",
|
|
@@ -27091,7 +27133,7 @@ var projectLowerCapCommand = new Command142("lower-cap").description(
|
|
|
27091
27133
|
});
|
|
27092
27134
|
|
|
27093
27135
|
// src/commands/project/limits.ts
|
|
27094
|
-
import { Command as
|
|
27136
|
+
import { Command as Command142 } from "commander";
|
|
27095
27137
|
function limitsBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
27096
27138
|
if (!ADDRESS.test(opts.operator)) {
|
|
27097
27139
|
return { error: "--operator must be a wallet address (0x + 40 hex chars)" };
|
|
@@ -27131,7 +27173,7 @@ function limitsBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
|
27131
27173
|
}
|
|
27132
27174
|
return body;
|
|
27133
27175
|
}
|
|
27134
|
-
var projectLimitsCommand = new
|
|
27176
|
+
var projectLimitsCommand = new Command142("limits").description(
|
|
27135
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"
|
|
27136
27178
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose limits to set").option(
|
|
27137
27179
|
"--expires <time>",
|
|
@@ -27153,8 +27195,8 @@ var projectLimitsCommand = new Command143("limits").description(
|
|
|
27153
27195
|
});
|
|
27154
27196
|
|
|
27155
27197
|
// src/commands/project/revoke.ts
|
|
27156
|
-
import { Command as
|
|
27157
|
-
var projectRevokeCommand = new
|
|
27198
|
+
import { Command as Command143 } from "commander";
|
|
27199
|
+
var projectRevokeCommand = new Command143("revoke").description(
|
|
27158
27200
|
"End an operator's right to create tasks from the project, as its owner (costs 0.001 in the payment token)"
|
|
27159
27201
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator to revoke").action(async (id, opts) => {
|
|
27160
27202
|
const projectId = parseProjectId(id);
|
|
@@ -27173,7 +27215,7 @@ var projectRevokeCommand = new Command144("revoke").description(
|
|
|
27173
27215
|
});
|
|
27174
27216
|
|
|
27175
27217
|
// src/commands/project/schedule.ts
|
|
27176
|
-
import { Command as
|
|
27218
|
+
import { Command as Command146 } from "commander";
|
|
27177
27219
|
|
|
27178
27220
|
// src/lib/owner-list.ts
|
|
27179
27221
|
import { getAddress as getAddress2, isAddress as isAddress5 } from "viem";
|
|
@@ -27213,7 +27255,7 @@ function ownerListQuery(owner, opts, statuses) {
|
|
|
27213
27255
|
}
|
|
27214
27256
|
|
|
27215
27257
|
// src/commands/project/suggestion-schedule.ts
|
|
27216
|
-
import { Command as
|
|
27258
|
+
import { Command as Command144 } from "commander";
|
|
27217
27259
|
var SUGGESTION_ONLY_FLAGS = [
|
|
27218
27260
|
["--rank", "rank"],
|
|
27219
27261
|
["--min-backed-share", "minBackedShare"],
|
|
@@ -27404,7 +27446,7 @@ function addSuggestionScheduleOptions(command) {
|
|
|
27404
27446
|
).option("--no-email-picks", "Suggestions schedules: do not email when picks are waiting");
|
|
27405
27447
|
}
|
|
27406
27448
|
var suggestionScheduleSettingsCommand = addSuggestionScheduleOptions(
|
|
27407
|
-
new
|
|
27449
|
+
new Command144("suggestion-settings").description(
|
|
27408
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"
|
|
27409
27451
|
).argument("<scheduleId>", "Schedule id").option(
|
|
27410
27452
|
"--mode <mode>",
|
|
@@ -27438,7 +27480,7 @@ var suggestionScheduleSettingsCommand = addSuggestionScheduleOptions(
|
|
|
27438
27480
|
|
|
27439
27481
|
// src/commands/workflow-template.ts
|
|
27440
27482
|
import { readFile as readFile4 } from "fs/promises";
|
|
27441
|
-
import { Command as
|
|
27483
|
+
import { Command as Command145 } from "commander";
|
|
27442
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}$/;
|
|
27443
27485
|
var ADDRESS2 = /^0x[0-9a-fA-F]{40}$/;
|
|
27444
27486
|
var FILE_MAX_BYTES = 256 * 1024;
|
|
@@ -27532,7 +27574,7 @@ async function readValidTemplate(path9) {
|
|
|
27532
27574
|
}
|
|
27533
27575
|
return parsed.document;
|
|
27534
27576
|
}
|
|
27535
|
-
var createCommand3 = new
|
|
27577
|
+
var createCommand3 = new Command145("create").description(
|
|
27536
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"
|
|
27537
27579
|
).requiredOption("--file <path>", "The template, JSON").action(async (opts) => {
|
|
27538
27580
|
const template = await readValidTemplate(opts.file);
|
|
@@ -27543,7 +27585,7 @@ var createCommand3 = new Command146("create").description(
|
|
|
27543
27585
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27544
27586
|
);
|
|
27545
27587
|
});
|
|
27546
|
-
var updateCommand = new
|
|
27588
|
+
var updateCommand = new Command145("update").description(
|
|
27547
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"
|
|
27548
27590
|
).argument("<templateId>", "Template id").requiredOption("--file <path>", "The template, JSON").action(async (value, opts) => {
|
|
27549
27591
|
const choice = templateChoice(value);
|
|
@@ -27597,7 +27639,7 @@ function parseTemplateSearch(opts) {
|
|
|
27597
27639
|
}
|
|
27598
27640
|
return { query: query4 };
|
|
27599
27641
|
}
|
|
27600
|
-
var listCommand6 = new
|
|
27642
|
+
var listCommand6 = new Command145("list").description(
|
|
27601
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`"
|
|
27602
27644
|
).option("--owner <address>", "The wallet whose templates to list").option(
|
|
27603
27645
|
"--mine",
|
|
@@ -27682,7 +27724,7 @@ var listCommand6 = new Command146("list").description(
|
|
|
27682
27724
|
}
|
|
27683
27725
|
}
|
|
27684
27726
|
);
|
|
27685
|
-
var showCommand4 = new
|
|
27727
|
+
var showCommand4 = new Command145("show").description(
|
|
27686
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)"
|
|
27687
27729
|
).argument("<template>", "Template id, official template id or preset name").action(async (value) => {
|
|
27688
27730
|
const choice = templateChoice(value);
|
|
@@ -27705,7 +27747,7 @@ function savedTemplateId(value, verb) {
|
|
|
27705
27747
|
}
|
|
27706
27748
|
return choice.templateId;
|
|
27707
27749
|
}
|
|
27708
|
-
var publishCommand = new
|
|
27750
|
+
var publishCommand = new Command145("publish").description(
|
|
27709
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"
|
|
27710
27752
|
).argument("<templateId>", "Saved template id").action(async (value) => {
|
|
27711
27753
|
const id = savedTemplateId(value, "publish");
|
|
@@ -27716,7 +27758,7 @@ var publishCommand = new Command146("publish").description(
|
|
|
27716
27758
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27717
27759
|
);
|
|
27718
27760
|
});
|
|
27719
|
-
var unpublishCommand = new
|
|
27761
|
+
var unpublishCommand = new Command145("unpublish").description(
|
|
27720
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"
|
|
27721
27763
|
).argument("<templateId>", "Saved template id").action(async (value) => {
|
|
27722
27764
|
const id = savedTemplateId(value, "unpublish");
|
|
@@ -27727,7 +27769,7 @@ var unpublishCommand = new Command146("unpublish").description(
|
|
|
27727
27769
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27728
27770
|
);
|
|
27729
27771
|
});
|
|
27730
|
-
var deleteCommand2 = new
|
|
27772
|
+
var deleteCommand2 = new Command145("delete").description(
|
|
27731
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"
|
|
27732
27774
|
).argument("<templateId>", "Template id").action(async (value) => {
|
|
27733
27775
|
const choice = templateChoice(value);
|
|
@@ -27744,7 +27786,7 @@ var deleteCommand2 = new Command146("delete").description(
|
|
|
27744
27786
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27745
27787
|
);
|
|
27746
27788
|
});
|
|
27747
|
-
var workflowTemplateCommand = new
|
|
27789
|
+
var workflowTemplateCommand = new Command145("template").description(
|
|
27748
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"
|
|
27749
27791
|
).addCommand(createCommand3).addCommand(updateCommand).addCommand(listCommand6).addCommand(showCommand4).addCommand(publishCommand).addCommand(unpublishCommand).addCommand(deleteCommand2);
|
|
27750
27792
|
async function createWorkflowFromTemplate(projectId, template, pairs) {
|
|
@@ -27944,7 +27986,7 @@ async function read2(path9) {
|
|
|
27944
27986
|
}
|
|
27945
27987
|
}
|
|
27946
27988
|
var createCommand4 = addSuggestionScheduleOptions(
|
|
27947
|
-
new
|
|
27989
|
+
new Command146("create").description(
|
|
27948
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"
|
|
27949
27991
|
).argument("<projectId>", "Project id").requiredOption(
|
|
27950
27992
|
"--cadence <cadence>",
|
|
@@ -27993,7 +28035,7 @@ var createCommand4 = addSuggestionScheduleOptions(
|
|
|
27993
28035
|
});
|
|
27994
28036
|
});
|
|
27995
28037
|
var OWNER_SCHEDULE_STATUSES = [...STATUSES, "needs_action", "all"];
|
|
27996
|
-
var listCommand7 = new
|
|
28038
|
+
var listCommand7 = new Command146("list").description(
|
|
27997
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)"
|
|
27998
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(
|
|
27999
28041
|
"--status <status>",
|
|
@@ -28026,7 +28068,7 @@ var listCommand7 = new Command147("list").description(
|
|
|
28026
28068
|
const query4 = params.toString();
|
|
28027
28069
|
await read2(withChainId(`/api/projects/${projectId}/schedules${query4 ? `?${query4}` : ""}`));
|
|
28028
28070
|
});
|
|
28029
|
-
var showCommand5 = new
|
|
28071
|
+
var showCommand5 = new Command146("show").description(
|
|
28030
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)"
|
|
28031
28073
|
).argument("<scheduleId>", "Schedule id").action(async (value) => {
|
|
28032
28074
|
const id = parseScheduleId(value);
|
|
@@ -28034,7 +28076,7 @@ var showCommand5 = new Command147("show").description(
|
|
|
28034
28076
|
await read2(`/api/project-schedules/${id}`);
|
|
28035
28077
|
});
|
|
28036
28078
|
function actionCommand(action, description) {
|
|
28037
|
-
return new
|
|
28079
|
+
return new Command146(action).description(description).argument("<scheduleId>", "Schedule id").action(async (value) => {
|
|
28038
28080
|
const id = parseScheduleId(value);
|
|
28039
28081
|
if (typeof id !== "string") return void printError(id.error);
|
|
28040
28082
|
await postProjectWrite(
|
|
@@ -28044,7 +28086,7 @@ function actionCommand(action, description) {
|
|
|
28044
28086
|
);
|
|
28045
28087
|
});
|
|
28046
28088
|
}
|
|
28047
|
-
var settingsCommand = new
|
|
28089
|
+
var settingsCommand = new Command146("settings").description(
|
|
28048
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"
|
|
28049
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) => {
|
|
28050
28092
|
const projectId = parseProjectId(id);
|
|
@@ -28066,7 +28108,7 @@ var settingsCommand = new Command147("settings").description(
|
|
|
28066
28108
|
maxAmount: ACTION_FEE_MAX_AMOUNT
|
|
28067
28109
|
});
|
|
28068
28110
|
});
|
|
28069
|
-
var projectScheduleCommand = new
|
|
28111
|
+
var projectScheduleCommand = new Command146("schedule").description(
|
|
28070
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>`)"
|
|
28071
28113
|
).addCommand(createCommand4).addCommand(listCommand7).addCommand(showCommand5).addCommand(
|
|
28072
28114
|
actionCommand(
|
|
@@ -28089,15 +28131,15 @@ var projectScheduleCommand = new Command147("schedule").description(
|
|
|
28089
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)"
|
|
28090
28132
|
)
|
|
28091
28133
|
).addCommand(settingsCommand).addCommand(suggestionScheduleSettingsCommand);
|
|
28092
|
-
var projectRunnerCommand = new
|
|
28134
|
+
var projectRunnerCommand = new Command146("runner").description(
|
|
28093
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"
|
|
28094
28136
|
).action(async () => {
|
|
28095
28137
|
await read2(withChainId("/api/project-runner"));
|
|
28096
28138
|
});
|
|
28097
28139
|
|
|
28098
28140
|
// src/commands/project/transfer.ts
|
|
28099
|
-
import { Command as
|
|
28100
|
-
var proposeCommand = new
|
|
28141
|
+
import { Command as Command147 } from "commander";
|
|
28142
|
+
var proposeCommand = new Command147("propose").description(
|
|
28101
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"
|
|
28102
28144
|
).argument("<projectId>", "Project id").requiredOption("--to <address>", "The wallet that will own the project once it accepts").action(async (id, opts) => {
|
|
28103
28145
|
const projectId = parseProjectId(id);
|
|
@@ -28111,7 +28153,7 @@ var proposeCommand = new Command148("propose").description(
|
|
|
28111
28153
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28112
28154
|
);
|
|
28113
28155
|
});
|
|
28114
|
-
var acceptCommand2 = new
|
|
28156
|
+
var acceptCommand2 = new Command147("accept").description(
|
|
28115
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"
|
|
28116
28158
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
28117
28159
|
const projectId = parseProjectId(id);
|
|
@@ -28122,7 +28164,7 @@ var acceptCommand2 = new Command148("accept").description(
|
|
|
28122
28164
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28123
28165
|
);
|
|
28124
28166
|
});
|
|
28125
|
-
var cancelCommand = new
|
|
28167
|
+
var cancelCommand = new Command147("cancel").description(
|
|
28126
28168
|
"Withdraw the pending ownership proposal, as the project owner (costs 0.001 in the payment token)"
|
|
28127
28169
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
28128
28170
|
const projectId = parseProjectId(id);
|
|
@@ -28133,13 +28175,13 @@ var cancelCommand = new Command148("cancel").description(
|
|
|
28133
28175
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28134
28176
|
);
|
|
28135
28177
|
});
|
|
28136
|
-
var projectTransferCommand = new
|
|
28178
|
+
var projectTransferCommand = new Command147("transfer").description(
|
|
28137
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"
|
|
28138
28180
|
).addCommand(proposeCommand).addCommand(acceptCommand2).addCommand(cancelCommand);
|
|
28139
28181
|
|
|
28140
28182
|
// src/commands/project/show.ts
|
|
28141
|
-
import { Command as
|
|
28142
|
-
var projectShowCommand = new
|
|
28183
|
+
import { Command as Command148 } from "commander";
|
|
28184
|
+
var projectShowCommand = new Command148("show").description(
|
|
28143
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)"
|
|
28144
28186
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
28145
28187
|
const projectId = parseProjectId(id);
|
|
@@ -28148,7 +28190,7 @@ var projectShowCommand = new Command149("show").description(
|
|
|
28148
28190
|
printResult(await apiGet(withChainId(`/api/projects/${projectId}`), { headers }));
|
|
28149
28191
|
});
|
|
28150
28192
|
var BACKERS_CURSOR = /^\d{1,20}-\d{1,9}$/;
|
|
28151
|
-
var projectBackersCommand = new
|
|
28193
|
+
var projectBackersCommand = new Command148("backers").description(
|
|
28152
28194
|
"List a project's backers, newest first, with each one's contribution, shares, claims and claimable share (free)"
|
|
28153
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) => {
|
|
28154
28196
|
const projectId = parseProjectId(id);
|
|
@@ -28167,13 +28209,13 @@ var projectBackersCommand = new Command149("backers").description(
|
|
|
28167
28209
|
await apiGet(withChainId(`/api/projects/${projectId}/backers${query4 ? `?${query4}` : ""}`))
|
|
28168
28210
|
);
|
|
28169
28211
|
});
|
|
28170
|
-
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) => {
|
|
28171
28213
|
if (!/^0x[0-9a-fA-F]{1,78}$/.test(taskId.trim())) {
|
|
28172
28214
|
return void printError("The task id must be 0x-prefixed hex");
|
|
28173
28215
|
}
|
|
28174
28216
|
printResult(await apiGet(`/api/projects/by-task/${encodeURIComponent(taskId.trim())}`));
|
|
28175
28217
|
});
|
|
28176
|
-
var projectListCommand = new
|
|
28218
|
+
var projectListCommand = new Command148("list").description(
|
|
28177
28219
|
"List a wallet's projects, as owner, operator or backer, or with --funding the projects open for backing now (free; default: your wallet)"
|
|
28178
28220
|
).option(
|
|
28179
28221
|
"--funding",
|
|
@@ -28224,7 +28266,7 @@ var projectListCommand = new Command149("list").description(
|
|
|
28224
28266
|
);
|
|
28225
28267
|
|
|
28226
28268
|
// src/commands/project/index.ts
|
|
28227
|
-
var projectCommand = new
|
|
28269
|
+
var projectCommand = new Command149("project").description(
|
|
28228
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"
|
|
28229
28271
|
);
|
|
28230
28272
|
projectCommand.addCommand(projectCreateCommand);
|
|
@@ -28255,7 +28297,7 @@ projectCommand.addCommand(projectForTaskCommand);
|
|
|
28255
28297
|
|
|
28256
28298
|
// src/commands/workflow.ts
|
|
28257
28299
|
import { readFile as readFile5 } from "fs/promises";
|
|
28258
|
-
import { Command as
|
|
28300
|
+
import { Command as Command150 } from "commander";
|
|
28259
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}$/;
|
|
28260
28302
|
var FILE_MAX_BYTES2 = 256 * 1024;
|
|
28261
28303
|
function parseWorkflowText(text) {
|
|
@@ -28319,7 +28361,7 @@ async function projectContext(projectId) {
|
|
|
28319
28361
|
runner
|
|
28320
28362
|
};
|
|
28321
28363
|
}
|
|
28322
|
-
var validateCommand = new
|
|
28364
|
+
var validateCommand = new Command150("validate").description(
|
|
28323
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)"
|
|
28324
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) => {
|
|
28325
28367
|
const parsed = await readDocument(opts.file ?? file);
|
|
@@ -28362,7 +28404,7 @@ var validateCommand = new Command151("validate").description(
|
|
|
28362
28404
|
document: result.document
|
|
28363
28405
|
});
|
|
28364
28406
|
});
|
|
28365
|
-
var createCommand5 = new
|
|
28407
|
+
var createCommand5 = new Command150("create").description(
|
|
28366
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"
|
|
28367
28409
|
).argument("<projectId>", "Project id").option("--file <path>", "The document, JSON").option(
|
|
28368
28410
|
"--template <template>",
|
|
@@ -28405,7 +28447,7 @@ var createCommand5 = new Command151("create").description(
|
|
|
28405
28447
|
);
|
|
28406
28448
|
});
|
|
28407
28449
|
var OWNER_WORKFLOW_STATUSES = ["needs_action", "running", "failed", "idle", "all"];
|
|
28408
|
-
var listCommand8 = new
|
|
28450
|
+
var listCommand8 = new Command150("list").description(
|
|
28409
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)"
|
|
28410
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(
|
|
28411
28453
|
"--status <status>",
|
|
@@ -28435,7 +28477,7 @@ var listCommand8 = new Command151("list").description(
|
|
|
28435
28477
|
const query4 = params.toString();
|
|
28436
28478
|
await read3(withChainId(`/api/projects/${projectId}/workflows${query4 ? `?${query4}` : ""}`));
|
|
28437
28479
|
});
|
|
28438
|
-
var showCommand6 = new
|
|
28480
|
+
var showCommand6 = new Command150("show").description(
|
|
28439
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)"
|
|
28440
28482
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
28441
28483
|
const id = uuid(value, "workflow");
|
|
@@ -28448,7 +28490,7 @@ var showCommand6 = new Command151("show").description(
|
|
|
28448
28490
|
renderFailure(err);
|
|
28449
28491
|
}
|
|
28450
28492
|
});
|
|
28451
|
-
var updateTemplateCommand = new
|
|
28493
|
+
var updateTemplateCommand = new Command150("update-template").description(
|
|
28452
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"
|
|
28453
28495
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
28454
28496
|
const id = uuid(value, "workflow");
|
|
@@ -28459,7 +28501,7 @@ var updateTemplateCommand = new Command151("update-template").description(
|
|
|
28459
28501
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28460
28502
|
);
|
|
28461
28503
|
});
|
|
28462
|
-
var updateStepsCommand = new
|
|
28504
|
+
var updateStepsCommand = new Command150("update-steps").description(
|
|
28463
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"
|
|
28464
28506
|
).argument("<workflowId>", "Workflow id").option("--file <path>", "The new document, JSON").action(async (value, opts) => {
|
|
28465
28507
|
const id = uuid(value, "workflow");
|
|
@@ -28481,7 +28523,7 @@ var updateStepsCommand = new Command151("update-steps").description(
|
|
|
28481
28523
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28482
28524
|
);
|
|
28483
28525
|
});
|
|
28484
|
-
var runsCommand = new
|
|
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) => {
|
|
28485
28527
|
const id = uuid(value, "workflow");
|
|
28486
28528
|
if (typeof id !== "string") return void printError(id.error);
|
|
28487
28529
|
if (opts.limit !== void 0 && !/^(100|[1-9][0-9]?)$/.test(opts.limit.trim())) {
|
|
@@ -28493,14 +28535,14 @@ var runsCommand = new Command151("runs").description("Page through a workflow's
|
|
|
28493
28535
|
const query4 = params.toString();
|
|
28494
28536
|
await read3(`/api/project-workflows/${id}/runs${query4 ? `?${query4}` : ""}`);
|
|
28495
28537
|
});
|
|
28496
|
-
var statusCommand3 = new
|
|
28538
|
+
var statusCommand3 = new Command150("status").description(
|
|
28497
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)"
|
|
28498
28540
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
28499
28541
|
const id = uuid(value, "run");
|
|
28500
28542
|
if (typeof id !== "string") return void printError(id.error);
|
|
28501
28543
|
await read3(`/api/project-workflow-runs/${id}`);
|
|
28502
28544
|
});
|
|
28503
|
-
var runCommand2 = new
|
|
28545
|
+
var runCommand2 = new Command150("run").description(
|
|
28504
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"
|
|
28505
28547
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
28506
28548
|
const id = uuid(value, "workflow");
|
|
@@ -28512,7 +28554,7 @@ var runCommand2 = new Command151("run").description(
|
|
|
28512
28554
|
);
|
|
28513
28555
|
});
|
|
28514
28556
|
function stepCommand(action, description) {
|
|
28515
|
-
return new
|
|
28557
|
+
return new Command150(action).description(description).argument("<runId>", "Run id").requiredOption(
|
|
28516
28558
|
"--step <key>",
|
|
28517
28559
|
"The step key the run shows, e.g. gate-1, review[round=2] or post[attempt=2]"
|
|
28518
28560
|
).action(async (value, opts) => {
|
|
@@ -28527,7 +28569,7 @@ function stepCommand(action, description) {
|
|
|
28527
28569
|
);
|
|
28528
28570
|
});
|
|
28529
28571
|
}
|
|
28530
|
-
var cancelCommand2 = new
|
|
28572
|
+
var cancelCommand2 = new Command150("cancel").description(
|
|
28531
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"
|
|
28532
28574
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
28533
28575
|
const id = uuid(value, "run");
|
|
@@ -28538,7 +28580,7 @@ var cancelCommand2 = new Command151("cancel").description(
|
|
|
28538
28580
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28539
28581
|
);
|
|
28540
28582
|
});
|
|
28541
|
-
var stopAutoPayoutCommand = new
|
|
28583
|
+
var stopAutoPayoutCommand = new Command150("stop-auto-payout").description(
|
|
28542
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"
|
|
28543
28585
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
28544
28586
|
const id = uuid(value, "run");
|
|
@@ -28549,7 +28591,7 @@ var stopAutoPayoutCommand = new Command151("stop-auto-payout").description(
|
|
|
28549
28591
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28550
28592
|
);
|
|
28551
28593
|
});
|
|
28552
|
-
var deleteCommand3 = new
|
|
28594
|
+
var deleteCommand3 = new Command150("delete").description(
|
|
28553
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"
|
|
28554
28596
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
28555
28597
|
const id = uuid(value, "workflow");
|
|
@@ -28571,21 +28613,21 @@ async function ownerRead(path9) {
|
|
|
28571
28613
|
renderFailure(err);
|
|
28572
28614
|
}
|
|
28573
28615
|
}
|
|
28574
|
-
var payoutListCommand = new
|
|
28616
|
+
var payoutListCommand = new Command150("list").description(
|
|
28575
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"
|
|
28576
28618
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
28577
28619
|
const id = uuid(value, "run");
|
|
28578
28620
|
if (typeof id !== "string") return void printError(id.error);
|
|
28579
28621
|
await ownerRead(withChainId(`/api/project-workflow-runs/${id}/payouts`));
|
|
28580
28622
|
});
|
|
28581
|
-
var payoutShowCommand = new
|
|
28623
|
+
var payoutShowCommand = new Command150("show").description(
|
|
28582
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)'
|
|
28583
28625
|
).argument("<proposalId>", "Payout proposal id").action(async (value) => {
|
|
28584
28626
|
const id = uuid(value, "payout proposal");
|
|
28585
28627
|
if (typeof id !== "string") return void printError(id.error);
|
|
28586
28628
|
await ownerRead(withChainId(`/api/project-workflow-payouts/${id}`));
|
|
28587
28629
|
});
|
|
28588
|
-
var payoutConfirmCommand = new
|
|
28630
|
+
var payoutConfirmCommand = new Command150("confirm").description(
|
|
28589
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'
|
|
28590
28632
|
).argument("<proposalId>", "Payout proposal id").action(async (value) => {
|
|
28591
28633
|
const id = uuid(value, "payout proposal");
|
|
@@ -28612,7 +28654,7 @@ var payoutConfirmCommand = new Command151("confirm").description(
|
|
|
28612
28654
|
}
|
|
28613
28655
|
);
|
|
28614
28656
|
});
|
|
28615
|
-
var payoutObjectCommand = new
|
|
28657
|
+
var payoutObjectCommand = new Command150("object").description(
|
|
28616
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`
|
|
28617
28659
|
).argument("<proposalId>", "Payout proposal id").requiredOption("--reason <text>", "Why you object, shown to the owner").action(async (value, opts) => {
|
|
28618
28660
|
const id = uuid(value, "payout proposal");
|
|
@@ -28636,10 +28678,10 @@ var payoutObjectCommand = new Command151("object").description(
|
|
|
28636
28678
|
renderFailure(err);
|
|
28637
28679
|
}
|
|
28638
28680
|
});
|
|
28639
|
-
var payoutCommand = new
|
|
28681
|
+
var payoutCommand = new Command150("payout").description(
|
|
28640
28682
|
"Payout proposals: a gating review's recommended winners and shares for the task it gates, which the owner confirms"
|
|
28641
28683
|
).addCommand(payoutListCommand).addCommand(payoutShowCommand).addCommand(payoutConfirmCommand).addCommand(payoutObjectCommand);
|
|
28642
|
-
var settingsCommand2 = new
|
|
28684
|
+
var settingsCommand2 = new Command150("settings").description(
|
|
28643
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`
|
|
28644
28686
|
).argument("<projectId>", "Project id").option("--step-limit <count>", "The most task steps per workflow").action(async (id, opts) => {
|
|
28645
28687
|
const projectId = parseProjectId(id);
|
|
@@ -28670,7 +28712,7 @@ var settingsCommand2 = new Command151("settings").description(
|
|
|
28670
28712
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
28671
28713
|
);
|
|
28672
28714
|
});
|
|
28673
|
-
var workflowCommand = new
|
|
28715
|
+
var workflowCommand = new Command150("workflow").description(
|
|
28674
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"
|
|
28675
28717
|
).addCommand(validateCommand).addCommand(createCommand5).addCommand(listCommand8).addCommand(showCommand6).addCommand(runsCommand).addCommand(runCommand2).addCommand(statusCommand3).addCommand(
|
|
28676
28718
|
stepCommand(
|
|
@@ -28685,8 +28727,8 @@ var workflowCommand = new Command151("workflow").description(
|
|
|
28685
28727
|
).addCommand(cancelCommand2).addCommand(stopAutoPayoutCommand).addCommand(updateTemplateCommand).addCommand(updateStepsCommand).addCommand(deleteCommand3).addCommand(settingsCommand2).addCommand(payoutCommand).addCommand(workflowTemplateCommand);
|
|
28686
28728
|
|
|
28687
28729
|
// src/commands/drops.ts
|
|
28688
|
-
import { Command as
|
|
28689
|
-
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(
|
|
28690
28732
|
async (opts) => {
|
|
28691
28733
|
try {
|
|
28692
28734
|
if (opts.worker && opts.entered) throw new Error("Pass --worker or --entered, not both");
|
|
@@ -28714,7 +28756,7 @@ var listCommand9 = new Command152("list").description("List public Task Drops, o
|
|
|
28714
28756
|
}
|
|
28715
28757
|
}
|
|
28716
28758
|
);
|
|
28717
|
-
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) => {
|
|
28718
28760
|
try {
|
|
28719
28761
|
const input = parseInput(TaskDropGetInputSchema, { taskDropId });
|
|
28720
28762
|
const result = await apiGet(`/api/task-drops/${encodeURIComponent(input.taskDropId)}`);
|
|
@@ -28726,7 +28768,7 @@ var showCommand7 = new Command152("show").description("Show a Task Drop and its
|
|
|
28726
28768
|
renderFailure(err);
|
|
28727
28769
|
}
|
|
28728
28770
|
});
|
|
28729
|
-
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(
|
|
28730
28772
|
async (taskDropId, opts) => {
|
|
28731
28773
|
try {
|
|
28732
28774
|
if (opts.official) {
|
|
@@ -28754,7 +28796,7 @@ var subscribeCommand = new Command152("subscribe").description("Subscribe an ema
|
|
|
28754
28796
|
}
|
|
28755
28797
|
}
|
|
28756
28798
|
);
|
|
28757
|
-
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) => {
|
|
28758
28800
|
try {
|
|
28759
28801
|
if (opts.official) {
|
|
28760
28802
|
if (taskDropId) throw new Error("Pass either a Task Drop ID or --official, not both");
|
|
@@ -28771,15 +28813,15 @@ var statusCommand4 = new Command152("status").description("Check whether an emai
|
|
|
28771
28813
|
renderFailure(err);
|
|
28772
28814
|
}
|
|
28773
28815
|
});
|
|
28774
|
-
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);
|
|
28775
28817
|
|
|
28776
28818
|
// src/commands/hooks.ts
|
|
28777
|
-
import { Command as
|
|
28819
|
+
import { Command as Command153 } from "commander";
|
|
28778
28820
|
import { BaseError, ContractFunctionRevertedError, ContractFunctionZeroDataError } from "viem";
|
|
28779
28821
|
|
|
28780
28822
|
// src/lib/listing-submissions.ts
|
|
28781
28823
|
import { readFile as readFile6 } from "fs/promises";
|
|
28782
|
-
import { Command as
|
|
28824
|
+
import { Command as Command152 } from "commander";
|
|
28783
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.";
|
|
28784
28826
|
function prepareListingFile(kind, text) {
|
|
28785
28827
|
if (Buffer.byteLength(text, "utf8") > LISTING_SUBMISSION_MAX_BYTES) {
|
|
@@ -28836,7 +28878,7 @@ function prepareListingFile(kind, text) {
|
|
|
28836
28878
|
}
|
|
28837
28879
|
function submitCommandFor(kind) {
|
|
28838
28880
|
const what = kind === "catalog" ? "catalog entry (kind x402-endpoint)" : "hook manifest";
|
|
28839
|
-
return new
|
|
28881
|
+
return new Command152("submit").description(
|
|
28840
28882
|
`Submit a ${what} for staff review. Pays the standard action fee, kept either way; needs an ERC-8004 identity on the selected network`
|
|
28841
28883
|
).requiredOption("--file <path>", `Path to the ${what} JSON file`).action(async (opts) => {
|
|
28842
28884
|
let text;
|
|
@@ -28868,7 +28910,7 @@ function submitCommandFor(kind) {
|
|
|
28868
28910
|
});
|
|
28869
28911
|
}
|
|
28870
28912
|
function submissionsCommandFor(kind) {
|
|
28871
|
-
return new
|
|
28913
|
+
return new Command152("submissions").description(
|
|
28872
28914
|
`List the ${kind === "catalog" ? "catalog entries" : "hook listings"} you submitted and their status`
|
|
28873
28915
|
).option("--status <status>", `Only this status: ${LISTING_SUBMISSION_STATUSES.join(", ")}`).option("--limit <n>", "Maximum submissions to return (1-100)", "50").action(async (opts) => {
|
|
28874
28916
|
if (opts.status && !LISTING_SUBMISSION_STATUSES.includes(opts.status)) {
|
|
@@ -28934,7 +28976,7 @@ async function probeHookVersion(entry, chainId) {
|
|
|
28934
28976
|
return reverted ? { ...entry, hookVersion: 1 } : entry;
|
|
28935
28977
|
}
|
|
28936
28978
|
}
|
|
28937
|
-
var listCommand10 = new
|
|
28979
|
+
var listCommand10 = new Command153("list").description(
|
|
28938
28980
|
"List hooks listed (verified) in the hook registry on the selected --network, then observed hooks that are not listed"
|
|
28939
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(
|
|
28940
28982
|
"--cursor <cursor>",
|
|
@@ -28973,7 +29015,7 @@ var listCommand10 = new Command154("list").description(
|
|
|
28973
29015
|
}
|
|
28974
29016
|
}
|
|
28975
29017
|
);
|
|
28976
|
-
var showCommand8 = new
|
|
29018
|
+
var showCommand8 = new Command153("show").description(
|
|
28977
29019
|
"Show one hook on the selected --network: its registry listing, or its onchain observation marked unlisted"
|
|
28978
29020
|
).argument("<address>", "Hook contract address").action(async (address3) => {
|
|
28979
29021
|
try {
|
|
@@ -28993,7 +29035,7 @@ var showCommand8 = new Command154("show").description(
|
|
|
28993
29035
|
renderFailure(err);
|
|
28994
29036
|
}
|
|
28995
29037
|
});
|
|
28996
|
-
var encodeConfigCommand = new
|
|
29038
|
+
var encodeConfigCommand = new Command153("encode-config").description(
|
|
28997
29039
|
"Encode a V2 hook's typed configuration from its registry config schema, for --hook-config"
|
|
28998
29040
|
).argument("<address>", "Hook contract address").requiredOption(
|
|
28999
29041
|
"--values <json>",
|
|
@@ -29022,7 +29064,7 @@ var encodeConfigCommand = new Command154("encode-config").description(
|
|
|
29022
29064
|
renderFailure(err);
|
|
29023
29065
|
}
|
|
29024
29066
|
});
|
|
29025
|
-
var attachmentConfigCommand = new
|
|
29067
|
+
var attachmentConfigCommand = new Command153("attachment-config").description(
|
|
29026
29068
|
"Show the protocol-default hook order and maximum hooks per task on the selected --network"
|
|
29027
29069
|
).action(async () => {
|
|
29028
29070
|
try {
|
|
@@ -29031,16 +29073,16 @@ var attachmentConfigCommand = new Command154("attachment-config").description(
|
|
|
29031
29073
|
renderFailure(err);
|
|
29032
29074
|
}
|
|
29033
29075
|
});
|
|
29034
|
-
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"));
|
|
29035
29077
|
|
|
29036
29078
|
// src/commands/catalog/index.ts
|
|
29037
|
-
import { Command as
|
|
29038
|
-
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"));
|
|
29039
29081
|
|
|
29040
29082
|
// src/commands/tap.ts
|
|
29041
29083
|
import { promises as fs12 } from "fs";
|
|
29042
|
-
import { Command as
|
|
29043
|
-
var tapCommand = new
|
|
29084
|
+
import { Command as Command155 } from "commander";
|
|
29085
|
+
var tapCommand = new Command155("tap").description(
|
|
29044
29086
|
"Manage the TAP signing key used on tasks that require TAP verification"
|
|
29045
29087
|
);
|
|
29046
29088
|
tapCommand.command("import").description(
|
|
@@ -29199,7 +29241,7 @@ tapCommand.command("remove").description("Remove the TAP key from the keystore")
|
|
|
29199
29241
|
});
|
|
29200
29242
|
|
|
29201
29243
|
// src/commands/hire.ts
|
|
29202
|
-
import { Command as
|
|
29244
|
+
import { Command as Command156 } from "commander";
|
|
29203
29245
|
var OWN_FLAGS = /* @__PURE__ */ new Set(["--mode", "--hire-worker", "--service-id"]);
|
|
29204
29246
|
async function lookupListedService(worker, serviceId) {
|
|
29205
29247
|
let listing;
|
|
@@ -29231,7 +29273,7 @@ function hireEvaluatorError(opts, requiresEvaluator) {
|
|
|
29231
29273
|
}
|
|
29232
29274
|
return null;
|
|
29233
29275
|
}
|
|
29234
|
-
var hireCommand = new
|
|
29276
|
+
var hireCommand = new Command156("hire").description(
|
|
29235
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."
|
|
29236
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(
|
|
29237
29279
|
"--requires-evaluator",
|
|
@@ -29294,7 +29336,7 @@ hireCommand.action(async (worker, opts) => {
|
|
|
29294
29336
|
// src/index.ts
|
|
29295
29337
|
var require2 = createRequire(import.meta.url);
|
|
29296
29338
|
var { version } = require2("../package.json");
|
|
29297
|
-
var program = new
|
|
29339
|
+
var program = new Command157();
|
|
29298
29340
|
setLastErrorCliVersion(version);
|
|
29299
29341
|
program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
|
|
29300
29342
|
program.option(
|