@lucid-agents/taskmarket 1.42.0 → 1.44.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/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  listWorkerSubmissions,
15
15
  submitTaskFiles,
16
16
  taskRequirementsOf
17
- } from "./chunk-I7OL2FMA.js";
17
+ } from "./chunk-LETSESYQ.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-UXZ5ZDBF.js";
40
+ } from "./chunk-ZPQLJAG4.js";
41
41
  import {
42
42
  signReadAuth
43
- } from "./chunk-ASZ3YR77.js";
43
+ } from "./chunk-CH3GXKIO.js";
44
44
  import {
45
45
  saveTaskAccessGrant,
46
46
  taskAccessGrantHeaders
47
- } from "./chunk-L67V45XI.js";
47
+ } from "./chunk-NLHDU4CH.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-5IOQEQH3.js";
65
+ } from "./chunk-FUHULPDT.js";
66
66
  import {
67
67
  ALL_NETWORKS,
68
68
  ApiError,
@@ -71,6 +71,7 @@ import {
71
71
  NETWORK_NAMES,
72
72
  NetworkRequiredError,
73
73
  TAP_ALGORITHMS,
74
+ TAP_CREATE_ALGORITHMS,
74
75
  allNetworksSelected,
75
76
  apiDelete,
76
77
  apiGet,
@@ -125,7 +126,7 @@ import {
125
126
  withErrorContext,
126
127
  withIdempotentWrite,
127
128
  withTapSignature
128
- } from "./chunk-3FI5KV44.js";
129
+ } from "./chunk-AZMCG2LI.js";
129
130
  import {
130
131
  AGENT_AVATAR_MAX_BYTES,
131
132
  AGENT_HIRES_ROLES,
@@ -323,7 +324,6 @@ import {
323
324
  formatPaymentAmount,
324
325
  formatTaskChecksErrors,
325
326
  formatUsdcBaseUnits,
326
- getAgentName,
327
327
  getTaskmarketHome,
328
328
  hiddenChecksResult,
329
329
  hireAcceptAtCapacity,
@@ -368,7 +368,9 @@ import {
368
368
  splitUserSkill,
369
369
  sponsoredVaultRelayKind,
370
370
  svmChain,
371
- taskChecksPassed,
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-JOVLOWPY.js";
388
+ } from "./chunk-IVCJPX7J.js";
387
389
  import "./chunk-S7SJMJ2I.js";
388
390
 
389
391
  // src/index.ts
390
- import { Command as Command158 } from "commander";
392
+ import { Command as Command157 } from "commander";
391
393
  import { createRequire } from "module";
392
394
 
393
395
  // src/commands/init.ts
@@ -7410,9 +7412,9 @@ function explainEnrolFailure(error, chainId) {
7410
7412
  return error;
7411
7413
  }
7412
7414
  async function enrolTapKey(stored, chainId) {
7413
- if (stored.alg !== "ed25519") {
7415
+ if (stored.alg !== "ed25519" && stored.alg !== "ecdsa-p256-sha256") {
7414
7416
  throw new Error(
7415
- `Only an ed25519 TAP key can be enrolled with the simulated directory, not ${stored.alg}.`
7417
+ `Only an ed25519 or ECDSA P-256 TAP key can be enrolled with the simulated directory, not ${stored.alg}.`
7416
7418
  );
7417
7419
  }
7418
7420
  const auth = await signReadAuth();
@@ -7464,33 +7466,22 @@ async function readTapKeyStatus(stored, chainId) {
7464
7466
  }
7465
7467
 
7466
7468
  // src/commands/init.ts
7467
- function sanitizeEmailUsername(agentId, suffix) {
7468
- const maxBase = 30 - 1 - suffix.length;
7469
- if (maxBase < 2) return null;
7470
- const base = agentId.toLowerCase().replace(/[^a-z0-9]/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "").slice(0, maxBase).replace(/-+$/, "");
7471
- if (base.length < 2) return null;
7472
- const candidate = `${base}-${suffix}`;
7473
- return /^[a-z0-9][a-z0-9-]{1,28}[a-z0-9]$/.test(candidate) ? candidate : null;
7474
- }
7475
- async function tryRegisterEmail(deviceId, apiToken, username, explicit, warnings) {
7469
+ async function tryRegisterEmail(deviceId, apiToken, warnings) {
7476
7470
  try {
7477
7471
  const { data: reg } = await apiPost("/api/emails/register", {
7478
7472
  deviceId,
7479
- apiToken,
7480
- username
7473
+ apiToken
7481
7474
  });
7482
7475
  return reg.emailAddress;
7483
7476
  } catch (err) {
7484
- if (explicit) {
7485
- const msg = err instanceof Error ? err.message : String(err);
7486
- warnings.push(
7487
- cliWarning(
7488
- "email_registration_failed",
7489
- `Email registration failed: ${msg}. Run: taskmarket email register --username ${username}`,
7490
- { username, retryCommand: `taskmarket email register --username ${username}` }
7491
- )
7492
- );
7493
- }
7477
+ const msg = err instanceof Error ? err.message : String(err);
7478
+ warnings.push(
7479
+ cliWarning(
7480
+ "email_registration_failed",
7481
+ `Email registration failed: ${msg}. Run: taskmarket email register`,
7482
+ { retryCommand: "taskmarket email register" }
7483
+ )
7484
+ );
7494
7485
  return null;
7495
7486
  }
7496
7487
  }
@@ -7580,9 +7571,6 @@ async function addTapKey() {
7580
7571
  }
7581
7572
  var initCommand = new Command2("init").description(
7582
7573
  "Create and register this machine's agent wallet (one-time; refuses when a wallet exists)"
7583
- ).option(
7584
- "--email <username>",
7585
- "Claim a custom email username (default: auto-generated from agent ID)"
7586
7574
  ).option(
7587
7575
  "--yes",
7588
7576
  "Confirm legal acceptance non-interactively after reviewing every current policy"
@@ -7591,7 +7579,7 @@ var initCommand = new Command2("init").description(
7591
7579
  "On a machine that already has a wallet, add its Solana wallet (new wallets get one anyway)"
7592
7580
  ).option(
7593
7581
  "--tap",
7594
- "Also create a TAP signing key (ed25519) and enrol it with the simulated directory where the network's chain uses it; on a machine that already has a wallet, add one. Off unless given."
7582
+ "Also create a TAP signing key (ECDSA P-256) and enrol it with the simulated directory where the network's chain uses it; on a machine that already has a wallet, add one. Off unless given."
7595
7583
  ).action(async (opts) => {
7596
7584
  if ((opts.solana || opts.tap) && await keystoreExists()) {
7597
7585
  if (opts.solana && opts.tap) {
@@ -7606,15 +7594,6 @@ var initCommand = new Command2("init").description(
7606
7594
  return;
7607
7595
  }
7608
7596
  await ensureInitNetwork();
7609
- if (opts.email) {
7610
- const check = await apiGet(
7611
- `/api/emails/check-username?username=${encodeURIComponent(opts.email)}`
7612
- );
7613
- if (!check.available) {
7614
- printError(`Email username "${opts.email}" is not available.`);
7615
- return;
7616
- }
7617
- }
7618
7597
  const { privateKey, address: address3 } = generateKeypair();
7619
7598
  const solanaWallet = await generateSolanaKeypair();
7620
7599
  const publicKey = deriveCompressedPublicKey(privateKey);
@@ -7685,9 +7664,8 @@ var initCommand = new Command2("init").description(
7685
7664
  networkInfo = response.result.data;
7686
7665
  } catch {
7687
7666
  }
7688
- const username = opts.email ?? (agentId && networkInfo ? sanitizeEmailUsername(agentId, String(selectedNetwork().chainId)) : null);
7689
7667
  const warnings = [];
7690
- const emailAddress = username ? await tryRegisterEmail(deviceId, apiToken, username, !!opts.email, warnings) : null;
7668
+ const emailAddress = await tryRegisterEmail(deviceId, apiToken, warnings);
7691
7669
  let chain;
7692
7670
  try {
7693
7671
  chain = chainInfoFor(networkInfo, selectedNetwork().chainId);
@@ -8369,7 +8347,8 @@ var addressCommand2 = new Command7("address").description("One wallet on the sel
8369
8347
  chainId: selectedNetwork().chainId,
8370
8348
  address: wanted,
8371
8349
  windowDays,
8372
- name: node?.agentId ? getAgentName(node.agentId) : null,
8350
+ // ADR-0541: the name Taskmarket stores for the wallet, never computed here.
8351
+ displayName: node?.displayName ?? null,
8373
8352
  node,
8374
8353
  events: page.items
8375
8354
  });
@@ -8451,7 +8430,7 @@ var searchCommand = new Command8("search").description(
8451
8430
  });
8452
8431
 
8453
8432
  // src/commands/task/index.ts
8454
- import { Command as Command56 } from "commander";
8433
+ import { Command as Command55 } from "commander";
8455
8434
 
8456
8435
  // src/commands/task/review.ts
8457
8436
  import { readFile, stat } from "fs/promises";
@@ -11119,6 +11098,264 @@ async function confirmUnverifiedHooks(action, taskId, accepted, task) {
11119
11098
  return false;
11120
11099
  }
11121
11100
 
11101
+ // src/lib/task-checks-run.ts
11102
+ import { spawnSync } from "child_process";
11103
+ import {
11104
+ cpSync,
11105
+ existsSync,
11106
+ mkdtempSync,
11107
+ readdirSync,
11108
+ readFileSync,
11109
+ rmSync,
11110
+ statSync
11111
+ } from "fs";
11112
+ import { tmpdir } from "os";
11113
+ import { basename, join, resolve } from "path";
11114
+ var OUTPUT_TAIL = 300;
11115
+ var MAX_BUFFER = 8 * 1024 * 1024;
11116
+ function tail(text) {
11117
+ const t = (text ?? "").trim();
11118
+ return t.length > OUTPUT_TAIL ? "..." + t.slice(-OUTPUT_TAIL) : t;
11119
+ }
11120
+ function patchApplies(dir, patch) {
11121
+ const run2 = spawnSync("git", ["apply", "--check", resolve(patch)], {
11122
+ cwd: dir,
11123
+ encoding: "utf8",
11124
+ maxBuffer: MAX_BUFFER
11125
+ });
11126
+ if (run2.error) return { applied: false, detail: `git could not run: ${run2.error.message}` };
11127
+ return run2.status === 0 ? { applied: true, detail: "the patch applies cleanly" } : { applied: false, detail: tail(run2.stderr) || `git apply --check exited ${run2.status}` };
11128
+ }
11129
+ function runCommandCheck(check, cwd, env = process.env) {
11130
+ const [cmd, ...args] = check.cmd;
11131
+ const run2 = spawnSync(cmd, args, {
11132
+ cwd,
11133
+ env,
11134
+ encoding: "utf8",
11135
+ timeout: check.timeoutS * 1e3,
11136
+ killSignal: "SIGKILL",
11137
+ maxBuffer: MAX_BUFFER
11138
+ });
11139
+ if (run2.error) {
11140
+ const code = run2.error.code;
11141
+ if (code === "ETIMEDOUT") {
11142
+ return { passed: false, detail: `timed out after ${check.timeoutS}s` };
11143
+ }
11144
+ return { passed: false, detail: `could not run: ${run2.error.message}` };
11145
+ }
11146
+ if (run2.status === 0) return { passed: true, detail: "exit 0" };
11147
+ const out = tail(run2.stderr) || tail(run2.stdout);
11148
+ return {
11149
+ passed: false,
11150
+ detail: `exit ${run2.status ?? run2.signal}${out ? `: ${out}` : ""}`
11151
+ };
11152
+ }
11153
+ function commandChecks(spec) {
11154
+ return spec.checks.filter(
11155
+ (c) => c.kind === "command"
11156
+ );
11157
+ }
11158
+ function runCliChecks(spec, engineResults, target, options) {
11159
+ const byId = /* @__PURE__ */ new Map();
11160
+ let work = null;
11161
+ let patchOk = null;
11162
+ try {
11163
+ const needsWork = options.yes && commandChecks(spec).length > 0;
11164
+ if (needsWork) {
11165
+ work = mkdtempSync(join(tmpdir(), "taskmarket-checks-"));
11166
+ if (target.dir) {
11167
+ cpSync(resolve(target.dir), work, { recursive: true });
11168
+ if (target.patch) {
11169
+ const run2 = spawnSync("git", ["apply", resolve(target.patch)], {
11170
+ cwd: work,
11171
+ encoding: "utf8"
11172
+ });
11173
+ patchOk = run2.status === 0 ? { applied: true, detail: "applied" } : { applied: false, detail: tail(run2.stderr) || "git apply failed" };
11174
+ }
11175
+ } else if (target.file) {
11176
+ cpSync(resolve(target.file), join(work, basename(target.file)));
11177
+ }
11178
+ }
11179
+ for (const check of spec.checks) {
11180
+ if (check.kind === "patch_applies") {
11181
+ let result;
11182
+ if (!target.dir || !target.patch) {
11183
+ result = {
11184
+ id: check.id,
11185
+ kind: check.kind,
11186
+ passed: false,
11187
+ skipped: true,
11188
+ detail: "pass --dir <checkout> and --patch <file> to test the patch"
11189
+ };
11190
+ } else {
11191
+ const r = patchApplies(target.dir, target.patch);
11192
+ result = { id: check.id, kind: check.kind, passed: r.applied, detail: r.detail };
11193
+ }
11194
+ byId.set(check.id, result);
11195
+ } else if (check.kind === "command") {
11196
+ if (!options.yes) {
11197
+ byId.set(check.id, {
11198
+ id: check.id,
11199
+ kind: check.kind,
11200
+ passed: false,
11201
+ skipped: true,
11202
+ detail: "pass --yes to run commands"
11203
+ });
11204
+ } else if (patchOk && !patchOk.applied) {
11205
+ byId.set(check.id, {
11206
+ id: check.id,
11207
+ kind: check.kind,
11208
+ passed: false,
11209
+ detail: `the patch did not apply, so the command did not run: ${patchOk.detail}`
11210
+ });
11211
+ } else {
11212
+ const env = {
11213
+ ...process.env,
11214
+ ...target.file ? { TASKMARKET_DELIVERABLE: join(work, basename(target.file)) } : {}
11215
+ };
11216
+ const r = runCommandCheck(check, work, env);
11217
+ byId.set(check.id, { id: check.id, kind: check.kind, ...r });
11218
+ }
11219
+ }
11220
+ }
11221
+ } finally {
11222
+ if (work && existsSync(work)) rmSync(work, { recursive: true, force: true });
11223
+ }
11224
+ return engineResults.map((r) => byId.get(r.id) ?? r);
11225
+ }
11226
+ function isDirectory(path9) {
11227
+ try {
11228
+ return statSync(path9).isDirectory();
11229
+ } catch {
11230
+ return false;
11231
+ }
11232
+ }
11233
+ var LITERAL_FILE_LIMIT = 2e3;
11234
+ var LITERAL_BYTES_LIMIT = 1024 * 1024;
11235
+ var SKIPPED_DIRS = /* @__PURE__ */ new Set([
11236
+ ".git",
11237
+ "node_modules",
11238
+ "target",
11239
+ "dist",
11240
+ "build",
11241
+ ".venv",
11242
+ "__pycache__"
11243
+ ]);
11244
+ function collectTestLiterals(dir, paths) {
11245
+ const globs = paths ?? DEFAULT_TEST_GLOBS;
11246
+ const root = resolve(dir);
11247
+ const found = /* @__PURE__ */ new Set();
11248
+ let visited = 0;
11249
+ const walk2 = (rel) => {
11250
+ let names;
11251
+ try {
11252
+ names = readdirSync(join(root, rel)).sort();
11253
+ } catch {
11254
+ return;
11255
+ }
11256
+ for (const name of names) {
11257
+ if (visited >= LITERAL_FILE_LIMIT) return;
11258
+ const next = rel === "" ? name : `${rel}/${name}`;
11259
+ let info;
11260
+ try {
11261
+ info = statSync(join(root, next));
11262
+ } catch {
11263
+ continue;
11264
+ }
11265
+ if (info.isDirectory()) {
11266
+ if (!SKIPPED_DIRS.has(name)) walk2(next);
11267
+ } else if (info.isFile() && info.size <= LITERAL_BYTES_LIMIT && matchesAnyGlob(next, globs)) {
11268
+ visited++;
11269
+ try {
11270
+ for (const lit of extractLiterals(readFileSync(join(root, next), "utf8"))) found.add(lit);
11271
+ } catch {
11272
+ }
11273
+ }
11274
+ }
11275
+ };
11276
+ walk2("");
11277
+ return [...found].sort();
11278
+ }
11279
+ function taskChecksSpecOf(task) {
11280
+ if (task.checks) return { spec: task.checks };
11281
+ const found = extractTaskChecks(task.description ?? "");
11282
+ if (!found) return { spec: null };
11283
+ if (!found.ok) {
11284
+ return {
11285
+ error: `The task's taskmarket-checks block is invalid: ${formatTaskChecksErrors(found.errors)}`
11286
+ };
11287
+ }
11288
+ return { spec: found.spec };
11289
+ }
11290
+ var deliverableFiles = taskCheckedFiles;
11291
+ function deliverablePatch(files, patch) {
11292
+ return patch ?? taskCheckedPatch(files);
11293
+ }
11294
+ function runTaskChecks(spec, input) {
11295
+ const read4 = (path9, encoding) => {
11296
+ try {
11297
+ return encoding ? readFileSync(path9, encoding) : readFileSync(path9);
11298
+ } catch (error) {
11299
+ throw new Error(`Cannot read ${path9}: ${error.message}`);
11300
+ }
11301
+ };
11302
+ const results = [];
11303
+ if (spec.deliverable.type === "file") {
11304
+ const targets = deliverableFiles(spec, input.files);
11305
+ if (targets.length === 0) {
11306
+ throw new Error(
11307
+ `This task takes a ${spec.deliverable.format} file: pass it with --file <path>`
11308
+ );
11309
+ }
11310
+ for (const file of targets) {
11311
+ const engine = runDataChecks(spec, { bytes: read4(file) });
11312
+ const full = runCliChecks(spec, engine, { file }, { yes: input.yes });
11313
+ for (const r of full) results.push(targets.length > 1 ? { ...r, file } : r);
11314
+ }
11315
+ } else {
11316
+ if (input.dir && !isDirectory(input.dir)) throw new Error(`Not a directory: ${input.dir}`);
11317
+ const patch = deliverablePatch(input.files, input.patch);
11318
+ let engine;
11319
+ if (patch === void 0) {
11320
+ engine = runDataChecks(spec, { text: "" });
11321
+ } else {
11322
+ const specials = spec.checks.flatMap((c) => c.kind === "no_test_special_casing" ? [c] : []);
11323
+ const literals = /* @__PURE__ */ new Set();
11324
+ if (input.dir) {
11325
+ for (const c of specials) {
11326
+ for (const lit of collectTestLiterals(input.dir, c.paths)) literals.add(lit);
11327
+ }
11328
+ }
11329
+ engine = runPatchChecks(spec, {
11330
+ patch: read4(patch, "utf8"),
11331
+ testLiterals: input.dir && specials.length > 0 ? [...literals].sort() : void 0
11332
+ });
11333
+ }
11334
+ results.push(...runCliChecks(spec, engine, { dir: input.dir, patch }, { yes: input.yes }));
11335
+ }
11336
+ const hidden = hiddenChecksResult(spec);
11337
+ if (hidden) results.push(hidden);
11338
+ const failed = taskChecksFailures(results).length;
11339
+ return {
11340
+ passed: failed === 0,
11341
+ failed,
11342
+ skipped: results.filter((r) => r.skipped && r.kind !== "hidden").length,
11343
+ warnings: results.filter((r) => r.warning).length,
11344
+ results,
11345
+ ...spec.environment?.image || spec.environment?.setup?.length ? {
11346
+ note: "The checks ran on this machine. The declared image and setup are not applied; the verifier runs the checks in that environment."
11347
+ } : {}
11348
+ };
11349
+ }
11350
+ function announceCommands(spec) {
11351
+ const commands = commandChecks(spec);
11352
+ if (commands.length === 0) return;
11353
+ process.stderr.write(
11354
+ "Running the requester's commands on this machine:\n" + commands.map((c) => ` ${c.id}: ${c.cmd.join(" ")}
11355
+ `).join("") + (spec.environment?.network === "none" ? "The task expects no network; this run does not enforce that.\n" : "")
11356
+ );
11357
+ }
11358
+
11122
11359
  // src/lib/task-network.ts
11123
11360
  var WRONG_NETWORK_CODE = "wrong_network";
11124
11361
  async function confirmTaskOnSelectedNetwork(taskId, task) {
@@ -11151,6 +11388,9 @@ async function confirmTaskOnSelectedNetwork(taskId, task) {
11151
11388
  }
11152
11389
 
11153
11390
  // src/commands/task/submit.ts
11391
+ function checksSummary(run2) {
11392
+ return { passed: run2.passed, failed: run2.failed, skipped: run2.skipped, warnings: run2.warnings };
11393
+ }
11154
11394
  function collectFile(value, previous) {
11155
11395
  return [...previous, value];
11156
11396
  }
@@ -11159,29 +11399,98 @@ var submitCmd = new Command14("submit").description("Submit work for a task").ar
11159
11399
  ).option(
11160
11400
  "--accept-unverified-hooks",
11161
11401
  "Proceed although the task has a hook the hook registry does not list (it can refuse every submission)"
11162
- ).action(
11163
- async (taskId, opts) => {
11164
- try {
11165
- if (!opts.file || opts.file.length === 0) {
11166
- printError("--file is required");
11402
+ ).option(
11403
+ "--dry-run",
11404
+ "Run the task's checks on your files and print the results; nothing is uploaded or paid"
11405
+ ).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) => {
11406
+ try {
11407
+ const patchOnly = opts.dryRun && (opts.dir || opts.patch);
11408
+ if ((!opts.file || opts.file.length === 0) && !patchOnly) {
11409
+ printError("--file is required");
11410
+ return;
11411
+ }
11412
+ if (opts.dryRun && opts.skipChecks) {
11413
+ printError("--dry-run runs the checks; it cannot be combined with --skip-checks");
11414
+ return;
11415
+ }
11416
+ let checks = null;
11417
+ if (!opts.skipChecks) {
11418
+ const task = await getTask(cliTaskReadContext(), { taskId });
11419
+ if (!task) {
11420
+ printError(
11421
+ `Task not found: ${taskId} (or this is a private task you don't have access to)`
11422
+ );
11167
11423
  return;
11168
11424
  }
11169
- const submissionKey = resolveIdempotencyKey();
11170
- if (!await confirmTaskOnSelectedNetwork(taskId)) return;
11171
- if (!await confirmUnverifiedHooks("submit", taskId, opts.acceptUnverifiedHooks)) return;
11172
- const keystore = await loadKeystore();
11173
- const { submissionId, idempotencyKey } = await submitTaskFiles(
11174
- cliTaskWriteContext(keystore),
11175
- { taskId },
11176
- opts.file.map((path9) => ({ path: path9, role: opts.role })),
11177
- { idempotencyKey: submissionKey }
11425
+ const found = taskChecksSpecOf(task);
11426
+ if ("error" in found) {
11427
+ printError(found.error);
11428
+ return;
11429
+ }
11430
+ if (found.spec) {
11431
+ if (opts.yes && commandChecks(found.spec).length > 0) announceCommands(found.spec);
11432
+ try {
11433
+ checks = runTaskChecks(found.spec, {
11434
+ files: opts.file ?? [],
11435
+ dir: opts.dir,
11436
+ patch: opts.patch,
11437
+ yes: opts.yes === true
11438
+ });
11439
+ } catch (error) {
11440
+ renderFailure(error);
11441
+ return;
11442
+ }
11443
+ } else if (opts.dryRun) {
11444
+ printResult({
11445
+ taskId,
11446
+ dryRun: true,
11447
+ checks: null,
11448
+ note: "This task publishes no checks"
11449
+ });
11450
+ return;
11451
+ }
11452
+ }
11453
+ if (opts.dryRun && checks) {
11454
+ printResult({ taskId, dryRun: true, ...checks });
11455
+ if (!checks.passed) process.exitCode = 1;
11456
+ return;
11457
+ }
11458
+ if (checks && !checks.passed) {
11459
+ renderFailure(
11460
+ Object.assign(
11461
+ new Error(
11462
+ `${checks.failed} of the task's checks failed, so nothing was submitted. Fix the work, or pass --skip-checks to submit anyway`
11463
+ ),
11464
+ { code: "checks_failed" }
11465
+ ),
11466
+ { details: { code: "checks_failed", checks } }
11178
11467
  );
11179
- printResult({ submissionId }, { idempotencyKey });
11180
- } finally {
11181
- submitCmd.setOptionValue("file", []);
11468
+ return;
11469
+ }
11470
+ const submissionKey = resolveIdempotencyKey();
11471
+ if (!await confirmTaskOnSelectedNetwork(taskId)) return;
11472
+ if (!await confirmUnverifiedHooks("submit", taskId, opts.acceptUnverifiedHooks)) return;
11473
+ const keystore = await loadKeystore();
11474
+ const { submissionId, idempotencyKey } = await submitTaskFiles(
11475
+ cliTaskWriteContext(keystore),
11476
+ { taskId },
11477
+ opts.file.map((path9) => ({ path: path9, role: opts.role })),
11478
+ { idempotencyKey: submissionKey }
11479
+ );
11480
+ printResult(
11481
+ {
11482
+ submissionId,
11483
+ ...opts.skipChecks ? { checks: { skipped: true } } : checks ? { checks: checksSummary(checks) } : {}
11484
+ },
11485
+ { idempotencyKey }
11486
+ );
11487
+ } finally {
11488
+ submitCmd.setOptionValue("file", []);
11489
+ for (const key of ["dryRun", "skipChecks", "yes", "dir", "patch"]) {
11490
+ submitCmd.setOptionValue(key, void 0);
11182
11491
  }
11183
11492
  }
11184
- );
11493
+ });
11185
11494
 
11186
11495
  // src/commands/task/accept.ts
11187
11496
  import { Command as Command15 } from "commander";
@@ -12748,323 +13057,34 @@ var termsCmd = new Command52("terms").description(
12748
13057
  printError(
12749
13058
  `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
13059
  );
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)}`;
13060
+ return;
12969
13061
  }
12970
- if (!found) return `Task ${taskId} has no taskmarket-checks block, so there is nothing to check`;
12971
- return found.spec;
12972
- }
12973
- var precheckCmd = new Command54("precheck").description(
12974
- "Run a task's public checks on your own deliverable before you submit: --file for a file, --dir (and --patch) for a patch against a checked-out repository"
12975
- ).argument("<taskId>", "Task ID (0x-prefixed hex)").option("--file <path>", "The deliverable file (file deliverables)").option("--dir <path>", "The checked-out repository (patch deliverables)").option("--patch <file>", "The patch to test against --dir (patch deliverables)").option("--yes", "Run the task's command checks on this machine (they are the requester's)").action(
12976
- async (taskId, opts) => {
12977
- try {
12978
- const spec = await specOf(taskId);
12979
- if (typeof spec === "string") return printError(spec);
12980
- const deliverable = spec.deliverable;
12981
- let engine;
12982
- if (deliverable.type === "file") {
12983
- if (!opts.file)
12984
- return printError("This task takes a file deliverable: pass --file <path>");
12985
- if (opts.dir || opts.patch) {
12986
- return printError(
12987
- "--dir and --patch are for patch deliverables; this task takes a file"
12988
- );
12989
- }
12990
- let bytes;
12991
- try {
12992
- bytes = readFileSync2(opts.file);
12993
- } catch (error) {
12994
- return renderFailure(
12995
- new Error(`Cannot read ${opts.file}: ${error.message}`)
12996
- );
12997
- }
12998
- engine = runDataChecks(spec, { bytes });
12999
- } else {
13000
- if (!opts.dir) {
13001
- return printError(
13002
- "This task takes a patch deliverable: pass --dir <checkout> and --patch <file>"
13003
- );
13004
- }
13005
- if (opts.file)
13006
- return printError("--file is for file deliverables; this task takes a patch");
13007
- if (!isDirectory(opts.dir)) return printError(`Not a directory: ${opts.dir}`);
13008
- let patchText = null;
13009
- if (opts.patch) {
13010
- try {
13011
- patchText = readFileSync2(opts.patch, "utf8");
13012
- } catch (error) {
13013
- return renderFailure(
13014
- new Error(`Cannot read ${opts.patch}: ${error.message}`)
13015
- );
13016
- }
13017
- }
13018
- if (patchText === null) {
13019
- engine = runDataChecks(spec, { text: "" });
13020
- } else {
13021
- const specials = spec.checks.flatMap(
13022
- (c) => c.kind === "no_test_special_casing" ? [c] : []
13023
- );
13024
- const literals = /* @__PURE__ */ new Set();
13025
- for (const c of specials) {
13026
- for (const lit of collectTestLiterals(opts.dir, c.paths)) literals.add(lit);
13027
- }
13028
- engine = runPatchChecks(spec, {
13029
- patch: patchText,
13030
- testLiterals: specials.length > 0 ? [...literals].sort() : void 0
13031
- });
13032
- }
13033
- }
13034
- const commands = commandChecks(spec);
13035
- if (opts.yes && commands.length > 0) {
13036
- process.stderr.write(
13037
- "Running the requester's commands on this machine:\n" + commands.map((c) => ` ${c.id}: ${c.cmd.join(" ")}
13038
- `).join("") + (spec.environment?.network === "none" ? "The task expects no network; this run does not enforce that.\n" : "")
13039
- );
13040
- }
13041
- const results = runCliChecks(
13042
- spec,
13043
- engine,
13044
- { file: opts.file, dir: opts.dir, patch: opts.patch },
13045
- { yes: opts.yes === true }
13046
- );
13047
- const hidden = hiddenChecksResult(spec);
13048
- const all = hidden ? [...results, hidden] : results;
13049
- printResult({
13050
- taskId,
13051
- passed: taskChecksPassed(all),
13052
- skipped: results.filter((r) => r.skipped).length,
13053
- warnings: results.filter((r) => r.warning).length,
13054
- results: all,
13055
- ...spec.environment?.image || spec.environment?.setup?.length ? {
13056
- note: "Precheck runs on this machine. The declared image and setup are not applied; the verifier runs the checks in that environment."
13057
- } : {}
13058
- });
13059
- } catch (error) {
13060
- renderFailure(error, { fallback: "Precheck failed." });
13061
- }
13062
+ printResult(detail);
13063
+ });
13064
+
13065
+ // src/commands/task/template.ts
13066
+ import { Command as Command53 } from "commander";
13067
+ var listCmd3 = new Command53("list").description("List the curated task templates (id, mode, what it is for, what the brief covers)").option(
13068
+ "--mode <mode>",
13069
+ "Only templates for one task mode: bounty, claim, pitch, benchmark, auction"
13070
+ ).action((opts) => {
13071
+ if (opts.mode !== void 0 && !TaskMode.safeParse(opts.mode).success) {
13072
+ return void printError("--mode must be one of: bounty, claim, pitch, benchmark, auction");
13062
13073
  }
13063
- );
13074
+ printResult({ templates: listTemplates(opts.mode) });
13075
+ });
13076
+ 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) => {
13077
+ const template = findTemplate(id);
13078
+ if (!template) return void printError(templateNotFound(id));
13079
+ printResult(templateDetail(template));
13080
+ });
13081
+ var templateCmd = new Command53("template").description(
13082
+ "Browse the curated task templates; create from one with `task create --template <id>`"
13083
+ ).addCommand(listCmd3).addCommand(showCmd);
13064
13084
 
13065
13085
  // src/commands/task/checks.ts
13066
- import { readFileSync as readFileSync3 } from "fs";
13067
- import { Command as Command55 } from "commander";
13086
+ import { readFileSync as readFileSync2 } from "fs";
13087
+ import { Command as Command54 } from "commander";
13068
13088
 
13069
13089
  // src/lib/task-hidden-checks.ts
13070
13090
  import { createHash } from "crypto";
@@ -13097,12 +13117,12 @@ function isCommitment(value) {
13097
13117
  // src/commands/task/checks.ts
13098
13118
  function readBytes(path9) {
13099
13119
  try {
13100
- return readFileSync3(path9);
13120
+ return readFileSync2(path9);
13101
13121
  } catch (error) {
13102
13122
  return `Cannot read ${path9}: ${error.message}`;
13103
13123
  }
13104
13124
  }
13105
- var commitCmd = new Command55("commit").description(
13125
+ var commitCmd = new Command54("commit").description(
13106
13126
  "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
13127
  ).requiredOption("--file <path>", "The hidden checks file (a taskmarket.checks/1 spec)").action((opts) => {
13108
13128
  const bytes = readBytes(opts.file);
@@ -13111,7 +13131,7 @@ var commitCmd = new Command55("commit").description(
13111
13131
  if (!file.valid) return void printError(file.error);
13112
13132
  printResult({ commitment: hiddenChecksCommitment(bytes), count: file.count });
13113
13133
  });
13114
- var verifyCmd = new Command55("verify").description("Check a decrypted hidden checks file against the commitment in the public spec").requiredOption("--file <path>", "The decrypted hidden checks file").requiredOption("--commitment <sha256:...>", "The spec's hiddenChecks.commitment").action((opts) => {
13134
+ 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
13135
  if (!isCommitment(opts.commitment)) {
13116
13136
  return void printError("--commitment must look like sha256:<64 lowercase hex characters>");
13117
13137
  }
@@ -13126,7 +13146,7 @@ var verifyCmd = new Command55("verify").description("Check a decrypted hidden ch
13126
13146
  count: file.valid ? file.count : null
13127
13147
  });
13128
13148
  });
13129
- var checksCmd = new Command55("checks").description(
13149
+ var checksCmd = new Command54("checks").description(
13130
13150
  "Hidden checks: commit to a private checks file and verify it against the commitment"
13131
13151
  ).addCommand(commitCmd).addCommand(verifyCmd);
13132
13152
 
@@ -13155,12 +13175,11 @@ var settleCmd = settlementActionCommand({
13155
13175
  });
13156
13176
 
13157
13177
  // src/commands/task/index.ts
13158
- var taskCommand2 = new Command56("task").description("Manage tasks");
13178
+ var taskCommand2 = new Command55("task").description("Manage tasks");
13159
13179
  taskCommand2.addCommand(createCmd);
13160
13180
  taskCommand2.addCommand(templateCmd);
13161
13181
  taskCommand2.addCommand(listCmd);
13162
13182
  taskCommand2.addCommand(getCmd);
13163
- taskCommand2.addCommand(precheckCmd);
13164
13183
  taskCommand2.addCommand(checksCmd);
13165
13184
  taskCommand2.addCommand(payoutGateCmd);
13166
13185
  taskCommand2.addCommand(linkGateCmd);
@@ -13209,10 +13228,10 @@ taskCommand2.addCommand(reviewCmd, { hidden: true });
13209
13228
  taskCommand2.addCommand(startReviewCmd);
13210
13229
 
13211
13230
  // src/commands/agent/index.ts
13212
- import { Command as Command60, Option as Option4 } from "commander";
13231
+ import { Command as Command59, Option as Option4 } from "commander";
13213
13232
 
13214
13233
  // src/commands/agent/credits.ts
13215
- import { Command as Command57 } from "commander";
13234
+ import { Command as Command56 } from "commander";
13216
13235
 
13217
13236
  // src/lib/tty-confirm.ts
13218
13237
  import { createInterface as createInterface3 } from "readline";
@@ -13265,7 +13284,7 @@ function setupLines(plan, pricing) {
13265
13284
  ...rateLines(pricing)
13266
13285
  ];
13267
13286
  }
13268
- var setupCommand = new Command57("setup").description(
13287
+ var setupCommand = new Command56("setup").description(
13269
13288
  "Approve the compute allocation that pays for sandboxes: daily and monthly caps, and optional auto-top-up"
13270
13289
  ).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
13290
  "--auto-top-up-below <credits>",
@@ -13302,7 +13321,7 @@ var setupCommand = new Command57("setup").description(
13302
13321
  printResult({ config, caps: plan.caps, autoTopUp: plan.autoTopUp ?? null });
13303
13322
  }
13304
13323
  );
13305
- var buyCommand = new Command57("buy").description("Buy compute credit over x402 from the compute allocation, after showing the rate").option("--amount <usd>", "Purchase size in whole USD (see `credits status` for the sizes)").option("--yes", "Skip the confirmation prompt (the allocation caps still apply)").action(async (options) => {
13324
+ 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
13325
  const config = await loadComputeCreditConfig();
13307
13326
  if (!config) {
13308
13327
  throw new ComputeCreditError(
@@ -13332,17 +13351,17 @@ var buyCommand = new Command57("buy").description("Buy compute credit over x402
13332
13351
  rate: { rateCardVersion: pricing.rateCardVersion, usdPerCredit: pricing.usdPerCredit }
13333
13352
  });
13334
13353
  });
13335
- var statusCommand2 = new Command57("status").description(
13354
+ var statusCommand2 = new Command56("status").description(
13336
13355
  "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
13356
  ).action(async () => {
13338
13357
  printResult(await computeCreditStatus());
13339
13358
  });
13340
- var checkCommand = new Command57("check").description(
13359
+ var checkCommand = new Command56("check").description(
13341
13360
  "Check the compute credit balance and, when auto-top-up was approved and the balance is low, buy one chunk"
13342
13361
  ).action(async () => {
13343
13362
  printResult(await checkComputeBalance());
13344
13363
  });
13345
- var reconcileCommand = new Command57("reconcile").description(
13364
+ var reconcileCommand = new Command56("reconcile").description(
13346
13365
  "Settle purchases whose outcome was lost, by their idempotency key; never pays again"
13347
13366
  ).option(
13348
13367
  "--release <key>",
@@ -13389,10 +13408,10 @@ var reconcileCommand = new Command57("reconcile").description(
13389
13408
  ...recoveryError === void 0 ? {} : { recoveryError }
13390
13409
  });
13391
13410
  });
13392
- var disableAutoTopUpCommand = new Command57("disable-auto-top-up").description("Turn off auto-top-up and close its allocation").action(async () => {
13411
+ var disableAutoTopUpCommand = new Command56("disable-auto-top-up").description("Turn off auto-top-up and close its allocation").action(async () => {
13393
13412
  printResult({ config: await disableComputeAutoTopUp() });
13394
13413
  });
13395
- var agentCreditsCommand = new Command57("credits").description("Prepaid compute credit for agent sandboxes, bought over x402").addCommand(setupCommand).addCommand(buyCommand).addCommand(statusCommand2).addCommand(checkCommand).addCommand(reconcileCommand).addCommand(disableAutoTopUpCommand);
13414
+ 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
13415
 
13397
13416
  // src/commands/agent/launch.ts
13398
13417
  var EXPERIMENTAL_AGENT_ENV = "TASKMARKET_EXPERIMENTAL_AGENT";
@@ -13414,7 +13433,7 @@ async function runAgentCommand(options) {
13414
13433
  try {
13415
13434
  const { assertAgentCompatibility } = await import("./compatibility-636WJOEX.js");
13416
13435
  const pi = assertAgentCompatibility();
13417
- const { runAgent } = await import("./launch-RL4BS22J.js");
13436
+ const { runAgent } = await import("./launch-FQFOZYIN.js");
13418
13437
  result = await runAgent({
13419
13438
  model: options.model,
13420
13439
  pi,
@@ -13448,7 +13467,7 @@ async function runAgentCommand(options) {
13448
13467
  import { createHash as createHash2, randomBytes as randomBytes4 } from "crypto";
13449
13468
  import { readFile as readFile2 } from "fs/promises";
13450
13469
  import { extname } from "path";
13451
- import { Command as Command58, Option as Option3 } from "commander";
13470
+ import { Command as Command57, Option as Option3 } from "commander";
13452
13471
  var WRITE_TTL_SECONDS2 = 5 * 60;
13453
13472
  var HOUR = 3600;
13454
13473
  var LISTING_UNTRUSTED_FIELDS = [
@@ -13581,7 +13600,7 @@ async function ownListing() {
13581
13600
  const keystore = await loadKeystore();
13582
13601
  return fetchListing(keystore.walletAddress);
13583
13602
  }
13584
- var profileCommand = new Command58("profile").description(
13603
+ var profileCommand = new Command57("profile").description(
13585
13604
  "Your listing's profile: name, description, roles, specialties and capabilities"
13586
13605
  );
13587
13606
  profileCommand.command("set").description(
@@ -13733,7 +13752,7 @@ function addServiceOptions(command) {
13733
13752
  "fixed or quote: a hire of this service must name an evaluator before it is accepted"
13734
13753
  ).option("--no-requires-evaluator", "fixed or quote: hires need no evaluator (the default)");
13735
13754
  }
13736
- var serviceCommand = new Command58("service").description(
13755
+ var serviceCommand = new Command57("service").description(
13737
13756
  "Your listing services: the priced offers requesters hire you for"
13738
13757
  );
13739
13758
  addServiceOptions(
@@ -13775,7 +13794,7 @@ serviceCommand.command("remove").description("Remove a service from your listing
13775
13794
  renderFailure(err);
13776
13795
  }
13777
13796
  });
13778
- var availabilityCommand = new Command58("availability").description(
13797
+ var availabilityCommand = new Command57("availability").description(
13779
13798
  "Open your listing for hires or pause it (services stay visible but cannot be hired), and set your capacity"
13780
13799
  ).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
13800
  try {
@@ -13795,7 +13814,7 @@ var availabilityCommand = new Command58("availability").description(
13795
13814
  renderFailure(err);
13796
13815
  }
13797
13816
  });
13798
- var listingCommand = new Command58("listing").description(
13817
+ var listingCommand = new Command57("listing").description(
13799
13818
  "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
13819
  ).argument("[address]", "Wallet address; your own when left out").action(async (address3) => {
13801
13820
  try {
@@ -13822,7 +13841,7 @@ function agentListingCommands() {
13822
13841
  }
13823
13842
 
13824
13843
  // src/commands/agent/manage.ts
13825
- import { Command as Command59 } from "commander";
13844
+ import { Command as Command58 } from "commander";
13826
13845
  async function run(work) {
13827
13846
  try {
13828
13847
  const value = await work();
@@ -13845,27 +13864,27 @@ async function requireExperimental() {
13845
13864
  );
13846
13865
  }
13847
13866
  function agentManagementCommands() {
13848
- const status = new Command59("status").description(
13867
+ const status = new Command58("status").description(
13849
13868
  "Show the agent channels (locked, charged, refundable), purchases with an unknown outcome, the sandbox and compute credit. Reads only."
13850
13869
  ).action(async () => {
13851
- const { collectAgentStatus } = await import("./status-IZ7ZTA5D.js");
13870
+ const { collectAgentStatus } = await import("./status-IMWQR4AR.js");
13852
13871
  await run(() => collectAgentStatus());
13853
13872
  });
13854
- const doctor = new Command59("doctor").description(
13873
+ const doctor = new Command58("doctor").description(
13855
13874
  "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
13875
  ).action(async () => {
13857
- const { runDoctor } = await import("./doctor-K4RKUTXL.js");
13876
+ const { runDoctor } = await import("./doctor-WW54ZCQR.js");
13858
13877
  const report = await run(() => runDoctor());
13859
13878
  if (report && !report.ok) process.exitCode = 1;
13860
13879
  });
13861
- const reconcile = new Command59("reconcile").description(
13880
+ const reconcile = new Command58("reconcile").description(
13862
13881
  "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
13882
  ).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
13883
  "--channel <channel-id>",
13865
13884
  "Reconcile the open purchases of this channel, as status lists it; also reaches retired channels"
13866
13885
  ).action(
13867
13886
  async (invocationId, options) => {
13868
- const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-ZFFNXOD7.js");
13887
+ const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-KHSXUVR3.js");
13869
13888
  const choice = { rail: options.rail, channel: options.channel };
13870
13889
  if (invocationId !== void 0) {
13871
13890
  await run(() => reconcileInvocation(invocationId, { choice }));
@@ -13883,7 +13902,7 @@ function agentManagementCommands() {
13883
13902
  });
13884
13903
  }
13885
13904
  );
13886
- const topup = new Command59("topup").description(
13905
+ const topup = new Command58("topup").description(
13887
13906
  "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
13907
  ).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
13908
  await run(async () => {
@@ -13897,7 +13916,7 @@ function agentManagementCommands() {
13897
13916
  `Not a USDC amount: ${options.amount} (digits, at most 6 decimals)`
13898
13917
  );
13899
13918
  }
13900
- const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-456WXKVT.js");
13919
+ const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-AH2WHLMC.js");
13901
13920
  const { rails } = await openAgentChannels();
13902
13921
  const result = await requestTopUp(selectRail(rails, options.rail), amount);
13903
13922
  return {
@@ -13908,7 +13927,7 @@ function agentManagementCommands() {
13908
13927
  };
13909
13928
  });
13910
13929
  });
13911
- const close = new Command59("close").description(
13930
+ const close = new Command58("close").description(
13912
13931
  "Close the agent's channel and refund its unused balance cooperatively; checks an earlier close instead of sending it again"
13913
13932
  ).option("--rail <id>", "The rail to close (required when the policy has more than one)").option(
13914
13933
  "--channel <channel-id>",
@@ -13917,8 +13936,8 @@ function agentManagementCommands() {
13917
13936
  await run(async () => {
13918
13937
  await requireExperimental();
13919
13938
  const { AGENT_VIEW_VERSION } = await import("./budget-view-J6L7X6EY.js");
13920
- const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-456WXKVT.js");
13921
- const { reconcileLeasedPurchase } = await import("./reconcile-ZFFNXOD7.js");
13939
+ const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-AH2WHLMC.js");
13940
+ const { reconcileLeasedPurchase } = await import("./reconcile-KHSXUVR3.js");
13922
13941
  const opened = await openAgentChannels();
13923
13942
  const { rail, retired } = selectChannel(opened, options);
13924
13943
  const result = await closeChannel(
@@ -13949,7 +13968,7 @@ function agentManagementCommands() {
13949
13968
  };
13950
13969
  });
13951
13970
  });
13952
- const pull = new Command59("pull").description(
13971
+ const pull = new Command58("pull").description(
13953
13972
  "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
13973
  ).option("--diff", "Print the full diff").option("--apply", "Apply the clean changes without asking").option(
13955
13974
  "--overwrite <path>",
@@ -13972,7 +13991,7 @@ function agentManagementCommands() {
13972
13991
  async (options) => {
13973
13992
  await run(async () => {
13974
13993
  await requireExperimental();
13975
- const { runPull } = await import("./sync-pull-Q7W6IPWN.js");
13994
+ const { runPull } = await import("./sync-pull-EN7CFU3J.js");
13976
13995
  const { terminalPrompter } = await import("./prompter-LSICEYSQ.js");
13977
13996
  return runPull(options, {
13978
13997
  interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
@@ -13990,7 +14009,7 @@ function agentManagementCommands() {
13990
14009
 
13991
14010
  // src/commands/agent/index.ts
13992
14011
  var experimental = agentCommandEnabled();
13993
- var agentCommand = new Command60("agent").description(
14012
+ var agentCommand = new Command59("agent").description(
13994
14013
  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
14014
  ).addOption(
13996
14015
  new Option4("--model <id>", "Start on one model from your approved spending policy").hideHelp(
@@ -14027,7 +14046,7 @@ for (const command of agentManagementCommands()) {
14027
14046
  }
14028
14047
 
14029
14048
  // src/commands/agents.ts
14030
- import { Command as Command61 } from "commander";
14049
+ import { Command as Command60 } from "commander";
14031
14050
  var MIN_RATINGS = ["3", "4", "4.5"];
14032
14051
  var MIN_TASKS = ["5", "10", "50"];
14033
14052
  var AVAILABILITIES = ["available", "unavailable", "any"];
@@ -14037,7 +14056,7 @@ function allowListed(flag, value, allowed) {
14037
14056
  throw new Error(`${flag} must be one of: ${allowed.join(", ")}`);
14038
14057
  }
14039
14058
  }
14040
- var agentsCommand = new Command61("agents").description("Browse the worker directory (agents and humans) on the selected --network").enablePositionalOptions().option(
14059
+ var agentsCommand = new Command60("agents").description("Browse the worker directory (agents and humans) on the selected --network").enablePositionalOptions().option(
14041
14060
  "--sort <order>",
14042
14061
  "Sort order: reputation (top rated), tasks, hires (most hired: completed reserved, quote and request hires) or volume (settled earnings)",
14043
14062
  "reputation"
@@ -14283,7 +14302,7 @@ agentsCommand.command("report").description("Report a worker's listing, or one o
14283
14302
  });
14284
14303
 
14285
14304
  // src/commands/dashboard.ts
14286
- import { Command as Command62 } from "commander";
14305
+ import { Command as Command61 } from "commander";
14287
14306
 
14288
14307
  // src/lib/dashboard.ts
14289
14308
  var DASHBOARD_LIST_LIMIT = 5;
@@ -14480,7 +14499,7 @@ async function settle(read4) {
14480
14499
  return { value: null, error: error instanceof Error ? error.message : String(error) };
14481
14500
  }
14482
14501
  }
14483
- var dashboardCommand = new Command62("dashboard").description(
14502
+ var dashboardCommand = new Command61("dashboard").description(
14484
14503
  "Show your home base: what needs you, your money, tasks you posted and work you do, projects and workflows, and recent activity"
14485
14504
  ).action(async () => {
14486
14505
  const auth = await signReadAuth();
@@ -14589,8 +14608,8 @@ var dashboardCommand = new Command62("dashboard").description(
14589
14608
  });
14590
14609
 
14591
14610
  // src/commands/inbox.ts
14592
- import { Command as Command63 } from "commander";
14593
- var inboxCommand = new Command63("inbox").description(
14611
+ import { Command as Command62 } from "commander";
14612
+ var inboxCommand = new Command62("inbox").description(
14594
14613
  "Show what you need to do now, then tasks you created, tasks you are working on, and private tasks you were invited to"
14595
14614
  ).option(
14596
14615
  "--limit <n>",
@@ -14733,7 +14752,7 @@ var inboxCommand = new Command63("inbox").description(
14733
14752
  );
14734
14753
 
14735
14754
  // src/commands/deposit.ts
14736
- import { Command as Command64 } from "commander";
14755
+ import { Command as Command63 } from "commander";
14737
14756
 
14738
14757
  // src/lib/relay-bridge.ts
14739
14758
  import { z as z4 } from "zod";
@@ -14816,7 +14835,7 @@ async function fundingOptionsFor(chainId) {
14816
14835
  note: "Run `taskmarket deposit --relay-route <routeId> --amount <n>` for a Relay deposit address. Fiat funding: see issue #2720."
14817
14836
  };
14818
14837
  }
14819
- var depositCommand = new Command64("deposit").description(
14838
+ var depositCommand = new Command63("deposit").description(
14820
14839
  "Show wallet address, network info and cross-chain funding options for the selected --network"
14821
14840
  ).option(
14822
14841
  "--relay-route <routeId>",
@@ -14906,10 +14925,10 @@ var depositCommand = new Command64("deposit").description(
14906
14925
  });
14907
14926
 
14908
14927
  // src/commands/wallet/index.ts
14909
- import { Command as Command75 } from "commander";
14928
+ import { Command as Command74 } from "commander";
14910
14929
 
14911
14930
  // src/commands/wallet/balance.ts
14912
- import { Command as Command65 } from "commander";
14931
+ import { Command as Command64 } from "commander";
14913
14932
  function balancePath(address3, chainId) {
14914
14933
  return `/api/wallet/balance?address=${address3}&chainId=${chainId}`;
14915
14934
  }
@@ -14943,7 +14962,7 @@ async function allChainBalances(address3) {
14943
14962
  );
14944
14963
  return { address: address3, chains };
14945
14964
  }
14946
- var walletBalanceCommand = new Command65("balance").description("Show the wallet's payment-token balance on the selected network").option("--address <addr>", "Address to check (defaults to own wallet)").option(
14965
+ 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
14966
  "--all-chains",
14948
14967
  "Show the balance on every chain the selected deployment serves, one entry per chain"
14949
14968
  ).option(
@@ -14983,7 +15002,7 @@ var walletBalanceCommand = new Command65("balance").description("Show the wallet
14983
15002
  );
14984
15003
 
14985
15004
  // src/commands/wallet/import.ts
14986
- import { Command as Command66 } from "commander";
15005
+ import { Command as Command65 } from "commander";
14987
15006
  import { createInterface as createInterface4 } from "readline";
14988
15007
  import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
14989
15008
  function normalizePrivateKey(raw) {
@@ -15057,7 +15076,7 @@ async function importSolanaWallet(flagKey) {
15057
15076
  { warnings: argvKeyWarnings(keySource) }
15058
15077
  );
15059
15078
  }
15060
- var walletImportCommand = new Command66("import").description("Import an existing private key as the agent wallet").option(
15079
+ var walletImportCommand = new Command65("import").description("Import an existing private key as the agent wallet").option(
15061
15080
  "--key <privateKey>",
15062
15081
  "Private key to import (64 hex chars, with or without 0x prefix; with --solana, a base58 or JSON-array Solana secret key)"
15063
15082
  ).option(
@@ -15148,7 +15167,7 @@ var walletImportCommand = new Command66("import").description("Import an existin
15148
15167
 
15149
15168
  // src/commands/wallet/set-withdrawal-address.ts
15150
15169
  import { randomBytes as randomBytes5 } from "crypto";
15151
- import { Command as Command67 } from "commander";
15170
+ import { Command as Command66 } from "commander";
15152
15171
 
15153
15172
  // src/lib/withdrawal-pin.ts
15154
15173
  var WithdrawalAddressMismatchError = class extends Error {
@@ -15225,7 +15244,7 @@ var SIGNATURE_TTL_SECONDS = 5 * 60;
15225
15244
  function isValidAddress(addr) {
15226
15245
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
15227
15246
  }
15228
- var setWithdrawalAddressCommand = new Command67("set-withdrawal-address").description(
15247
+ var setWithdrawalAddressCommand = new Command66("set-withdrawal-address").description(
15229
15248
  "Set the withdrawal address for payment-token withdrawals on the selected network (once per chain, free)"
15230
15249
  ).argument("<address>", "Ethereum address to receive withdrawals").action(async (address3) => {
15231
15250
  if (!isValidAddress(address3)) {
@@ -15286,8 +15305,8 @@ var setWithdrawalAddressCommand = new Command67("set-withdrawal-address").descri
15286
15305
  });
15287
15306
 
15288
15307
  // src/commands/wallet/get-withdrawal-address.ts
15289
- import { Command as Command68 } from "commander";
15290
- var getWithdrawalAddressCommand = new Command68("get-withdrawal-address").description(
15308
+ import { Command as Command67 } from "commander";
15309
+ var getWithdrawalAddressCommand = new Command67("get-withdrawal-address").description(
15291
15310
  "Show the withdrawal address registered on the selected network, if any (the address is per chain)"
15292
15311
  ).option("--address <addr>", "Wallet address to check (defaults to own wallet)").action(async (opts) => {
15293
15312
  let address3 = opts.address;
@@ -15303,14 +15322,14 @@ var getWithdrawalAddressCommand = new Command68("get-withdrawal-address").descri
15303
15322
  });
15304
15323
 
15305
15324
  // src/commands/wallet/change-withdrawal-address.ts
15306
- import { Command as Command69 } from "commander";
15325
+ import { Command as Command68 } from "commander";
15307
15326
  function isValidAddress2(addr) {
15308
15327
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
15309
15328
  }
15310
15329
  function isValidRecoveryCode(code) {
15311
15330
  return /^\d{8}$/.test(code);
15312
15331
  }
15313
- var changeWithdrawalAddressCommand = new Command69("change-withdrawal-address").description(
15332
+ var changeWithdrawalAddressCommand = new Command68("change-withdrawal-address").description(
15314
15333
  "Change the selected network's withdrawal address using that chain's account recovery code (RFC-0012)"
15315
15334
  ).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
15335
  if (!isValidRecoveryCode(recoveryCode)) {
@@ -15362,8 +15381,8 @@ var changeWithdrawalAddressCommand = new Command69("change-withdrawal-address").
15362
15381
  });
15363
15382
 
15364
15383
  // src/commands/wallet/sync-withdrawal-address.ts
15365
- import { Command as Command70 } from "commander";
15366
- var syncWithdrawalAddressCommand = new Command70("sync-withdrawal-address").description(
15384
+ import { Command as Command69 } from "commander";
15385
+ var syncWithdrawalAddressCommand = new Command69("sync-withdrawal-address").description(
15367
15386
  "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
15387
  ).action(async () => {
15369
15388
  let keystore;
@@ -15396,8 +15415,8 @@ var syncWithdrawalAddressCommand = new Command70("sync-withdrawal-address").desc
15396
15415
  });
15397
15416
 
15398
15417
  // src/commands/wallet/reveal-recovery-code.ts
15399
- import { Command as Command71 } from "commander";
15400
- var revealRecoveryCodeCommand = new Command71("reveal-recovery-code").description(
15418
+ import { Command as Command70 } from "commander";
15419
+ var revealRecoveryCodeCommand = new Command70("reveal-recovery-code").description(
15401
15420
  "One-time reveal of the selected network's account recovery code, if one has not been generated yet"
15402
15421
  ).action(async () => {
15403
15422
  let keystore;
@@ -15436,8 +15455,8 @@ var revealRecoveryCodeCommand = new Command71("reveal-recovery-code").descriptio
15436
15455
  });
15437
15456
 
15438
15457
  // src/commands/wallet/publish-key.ts
15439
- import { Command as Command72 } from "commander";
15440
- var publishKeyCommand = new Command72("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
15458
+ import { Command as Command71 } from "commander";
15459
+ var publishKeyCommand = new Command71("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
15441
15460
  let keystore;
15442
15461
  try {
15443
15462
  keystore = await loadKeystore();
@@ -15457,7 +15476,7 @@ var publishKeyCommand = new Command72("publish-key").description("Publish your s
15457
15476
  });
15458
15477
 
15459
15478
  // src/commands/wallet/withdraw-dreams.ts
15460
- import { Command as Command73 } from "commander";
15479
+ import { Command as Command72 } from "commander";
15461
15480
  import { toHex } from "viem";
15462
15481
  var AUTHORIZATION_VALIDITY_SECONDS = 300;
15463
15482
  function isValidAddress3(addr) {
@@ -15479,7 +15498,7 @@ function withdrawalTargets(balance, hook) {
15479
15498
  targets: hooks.filter((entry) => BigInt(entry.claimableBaseUnits) > 0n).map((entry) => ({ hookAddress: entry.hookAddress, send: true }))
15480
15499
  };
15481
15500
  }
15482
- var withdrawDreamsCommand = new Command73("withdraw-dreams").description(
15501
+ var withdrawDreamsCommand = new Command72("withdraw-dreams").description(
15483
15502
  "Withdraw accumulated DREAMS rewards to the withdrawal address: one signed withdrawal from each reward hook holding a balance, or from --hook alone"
15484
15503
  ).option("--destination <addr>", "Destination address (defaults to registered withdrawal address)").option("--hook <address>", "Withdraw from this reward hook only").action(async (opts) => {
15485
15504
  let keystore;
@@ -15600,7 +15619,7 @@ var withdrawDreamsCommand = new Command73("withdraw-dreams").description(
15600
15619
  });
15601
15620
 
15602
15621
  // src/commands/wallet/bridge.ts
15603
- import { Command as Command74 } from "commander";
15622
+ import { Command as Command73 } from "commander";
15604
15623
  import { toHex as toHex2 } from "viem";
15605
15624
  var USDC_TYPES = {
15606
15625
  TransferWithAuthorization: [
@@ -15644,7 +15663,7 @@ async function pollBridgeStatus(requestId) {
15644
15663
  await sleep(bridgeTiming.intervalMs);
15645
15664
  }
15646
15665
  }
15647
- var walletBridgeCommand = new Command74("bridge").description(
15666
+ var walletBridgeCommand = new Command73("bridge").description(
15648
15667
  "Move free USDC on Base to OUSD at the same address on Tempo (gasless, through Relay)"
15649
15668
  ).requiredOption("--to <chain>", 'Destination chain (only "tempo")').option(
15650
15669
  "--recipient <address>",
@@ -15783,7 +15802,7 @@ var walletBridgeCommand = new Command74("bridge").description(
15783
15802
  });
15784
15803
 
15785
15804
  // src/commands/wallet/index.ts
15786
- var walletCommand = new Command75("wallet").description("Wallet management commands");
15805
+ var walletCommand = new Command74("wallet").description("Wallet management commands");
15787
15806
  walletCommand.addCommand(walletBalanceCommand);
15788
15807
  walletCommand.addCommand(walletImportCommand);
15789
15808
  walletCommand.addCommand(setWithdrawalAddressCommand);
@@ -15796,7 +15815,7 @@ walletCommand.addCommand(withdrawDreamsCommand);
15796
15815
  walletCommand.addCommand(walletBridgeCommand);
15797
15816
 
15798
15817
  // src/commands/withdraw.ts
15799
- import { Command as Command76 } from "commander";
15818
+ import { Command as Command75 } from "commander";
15800
15819
  import { toHex as toHex3 } from "viem";
15801
15820
 
15802
15821
  // src/lib/solana-relay.ts
@@ -15975,7 +15994,7 @@ var USDC_TYPES2 = {
15975
15994
  { name: "nonce", type: "bytes32" }
15976
15995
  ]
15977
15996
  };
15978
- var withdrawCommand = new Command76("withdraw").description(
15997
+ var withdrawCommand = new Command75("withdraw").description(
15979
15998
  "Withdraw the payment token (USDC on Base, OUSD on Tempo) to the registered withdrawal address"
15980
15999
  ).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
16000
  if (opts.solana) {
@@ -16064,9 +16083,9 @@ var withdrawCommand = new Command76("withdraw").description(
16064
16083
  });
16065
16084
 
16066
16085
  // src/commands/encrypt.ts
16067
- import { Command as Command77 } from "commander";
16086
+ import { Command as Command76 } from "commander";
16068
16087
  import { promises as fs2 } from "fs";
16069
- var encryptCommand = new Command77("encrypt").description("Encrypt a file with ECIES using wallet keys").argument("<file>", "Path to the file to encrypt").option("--recipient <address>", "Recipient wallet address (default: self)").option("--output <path>", "Output path (default: <file>.enc)").action(async (file, opts) => {
16088
+ 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
16089
  let plaintext;
16071
16090
  try {
16072
16091
  plaintext = await fs2.readFile(file);
@@ -16114,9 +16133,9 @@ var encryptCommand = new Command77("encrypt").description("Encrypt a file with E
16114
16133
  });
16115
16134
 
16116
16135
  // src/commands/decrypt.ts
16117
- import { Command as Command78 } from "commander";
16136
+ import { Command as Command77 } from "commander";
16118
16137
  import { promises as fs3 } from "fs";
16119
- var decryptCommand = new Command78("decrypt").description("Decrypt a file using your wallet key").argument("<file>", "Path to the encrypted file").option("--output <path>", "Output path (default: strips .enc, otherwise appends .dec)").action(async (file, opts) => {
16138
+ 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
16139
  let ciphertext;
16121
16140
  try {
16122
16141
  ciphertext = await fs3.readFile(file);
@@ -16156,7 +16175,7 @@ var decryptCommand = new Command78("decrypt").description("Decrypt a file using
16156
16175
  });
16157
16176
 
16158
16177
  // src/commands/xmtp.ts
16159
- import { Command as Command79 } from "commander";
16178
+ import { Command as Command78 } from "commander";
16160
16179
 
16161
16180
  // src/lib/xmtp-client.ts
16162
16181
  import fs6 from "fs";
@@ -17570,7 +17589,7 @@ function senderInboxIdFor(keystore, client) {
17570
17589
  }
17571
17590
  return client.inboxId;
17572
17591
  }
17573
- var xmtpCommand = new Command79("xmtp").description("Manage XMTP messaging for this agent");
17592
+ var xmtpCommand = new Command78("xmtp").description("Manage XMTP messaging for this agent");
17574
17593
  xmtpCommand.hook("preAction", () => {
17575
17594
  if (resolveXmtpEnv() !== "memory") assertXmtpSupported();
17576
17595
  });
@@ -17835,7 +17854,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
17835
17854
  });
17836
17855
 
17837
17856
  // src/commands/daemon.ts
17838
- import { Command as Command81 } from "commander";
17857
+ import { Command as Command80 } from "commander";
17839
17858
 
17840
17859
  // src/lib/market-event-settings-auth.ts
17841
17860
  function signMarketEventSettingsWrite(change) {
@@ -17843,7 +17862,7 @@ function signMarketEventSettingsWrite(change) {
17843
17862
  }
17844
17863
 
17845
17864
  // src/commands/events.ts
17846
- import { Command as Command80 } from "commander";
17865
+ import { Command as Command79 } from "commander";
17847
17866
 
17848
17867
  // src/lib/market-event-cursor.ts
17849
17868
  import { promises as fs7 } from "fs";
@@ -18239,14 +18258,14 @@ async function readOrMarkSeen(options) {
18239
18258
  printResult(data, { idempotencyKey });
18240
18259
  }
18241
18260
  function createSeenCommand() {
18242
- return new Command80("seen").description(
18261
+ return new Command79("seen").description(
18243
18262
  "Show the newest event you have seen and how many are unread (the web Inbox's Activity count); --mark moves it forward"
18244
18263
  ).option("--mark <id>", "Mark events up to this event id as seen, or `latest` for all of them").action(async (options) => {
18245
18264
  await readOrMarkSeen(options);
18246
18265
  });
18247
18266
  }
18248
18267
  function createEventsCommand() {
18249
- return new Command80("events").description(
18268
+ return new Command79("events").description(
18250
18269
  "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
18270
  ).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
18271
  "--task <taskId>",
@@ -18625,7 +18644,7 @@ function sleepOrAbort(ms2, signal) {
18625
18644
  });
18626
18645
  }
18627
18646
  function createDaemonCommand(seams = {}) {
18628
- return new Command81("daemon").description(
18647
+ return new Command80("daemon").description(
18629
18648
  "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
18649
  ).option("--heartbeat-interval <ms>", "Heartbeat interval in milliseconds", "1800000").option(
18631
18650
  "--task-filters <json>",
@@ -18684,7 +18703,7 @@ function createDaemonCommand(seams = {}) {
18684
18703
  );
18685
18704
  }
18686
18705
  if (emailRequested && !emailAvailable) {
18687
- const hint = `${emailMissing} Run \`taskmarket email register --username <name>\` to get one.`;
18706
+ const hint = `${emailMissing} Run \`taskmarket email register\` to get one.`;
18688
18707
  if (!othersRun("email")) throw new Error(hint);
18689
18708
  if (explicitSources || emailLookupFailed) {
18690
18709
  process.stderr.write(`${hint} Following the other sources.
@@ -18804,10 +18823,10 @@ function createDaemonCommand(seams = {}) {
18804
18823
  var daemonCommand = createDaemonCommand();
18805
18824
 
18806
18825
  // src/commands/events-filter.ts
18807
- import { Command as Command83 } from "commander";
18826
+ import { Command as Command82 } from "commander";
18808
18827
 
18809
18828
  // src/commands/events-settings.ts
18810
- import { Command as Command82 } from "commander";
18829
+ import { Command as Command81 } from "commander";
18811
18830
  var PREFERENCES_PATH = "/api/market-events/preferences";
18812
18831
  var CHANNEL_OPTION = [
18813
18832
  "--channel <channel>",
@@ -18825,7 +18844,7 @@ async function walletHeaders() {
18825
18844
  function parseChannel(channel) {
18826
18845
  return parseInput(MarketEventWalletChannelSchema, channel ?? "email");
18827
18846
  }
18828
- var listCommand = new Command82("list").description(
18847
+ var listCommand = new Command81("list").description(
18829
18848
  "Show which event types reach this wallet on one channel (email by default); locked types cannot be turned off"
18830
18849
  ).option(...CHANNEL_OPTION).action(async (options) => {
18831
18850
  try {
@@ -18839,7 +18858,7 @@ var listCommand = new Command82("list").description(
18839
18858
  }
18840
18859
  });
18841
18860
  function setCommand(name, enabled, description) {
18842
- return new Command82(name).description(description).argument("<type>", "Event type, e.g. task.invited (see `taskmarket events settings list`)").option(...CHANNEL_OPTION).action(async (type, options) => {
18861
+ 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
18862
  try {
18844
18863
  const channel = parseChannel(options.channel);
18845
18864
  const body = parseInput(SetMarketEventPreferenceInputSchema, { type, enabled });
@@ -18859,7 +18878,7 @@ function setCommand(name, enabled, description) {
18859
18878
  }
18860
18879
  });
18861
18880
  }
18862
- var eventsSettingsCommand = new Command82("settings").description(
18881
+ var eventsSettingsCommand = new Command81("settings").description(
18863
18882
  "Choose which market events reach this wallet by email or as in-app notices in the web app"
18864
18883
  ).addCommand(listCommand).addCommand(setCommand("on", true, "Turn an event type on for this wallet on one channel")).addCommand(
18865
18884
  setCommand(
@@ -18913,7 +18932,7 @@ function mergeFilter(current, options) {
18913
18932
  }
18914
18933
  return { filter: parsed.data };
18915
18934
  }
18916
- var eventsFilterCommand = new Command83("filter").description(
18935
+ var eventsFilterCommand = new Command82("filter").description(
18917
18936
  "Read or set this wallet's discovery filter: which newly listed tasks are announced to it as task.listed events"
18918
18937
  ).option("--enable", "Turn discovery on").option("--disable", "Turn discovery off: no task.listed events at all").option(
18919
18938
  "--modes <list>",
@@ -18975,33 +18994,27 @@ function attachEventsFilter(program2) {
18975
18994
  }
18976
18995
 
18977
18996
  // src/commands/email/index.ts
18978
- import { Command as Command92 } from "commander";
18997
+ import { Command as Command91 } from "commander";
18979
18998
 
18980
18999
  // src/commands/email/register.ts
18981
- import { Command as Command84 } from "commander";
18982
- var registerCommand = new Command84("register").description("Register an email address for this agent").requiredOption("--username <name>", "Desired username (e.g. myagent)").action(async (opts) => {
18983
- const check = await apiGet(
18984
- `/api/emails/check-username?username=${encodeURIComponent(opts.username)}`
18985
- );
18986
- if (!check.available) {
18987
- printError(`Username "${opts.username}" is not available.`);
18988
- return;
18989
- }
19000
+ import { Command as Command83 } from "commander";
19001
+ var registerCommand = new Command83("register").description(
19002
+ "Register this agent email address, agent-<id>@taskmarket.dev (the backend assigns the id)"
19003
+ ).action(async () => {
18990
19004
  const keystore = await loadKeystore();
18991
19005
  const { data: result, idempotencyKey } = await apiPost(
18992
19006
  "/api/emails/register",
18993
19007
  {
18994
19008
  deviceId: keystore.deviceId,
18995
- apiToken: keystore.apiToken,
18996
- username: opts.username
19009
+ apiToken: keystore.apiToken
18997
19010
  }
18998
19011
  );
18999
19012
  printResult({ emailAddress: result.emailAddress }, { idempotencyKey });
19000
19013
  });
19001
19014
 
19002
19015
  // src/commands/email/inbox.ts
19003
- import { Command as Command85 } from "commander";
19004
- var inboxCommand2 = new Command85("inbox").description("List emails in your inbox").option("--limit <n>", "Number of emails to return", "20").option("--unread", "Show only unread emails").action(async (opts) => {
19016
+ import { Command as Command84 } from "commander";
19017
+ 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
19018
  const keystore = await loadKeystore();
19006
19019
  const params = new URLSearchParams({
19007
19020
  deviceId: keystore.deviceId,
@@ -19017,8 +19030,8 @@ var inboxCommand2 = new Command85("inbox").description("List emails in your inbo
19017
19030
  });
19018
19031
 
19019
19032
  // src/commands/email/read.ts
19020
- import { Command as Command86 } from "commander";
19021
- var readCommand = new Command86("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
19033
+ import { Command as Command85 } from "commander";
19034
+ var readCommand = new Command85("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
19022
19035
  const keystore = await loadKeystore();
19023
19036
  const params = new URLSearchParams({
19024
19037
  deviceId: keystore.deviceId,
@@ -19031,8 +19044,8 @@ var readCommand = new Command86("read").description("Read an email by ID (marks
19031
19044
  });
19032
19045
 
19033
19046
  // src/commands/email/send.ts
19034
- import { Command as Command87 } from "commander";
19035
- var sendCommand = new Command87("send").description("Send an email").requiredOption("--to <address>", "Recipient email address").requiredOption("--subject <subject>", "Email subject").requiredOption("--body <text>", "Email body text").action(async (opts) => {
19047
+ import { Command as Command86 } from "commander";
19048
+ 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
19049
  const keystore = await loadKeystore();
19037
19050
  const { data: result, idempotencyKey } = await apiPost("/api/emails/send", {
19038
19051
  deviceId: keystore.deviceId,
@@ -19045,8 +19058,8 @@ var sendCommand = new Command87("send").description("Send an email").requiredOpt
19045
19058
  });
19046
19059
 
19047
19060
  // src/commands/email/reply.ts
19048
- import { Command as Command88 } from "commander";
19049
- var replyCommand = new Command88("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").action(async (id, opts) => {
19061
+ import { Command as Command87 } from "commander";
19062
+ 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
19063
  const keystore = await loadKeystore();
19051
19064
  const params = new URLSearchParams({
19052
19065
  deviceId: keystore.deviceId,
@@ -19072,8 +19085,8 @@ var replyCommand = new Command88("reply").description("Reply to an email").argum
19072
19085
  });
19073
19086
 
19074
19087
  // src/commands/email/delete.ts
19075
- import { Command as Command89 } from "commander";
19076
- var deleteCommand = new Command89("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
19088
+ import { Command as Command88 } from "commander";
19089
+ var deleteCommand = new Command88("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
19077
19090
  const keystore = await loadKeystore();
19078
19091
  const { data: result, idempotencyKey } = await apiPost(
19079
19092
  "/api/emails/delete",
@@ -19087,15 +19100,15 @@ var deleteCommand = new Command89("delete").description("Delete an email by ID")
19087
19100
  });
19088
19101
 
19089
19102
  // src/commands/email/address.ts
19090
- import { Command as Command90 } from "commander";
19091
- var addressCommand3 = new Command90("address").description("Show your registered email address").action(async () => {
19103
+ import { Command as Command89 } from "commander";
19104
+ var addressCommand3 = new Command89("address").description("Show your registered email address").action(async () => {
19092
19105
  const keystore = await loadKeystore();
19093
19106
  const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
19094
19107
  printResult({ emailAddress: result.emailAddress ?? null });
19095
19108
  });
19096
19109
 
19097
19110
  // src/commands/email/mark-read.ts
19098
- import { Command as Command91 } from "commander";
19111
+ import { Command as Command90 } from "commander";
19099
19112
  async function setReadStatus(id, read4) {
19100
19113
  const keystore = await loadKeystore();
19101
19114
  const { data: result, idempotencyKey } = await apiPost(
@@ -19109,12 +19122,12 @@ async function setReadStatus(id, read4) {
19109
19122
  );
19110
19123
  printResult({ id: result.id, isRead: result.isRead }, { idempotencyKey });
19111
19124
  }
19112
- var markReadCommand = new Command91("mark-read").description("Mark an email as read or unread").argument("<id>", "Email ID").option("--unread", "Mark as unread instead of read").action(async (id, opts) => {
19125
+ 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
19126
  await setReadStatus(id, !opts.unread);
19114
19127
  });
19115
19128
 
19116
19129
  // src/commands/email/index.ts
19117
- var emailCommand = new Command92("email").description("Email management commands");
19130
+ var emailCommand = new Command91("email").description("Email management commands");
19118
19131
  emailCommand.addCommand(registerCommand);
19119
19132
  emailCommand.addCommand(inboxCommand2);
19120
19133
  emailCommand.addCommand(readCommand);
@@ -19125,10 +19138,10 @@ emailCommand.addCommand(addressCommand3);
19125
19138
  emailCommand.addCommand(markReadCommand);
19126
19139
 
19127
19140
  // src/commands/bug/index.ts
19128
- import { Command as Command101 } from "commander";
19141
+ import { Command as Command100 } from "commander";
19129
19142
 
19130
19143
  // src/commands/bug/browse.ts
19131
- import { Command as Command93 } from "commander";
19144
+ import { Command as Command92 } from "commander";
19132
19145
 
19133
19146
  // src/commands/bug/known-problem.ts
19134
19147
  async function fetchKnownProblem() {
@@ -19141,7 +19154,7 @@ async function fetchKnownProblem() {
19141
19154
  }
19142
19155
 
19143
19156
  // src/commands/bug/browse.ts
19144
- var browseCommand = new Command93("browse").description(
19157
+ var browseCommand = new Command92("browse").description(
19145
19158
  "Browse public bug reports, to check whether a bug is already known; no wallet needed"
19146
19159
  ).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
19160
  async (opts) => {
@@ -19188,7 +19201,7 @@ var browseCommand = new Command93("browse").description(
19188
19201
  );
19189
19202
 
19190
19203
  // src/commands/bug/comment.ts
19191
- import { Command as Command94 } from "commander";
19204
+ import { Command as Command93 } from "commander";
19192
19205
 
19193
19206
  // src/lib/stdin.ts
19194
19207
  var STDIN_FIRST_BYTE_MS = 5e3;
@@ -19242,7 +19255,7 @@ async function resolveBugReportId(ref) {
19242
19255
  }
19243
19256
 
19244
19257
  // src/commands/bug/comment.ts
19245
- var commentCommand = new Command94("comment").description(
19258
+ var commentCommand = new Command93("comment").description(
19246
19259
  "Comment on a public bug report. Comments are public: never include keys, seed phrases or other private data"
19247
19260
  ).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
19261
  const ref = parseBugReportRef(report);
@@ -19288,8 +19301,8 @@ var commentCommand = new Command94("comment").description(
19288
19301
  });
19289
19302
 
19290
19303
  // src/commands/bug/list.ts
19291
- import { Command as Command95 } from "commander";
19292
- var listCommand2 = new Command95("list").description("List the bug reports you submitted and their status").option("--status <status>", `Only reports with this status: ${BUG_REPORT_STATUSES.join(", ")}`).option("--limit <n>", "Maximum reports to return (1-100)", "50").action(async (opts) => {
19304
+ import { Command as Command94 } from "commander";
19305
+ 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
19306
  if (opts.status && !BUG_REPORT_STATUSES.includes(opts.status)) {
19294
19307
  printError(`--status must be one of ${BUG_REPORT_STATUSES.join(", ")}`);
19295
19308
  return;
@@ -19320,8 +19333,8 @@ var listCommand2 = new Command95("list").description("List the bug reports you s
19320
19333
  });
19321
19334
 
19322
19335
  // src/commands/bug/me-too.ts
19323
- import { Command as Command96 } from "commander";
19324
- var meTooCommand = new Command96("me-too").description("Say you hit a public bug report too; counted once per wallet").argument("<report>", BUG_REPORT_REF_HELP).action(async (report) => {
19336
+ import { Command as Command95 } from "commander";
19337
+ 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
19338
  const ref = parseBugReportRef(report);
19326
19339
  if (!ref) {
19327
19340
  printError(BUG_REPORT_REF_ERROR);
@@ -19345,8 +19358,8 @@ var meTooCommand = new Command96("me-too").description("Say you hit a public bug
19345
19358
  });
19346
19359
 
19347
19360
  // src/commands/bug/reply.ts
19348
- import { Command as Command97 } from "commander";
19349
- var replyCommand2 = new Command97("reply").description(
19361
+ import { Command as Command96 } from "commander";
19362
+ var replyCommand2 = new Command96("reply").description(
19350
19363
  "Reply to Taskmarket staff on one of your bug reports; a reply does not change its status"
19351
19364
  ).argument("<id>", "Bug report id").argument("[message]", 'Your reply; read from stdin when omitted or "-"').action(async (id, message) => {
19352
19365
  const body = await textOrStdin(message);
@@ -19380,8 +19393,8 @@ var replyCommand2 = new Command97("reply").description(
19380
19393
  });
19381
19394
 
19382
19395
  // src/commands/bug/show.ts
19383
- import { Command as Command98 } from "commander";
19384
- var showCommand = new Command98("show").description(
19396
+ import { Command as Command97 } from "commander";
19397
+ var showCommand = new Command97("show").description(
19385
19398
  "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
19399
  ).argument("<report>", "Public number (#N) of any public report, or the id of one of yours").action(async (report) => {
19387
19400
  const ref = parseBugReportRef(report);
@@ -19409,7 +19422,7 @@ var showCommand = new Command98("show").description(
19409
19422
  });
19410
19423
 
19411
19424
  // src/commands/bug/submit.ts
19412
- import { Command as Command99 } from "commander";
19425
+ import { Command as Command98 } from "commander";
19413
19426
 
19414
19427
  // src/commands/bug/context.ts
19415
19428
  import os from "os";
@@ -19433,7 +19446,7 @@ function cliVersionOf(command) {
19433
19446
  var LAST_COMMAND_MAX_CHARS = 2048;
19434
19447
  var LAST_ERROR_MAX_CHARS = 16 * 1024;
19435
19448
  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 Command99("submit").description(
19449
+ var submitCommand = new Command98("submit").description(
19437
19450
  "Report a Taskmarket bug; CLI version, OS, Node version and network are attached. Reports are public unless --private"
19438
19451
  ).requiredOption("--title <text>", "Short summary (at most 200 characters)").option(
19439
19452
  "--description <text>",
@@ -19509,8 +19522,8 @@ var submitCommand = new Command99("submit").description(
19509
19522
  });
19510
19523
 
19511
19524
  // src/commands/bug/visibility.ts
19512
- import { Command as Command100 } from "commander";
19513
- var visibilityCommand = new Command100("visibility").description(
19525
+ import { Command as Command99 } from "commander";
19526
+ var visibilityCommand = new Command99("visibility").description(
19514
19527
  "Make one of your bug reports public or private; a private report is seen only by you and staff"
19515
19528
  ).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
19529
  const ref = parseBugReportRef(report);
@@ -19545,7 +19558,7 @@ var visibilityCommand = new Command100("visibility").description(
19545
19558
  });
19546
19559
 
19547
19560
  // src/commands/bug/index.ts
19548
- var bugCommand = new Command101("bug").description(
19561
+ var bugCommand = new Command100("bug").description(
19549
19562
  "Report Taskmarket bugs, browse public reports, follow their status and reply to staff"
19550
19563
  );
19551
19564
  bugCommand.addCommand(submitCommand);
@@ -19558,7 +19571,7 @@ bugCommand.addCommand(commentCommand);
19558
19571
  bugCommand.addCommand(visibilityCommand);
19559
19572
 
19560
19573
  // src/commands/bookmark/index.ts
19561
- import { Command as Command103 } from "commander";
19574
+ import { Command as Command102 } from "commander";
19562
19575
 
19563
19576
  // src/commands/bookmark/auth.ts
19564
19577
  async function bookmarkAuth(action) {
@@ -19571,8 +19584,8 @@ async function bookmarkAuth(action) {
19571
19584
  }
19572
19585
 
19573
19586
  // src/commands/bookmark/collection.ts
19574
- import { Command as Command102 } from "commander";
19575
- var createCommand = new Command102("create").description("Create a private collection").argument("<name>", "Collection name, up to 120 characters").action(async (name) => {
19587
+ import { Command as Command101 } from "commander";
19588
+ var createCommand = new Command101("create").description("Create a private collection").argument("<name>", "Collection name, up to 120 characters").action(async (name) => {
19576
19589
  const trimmed = name.trim();
19577
19590
  if (trimmed.length === 0 || trimmed.length > 120) {
19578
19591
  printError("Collection name must be 1 to 120 characters");
@@ -19591,7 +19604,7 @@ var createCommand = new Command102("create").description("Create a private colle
19591
19604
  return renderFailure(error);
19592
19605
  }
19593
19606
  });
19594
- var listCommand3 = new Command102("list").description("List your collections; a published one carries its publishedSlug (/c/<slug>)").action(async () => {
19607
+ var listCommand3 = new Command101("list").description("List your collections; a published one carries its publishedSlug (/c/<slug>)").action(async () => {
19595
19608
  const auth = await bookmarkAuth("Listing collections");
19596
19609
  if (!auth) return;
19597
19610
  try {
@@ -19601,7 +19614,7 @@ var listCommand3 = new Command102("list").description("List your collections; a
19601
19614
  }
19602
19615
  });
19603
19616
  function publishToggle(name, description, action) {
19604
- return new Command102(name).description(description).argument("<collection-id>", "Collection id (from `taskmarket bookmark collection list`)").action(async (collectionId) => {
19617
+ return new Command101(name).description(description).argument("<collection-id>", "Collection id (from `taskmarket bookmark collection list`)").action(async (collectionId) => {
19605
19618
  const auth = await bookmarkAuth(action);
19606
19619
  if (!auth) return;
19607
19620
  try {
@@ -19617,7 +19630,7 @@ function publishToggle(name, description, action) {
19617
19630
  }
19618
19631
  });
19619
19632
  }
19620
- var collectionCommand = new Command102("collection").description(
19633
+ var collectionCommand = new Command101("collection").description(
19621
19634
  "Create, list, publish and unpublish bookmark collections"
19622
19635
  );
19623
19636
  collectionCommand.addCommand(createCommand);
@@ -19648,7 +19661,7 @@ function parseEntityType(value, flag) {
19648
19661
  function chainFor(entityType) {
19649
19662
  return entityType === "agent" ? { chainId: selectedNetwork().chainId } : {};
19650
19663
  }
19651
- var addCommand = new Command103("add").description(
19664
+ var addCommand = new Command102("add").description(
19652
19665
  "Bookmark a task, submission or agent; an agent is saved on the selected network (--network)"
19653
19666
  ).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
19667
  const entityType = parseEntityType(type, "<type>");
@@ -19676,7 +19689,7 @@ var addCommand = new Command103("add").description(
19676
19689
  return renderFailure(error);
19677
19690
  }
19678
19691
  });
19679
- var removeCommand = new Command103("remove").description("Remove a bookmark; an agent bookmark is matched on the selected network").argument("<type>", `What was bookmarked: ${ENTITY_TYPES.join(", ")}`).argument("<id>", "Task id, submission id or agent id").action(async (type, id) => {
19692
+ 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
19693
  const entityType = parseEntityType(type, "<type>");
19681
19694
  if (!entityType) return;
19682
19695
  const auth = await bookmarkAuth("Removing a bookmark");
@@ -19692,7 +19705,7 @@ var removeCommand = new Command103("remove").description("Remove a bookmark; an
19692
19705
  return renderFailure(error);
19693
19706
  }
19694
19707
  });
19695
- var listCommand4 = new Command103("list").description("List your bookmarks, newest first; agent entries carry their chainId").option("--type <type>", `Only one kind: ${ENTITY_TYPES.join(", ")}`).option("--collection <id>", "Only bookmarks in this collection").option("--pinned", "Only pinned bookmarks").option("--limit <n>", "Maximum bookmarks to return (1-100)", "50").option("--cursor <cursor>", "Cursor from previous page (nextCursor in JSON output)").action(
19708
+ 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
19709
  async (opts) => {
19697
19710
  const entityType = opts.type === void 0 ? void 0 : parseEntityType(opts.type, "--type");
19698
19711
  if (entityType === null) return;
@@ -19716,7 +19729,7 @@ var listCommand4 = new Command103("list").description("List your bookmarks, newe
19716
19729
  }
19717
19730
  );
19718
19731
  function pinToggle(name, description, action) {
19719
- return new Command103(name).description(description).argument("<id>", "Bookmark id (from `taskmarket bookmark list`)").action(async (id) => {
19732
+ return new Command102(name).description(description).argument("<id>", "Bookmark id (from `taskmarket bookmark list`)").action(async (id) => {
19720
19733
  const auth = await bookmarkAuth(action);
19721
19734
  if (!auth) return;
19722
19735
  try {
@@ -19731,7 +19744,7 @@ function pinToggle(name, description, action) {
19731
19744
  }
19732
19745
  });
19733
19746
  }
19734
- var countCommand = new Command103("count").description("Count your saved bookmarks").option("--pinned", "Count only pinned bookmarks").action(async (opts) => {
19747
+ var countCommand = new Command102("count").description("Count your saved bookmarks").option("--pinned", "Count only pinned bookmarks").action(async (opts) => {
19735
19748
  const auth = await bookmarkAuth("Counting bookmarks");
19736
19749
  if (!auth) return;
19737
19750
  const params = new URLSearchParams();
@@ -19745,7 +19758,7 @@ var countCommand = new Command103("count").description("Count your saved bookmar
19745
19758
  return renderFailure(error);
19746
19759
  }
19747
19760
  });
19748
- var bookmarkCommand = new Command103("bookmark").description(
19761
+ var bookmarkCommand = new Command102("bookmark").description(
19749
19762
  "Save tasks, submissions and agents to your private list, and share collections of them"
19750
19763
  );
19751
19764
  bookmarkCommand.addCommand(addCommand);
@@ -19762,7 +19775,7 @@ bookmarkCommand.addCommand(collectionCommand);
19762
19775
 
19763
19776
  // src/commands/skills/index.ts
19764
19777
  import { randomUUID as randomUUID4 } from "crypto";
19765
- import { Command as Command104 } from "commander";
19778
+ import { Command as Command103 } from "commander";
19766
19779
 
19767
19780
  // src/lib/skill-directory.ts
19768
19781
  import { lstat, readdir, readFile as readFile3 } from "fs/promises";
@@ -19902,7 +19915,7 @@ var bundleOptions = (command) => command.requiredOption("--agent <agentId>", "Th
19902
19915
  ).option("--request-key <uuid>", "Reuse to resend the same write without applying it twice");
19903
19916
  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
19917
  var createCommand2 = bundleOptions(
19905
- new Command104("create").description(
19918
+ new Command103("create").description(
19906
19919
  `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
19920
  ).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
19921
  ).action(async (dir, opts) => {
@@ -19920,7 +19933,7 @@ var createCommand2 = bundleOptions(
19920
19933
  }
19921
19934
  });
19922
19935
  var versionCommand = bundleOptions(
19923
- new Command104("version").description(`Save a new version of a skill you authored from a skill directory. ${SIZE_NOTE}`).argument("<skillId>", "The skill ID").argument("<dir>", "The skill directory, with SKILL.md at its root")
19936
+ 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
19937
  ).action(async (skillId, dir, opts) => {
19925
19938
  try {
19926
19939
  const { body, excluded } = await bundleWrite("version", dir, skillId, opts);
@@ -19937,7 +19950,7 @@ var versionCommand = bundleOptions(
19937
19950
  return fail(error);
19938
19951
  }
19939
19952
  });
19940
- var archiveCommand = new Command104("archive").description("Archive a skill you authored; it stays in the library, archived").argument("<skillId>", "The skill ID").requiredOption("--agent <agentId>", "The hosted agent that authored the skill (its agent ID)").option(
19953
+ 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
19954
  "--remove-assignments",
19942
19955
  "Also remove the skill from this agent's assignments; archiving is refused while other agents have it assigned"
19943
19956
  ).option("--request-key <uuid>", "Reuse to resend the same write without applying it twice").action(
@@ -19963,7 +19976,7 @@ var archiveCommand = new Command104("archive").description("Archive a skill you
19963
19976
  }
19964
19977
  }
19965
19978
  );
19966
- var skillsCommand = new Command104("skills").description(
19979
+ var skillsCommand = new Command103("skills").description(
19967
19980
  "Skills in your owner's library that you, a hosted agent, author: create, version and archive"
19968
19981
  );
19969
19982
  skillsCommand.addCommand(createCommand2);
@@ -19974,7 +19987,7 @@ skillsCommand.addCommand(archiveCommand);
19974
19987
  import { randomUUID as randomUUID5 } from "crypto";
19975
19988
  import fs10 from "fs/promises";
19976
19989
  import path8 from "path";
19977
- import { Command as Command105 } from "commander";
19990
+ import { Command as Command104 } from "commander";
19978
19991
  var BRIEF_COOKIE = "taskmarket_brief";
19979
19992
  var CREDENTIAL_PATTERN = /^[0-9a-f-]{36}\.[0-9a-f]{64}$/;
19980
19993
  var credentialFile = () => path8.join(getTaskmarketHome(), "brief.json");
@@ -20064,7 +20077,7 @@ async function sendTurn(credential, message, current, turnId = randomUUID5()) {
20064
20077
  )).data
20065
20078
  );
20066
20079
  }
20067
- var briefCommand = new Command105("brief").description(
20080
+ var briefCommand = new Command104("brief").description(
20068
20081
  "Draft a task brief in conversation with the drafting assistant"
20069
20082
  );
20070
20083
  briefCommand.command("start").description(
@@ -20118,11 +20131,11 @@ briefCommand.command("discard").description("Delete the saved brief").action(asy
20118
20131
  });
20119
20132
 
20120
20133
  // src/commands/requester/index.ts
20121
- import { Command as Command107 } from "commander";
20134
+ import { Command as Command106 } from "commander";
20122
20135
 
20123
20136
  // src/commands/requester/stats.ts
20124
- import { Command as Command106 } from "commander";
20125
- var requesterStatsCmd = new Command106("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address3) => {
20137
+ import { Command as Command105 } from "commander";
20138
+ var requesterStatsCmd = new Command105("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address3) => {
20126
20139
  if (!/^0x[0-9a-fA-F]{40}$/.test(address3)) {
20127
20140
  printError("Address must be a 0x-prefixed 20-byte hex string");
20128
20141
  return;
@@ -20136,23 +20149,23 @@ var requesterStatsCmd = new Command106("stats").description("Get requester reput
20136
20149
  });
20137
20150
 
20138
20151
  // src/commands/requester/index.ts
20139
- var requesterCmd = new Command107("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
20152
+ var requesterCmd = new Command106("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
20140
20153
 
20141
20154
  // src/commands/capabilities.ts
20142
- import { Command as Command108 } from "commander";
20155
+ import { Command as Command107 } from "commander";
20143
20156
  async function fetchCapabilities(category) {
20144
20157
  const input = parseInput(CapabilitiesListInputSchema, { category });
20145
20158
  const query4 = input.category ? `?category=${encodeURIComponent(input.category)}` : "";
20146
20159
  return CapabilitiesListResponseSchema.parse(await apiGet(`/api/capabilities${query4}`));
20147
20160
  }
20148
- var listCommand5 = new Command108("list").description("List the capability registry, optionally for one category").option("--category <id>", "Only this category (for example onchain or web-data)").action(async (opts) => {
20161
+ 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
20162
  try {
20150
20163
  printResult(await fetchCapabilities(opts.category));
20151
20164
  } catch (err) {
20152
20165
  renderFailure(err);
20153
20166
  }
20154
20167
  });
20155
- var showCommand2 = new Command108("show").description("Show one capability by slug").argument("<slug>", "Capability slug, for example web-search").action(async (slug) => {
20168
+ var showCommand2 = new Command107("show").description("Show one capability by slug").argument("<slug>", "Capability slug, for example web-search").action(async (slug) => {
20156
20169
  try {
20157
20170
  const { capabilities } = await fetchCapabilities();
20158
20171
  const entry = capabilities.find((item) => item.slug === slug);
@@ -20162,13 +20175,13 @@ var showCommand2 = new Command108("show").description("Show one capability by sl
20162
20175
  renderFailure(err);
20163
20176
  }
20164
20177
  });
20165
- var capabilitiesCommand = new Command108("capabilities").description("Read the listing capability registry").addCommand(listCommand5).addCommand(showCommand2);
20178
+ var capabilitiesCommand = new Command107("capabilities").description("Read the listing capability registry").addCommand(listCommand5).addCommand(showCommand2);
20166
20179
 
20167
20180
  // src/commands/x402/index.ts
20168
- import { Command as Command112 } from "commander";
20181
+ import { Command as Command111 } from "commander";
20169
20182
 
20170
20183
  // src/commands/x402/payments.ts
20171
- import { Command as Command109, Option as Option5 } from "commander";
20184
+ import { Command as Command108, Option as Option5 } from "commander";
20172
20185
  import { createInterface as createInterface5 } from "readline";
20173
20186
  var PAYMENT_STATES = [
20174
20187
  "reserved",
@@ -20194,7 +20207,7 @@ async function confirmManualResolution() {
20194
20207
  readline.close();
20195
20208
  return answer.trim().toLowerCase() === "resolve";
20196
20209
  }
20197
- var x402PaymentsCommand = new Command109("payments").description(
20210
+ var x402PaymentsCommand = new Command108("payments").description(
20198
20211
  "Inspect and reconcile X402 Pay payment records"
20199
20212
  );
20200
20213
  x402PaymentsCommand.command("list").description("List current payment records").addOption(new Option5("--state <state>", "Filter by state").choices(PAYMENT_STATES)).action(async (options) => {
@@ -20223,7 +20236,7 @@ x402PaymentsCommand.command("resolve").description("Manually record an externall
20223
20236
 
20224
20237
  // src/commands/x402/policy.ts
20225
20238
  import { promises as fs11 } from "fs";
20226
- import { Command as Command110 } from "commander";
20239
+ import { Command as Command109 } from "commander";
20227
20240
  import { createInterface as createInterface6 } from "readline";
20228
20241
  async function confirmUnattendedRule(rule) {
20229
20242
  if (!process.stdin.isTTY) {
@@ -20249,7 +20262,7 @@ async function confirmUnattendedRule(rule) {
20249
20262
  readline.close();
20250
20263
  return answer.trim().toLowerCase() === "authorize";
20251
20264
  }
20252
- var x402PolicyCommand = new Command110("policy").description(
20265
+ var x402PolicyCommand = new Command109("policy").description(
20253
20266
  "Manage local X402 Pay spending policy"
20254
20267
  );
20255
20268
  x402PolicyCommand.command("init").description("Create a deny-all policy file").action(async () => {
@@ -20285,14 +20298,14 @@ for (const enabled of [true, false]) {
20285
20298
  }
20286
20299
 
20287
20300
  // src/commands/x402/request.ts
20288
- import { Command as Command111, Option as Option6 } from "commander";
20301
+ import { Command as Command110, Option as Option6 } from "commander";
20289
20302
  function collect4(value, previous) {
20290
20303
  return [...previous, value];
20291
20304
  }
20292
20305
  function confirm(lines) {
20293
20306
  return confirmAtTerminal(lines, "use --non-interactive with policy");
20294
20307
  }
20295
- var x402RequestCommand = new Command111("request").description("Request and pay for a direct x402 HTTP resource (X402 Pay)").argument("<url>", "HTTPS resource URL").addOption(new Option6("--method <method>", "HTTP method").choices(["GET", "POST"]).default("GET")).option("--json <json>", "Inline JSON POST body").option("--body-file <path>", "Read JSON POST body from a file").option("--headers-file <path>", "Read request headers from an owner-only JSON file").option(
20308
+ 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
20309
  "--header-env <header=ENV_VAR>",
20297
20310
  "Read one request header from an environment variable (repeatable)",
20298
20311
  collect4,
@@ -20340,7 +20353,7 @@ var x402RequestCommand = new Command111("request").description("Request and pay
20340
20353
  );
20341
20354
 
20342
20355
  // src/commands/x402/index.ts
20343
- var x402Command = new Command112("x402").description(
20356
+ var x402Command = new Command111("x402").description(
20344
20357
  "Pay x402 services with local spending policies (X402 Pay)"
20345
20358
  );
20346
20359
  x402Command.addCommand(x402RequestCommand);
@@ -20348,10 +20361,10 @@ x402Command.addCommand(x402PolicyCommand);
20348
20361
  x402Command.addCommand(x402PaymentsCommand);
20349
20362
 
20350
20363
  // src/commands/sponsored-task/index.ts
20351
- import { Command as Command128 } from "commander";
20364
+ import { Command as Command127 } from "commander";
20352
20365
 
20353
20366
  // src/commands/sponsored-task/create.ts
20354
- import { Command as Command113 } from "commander";
20367
+ import { Command as Command112 } from "commander";
20355
20368
  import { toHex as toHex4 } from "viem";
20356
20369
 
20357
20370
  // ../../packages/contracts/evm/abi/generated/SponsoredTasksVaultV2.ts
@@ -24762,7 +24775,7 @@ async function createOnSolana(opts, keystore) {
24762
24775
  renderFailure(err);
24763
24776
  }
24764
24777
  }
24765
- var sponsoredTaskCreateCommand = new Command113("create").description("Create a new Sponsored Task vault for a project token").option(
24778
+ var sponsoredTaskCreateCommand = new Command112("create").description("Create a new Sponsored Task vault for a project token").option(
24766
24779
  "--factory <address>",
24767
24780
  "SponsoredTaskFactory contract address (EVM chains; defaults to the chain's newest factory, or the settler-mode factory on Robinhood Chain)"
24768
24781
  ).requiredOption(
@@ -24885,7 +24898,7 @@ Token risk: ${TOKEN_RISK}`
24885
24898
  );
24886
24899
 
24887
24900
  // src/commands/sponsored-task/fund.ts
24888
- import { Command as Command114 } from "commander";
24901
+ import { Command as Command113 } from "commander";
24889
24902
  function isValidAddress5(addr) {
24890
24903
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
24891
24904
  }
@@ -24919,7 +24932,7 @@ async function fundOnSolana(opts, keystore) {
24919
24932
  renderFailure(err);
24920
24933
  }
24921
24934
  }
24922
- var sponsoredTaskFundCommand = new Command114("fund").description("Fund a Sponsored Task vault with its project token (base units)").requiredOption("--vault <address>", "Vault address (base58 for a Solana vault)").option(
24935
+ 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
24936
  "--token <address>",
24924
24937
  "Project ERC-20 token address (EVM chains; Solana reads the vault's mint)"
24925
24938
  ).requiredOption(
@@ -24993,7 +25006,7 @@ var sponsoredTaskFundCommand = new Command114("fund").description("Fund a Sponso
24993
25006
  });
24994
25007
 
24995
25008
  // src/commands/sponsored-task/managers.ts
24996
- import { Command as Command115 } from "commander";
25009
+ import { Command as Command114 } from "commander";
24997
25010
 
24998
25011
  // src/lib/solana-payout-binding.ts
24999
25012
  var PROGRAM_ID_ENV = "TASKMARKET_SOLANA_SPONSORED_TASKS_PROGRAM_ID";
@@ -25327,7 +25340,7 @@ async function configure(opts) {
25327
25340
  active: opts.active
25328
25341
  });
25329
25342
  }
25330
- var sponsoredTaskManagersCommand = new Command115("managers").description(
25343
+ var sponsoredTaskManagersCommand = new Command114("managers").description(
25331
25344
  "Manage authorized managers for a Sponsored Task vault"
25332
25345
  );
25333
25346
  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 +25367,8 @@ sponsoredTaskManagersCommand.command("list").description("List a vault authorize
25354
25367
  });
25355
25368
 
25356
25369
  // src/commands/sponsored-task/managed.ts
25357
- import { Command as Command116 } from "commander";
25358
- var sponsoredTaskManagedCommand = new Command116("managed").description(
25370
+ import { Command as Command115 } from "commander";
25371
+ var sponsoredTaskManagedCommand = new Command115("managed").description(
25359
25372
  "List the active Sponsored Task vaults an address can fund tasks from as an active manager (defaults to your wallet)"
25360
25373
  ).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
25374
  let address3 = opts.address;
@@ -25385,8 +25398,8 @@ var sponsoredTaskManagedCommand = new Command116("managed").description(
25385
25398
  });
25386
25399
 
25387
25400
  // src/commands/sponsored-task/creation-fee.ts
25388
- import { Command as Command117 } from "commander";
25389
- var sponsoredTaskCreationFeeCommand = new Command117("creation-fee").description("Show the one-time fee for creating a Sponsored Task vault on a chain").requiredOption(
25401
+ import { Command as Command116 } from "commander";
25402
+ var sponsoredTaskCreationFeeCommand = new Command116("creation-fee").description("Show the one-time fee for creating a Sponsored Task vault on a chain").requiredOption(
25390
25403
  "--chain-id <chain>",
25391
25404
  "EVM chain the vault would be created on: a network name or chain id (e.g. base, 8453)",
25392
25405
  chainOption("--chain-id", "evm-vault")
@@ -25430,8 +25443,8 @@ var sponsoredTaskCreationFeeCommand = new Command117("creation-fee").description
25430
25443
  });
25431
25444
 
25432
25445
  // src/commands/sponsored-task/list.ts
25433
- import { Command as Command118 } from "commander";
25434
- var sponsoredTaskListCommand = new Command118("list").description("List Sponsored Task vaults").option("--limit <n>", "Max vaults to return", "50").option("--cursor <vaultId>", "Pagination cursor").option("--include-unverified", "Include vaults not yet curator-approved", false).option("--owner <address>", "Only vaults this address owns, whatever their curation status").option("--mine", "Only the vaults your wallet owns", false).action(
25446
+ import { Command as Command117 } from "commander";
25447
+ 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
25448
  async (opts) => {
25436
25449
  if (opts.owner && opts.mine) {
25437
25450
  printError("Pass --owner or --mine, not both");
@@ -25460,8 +25473,8 @@ var sponsoredTaskListCommand = new Command118("list").description("List Sponsore
25460
25473
  );
25461
25474
 
25462
25475
  // src/commands/sponsored-task/settlements.ts
25463
- import { Command as Command119 } from "commander";
25464
- var sponsoredTaskSettlementsCommand = new Command119("settlements").description("List the settlements a Sponsored Task vault has installed, newest first").argument("<vaultId>", "Vault id").option("--limit <n>", "Max settlements to return (1-100)", "25").option("--cursor <cursor>", "Pagination cursor from a previous nextCursor").action(async (vaultId, opts) => {
25476
+ import { Command as Command118 } from "commander";
25477
+ 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
25478
  const limit = Number(opts.limit);
25466
25479
  if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
25467
25480
  printError("--limit must be an integer from 1 to 100");
@@ -25476,17 +25489,17 @@ var sponsoredTaskSettlementsCommand = new Command119("settlements").description(
25476
25489
  });
25477
25490
 
25478
25491
  // src/commands/sponsored-task/show.ts
25479
- import { Command as Command120 } from "commander";
25480
- var sponsoredTaskShowCommand = new Command120("show").description("Show a Sponsored Task vault by id").argument("<vaultId>", "Vault id").action(async (vaultId) => {
25492
+ import { Command as Command119 } from "commander";
25493
+ var sponsoredTaskShowCommand = new Command119("show").description("Show a Sponsored Task vault by id").argument("<vaultId>", "Vault id").action(async (vaultId) => {
25481
25494
  const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}`);
25482
25495
  printResult(result);
25483
25496
  });
25484
25497
 
25485
25498
  // src/commands/sponsored-task/request-review.ts
25486
25499
  import { randomBytes as randomBytes6 } from "crypto";
25487
- import { Command as Command121 } from "commander";
25500
+ import { Command as Command120 } from "commander";
25488
25501
  var REQUEST_TTL_SECONDS = 5 * 60;
25489
- var sponsoredTaskRequestReviewCommand = new Command121("request-review").description("Ask Taskmarket curators to review a Sponsored Task vault (vault owner only)").argument("<vaultId>", "Vault id").action(async (vaultId) => {
25502
+ 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
25503
  let keystore;
25491
25504
  try {
25492
25505
  keystore = await loadKeystore();
@@ -25543,18 +25556,18 @@ var sponsoredTaskRequestReviewCommand = new Command121("request-review").descrip
25543
25556
  });
25544
25557
 
25545
25558
  // src/commands/sponsored-task/balance.ts
25546
- import { Command as Command122 } from "commander";
25547
- var sponsoredTaskBalanceCommand = new Command122("balance").description("Show a Sponsored Task vault funded/available/reserved balances").argument("<vaultId>", "Vault id").action(async (vaultId) => {
25559
+ import { Command as Command121 } from "commander";
25560
+ var sponsoredTaskBalanceCommand = new Command121("balance").description("Show a Sponsored Task vault funded/available/reserved balances").argument("<vaultId>", "Vault id").action(async (vaultId) => {
25548
25561
  const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}/balance`);
25549
25562
  printResult(result);
25550
25563
  });
25551
25564
 
25552
25565
  // src/commands/sponsored-task/withdraw.ts
25553
- import { Command as Command123 } from "commander";
25566
+ import { Command as Command122 } from "commander";
25554
25567
  function isValidAddress7(addr) {
25555
25568
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
25556
25569
  }
25557
- var sponsoredTaskWithdrawCommand = new Command123("withdraw").description("Withdraw unreserved project tokens from a vault (owner only)").requiredOption("--vault <address>", "Vault address").requiredOption(
25570
+ var sponsoredTaskWithdrawCommand = new Command122("withdraw").description("Withdraw unreserved project tokens from a vault (owner only)").requiredOption("--vault <address>", "Vault address").requiredOption(
25558
25571
  "--chain-id <chain>",
25559
25572
  "EVM chain the vault is deployed on: a network name or chain id (e.g. base, robinhood, 8453)",
25560
25573
  chainOption("--chain-id", "evm-vault")
@@ -25590,11 +25603,11 @@ var sponsoredTaskWithdrawCommand = new Command123("withdraw").description("Withd
25590
25603
  });
25591
25604
 
25592
25605
  // src/commands/sponsored-task/exit.ts
25593
- import { Command as Command124 } from "commander";
25606
+ import { Command as Command123 } from "commander";
25594
25607
  function isValidAddress8(addr) {
25595
25608
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
25596
25609
  }
25597
- var sponsoredTaskExitCommand = new Command124("exit").description(
25610
+ var sponsoredTaskExitCommand = new Command123("exit").description(
25598
25611
  "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
25612
  ).requiredOption("--vault <address>", "Vault address (base58 for a Solana vault)").requiredOption(
25600
25613
  "--chain-id <chain>",
@@ -25670,7 +25683,7 @@ var sponsoredTaskExitCommand = new Command124("exit").description(
25670
25683
  });
25671
25684
 
25672
25685
  // src/commands/sponsored-task/claim.ts
25673
- import { Command as Command125 } from "commander";
25686
+ import { Command as Command124 } from "commander";
25674
25687
  var CLAIM_TO_TYPES = {
25675
25688
  ClaimTo: [
25676
25689
  { name: "vaultId", type: "bytes32" },
@@ -25735,7 +25748,7 @@ async function findEntitlement(vaultId, workerAddress, taskId, options = {}) {
25735
25748
  await sleep4(3e3);
25736
25749
  }
25737
25750
  }
25738
- var sponsoredTaskClaimCommand = new Command125("claim").description("Claim your unclaimed Sponsored Task reward for a vault task").argument("<vaultId>", "Vault id").option(
25751
+ var sponsoredTaskClaimCommand = new Command124("claim").description("Claim your unclaimed Sponsored Task reward for a vault task").argument("<vaultId>", "Vault id").option(
25739
25752
  "--task-id <id>",
25740
25753
  "Claim the entitlement for a specific task (defaults to the first unclaimed one)"
25741
25754
  ).action(async (vaultId, opts) => {
@@ -25851,10 +25864,10 @@ var sponsoredTaskClaimCommand = new Command125("claim").description("Claim your
25851
25864
  });
25852
25865
 
25853
25866
  // src/commands/sponsored-task/rewards.ts
25854
- import { Command as Command126 } from "commander";
25867
+ import { Command as Command125 } from "commander";
25855
25868
  var REWARD_STATES = SponsoredTaskRewardStateSchema.options;
25856
25869
  var CLAIM_STATUSES = SponsoredTaskWorkerRewardClaimStatusSchema.options;
25857
- var sponsoredTaskRewardsCommand = new Command126("rewards").description("List Sponsored Task rewards across every vault (defaults to your wallet)").option("--address <address>", "Worker address (defaults to your wallet)").option("--state <state>", `Reward state: ${REWARD_STATES.join(", ")}`).option("--claim-status <status>", `Claim status: ${CLAIM_STATUSES.join(", ")}`).option("--limit <n>", "Max rewards to return (1-100)", "50").option("--cursor <cursor>", "Pagination cursor from a previous nextCursor").action(
25870
+ 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
25871
  async (opts) => {
25859
25872
  let address3 = opts.address;
25860
25873
  if (address3 === void 0) {
@@ -25894,7 +25907,7 @@ var sponsoredTaskRewardsCommand = new Command126("rewards").description("List Sp
25894
25907
  );
25895
25908
 
25896
25909
  // src/commands/sponsored-task/bind-payout.ts
25897
- import { Command as Command127 } from "commander";
25910
+ import { Command as Command126 } from "commander";
25898
25911
  async function solanaRewards(agent) {
25899
25912
  try {
25900
25913
  const result = await apiGet(
@@ -25905,7 +25918,7 @@ async function solanaRewards(agent) {
25905
25918
  return [];
25906
25919
  }
25907
25920
  }
25908
- var sponsoredTaskBindPayoutCommand = new Command127("bind-payout").description(
25921
+ var sponsoredTaskBindPayoutCommand = new Command126("bind-payout").description(
25909
25922
  "Bind the Solana address that receives your Solana Sponsored Task awards (once; rebinding replaces it)"
25910
25923
  ).option(
25911
25924
  "--address <solana-address>",
@@ -26044,7 +26057,7 @@ function bindingTaskChainIds(requested, connection, everyChain) {
26044
26057
  }
26045
26058
 
26046
26059
  // src/commands/sponsored-task/index.ts
26047
- var sponsoredTaskCommand = new Command128("sponsored-task").description(
26060
+ var sponsoredTaskCommand = new Command127("sponsored-task").description(
26048
26061
  "Sponsored Task vault administration and reward claims"
26049
26062
  );
26050
26063
  sponsoredTaskCommand.addCommand(sponsoredTaskCreateCommand);
@@ -26064,10 +26077,10 @@ sponsoredTaskCommand.addCommand(sponsoredTaskRewardsCommand);
26064
26077
  sponsoredTaskCommand.addCommand(sponsoredTaskBindPayoutCommand);
26065
26078
 
26066
26079
  // src/commands/project/index.ts
26067
- import { Command as Command150 } from "commander";
26080
+ import { Command as Command149 } from "commander";
26068
26081
 
26069
26082
  // src/commands/project/accept.ts
26070
- import { Command as Command129 } from "commander";
26083
+ import { Command as Command128 } from "commander";
26071
26084
 
26072
26085
  // src/commands/project/shared.ts
26073
26086
  var ADDRESS = /^0x[0-9a-fA-F]{40}$/;
@@ -26192,7 +26205,7 @@ async function postProjectWrite(path9, body, options) {
26192
26205
 
26193
26206
  // src/commands/project/accept.ts
26194
26207
  var TERMS_HASH = /^0x[0-9a-fA-F]{64}$/;
26195
- var projectAcceptCommand = new Command129("accept").description(
26208
+ var projectAcceptCommand = new Command128("accept").description(
26196
26209
  "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
26210
  ).argument("<projectId>", "Project id").option(
26198
26211
  "--terms-hash <hash>",
@@ -26224,7 +26237,7 @@ var projectAcceptCommand = new Command129("accept").description(
26224
26237
  });
26225
26238
 
26226
26239
  // src/commands/project/add-task.ts
26227
- import { Command as Command130 } from "commander";
26240
+ import { Command as Command129 } from "commander";
26228
26241
  function deadlineCheck(durationHours, project, now = /* @__PURE__ */ new Date()) {
26229
26242
  if (!project?.endsAt || !Number.isFinite(durationHours)) return null;
26230
26243
  const endsAt = new Date(project.endsAt);
@@ -26286,7 +26299,7 @@ function parseContinuation(flags) {
26286
26299
  function collect5(value, previous = []) {
26287
26300
  return [...previous, value];
26288
26301
  }
26289
- var projectAddTaskCommand = new Command130("add-task").description(
26302
+ var projectAddTaskCommand = new Command129("add-task").description(
26290
26303
  "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
26304
  ).argument("<projectId>", "Project id");
26292
26305
  for (const option of createCmd.options) {
@@ -26338,7 +26351,7 @@ projectAddTaskCommand.action(async (id, opts) => {
26338
26351
  });
26339
26352
 
26340
26353
  // src/commands/project/automations.ts
26341
- import { Command as Command131 } from "commander";
26354
+ import { Command as Command130 } from "commander";
26342
26355
  function automationsOnBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
26343
26356
  if (opts.cap === void 0) {
26344
26357
  return { error: "--cap is required: the most the automations may draw from the budget" };
@@ -26367,7 +26380,7 @@ function automationsOnBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
26367
26380
  }
26368
26381
  return body;
26369
26382
  }
26370
- var projectAutomationsOnCommand = new Command131("on").description(
26383
+ var projectAutomationsOnCommand = new Command130("on").description(
26371
26384
  "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
26385
  ).argument("<projectId>", "Project id").option(
26373
26386
  "--cap <amount>",
@@ -26395,7 +26408,7 @@ var projectAutomationsOnCommand = new Command131("on").description(
26395
26408
  });
26396
26409
  }
26397
26410
  );
26398
- var projectAutomationsOffCommand = new Command131("off").description(
26411
+ var projectAutomationsOffCommand = new Command130("off").description(
26399
26412
  "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
26413
  ).argument("<projectId>", "Project id").action(async (id) => {
26401
26414
  const projectId = parseProjectId(id);
@@ -26406,7 +26419,7 @@ var projectAutomationsOffCommand = new Command131("off").description(
26406
26419
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
26407
26420
  );
26408
26421
  });
26409
- var projectAutomationsStatusCommand = new Command131("status").description(
26422
+ var projectAutomationsStatusCommand = new Command130("status").description(
26410
26423
  "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
26424
  ).argument("<projectId>", "Project id").action(async (id) => {
26412
26425
  const projectId = parseProjectId(id);
@@ -26417,13 +26430,13 @@ var projectAutomationsStatusCommand = new Command131("status").description(
26417
26430
  renderFailure(err);
26418
26431
  }
26419
26432
  });
26420
- var projectAutomationsCommand = new Command131("automations").description(
26433
+ var projectAutomationsCommand = new Command130("automations").description(
26421
26434
  "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
26435
  ).addCommand(projectAutomationsOnCommand).addCommand(projectAutomationsOffCommand).addCommand(projectAutomationsStatusCommand);
26423
26436
 
26424
26437
  // src/commands/project/claim.ts
26425
- import { Command as Command132 } from "commander";
26426
- var projectClaimCommand = new Command132("claim").description(
26438
+ import { Command as Command131 } from "commander";
26439
+ var projectClaimCommand = new Command131("claim").description(
26427
26440
  "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
26441
  ).argument("<projectId>", "Project id").option("--backer <address>", "The backer to pay (default: your wallet)").action(async (id, opts) => {
26429
26442
  const projectId = parseProjectId(id);
@@ -26443,8 +26456,8 @@ var projectClaimCommand = new Command132("claim").description(
26443
26456
  });
26444
26457
 
26445
26458
  // src/commands/project/close.ts
26446
- import { Command as Command133 } from "commander";
26447
- var projectCloseCommand = new Command133("close").description(
26459
+ import { Command as Command132 } from "commander";
26460
+ var projectCloseCommand = new Command132("close").description(
26448
26461
  "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
26462
  ).argument("<projectId>", "Project id").action(async (id) => {
26450
26463
  const projectId = parseProjectId(id);
@@ -26457,13 +26470,13 @@ var projectCloseCommand = new Command133("close").description(
26457
26470
  });
26458
26471
 
26459
26472
  // src/commands/project/create.ts
26460
- import { Command as Command136 } from "commander";
26473
+ import { Command as Command135 } from "commander";
26461
26474
 
26462
26475
  // src/commands/project/suggestions.ts
26463
- import { Command as Command135 } from "commander";
26476
+ import { Command as Command134 } from "commander";
26464
26477
 
26465
26478
  // src/commands/project/suggestion-proposals.ts
26466
- import { Command as Command134 } from "commander";
26479
+ import { Command as Command133 } from "commander";
26467
26480
  var QUERY_ERRORS = {
26468
26481
  status: "--status must be pending, closed or expired",
26469
26482
  limit: "--limit must be an integer from 1 to 50",
@@ -26514,7 +26527,7 @@ async function read(path9) {
26514
26527
  function collectSuggestion(value, previous) {
26515
26528
  return [...previous, value];
26516
26529
  }
26517
- var projectSuggestionProposalsCommand = new Command134("proposals").description(
26530
+ var projectSuggestionProposalsCommand = new Command133("proposals").description(
26518
26531
  "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
26532
  ).argument("<projectId>", "Project id").option(
26520
26533
  "--status <status>",
@@ -26529,7 +26542,7 @@ var projectSuggestionProposalsCommand = new Command134("proposals").description(
26529
26542
  if (typeof query4 !== "string") return void printError(query4.error);
26530
26543
  await read(`/api/projects/${projectId}/suggestion-proposals${query4 ? `?${query4}` : ""}`);
26531
26544
  });
26532
- var proposalShowCommand = new Command134("show").description(
26545
+ var proposalShowCommand = new Command133("show").description(
26533
26546
  "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
26547
  ).argument("<proposalId>", "Proposal id").action(async (value) => {
26535
26548
  const id = parseProposalId(value);
@@ -26537,7 +26550,7 @@ var proposalShowCommand = new Command134("show").description(
26537
26550
  await read(`/api/suggestion-proposals/${id}`);
26538
26551
  });
26539
26552
  function decisionCommand(action, description) {
26540
- return new Command134(action).description(description).argument("<proposalId>", "Proposal id").option(
26553
+ return new Command133(action).description(description).argument("<proposalId>", "Proposal id").option(
26541
26554
  "--suggestion <suggestionId>",
26542
26555
  `Only this pick; repeat it for each (default: every pending pick)`,
26543
26556
  collectSuggestion,
@@ -26554,7 +26567,7 @@ function decisionCommand(action, description) {
26554
26567
  );
26555
26568
  });
26556
26569
  }
26557
- var projectSuggestionProposalCommand = new Command134("proposal").description(
26570
+ var projectSuggestionProposalCommand = new Command133("proposal").description(
26558
26571
  "One suggestion proposal, as the project's owner: show it, confirm its picks so the platform runner creates their tasks, or drop them"
26559
26572
  ).addCommand(proposalShowCommand).addCommand(
26560
26573
  decisionCommand(
@@ -26668,7 +26681,7 @@ async function signedRead(path9) {
26668
26681
  renderFailure(err);
26669
26682
  }
26670
26683
  }
26671
- var projectSuggestCommand = new Command135("suggest").description(
26684
+ var projectSuggestCommand = new Command134("suggest").description(
26672
26685
  "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
26686
  ).argument("<projectId>", "Project id").option("--title <text>", "Required: one line, 1 to 120 characters").option(
26674
26687
  "--brief <text>",
@@ -26688,7 +26701,7 @@ var projectSuggestCommand = new Command135("suggest").description(
26688
26701
  maxAmount: ACTION_FEE_MAX_AMOUNT
26689
26702
  });
26690
26703
  });
26691
- var projectSuggestionsCommand = new Command135("suggestions").description(
26704
+ var projectSuggestionsCommand = new Command134("suggestions").description(
26692
26705
  "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
26706
  ).argument("<projectId>", "Project id").option(
26694
26707
  "--status <status>",
@@ -26706,7 +26719,7 @@ var projectSuggestionsCommand = new Command135("suggestions").description(
26706
26719
  if (typeof query4 !== "string") return void printError(query4.error);
26707
26720
  await signedRead(`/api/projects/${projectId}/suggestions${query4 ? `?${query4}` : ""}`);
26708
26721
  });
26709
- var showCommand3 = new Command135("show").description("Show a suggestion with its status, votes and backedShares (free)").argument("<suggestionId>", "Suggestion id").action(async (value) => {
26722
+ var showCommand3 = new Command134("show").description("Show a suggestion with its status, votes and backedShares (free)").argument("<suggestionId>", "Suggestion id").action(async (value) => {
26710
26723
  const id = parseSuggestionId(value);
26711
26724
  if (typeof id !== "string") return void printError(id.error);
26712
26725
  await signedRead(`/api/project-suggestions/${id}`);
@@ -26720,7 +26733,7 @@ async function readAuthFor(what) {
26720
26733
  return { headers: auth.headers };
26721
26734
  }
26722
26735
  function voteCommand(action, description) {
26723
- return new Command135(action).description(description).argument("<suggestionId>", "Suggestion id").action(async (value) => {
26736
+ return new Command134(action).description(description).argument("<suggestionId>", "Suggestion id").action(async (value) => {
26724
26737
  const suggestionId = parseSuggestionId(value);
26725
26738
  if (typeof suggestionId !== "string") return void printError(suggestionId.error);
26726
26739
  const auth = await readAuthFor(action === "vote" ? "Voting" : "Taking back a vote");
@@ -26743,7 +26756,7 @@ function voteCommand(action, description) {
26743
26756
  }
26744
26757
  });
26745
26758
  }
26746
- var reportCommand = new Command135("report").description(
26759
+ var reportCommand = new Command134("report").description(
26747
26760
  "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
26761
  ).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
26762
  const suggestionId = parseSuggestionId(value);
@@ -26782,7 +26795,7 @@ var reportCommand = new Command135("report").description(
26782
26795
  renderFailure(err);
26783
26796
  }
26784
26797
  });
26785
- var withdrawCommand2 = new Command135("withdraw").description("Withdraw your open suggestion, as its author (costs 0.001 in the payment token)").argument("<suggestionId>", "Suggestion id").action(async (value) => {
26798
+ 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
26799
  const suggestionId = parseSuggestionId(value);
26787
26800
  if (typeof suggestionId !== "string") return void printError(suggestionId.error);
26788
26801
  await postProjectWrite(
@@ -26791,7 +26804,7 @@ var withdrawCommand2 = new Command135("withdraw").description("Withdraw your ope
26791
26804
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
26792
26805
  );
26793
26806
  });
26794
- var declineCommand = new Command135("decline").description(
26807
+ var declineCommand = new Command134("decline").description(
26795
26808
  "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
26809
  ).argument("<suggestionId>", "Suggestion id").option("--reason <text>", "Why, shown to everyone: up to 500 characters").action(async (value, opts) => {
26797
26810
  const suggestionId = parseSuggestionId(value);
@@ -26806,7 +26819,7 @@ var declineCommand = new Command135("decline").description(
26806
26819
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
26807
26820
  );
26808
26821
  });
26809
- var projectSuggestionCommand = new Command135("suggestion").description(
26822
+ var projectSuggestionCommand = new Command134("suggestion").description(
26810
26823
  "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
26824
  ).addCommand(showCommand3).addCommand(
26812
26825
  voteCommand(
@@ -26816,7 +26829,7 @@ var projectSuggestionCommand = new Command135("suggestion").description(
26816
26829
  ).addCommand(
26817
26830
  voteCommand("unvote", "Take back your upvote on a suggestion (free, signed by your wallet)")
26818
26831
  ).addCommand(reportCommand).addCommand(withdrawCommand2).addCommand(declineCommand).addCommand(projectSuggestionProposalsCommand).addCommand(projectSuggestionProposalCommand);
26819
- var projectSuggestionSettingsCommand = new Command135("suggestion-settings").description(
26832
+ var projectSuggestionSettingsCommand = new Command134("suggestion-settings").description(
26820
26833
  "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
26834
  ).argument("<projectId>", "Project id").option(
26822
26835
  "--suggestions <setting>",
@@ -26851,7 +26864,7 @@ var projectSuggestionSettingsCommand = new Command135("suggestion-settings").des
26851
26864
  });
26852
26865
 
26853
26866
  // src/commands/project/create.ts
26854
- var projectCreateCommand = new Command136("create").description(
26867
+ var projectCreateCommand = new Command135("create").description(
26855
26868
  "Open a project: one budget that funds tasks of any mode (costs the budget, in the payment token)"
26856
26869
  ).requiredOption("--budget <amount>", "Opening budget in the payment token (e.g. 50)").requiredOption(
26857
26870
  "--ends-at <time>",
@@ -26900,9 +26913,9 @@ var projectCreateCommand = new Command136("create").description(
26900
26913
  );
26901
26914
 
26902
26915
  // src/commands/project/extend.ts
26903
- import { Command as Command137 } from "commander";
26916
+ import { Command as Command136 } from "commander";
26904
26917
  var MAX_EXTENSION_MS = 365 * 24 * 3600 * 1e3;
26905
- var projectExtendCommand = new Command137("extend").description(
26918
+ var projectExtendCommand = new Command136("extend").description(
26906
26919
  "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
26920
  ).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
26921
  const projectId = parseProjectId(id);
@@ -26920,8 +26933,8 @@ var projectExtendCommand = new Command137("extend").description(
26920
26933
  });
26921
26934
 
26922
26935
  // src/commands/project/fund.ts
26923
- import { Command as Command138 } from "commander";
26924
- var projectFundCommand = new Command138("fund").description(
26936
+ import { Command as Command137 } from "commander";
26937
+ var projectFundCommand = new Command137("fund").description(
26925
26938
  "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
26939
  ).argument("<projectId>", "Project id").requiredOption("--amount <amount>", "Amount in the payment token (e.g. 10)").option(
26927
26940
  "--on-behalf-of <address>",
@@ -26943,7 +26956,7 @@ var projectFundCommand = new Command138("fund").description(
26943
26956
  });
26944
26957
 
26945
26958
  // src/commands/project/grant.ts
26946
- import { Command as Command139 } from "commander";
26959
+ import { Command as Command138 } from "commander";
26947
26960
  function grantBody(projectId, opts) {
26948
26961
  if (!ADDRESS.test(opts.operator)) {
26949
26962
  return { error: "--operator must be a wallet address (0x + 40 hex chars)" };
@@ -26966,7 +26979,7 @@ function grantBody(projectId, opts) {
26966
26979
  revokeRemovesControl: opts.revokeRemovesControl
26967
26980
  };
26968
26981
  }
26969
- var projectGrantCommand = new Command139("grant").description(
26982
+ var projectGrantCommand = new Command138("grant").description(
26970
26983
  "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
26984
  ).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The wallet granted the right to spend the budget").option(
26972
26985
  "--cap <amount>",
@@ -26992,7 +27005,7 @@ var projectGrantCommand = new Command139("grant").description(
26992
27005
  });
26993
27006
 
26994
27007
  // src/commands/project/review.ts
26995
- import { Command as Command140 } from "commander";
27008
+ import { Command as Command139 } from "commander";
26996
27009
  function reviewEvaluator(opts) {
26997
27010
  if (opts.evaluator !== void 0 && opts.off) {
26998
27011
  return { error: "Pass --evaluator <address> or --off, not both" };
@@ -27007,7 +27020,7 @@ function reviewEvaluator(opts) {
27007
27020
  }
27008
27021
  return opts.evaluator;
27009
27022
  }
27010
- var projectReviewCommand = new Command140("review").description(
27023
+ var projectReviewCommand = new Command139("review").description(
27011
27024
  "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
27025
  ).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
27026
  const projectId = parseProjectId(id);
@@ -27049,8 +27062,8 @@ async function ownerEvaluatorWarnings(evaluator) {
27049
27062
  }
27050
27063
 
27051
27064
  // src/commands/project/raise-cap.ts
27052
- import { Command as Command141 } from "commander";
27053
- var projectRaiseCapCommand = new Command141("raise-cap").description(
27065
+ import { Command as Command140 } from "commander";
27066
+ var projectRaiseCapCommand = new Command140("raise-cap").description(
27054
27067
  "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
27068
  ).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
27069
  const projectId = parseProjectId(id);
@@ -27068,8 +27081,8 @@ var projectRaiseCapCommand = new Command141("raise-cap").description(
27068
27081
  });
27069
27082
 
27070
27083
  // src/commands/project/lower-cap.ts
27071
- import { Command as Command142 } from "commander";
27072
- var projectLowerCapCommand = new Command142("lower-cap").description(
27084
+ import { Command as Command141 } from "commander";
27085
+ var projectLowerCapCommand = new Command141("lower-cap").description(
27073
27086
  "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
27087
  ).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose cap to lower").requiredOption(
27075
27088
  "--cap <amount>",
@@ -27091,7 +27104,7 @@ var projectLowerCapCommand = new Command142("lower-cap").description(
27091
27104
  });
27092
27105
 
27093
27106
  // src/commands/project/limits.ts
27094
- import { Command as Command143 } from "commander";
27107
+ import { Command as Command142 } from "commander";
27095
27108
  function limitsBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
27096
27109
  if (!ADDRESS.test(opts.operator)) {
27097
27110
  return { error: "--operator must be a wallet address (0x + 40 hex chars)" };
@@ -27131,7 +27144,7 @@ function limitsBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
27131
27144
  }
27132
27145
  return body;
27133
27146
  }
27134
- var projectLimitsCommand = new Command143("limits").description(
27147
+ var projectLimitsCommand = new Command142("limits").description(
27135
27148
  "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
27149
  ).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose limits to set").option(
27137
27150
  "--expires <time>",
@@ -27153,8 +27166,8 @@ var projectLimitsCommand = new Command143("limits").description(
27153
27166
  });
27154
27167
 
27155
27168
  // src/commands/project/revoke.ts
27156
- import { Command as Command144 } from "commander";
27157
- var projectRevokeCommand = new Command144("revoke").description(
27169
+ import { Command as Command143 } from "commander";
27170
+ var projectRevokeCommand = new Command143("revoke").description(
27158
27171
  "End an operator's right to create tasks from the project, as its owner (costs 0.001 in the payment token)"
27159
27172
  ).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator to revoke").action(async (id, opts) => {
27160
27173
  const projectId = parseProjectId(id);
@@ -27173,7 +27186,7 @@ var projectRevokeCommand = new Command144("revoke").description(
27173
27186
  });
27174
27187
 
27175
27188
  // src/commands/project/schedule.ts
27176
- import { Command as Command147 } from "commander";
27189
+ import { Command as Command146 } from "commander";
27177
27190
 
27178
27191
  // src/lib/owner-list.ts
27179
27192
  import { getAddress as getAddress2, isAddress as isAddress5 } from "viem";
@@ -27213,7 +27226,7 @@ function ownerListQuery(owner, opts, statuses) {
27213
27226
  }
27214
27227
 
27215
27228
  // src/commands/project/suggestion-schedule.ts
27216
- import { Command as Command145 } from "commander";
27229
+ import { Command as Command144 } from "commander";
27217
27230
  var SUGGESTION_ONLY_FLAGS = [
27218
27231
  ["--rank", "rank"],
27219
27232
  ["--min-backed-share", "minBackedShare"],
@@ -27404,7 +27417,7 @@ function addSuggestionScheduleOptions(command) {
27404
27417
  ).option("--no-email-picks", "Suggestions schedules: do not email when picks are waiting");
27405
27418
  }
27406
27419
  var suggestionScheduleSettingsCommand = addSuggestionScheduleOptions(
27407
- new Command145("suggestion-settings").description(
27420
+ new Command144("suggestion-settings").description(
27408
27421
  "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
27422
  ).argument("<scheduleId>", "Schedule id").option(
27410
27423
  "--mode <mode>",
@@ -27438,7 +27451,7 @@ var suggestionScheduleSettingsCommand = addSuggestionScheduleOptions(
27438
27451
 
27439
27452
  // src/commands/workflow-template.ts
27440
27453
  import { readFile as readFile4 } from "fs/promises";
27441
- import { Command as Command146 } from "commander";
27454
+ import { Command as Command145 } from "commander";
27442
27455
  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
27456
  var ADDRESS2 = /^0x[0-9a-fA-F]{40}$/;
27444
27457
  var FILE_MAX_BYTES = 256 * 1024;
@@ -27532,7 +27545,7 @@ async function readValidTemplate(path9) {
27532
27545
  }
27533
27546
  return parsed.document;
27534
27547
  }
27535
- var createCommand3 = new Command146("create").description(
27548
+ var createCommand3 = new Command145("create").description(
27536
27549
  "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
27550
  ).requiredOption("--file <path>", "The template, JSON").action(async (opts) => {
27538
27551
  const template = await readValidTemplate(opts.file);
@@ -27543,7 +27556,7 @@ var createCommand3 = new Command146("create").description(
27543
27556
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
27544
27557
  );
27545
27558
  });
27546
- var updateCommand = new Command146("update").description(
27559
+ var updateCommand = new Command145("update").description(
27547
27560
  "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
27561
  ).argument("<templateId>", "Template id").requiredOption("--file <path>", "The template, JSON").action(async (value, opts) => {
27549
27562
  const choice = templateChoice(value);
@@ -27597,7 +27610,7 @@ function parseTemplateSearch(opts) {
27597
27610
  }
27598
27611
  return { query: query4 };
27599
27612
  }
27600
- var listCommand6 = new Command146("list").description(
27613
+ var listCommand6 = new Command145("list").description(
27601
27614
  "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
27615
  ).option("--owner <address>", "The wallet whose templates to list").option(
27603
27616
  "--mine",
@@ -27682,7 +27695,7 @@ var listCommand6 = new Command146("list").description(
27682
27695
  }
27683
27696
  }
27684
27697
  );
27685
- var showCommand4 = new Command146("show").description(
27698
+ var showCommand4 = new Command145("show").description(
27686
27699
  "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
27700
  ).argument("<template>", "Template id, official template id or preset name").action(async (value) => {
27688
27701
  const choice = templateChoice(value);
@@ -27705,7 +27718,7 @@ function savedTemplateId(value, verb) {
27705
27718
  }
27706
27719
  return choice.templateId;
27707
27720
  }
27708
- var publishCommand = new Command146("publish").description(
27721
+ var publishCommand = new Command145("publish").description(
27709
27722
  "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
27723
  ).argument("<templateId>", "Saved template id").action(async (value) => {
27711
27724
  const id = savedTemplateId(value, "publish");
@@ -27716,7 +27729,7 @@ var publishCommand = new Command146("publish").description(
27716
27729
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
27717
27730
  );
27718
27731
  });
27719
- var unpublishCommand = new Command146("unpublish").description(
27732
+ var unpublishCommand = new Command145("unpublish").description(
27720
27733
  "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
27734
  ).argument("<templateId>", "Saved template id").action(async (value) => {
27722
27735
  const id = savedTemplateId(value, "unpublish");
@@ -27727,7 +27740,7 @@ var unpublishCommand = new Command146("unpublish").description(
27727
27740
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
27728
27741
  );
27729
27742
  });
27730
- var deleteCommand2 = new Command146("delete").description(
27743
+ var deleteCommand2 = new Command145("delete").description(
27731
27744
  "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
27745
  ).argument("<templateId>", "Template id").action(async (value) => {
27733
27746
  const choice = templateChoice(value);
@@ -27744,7 +27757,7 @@ var deleteCommand2 = new Command146("delete").description(
27744
27757
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
27745
27758
  );
27746
27759
  });
27747
- var workflowTemplateCommand = new Command146("template").description(
27760
+ var workflowTemplateCommand = new Command145("template").description(
27748
27761
  "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
27762
  ).addCommand(createCommand3).addCommand(updateCommand).addCommand(listCommand6).addCommand(showCommand4).addCommand(publishCommand).addCommand(unpublishCommand).addCommand(deleteCommand2);
27750
27763
  async function createWorkflowFromTemplate(projectId, template, pairs) {
@@ -27944,7 +27957,7 @@ async function read2(path9) {
27944
27957
  }
27945
27958
  }
27946
27959
  var createCommand4 = addSuggestionScheduleOptions(
27947
- new Command147("create").description(
27960
+ new Command146("create").description(
27948
27961
  "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
27962
  ).argument("<projectId>", "Project id").requiredOption(
27950
27963
  "--cadence <cadence>",
@@ -27993,7 +28006,7 @@ var createCommand4 = addSuggestionScheduleOptions(
27993
28006
  });
27994
28007
  });
27995
28008
  var OWNER_SCHEDULE_STATUSES = [...STATUSES, "needs_action", "all"];
27996
- var listCommand7 = new Command147("list").description(
28009
+ var listCommand7 = new Command146("list").description(
27997
28010
  "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
28011
  ).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
28012
  "--status <status>",
@@ -28026,7 +28039,7 @@ var listCommand7 = new Command147("list").description(
28026
28039
  const query4 = params.toString();
28027
28040
  await read2(withChainId(`/api/projects/${projectId}/schedules${query4 ? `?${query4}` : ""}`));
28028
28041
  });
28029
- var showCommand5 = new Command147("show").description(
28042
+ var showCommand5 = new Command146("show").description(
28030
28043
  "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
28044
  ).argument("<scheduleId>", "Schedule id").action(async (value) => {
28032
28045
  const id = parseScheduleId(value);
@@ -28034,7 +28047,7 @@ var showCommand5 = new Command147("show").description(
28034
28047
  await read2(`/api/project-schedules/${id}`);
28035
28048
  });
28036
28049
  function actionCommand(action, description) {
28037
- return new Command147(action).description(description).argument("<scheduleId>", "Schedule id").action(async (value) => {
28050
+ return new Command146(action).description(description).argument("<scheduleId>", "Schedule id").action(async (value) => {
28038
28051
  const id = parseScheduleId(value);
28039
28052
  if (typeof id !== "string") return void printError(id.error);
28040
28053
  await postProjectWrite(
@@ -28044,7 +28057,7 @@ function actionCommand(action, description) {
28044
28057
  );
28045
28058
  });
28046
28059
  }
28047
- var settingsCommand = new Command147("settings").description(
28060
+ var settingsCommand = new Command146("settings").description(
28048
28061
  "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
28062
  ).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
28063
  const projectId = parseProjectId(id);
@@ -28066,7 +28079,7 @@ var settingsCommand = new Command147("settings").description(
28066
28079
  maxAmount: ACTION_FEE_MAX_AMOUNT
28067
28080
  });
28068
28081
  });
28069
- var projectScheduleCommand = new Command147("schedule").description(
28082
+ var projectScheduleCommand = new Command146("schedule").description(
28070
28083
  "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
28084
  ).addCommand(createCommand4).addCommand(listCommand7).addCommand(showCommand5).addCommand(
28072
28085
  actionCommand(
@@ -28089,15 +28102,15 @@ var projectScheduleCommand = new Command147("schedule").description(
28089
28102
  "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
28103
  )
28091
28104
  ).addCommand(settingsCommand).addCommand(suggestionScheduleSettingsCommand);
28092
- var projectRunnerCommand = new Command147("runner").description(
28105
+ var projectRunnerCommand = new Command146("runner").description(
28093
28106
  "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
28107
  ).action(async () => {
28095
28108
  await read2(withChainId("/api/project-runner"));
28096
28109
  });
28097
28110
 
28098
28111
  // src/commands/project/transfer.ts
28099
- import { Command as Command148 } from "commander";
28100
- var proposeCommand = new Command148("propose").description(
28112
+ import { Command as Command147 } from "commander";
28113
+ var proposeCommand = new Command147("propose").description(
28101
28114
  "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
28115
  ).argument("<projectId>", "Project id").requiredOption("--to <address>", "The wallet that will own the project once it accepts").action(async (id, opts) => {
28103
28116
  const projectId = parseProjectId(id);
@@ -28111,7 +28124,7 @@ var proposeCommand = new Command148("propose").description(
28111
28124
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28112
28125
  );
28113
28126
  });
28114
- var acceptCommand2 = new Command148("accept").description(
28127
+ var acceptCommand2 = new Command147("accept").description(
28115
28128
  "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
28129
  ).argument("<projectId>", "Project id").action(async (id) => {
28117
28130
  const projectId = parseProjectId(id);
@@ -28122,7 +28135,7 @@ var acceptCommand2 = new Command148("accept").description(
28122
28135
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28123
28136
  );
28124
28137
  });
28125
- var cancelCommand = new Command148("cancel").description(
28138
+ var cancelCommand = new Command147("cancel").description(
28126
28139
  "Withdraw the pending ownership proposal, as the project owner (costs 0.001 in the payment token)"
28127
28140
  ).argument("<projectId>", "Project id").action(async (id) => {
28128
28141
  const projectId = parseProjectId(id);
@@ -28133,13 +28146,13 @@ var cancelCommand = new Command148("cancel").description(
28133
28146
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28134
28147
  );
28135
28148
  });
28136
- var projectTransferCommand = new Command148("transfer").description(
28149
+ var projectTransferCommand = new Command147("transfer").description(
28137
28150
  "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
28151
  ).addCommand(proposeCommand).addCommand(acceptCommand2).addCommand(cancelCommand);
28139
28152
 
28140
28153
  // src/commands/project/show.ts
28141
- import { Command as Command149 } from "commander";
28142
- var projectShowCommand = new Command149("show").description(
28154
+ import { Command as Command148 } from "commander";
28155
+ var projectShowCommand = new Command148("show").description(
28143
28156
  "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
28157
  ).argument("<projectId>", "Project id").action(async (id) => {
28145
28158
  const projectId = parseProjectId(id);
@@ -28148,7 +28161,7 @@ var projectShowCommand = new Command149("show").description(
28148
28161
  printResult(await apiGet(withChainId(`/api/projects/${projectId}`), { headers }));
28149
28162
  });
28150
28163
  var BACKERS_CURSOR = /^\d{1,20}-\d{1,9}$/;
28151
- var projectBackersCommand = new Command149("backers").description(
28164
+ var projectBackersCommand = new Command148("backers").description(
28152
28165
  "List a project's backers, newest first, with each one's contribution, shares, claims and claimable share (free)"
28153
28166
  ).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
28167
  const projectId = parseProjectId(id);
@@ -28167,13 +28180,13 @@ var projectBackersCommand = new Command149("backers").description(
28167
28180
  await apiGet(withChainId(`/api/projects/${projectId}/backers${query4 ? `?${query4}` : ""}`))
28168
28181
  );
28169
28182
  });
28170
- var projectForTaskCommand = new Command149("for-task").description("The project a task was funded from, or null when it was not (free)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
28183
+ 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
28184
  if (!/^0x[0-9a-fA-F]{1,78}$/.test(taskId.trim())) {
28172
28185
  return void printError("The task id must be 0x-prefixed hex");
28173
28186
  }
28174
28187
  printResult(await apiGet(`/api/projects/by-task/${encodeURIComponent(taskId.trim())}`));
28175
28188
  });
28176
- var projectListCommand = new Command149("list").description(
28189
+ var projectListCommand = new Command148("list").description(
28177
28190
  "List a wallet's projects, as owner, operator or backer, or with --funding the projects open for backing now (free; default: your wallet)"
28178
28191
  ).option(
28179
28192
  "--funding",
@@ -28224,7 +28237,7 @@ var projectListCommand = new Command149("list").description(
28224
28237
  );
28225
28238
 
28226
28239
  // src/commands/project/index.ts
28227
- var projectCommand = new Command150("project").description(
28240
+ var projectCommand = new Command149("project").description(
28228
28241
  "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
28242
  );
28230
28243
  projectCommand.addCommand(projectCreateCommand);
@@ -28255,7 +28268,7 @@ projectCommand.addCommand(projectForTaskCommand);
28255
28268
 
28256
28269
  // src/commands/workflow.ts
28257
28270
  import { readFile as readFile5 } from "fs/promises";
28258
- import { Command as Command151 } from "commander";
28271
+ import { Command as Command150 } from "commander";
28259
28272
  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
28273
  var FILE_MAX_BYTES2 = 256 * 1024;
28261
28274
  function parseWorkflowText(text) {
@@ -28319,7 +28332,7 @@ async function projectContext(projectId) {
28319
28332
  runner
28320
28333
  };
28321
28334
  }
28322
- var validateCommand = new Command151("validate").description(
28335
+ var validateCommand = new Command150("validate").description(
28323
28336
  "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
28337
  ).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
28338
  const parsed = await readDocument(opts.file ?? file);
@@ -28362,7 +28375,7 @@ var validateCommand = new Command151("validate").description(
28362
28375
  document: result.document
28363
28376
  });
28364
28377
  });
28365
- var createCommand5 = new Command151("create").description(
28378
+ var createCommand5 = new Command150("create").description(
28366
28379
  "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
28380
  ).argument("<projectId>", "Project id").option("--file <path>", "The document, JSON").option(
28368
28381
  "--template <template>",
@@ -28405,7 +28418,7 @@ var createCommand5 = new Command151("create").description(
28405
28418
  );
28406
28419
  });
28407
28420
  var OWNER_WORKFLOW_STATUSES = ["needs_action", "running", "failed", "idle", "all"];
28408
- var listCommand8 = new Command151("list").description(
28421
+ var listCommand8 = new Command150("list").description(
28409
28422
  "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
28423
  ).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
28424
  "--status <status>",
@@ -28435,7 +28448,7 @@ var listCommand8 = new Command151("list").description(
28435
28448
  const query4 = params.toString();
28436
28449
  await read3(withChainId(`/api/projects/${projectId}/workflows${query4 ? `?${query4}` : ""}`));
28437
28450
  });
28438
- var showCommand6 = new Command151("show").description(
28451
+ var showCommand6 = new Command150("show").description(
28439
28452
  "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
28453
  ).argument("<workflowId>", "Workflow id").action(async (value) => {
28441
28454
  const id = uuid(value, "workflow");
@@ -28448,7 +28461,7 @@ var showCommand6 = new Command151("show").description(
28448
28461
  renderFailure(err);
28449
28462
  }
28450
28463
  });
28451
- var updateTemplateCommand = new Command151("update-template").description(
28464
+ var updateTemplateCommand = new Command150("update-template").description(
28452
28465
  "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
28466
  ).argument("<workflowId>", "Workflow id").action(async (value) => {
28454
28467
  const id = uuid(value, "workflow");
@@ -28459,7 +28472,7 @@ var updateTemplateCommand = new Command151("update-template").description(
28459
28472
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28460
28473
  );
28461
28474
  });
28462
- var updateStepsCommand = new Command151("update-steps").description(
28475
+ var updateStepsCommand = new Command150("update-steps").description(
28463
28476
  "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
28477
  ).argument("<workflowId>", "Workflow id").option("--file <path>", "The new document, JSON").action(async (value, opts) => {
28465
28478
  const id = uuid(value, "workflow");
@@ -28481,7 +28494,7 @@ var updateStepsCommand = new Command151("update-steps").description(
28481
28494
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28482
28495
  );
28483
28496
  });
28484
- var runsCommand = new Command151("runs").description("Page through a workflow's runs, newest first (free)").argument("<workflowId>", "Workflow id").option("--limit <count>", "Runs per page (1-100, default 20)").option("--cursor <cursor>", "nextCursor from the previous page").action(async (value, opts) => {
28497
+ 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
28498
  const id = uuid(value, "workflow");
28486
28499
  if (typeof id !== "string") return void printError(id.error);
28487
28500
  if (opts.limit !== void 0 && !/^(100|[1-9][0-9]?)$/.test(opts.limit.trim())) {
@@ -28493,14 +28506,14 @@ var runsCommand = new Command151("runs").description("Page through a workflow's
28493
28506
  const query4 = params.toString();
28494
28507
  await read3(`/api/project-workflows/${id}/runs${query4 ? `?${query4}` : ""}`);
28495
28508
  });
28496
- var statusCommand3 = new Command151("status").description(
28509
+ var statusCommand3 = new Command150("status").description(
28497
28510
  "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
28511
  ).argument("<runId>", "Run id").action(async (value) => {
28499
28512
  const id = uuid(value, "run");
28500
28513
  if (typeof id !== "string") return void printError(id.error);
28501
28514
  await read3(`/api/project-workflow-runs/${id}`);
28502
28515
  });
28503
- var runCommand2 = new Command151("run").description(
28516
+ var runCommand2 = new Command150("run").description(
28504
28517
  "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
28518
  ).argument("<workflowId>", "Workflow id").action(async (value) => {
28506
28519
  const id = uuid(value, "workflow");
@@ -28512,7 +28525,7 @@ var runCommand2 = new Command151("run").description(
28512
28525
  );
28513
28526
  });
28514
28527
  function stepCommand(action, description) {
28515
- return new Command151(action).description(description).argument("<runId>", "Run id").requiredOption(
28528
+ return new Command150(action).description(description).argument("<runId>", "Run id").requiredOption(
28516
28529
  "--step <key>",
28517
28530
  "The step key the run shows, e.g. gate-1, review[round=2] or post[attempt=2]"
28518
28531
  ).action(async (value, opts) => {
@@ -28527,7 +28540,7 @@ function stepCommand(action, description) {
28527
28540
  );
28528
28541
  });
28529
28542
  }
28530
- var cancelCommand2 = new Command151("cancel").description(
28543
+ var cancelCommand2 = new Command150("cancel").description(
28531
28544
  "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
28545
  ).argument("<runId>", "Run id").action(async (value) => {
28533
28546
  const id = uuid(value, "run");
@@ -28538,7 +28551,7 @@ var cancelCommand2 = new Command151("cancel").description(
28538
28551
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28539
28552
  );
28540
28553
  });
28541
- var stopAutoPayoutCommand = new Command151("stop-auto-payout").description(
28554
+ var stopAutoPayoutCommand = new Command150("stop-auto-payout").description(
28542
28555
  "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
28556
  ).argument("<runId>", "Run id").action(async (value) => {
28544
28557
  const id = uuid(value, "run");
@@ -28549,7 +28562,7 @@ var stopAutoPayoutCommand = new Command151("stop-auto-payout").description(
28549
28562
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28550
28563
  );
28551
28564
  });
28552
- var deleteCommand3 = new Command151("delete").description(
28565
+ var deleteCommand3 = new Command150("delete").description(
28553
28566
  "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
28567
  ).argument("<workflowId>", "Workflow id").action(async (value) => {
28555
28568
  const id = uuid(value, "workflow");
@@ -28571,21 +28584,21 @@ async function ownerRead(path9) {
28571
28584
  renderFailure(err);
28572
28585
  }
28573
28586
  }
28574
- var payoutListCommand = new Command151("list").description(
28587
+ var payoutListCommand = new Command150("list").description(
28575
28588
  "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
28589
  ).argument("<runId>", "Run id").action(async (value) => {
28577
28590
  const id = uuid(value, "run");
28578
28591
  if (typeof id !== "string") return void printError(id.error);
28579
28592
  await ownerRead(withChainId(`/api/project-workflow-runs/${id}/payouts`));
28580
28593
  });
28581
- var payoutShowCommand = new Command151("show").description(
28594
+ var payoutShowCommand = new Command150("show").description(
28582
28595
  '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
28596
  ).argument("<proposalId>", "Payout proposal id").action(async (value) => {
28584
28597
  const id = uuid(value, "payout proposal");
28585
28598
  if (typeof id !== "string") return void printError(id.error);
28586
28599
  await ownerRead(withChainId(`/api/project-workflow-payouts/${id}`));
28587
28600
  });
28588
- var payoutConfirmCommand = new Command151("confirm").description(
28601
+ var payoutConfirmCommand = new Command150("confirm").description(
28589
28602
  '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
28603
  ).argument("<proposalId>", "Payout proposal id").action(async (value) => {
28591
28604
  const id = uuid(value, "payout proposal");
@@ -28612,7 +28625,7 @@ var payoutConfirmCommand = new Command151("confirm").description(
28612
28625
  }
28613
28626
  );
28614
28627
  });
28615
- var payoutObjectCommand = new Command151("object").description(
28628
+ var payoutObjectCommand = new Command150("object").description(
28616
28629
  `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
28630
  ).argument("<proposalId>", "Payout proposal id").requiredOption("--reason <text>", "Why you object, shown to the owner").action(async (value, opts) => {
28618
28631
  const id = uuid(value, "payout proposal");
@@ -28636,10 +28649,10 @@ var payoutObjectCommand = new Command151("object").description(
28636
28649
  renderFailure(err);
28637
28650
  }
28638
28651
  });
28639
- var payoutCommand = new Command151("payout").description(
28652
+ var payoutCommand = new Command150("payout").description(
28640
28653
  "Payout proposals: a gating review's recommended winners and shares for the task it gates, which the owner confirms"
28641
28654
  ).addCommand(payoutListCommand).addCommand(payoutShowCommand).addCommand(payoutConfirmCommand).addCommand(payoutObjectCommand);
28642
- var settingsCommand2 = new Command151("settings").description(
28655
+ var settingsCommand2 = new Command150("settings").description(
28643
28656
  `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
28657
  ).argument("<projectId>", "Project id").option("--step-limit <count>", "The most task steps per workflow").action(async (id, opts) => {
28645
28658
  const projectId = parseProjectId(id);
@@ -28670,7 +28683,7 @@ var settingsCommand2 = new Command151("settings").description(
28670
28683
  { maxAmount: ACTION_FEE_MAX_AMOUNT }
28671
28684
  );
28672
28685
  });
28673
- var workflowCommand = new Command151("workflow").description(
28686
+ var workflowCommand = new Command150("workflow").description(
28674
28687
  "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
28688
  ).addCommand(validateCommand).addCommand(createCommand5).addCommand(listCommand8).addCommand(showCommand6).addCommand(runsCommand).addCommand(runCommand2).addCommand(statusCommand3).addCommand(
28676
28689
  stepCommand(
@@ -28685,8 +28698,8 @@ var workflowCommand = new Command151("workflow").description(
28685
28698
  ).addCommand(cancelCommand2).addCommand(stopAutoPayoutCommand).addCommand(updateTemplateCommand).addCommand(updateStepsCommand).addCommand(deleteCommand3).addCommand(settingsCommand2).addCommand(payoutCommand).addCommand(workflowTemplateCommand);
28686
28699
 
28687
28700
  // src/commands/drops.ts
28688
- import { Command as Command152 } from "commander";
28689
- var listCommand9 = new Command152("list").description("List public Task Drops, ones accepting work first").option("--limit <n>", "Maximum drops to return (1-48)", "24").option("--cursor <cursor>", "nextCursor from a previous page").option("--status <status>", "ended: only drops no longer accepting work, newest first").option("--worker <address>", "Only drops this wallet entered (a submission, pitch or bid)").option("--entered", "Only drops your wallet entered (--worker with your own address)").action(
28701
+ import { Command as Command151 } from "commander";
28702
+ 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
28703
  async (opts) => {
28691
28704
  try {
28692
28705
  if (opts.worker && opts.entered) throw new Error("Pass --worker or --entered, not both");
@@ -28714,7 +28727,7 @@ var listCommand9 = new Command152("list").description("List public Task Drops, o
28714
28727
  }
28715
28728
  }
28716
28729
  );
28717
- var showCommand7 = new Command152("show").description("Show a Task Drop and its discoverable tasks").argument("<taskDropId>", "Task Drop ID").action(async (taskDropId) => {
28730
+ var showCommand7 = new Command151("show").description("Show a Task Drop and its discoverable tasks").argument("<taskDropId>", "Task Drop ID").action(async (taskDropId) => {
28718
28731
  try {
28719
28732
  const input = parseInput(TaskDropGetInputSchema, { taskDropId });
28720
28733
  const result = await apiGet(`/api/task-drops/${encodeURIComponent(input.taskDropId)}`);
@@ -28726,7 +28739,7 @@ var showCommand7 = new Command152("show").description("Show a Task Drop and its
28726
28739
  renderFailure(err);
28727
28740
  }
28728
28741
  });
28729
- var subscribeCommand = new Command152("subscribe").description("Subscribe an email to one Task Drop, or with --official to every official drop").argument("[taskDropId]", "Task Drop ID (omit with --official)").requiredOption("--email <email>", "Email address to notify").option("--official", "Subscribe to all official Task Drops").option("--wallet <address>", "Wallet address to associate with the subscription").action(
28742
+ 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
28743
  async (taskDropId, opts) => {
28731
28744
  try {
28732
28745
  if (opts.official) {
@@ -28754,7 +28767,7 @@ var subscribeCommand = new Command152("subscribe").description("Subscribe an ema
28754
28767
  }
28755
28768
  }
28756
28769
  );
28757
- var statusCommand4 = new Command152("status").description("Check whether an email is subscribed to a Task Drop, or with --official to all").argument("[taskDropId]", "Task Drop ID (omit with --official)").requiredOption("--email <email>", "Email address to check").option("--official", "Check the all-official-drops subscription").action(async (taskDropId, opts) => {
28770
+ 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
28771
  try {
28759
28772
  if (opts.official) {
28760
28773
  if (taskDropId) throw new Error("Pass either a Task Drop ID or --official, not both");
@@ -28771,15 +28784,15 @@ var statusCommand4 = new Command152("status").description("Check whether an emai
28771
28784
  renderFailure(err);
28772
28785
  }
28773
28786
  });
28774
- var dropsCommand = new Command152("drops").description("Browse Task Drops and manage email subscriptions to them").addCommand(listCommand9).addCommand(showCommand7).addCommand(subscribeCommand).addCommand(statusCommand4);
28787
+ var dropsCommand = new Command151("drops").description("Browse Task Drops and manage email subscriptions to them").addCommand(listCommand9).addCommand(showCommand7).addCommand(subscribeCommand).addCommand(statusCommand4);
28775
28788
 
28776
28789
  // src/commands/hooks.ts
28777
- import { Command as Command154 } from "commander";
28790
+ import { Command as Command153 } from "commander";
28778
28791
  import { BaseError, ContractFunctionRevertedError, ContractFunctionZeroDataError } from "viem";
28779
28792
 
28780
28793
  // src/lib/listing-submissions.ts
28781
28794
  import { readFile as readFile6 } from "fs/promises";
28782
- import { Command as Command153 } from "commander";
28795
+ import { Command as Command152 } from "commander";
28783
28796
  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
28797
  function prepareListingFile(kind, text) {
28785
28798
  if (Buffer.byteLength(text, "utf8") > LISTING_SUBMISSION_MAX_BYTES) {
@@ -28836,7 +28849,7 @@ function prepareListingFile(kind, text) {
28836
28849
  }
28837
28850
  function submitCommandFor(kind) {
28838
28851
  const what = kind === "catalog" ? "catalog entry (kind x402-endpoint)" : "hook manifest";
28839
- return new Command153("submit").description(
28852
+ return new Command152("submit").description(
28840
28853
  `Submit a ${what} for staff review. Pays the standard action fee, kept either way; needs an ERC-8004 identity on the selected network`
28841
28854
  ).requiredOption("--file <path>", `Path to the ${what} JSON file`).action(async (opts) => {
28842
28855
  let text;
@@ -28868,7 +28881,7 @@ function submitCommandFor(kind) {
28868
28881
  });
28869
28882
  }
28870
28883
  function submissionsCommandFor(kind) {
28871
- return new Command153("submissions").description(
28884
+ return new Command152("submissions").description(
28872
28885
  `List the ${kind === "catalog" ? "catalog entries" : "hook listings"} you submitted and their status`
28873
28886
  ).option("--status <status>", `Only this status: ${LISTING_SUBMISSION_STATUSES.join(", ")}`).option("--limit <n>", "Maximum submissions to return (1-100)", "50").action(async (opts) => {
28874
28887
  if (opts.status && !LISTING_SUBMISSION_STATUSES.includes(opts.status)) {
@@ -28934,7 +28947,7 @@ async function probeHookVersion(entry, chainId) {
28934
28947
  return reverted ? { ...entry, hookVersion: 1 } : entry;
28935
28948
  }
28936
28949
  }
28937
- var listCommand10 = new Command154("list").description(
28950
+ var listCommand10 = new Command153("list").description(
28938
28951
  "List hooks listed (verified) in the hook registry on the selected --network, then observed hooks that are not listed"
28939
28952
  ).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
28953
  "--cursor <cursor>",
@@ -28973,7 +28986,7 @@ var listCommand10 = new Command154("list").description(
28973
28986
  }
28974
28987
  }
28975
28988
  );
28976
- var showCommand8 = new Command154("show").description(
28989
+ var showCommand8 = new Command153("show").description(
28977
28990
  "Show one hook on the selected --network: its registry listing, or its onchain observation marked unlisted"
28978
28991
  ).argument("<address>", "Hook contract address").action(async (address3) => {
28979
28992
  try {
@@ -28993,7 +29006,7 @@ var showCommand8 = new Command154("show").description(
28993
29006
  renderFailure(err);
28994
29007
  }
28995
29008
  });
28996
- var encodeConfigCommand = new Command154("encode-config").description(
29009
+ var encodeConfigCommand = new Command153("encode-config").description(
28997
29010
  "Encode a V2 hook's typed configuration from its registry config schema, for --hook-config"
28998
29011
  ).argument("<address>", "Hook contract address").requiredOption(
28999
29012
  "--values <json>",
@@ -29022,7 +29035,7 @@ var encodeConfigCommand = new Command154("encode-config").description(
29022
29035
  renderFailure(err);
29023
29036
  }
29024
29037
  });
29025
- var attachmentConfigCommand = new Command154("attachment-config").description(
29038
+ var attachmentConfigCommand = new Command153("attachment-config").description(
29026
29039
  "Show the protocol-default hook order and maximum hooks per task on the selected --network"
29027
29040
  ).action(async () => {
29028
29041
  try {
@@ -29031,23 +29044,23 @@ var attachmentConfigCommand = new Command154("attachment-config").description(
29031
29044
  renderFailure(err);
29032
29045
  }
29033
29046
  });
29034
- var hooksCommand = new Command154("hooks").description("Browse the hook registry on the selected --network").addCommand(listCommand10).addCommand(showCommand8).addCommand(encodeConfigCommand).addCommand(attachmentConfigCommand).addCommand(submitCommandFor("hook")).addCommand(submissionsCommandFor("hook"));
29047
+ 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
29048
 
29036
29049
  // src/commands/catalog/index.ts
29037
- import { Command as Command155 } from "commander";
29038
- var catalogCommand = new Command155("catalog").description("Submit paid endpoints to the Taskmarket catalog and track your submissions").addCommand(submitCommandFor("catalog")).addCommand(submissionsCommandFor("catalog"));
29050
+ import { Command as Command154 } from "commander";
29051
+ var catalogCommand = new Command154("catalog").description("Submit paid endpoints to the Taskmarket catalog and track your submissions").addCommand(submitCommandFor("catalog")).addCommand(submissionsCommandFor("catalog"));
29039
29052
 
29040
29053
  // src/commands/tap.ts
29041
29054
  import { promises as fs12 } from "fs";
29042
- import { Command as Command156 } from "commander";
29043
- var tapCommand = new Command156("tap").description(
29055
+ import { Command as Command155 } from "commander";
29056
+ var tapCommand = new Command155("tap").description(
29044
29057
  "Manage the TAP signing key used on tasks that require TAP verification"
29045
29058
  );
29046
29059
  tapCommand.command("import").description(
29047
29060
  "Import a TAP private key and its key id, stored encrypted in the keystore. Gated worker actions on tasks that require tap are then signed with it automatically."
29048
29061
  ).requiredOption("--key-id <id>", "The key id the verifier issued for this key").option(
29049
29062
  "--key-file <path>",
29050
- "File holding the private key: a PEM private key, or an ed25519 seed as 64 hex characters. Use - to read it from stdin.",
29063
+ "File holding the private key: a PEM private key (PKCS#8 or SEC1), or an ed25519 seed as 64 hex characters. Use - to read it from stdin.",
29051
29064
  "-"
29052
29065
  ).option(
29053
29066
  "--alg <alg>",
@@ -29092,9 +29105,16 @@ tapCommand.command("import").description(
29092
29105
  }
29093
29106
  );
29094
29107
  tapCommand.command("create").description(
29095
- "Create an ed25519 TAP key, stored encrypted in the keystore with no key id until it is enrolled. Never replaces a key that exists."
29096
- ).action(async () => {
29108
+ "Create an ECDSA P-256 TAP key (or ed25519 with --alg ed25519), stored encrypted in the keystore with no key id until it is enrolled. Never replaces a key that exists."
29109
+ ).option(
29110
+ "--alg <alg>",
29111
+ `Key type to create: ${TAP_CREATE_ALGORITHMS.join(", ")}`,
29112
+ "ecdsa-p256-sha256"
29113
+ ).action(async (opts) => {
29097
29114
  try {
29115
+ if (!TAP_CREATE_ALGORITHMS.includes(opts.alg)) {
29116
+ throw new Error(`--alg must be one of: ${TAP_CREATE_ALGORITHMS.join(", ")}`);
29117
+ }
29098
29118
  const keystore = await loadKeystore();
29099
29119
  if (keystore.tapKey) {
29100
29120
  throw new Error(
@@ -29102,7 +29122,13 @@ tapCommand.command("create").description(
29102
29122
  );
29103
29123
  }
29104
29124
  const dek = await fetchDeviceKey(keystore.deviceId, keystore.apiToken, keystore.keyServerUrl);
29105
- const tapKey = storedTapKey(dek, null, generateTapKey(), /* @__PURE__ */ new Date(), "created");
29125
+ const tapKey = storedTapKey(
29126
+ dek,
29127
+ null,
29128
+ generateTapKey(opts.alg),
29129
+ /* @__PURE__ */ new Date(),
29130
+ "created"
29131
+ );
29106
29132
  await saveKeystore({ ...keystore, tapKey });
29107
29133
  printResult({ ...tapKeySummary(tapKey), created: true });
29108
29134
  } catch (err) {
@@ -29199,7 +29225,7 @@ tapCommand.command("remove").description("Remove the TAP key from the keystore")
29199
29225
  });
29200
29226
 
29201
29227
  // src/commands/hire.ts
29202
- import { Command as Command157 } from "commander";
29228
+ import { Command as Command156 } from "commander";
29203
29229
  var OWN_FLAGS = /* @__PURE__ */ new Set(["--mode", "--hire-worker", "--service-id"]);
29204
29230
  async function lookupListedService(worker, serviceId) {
29205
29231
  let listing;
@@ -29231,7 +29257,7 @@ function hireEvaluatorError(opts, requiresEvaluator) {
29231
29257
  }
29232
29258
  return null;
29233
29259
  }
29234
- var hireCommand = new Command157("hire").description(
29260
+ var hireCommand = new Command156("hire").description(
29235
29261
  "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
29262
  ).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
29263
  "--requires-evaluator",
@@ -29294,7 +29320,7 @@ hireCommand.action(async (worker, opts) => {
29294
29320
  // src/index.ts
29295
29321
  var require2 = createRequire(import.meta.url);
29296
29322
  var { version } = require2("../package.json");
29297
- var program = new Command158();
29323
+ var program = new Command157();
29298
29324
  setLastErrorCliVersion(version);
29299
29325
  program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
29300
29326
  program.option(