@lucid-agents/taskmarket 1.31.0 → 1.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/agent-compatibility.json +1 -1
  2. package/dist/{api-72EG7RDG.js → api-TEZH6URZ.js} +2 -2
  3. package/dist/{channels-WVJNWZHJ.js → channels-ZNOTOJIS.js} +4 -4
  4. package/dist/{chunk-SJZEU7FN.js → chunk-62QDQXS3.js} +15 -9
  5. package/dist/{chunk-LEQ4JRAS.js → chunk-6WOUTOR4.js} +126 -13
  6. package/dist/{chunk-AUQJBVNF.js → chunk-CH3OZ5EM.js} +2 -2
  7. package/dist/{chunk-VIKSHMQ7.js → chunk-CWANOJKR.js} +3 -3
  8. package/dist/{chunk-7KGKGZLK.js → chunk-FJ4EPHIN.js} +1 -1
  9. package/dist/{chunk-GO4PAHB3.js → chunk-KC32V4AD.js} +2 -1
  10. package/dist/{chunk-4E4WY6AJ.js → chunk-LT4DDAEZ.js} +3 -3
  11. package/dist/{chunk-3YNTCMLY.js → chunk-OUV2RQSB.js} +1 -1
  12. package/dist/{chunk-PSFCFRC4.js → chunk-PSN4GDLD.js} +5 -5
  13. package/dist/{chunk-VLXBDE22.js → chunk-QVP3VXGD.js} +1 -1
  14. package/dist/{chunk-JI63EPPO.js → chunk-R6QEAGHK.js} +1 -1
  15. package/dist/{chunk-PCSHRHUX.js → chunk-SPG5J4RN.js} +3 -3
  16. package/dist/{doctor-JP77AWIU.js → doctor-5KU2FAWD.js} +8 -8
  17. package/dist/index.js +361 -171
  18. package/dist/{launch-DFIZTKMO.js → launch-RFRQPJAY.js} +11 -11
  19. package/dist/pi-extensions/xgate.cjs +126 -13
  20. package/dist/{read-auth-U6CQ2ATH.js → read-auth-PQ7DGWZC.js} +3 -3
  21. package/dist/{reconcile-TD7RMO4A.js → reconcile-ZTCPP3G5.js} +4 -4
  22. package/dist/{status-P3NIGGYJ.js → status-CDPRDSYZ.js} +8 -8
  23. package/dist/{sync-pull-TH3U6DPI.js → sync-pull-R7EBZKUG.js} +4 -4
  24. package/dist/{task-access-grants-4GVGJEKT.js → task-access-grants-H3RJAJ32.js} +2 -2
  25. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  listWorkerSubmissions,
14
14
  submitTaskFiles,
15
15
  taskRequirementsOf
16
- } from "./chunk-SJZEU7FN.js";
16
+ } from "./chunk-62QDQXS3.js";
17
17
  import {
18
18
  ComputeCreditError,
19
19
  applyComputeCreditSetup,
@@ -35,14 +35,14 @@ import {
35
35
  refusedPaidWrite,
36
36
  releasePendingComputePurchase,
37
37
  resolvePendingComputePurchases
38
- } from "./chunk-4E4WY6AJ.js";
38
+ } from "./chunk-LT4DDAEZ.js";
39
39
  import {
40
40
  signReadAuth
41
- } from "./chunk-AUQJBVNF.js";
41
+ } from "./chunk-CH3OZ5EM.js";
42
42
  import {
43
43
  saveTaskAccessGrant,
44
44
  taskAccessGrantHeaders
45
- } from "./chunk-VLXBDE22.js";
45
+ } from "./chunk-QVP3VXGD.js";
46
46
  import {
47
47
  MPP_TEMPO_DEFAULT_VALIDITY_SECONDS,
48
48
  X402PayError,
@@ -60,7 +60,7 @@ import {
60
60
  setX402PolicyRuleEnabled,
61
61
  signSponsoredTempoTransfer,
62
62
  signTaskmarketFeePayment
63
- } from "./chunk-3YNTCMLY.js";
63
+ } from "./chunk-OUV2RQSB.js";
64
64
  import {
65
65
  ALL_NETWORKS,
66
66
  ApiError,
@@ -96,6 +96,7 @@ import {
96
96
  keystoreExists,
97
97
  liveNetworkNames,
98
98
  loadKeystore,
99
+ networkNameForChain,
99
100
  networkToStamp,
100
101
  parseTapPrivateKey,
101
102
  paymentProtocolOf,
@@ -121,7 +122,7 @@ import {
121
122
  withErrorContext,
122
123
  withIdempotentWrite,
123
124
  withTapSignature
124
- } from "./chunk-GO4PAHB3.js";
125
+ } from "./chunk-KC32V4AD.js";
125
126
  import {
126
127
  AGENT_AVATAR_MAX_BYTES,
127
128
  AGENT_HIRES_ROLES,
@@ -336,7 +337,7 @@ import {
336
337
  vaultCallGasLimit7702,
337
338
  verifierProviderId,
338
339
  verifiersUnsupportedOnChain
339
- } from "./chunk-LEQ4JRAS.js";
340
+ } from "./chunk-6WOUTOR4.js";
340
341
  import "./chunk-S7SJMJ2I.js";
341
342
 
342
343
  // src/index.ts
@@ -8248,30 +8249,43 @@ function snapshotPath(windowDays, maxNodes) {
8248
8249
  `/api/ecosystem/snapshot?windowDays=${windowDays}&maxNodes=${maxNodes}&maxLinks=1`
8249
8250
  );
8250
8251
  }
8251
- var eventsCommand = new Command7("events").description("Recent public market events on the selected --network (the web Explorer feed)").option("--type <type>", `Keep one event type: ${EcosystemEventTypeEnum.options.join(", ")}`).option("--limit <n>", "Events to read (1-200, default 100)").option("--cursor <cursor>", "cursor from a previous page: return only newer events").option(
8252
+ var eventsCommand = new Command7("events").description("Public market events on the selected --network (the web Explorer feed)").option(
8253
+ "--type <types>",
8254
+ `Only these event types, comma separated: ${EcosystemEventTypeEnum.options.join(", ")}`
8255
+ ).option("--limit <n>", "Events to read (1-200, default 100)").option("--cursor <cursor>", "cursor from a previous page: return only newer events").option("--newest", "Read newest first and page backwards with nextBefore").option(
8256
+ "--before <cursor>",
8257
+ "nextBefore from a previous --newest page: return the next older events, newest first"
8258
+ ).option(
8252
8259
  "--search <text>",
8253
- "Keep events whose task id, title or requester/worker address contains the text (filters the page read)"
8254
- ).action(async (opts) => {
8260
+ "A full wallet address, a full task id, or the start of a task title (case-insensitive)"
8261
+ ).option("--address <address>", "Only events this wallet is part of (requester, worker, joined)").option("--task <id>", "Only events about this task").action(async (opts) => {
8255
8262
  try {
8256
- const type = opts.type === void 0 ? void 0 : parseInput(EcosystemEventTypeEnum, opts.type);
8263
+ const newest = Boolean(opts.newest || opts.before);
8264
+ if (newest && opts.cursor)
8265
+ throw new Error("--cursor cannot be combined with --newest or --before");
8257
8266
  const input = parseInput(EcosystemEventsInputSchema, {
8258
8267
  limit: optionalInt(opts.limit),
8259
- since: opts.cursor
8268
+ since: opts.cursor,
8269
+ type: opts.type?.trim() || void 0,
8270
+ q: opts.search?.trim().slice(0, 80) || void 0,
8271
+ address: opts.address,
8272
+ taskId: opts.task,
8273
+ order: newest ? "newest" : void 0,
8274
+ before: opts.before
8260
8275
  });
8261
8276
  const params = new URLSearchParams({ limit: String(input.limit) });
8262
- if (input.since) params.set("since", input.since);
8277
+ for (const key of ["since", "type", "q", "address", "taskId", "order", "before"]) {
8278
+ if (input[key]) params.set(key, input[key]);
8279
+ }
8263
8280
  const page = await apiGet(
8264
8281
  withChainId(`/api/ecosystem/events?${params.toString()}`)
8265
8282
  );
8266
- const needle = opts.search?.trim().toLowerCase().slice(0, 80);
8267
- const matches = (item) => (!type || item.type === type) && (!needle || [item.taskId, item.taskTitle, item.requester, item.worker].some(
8268
- (field) => (field ?? "").toLowerCase().includes(needle)
8269
- ));
8270
8283
  printResult({
8271
8284
  chainId: selectedNetwork().chainId,
8272
- items: type || needle ? page.items.filter(matches) : page.items,
8285
+ items: page.items,
8273
8286
  cursor: page.cursor,
8274
- hasMore: page.hasMore
8287
+ hasMore: page.hasMore,
8288
+ ...page.nextBefore !== void 0 ? { nextBefore: page.nextBefore } : {}
8275
8289
  });
8276
8290
  } catch (err) {
8277
8291
  renderFailure(err);
@@ -8300,17 +8314,18 @@ var addressCommand2 = new Command7("address").description("One wallet on the sel
8300
8314
  const wanted = address3.toLowerCase();
8301
8315
  const [snapshot, page] = await Promise.all([
8302
8316
  apiGet(snapshotPath(windowDays, NODE_LIMIT)),
8303
- apiGet(withChainId("/api/ecosystem/events?limit=200"))
8317
+ apiGet(
8318
+ withChainId(`/api/ecosystem/events?limit=20&order=newest&address=${wanted}`)
8319
+ )
8304
8320
  ]);
8305
8321
  const node = snapshot.nodes.find((n) => n.address.toLowerCase() === wanted) ?? null;
8306
- const events = page.items.filter((e5) => e5.requester?.toLowerCase() === wanted || e5.worker?.toLowerCase() === wanted).reverse().slice(0, 20);
8307
8322
  printResult({
8308
8323
  chainId: selectedNetwork().chainId,
8309
8324
  address: wanted,
8310
8325
  windowDays,
8311
8326
  name: node?.agentId ? getAgentName(node.agentId) : null,
8312
8327
  node,
8313
- events
8328
+ events: page.items
8314
8329
  });
8315
8330
  } catch (err) {
8316
8331
  renderFailure(err);
@@ -8945,9 +8960,6 @@ var reviewCmd = createReviewCommand();
8945
8960
  import { Command as Command11 } from "commander";
8946
8961
  import { parseUnits } from "viem";
8947
8962
 
8948
- // src/lib/fee-ceiling.ts
8949
- var TASKMARKET_FEE_DEFAULT_CEILING = (BigInt(STANDARD_X402_ACTION_AMOUNT) * 2n).toString();
8950
-
8951
8963
  // src/lib/x402.ts
8952
8964
  var FACILITATOR_RETRIES = 2;
8953
8965
  var MAX_RETRY_AFTER_SECONDS = 60;
@@ -8988,7 +9000,7 @@ async function x402Post(path8, body, options) {
8988
9000
  const accept = selectTaskmarketFeeRequirement(requirements.accepts, {
8989
9001
  network: chain.caip2,
8990
9002
  asset: chain.payment.token,
8991
- maxAmount: options?.maxAmount ?? TASKMARKET_FEE_DEFAULT_CEILING
9003
+ maxAmount: options.maxAmount
8992
9004
  });
8993
9005
  const { header } = await signTaskmarketFeePayment({
8994
9006
  resource: requirements.resource,
@@ -9446,6 +9458,9 @@ async function settleRecording(data, idempotencyKey, options = {}) {
9446
9458
  };
9447
9459
  }
9448
9460
 
9461
+ // src/lib/fee-ceiling.ts
9462
+ var ACTION_FEE_MAX_AMOUNT = (BigInt(STANDARD_X402_ACTION_AMOUNT) * 2n).toString();
9463
+
9449
9464
  // src/commands/task/payout-gate.ts
9450
9465
  var TASK_ID_RE2 = /^0x[0-9a-fA-F]{64}$/;
9451
9466
  function assertTaskId(taskId) {
@@ -9535,7 +9550,8 @@ var linkGateCmd = new Command10("link-gate").description(
9535
9550
  }
9536
9551
  const { data: result, idempotencyKey } = await x402Post(
9537
9552
  linkGateRelayPath(id),
9538
- linkGateRelayBody(id, gatingTaskId)
9553
+ linkGateRelayBody(id, gatingTaskId),
9554
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
9539
9555
  );
9540
9556
  printResult(
9541
9557
  {
@@ -10636,7 +10652,7 @@ async function runCreateTask(input, extra = {}) {
10636
10652
  const { data: result, idempotencyKey } = await x402Post("/api/tasks", body, {
10637
10653
  // Creating a task pays the reward plus any evaluator stake, exactly; never more. A project
10638
10654
  // task pays only the action fee: its budget funds the reward and the stake.
10639
- maxAmount: extra.projectId !== void 0 ? TASKMARKET_FEE_DEFAULT_CEILING : (BigInt(String(body.reward)) + BigInt(String(body.evaluatorStake ?? "0"))).toString()
10655
+ maxAmount: extra.projectId !== void 0 ? ACTION_FEE_MAX_AMOUNT : (BigInt(String(body.reward)) + BigInt(String(body.evaluatorStake ?? "0"))).toString()
10640
10656
  });
10641
10657
  const missing = [];
10642
10658
  if (Array.isArray(result.hookAttachments)) {
@@ -10746,7 +10762,10 @@ var listCmd = new Command12("list").alias("search").description("List available
10746
10762
  ).option(
10747
10763
  "--verified-by <verifier>",
10748
10764
  "Only tasks that require this verifier: tap:identity:verified or tap:identity:known"
10749
- ).option("--limit <n>", "Maximum results to return", "20").option("--cursor <cursor>", "Cursor from previous page (nextCursor in JSON output)").action(
10765
+ ).option("--limit <n>", "Maximum results to return", "20").option(
10766
+ "--cursor <cursor>",
10767
+ "Cursor from previous page (nextCursor in JSON output); pass it with the same --sort and filters"
10768
+ ).action(
10750
10769
  async (opts) => {
10751
10770
  const identity = parseRequirementFilter(opts.identity, IDENTITY_FILTER, "--identity");
10752
10771
  if ("error" in identity) return void printError(identity.error);
@@ -10852,6 +10871,39 @@ async function termsAmountsAndDeadlines(taskId) {
10852
10871
 
10853
10872
  // src/commands/task/submit.ts
10854
10873
  import { Command as Command14, Option as Option2 } from "commander";
10874
+
10875
+ // src/lib/task-network.ts
10876
+ var WRONG_NETWORK_CODE = "wrong_network";
10877
+ async function confirmTaskOnSelectedNetwork(taskId, task) {
10878
+ let read3 = task;
10879
+ if (read3 === void 0) {
10880
+ try {
10881
+ read3 = await getTask(cliTaskReadContext(), { taskId });
10882
+ } catch {
10883
+ return true;
10884
+ }
10885
+ }
10886
+ const taskChainId = read3?.chainId;
10887
+ const network = selectedNetwork();
10888
+ if (typeof taskChainId !== "number" || taskChainId === network.chainId) return true;
10889
+ const taskNetwork = networkNameForChain(taskChainId) ?? null;
10890
+ renderFailure(
10891
+ new Error(
10892
+ `This task is on ${taskNetwork ?? `chain ${taskChainId}`}, but the selected network is ${network.name}. Re-run with ${taskmarketCommandFor(taskChainId)}.`
10893
+ ),
10894
+ {
10895
+ details: {
10896
+ code: WRONG_NETWORK_CODE,
10897
+ taskChainId,
10898
+ taskNetwork,
10899
+ selectedNetwork: network.name
10900
+ }
10901
+ }
10902
+ );
10903
+ return false;
10904
+ }
10905
+
10906
+ // src/commands/task/submit.ts
10855
10907
  function collectFile(value, previous) {
10856
10908
  return [...previous, value];
10857
10909
  }
@@ -10864,6 +10916,7 @@ var submitCmd = new Command14("submit").description("Submit work for a task").ar
10864
10916
  return;
10865
10917
  }
10866
10918
  const submissionKey = resolveIdempotencyKey();
10919
+ if (!await confirmTaskOnSelectedNetwork(taskId)) return;
10867
10920
  const keystore = await loadKeystore();
10868
10921
  const { submissionId, idempotencyKey } = await submitTaskFiles(
10869
10922
  cliTaskWriteContext(keystore),
@@ -10947,11 +11000,15 @@ var acceptCmd = new Command15("accept").description(
10947
11000
  printError(target.error);
10948
11001
  return;
10949
11002
  }
10950
- const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/accept`, {
10951
- taskId,
10952
- worker: target.worker,
10953
- ...target.submissionId ? { submissionId: target.submissionId } : {}
10954
- });
11003
+ const { data: result, idempotencyKey } = await x402Post(
11004
+ `/api/tasks/${taskId}/accept`,
11005
+ {
11006
+ taskId,
11007
+ worker: target.worker,
11008
+ ...target.submissionId ? { submissionId: target.submissionId } : {}
11009
+ },
11010
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
11011
+ );
10955
11012
  printResult(
10956
11013
  {
10957
11014
  accepted: true,
@@ -10999,7 +11056,8 @@ var acceptSubmissionsCmd = new Command16("accept-submissions").description(
10999
11056
  {
11000
11057
  taskId,
11001
11058
  winners
11002
- }
11059
+ },
11060
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
11003
11061
  );
11004
11062
  printResult(
11005
11063
  {
@@ -11022,12 +11080,16 @@ var rateCmd = new Command17("rate").description("Rate a worker (costs 0.001 in t
11022
11080
  printError("Rating must be between 0 and 100");
11023
11081
  return;
11024
11082
  }
11025
- const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/rate`, {
11026
- taskId,
11027
- worker: opts.worker,
11028
- rating,
11029
- ...opts.feedback ? { feedbackText: opts.feedback } : {}
11030
- });
11083
+ const { data: result, idempotencyKey } = await x402Post(
11084
+ `/api/tasks/${taskId}/rate`,
11085
+ {
11086
+ taskId,
11087
+ worker: opts.worker,
11088
+ rating,
11089
+ ...opts.feedback ? { feedbackText: opts.feedback } : {}
11090
+ },
11091
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
11092
+ );
11031
11093
  printResult(
11032
11094
  { feedbackId: result.feedbackId, ...await settleRecording(result, idempotencyKey) },
11033
11095
  { idempotencyKey }
@@ -11257,7 +11319,7 @@ var listCmd2 = new Command19("list").description(
11257
11319
  "List hires: offers made to you (--role worker, the default) or hires you made, including quotes and requests (--role requester). Signed, so your private hires are included."
11258
11320
  ).option("--role <role>", `Whose hires: ${ROLES.join(" or ")}`, "worker").option("--state <state>", `Filter by hire state: ${HireState.options.join(", ")}`).option(
11259
11321
  "--tab <tab>",
11260
- `Only one Hires dashboard tab: ${HIRE_TABS.join(", ")} (filters the page fetched; each hire carries its tab)`
11322
+ `Only one Hires dashboard tab: ${HIRE_TABS.join(", ")} (filtered on the server, so an older hire is found whatever the page size; the output then carries tabCounts for every tab)`
11261
11323
  ).option("--service <id>", "Only hires made for this listed service").option("--address <address>", "List for this wallet instead of your own").option("--limit <n>", "Maximum results to return", "20").option("--cursor <cursor>", "Cursor from previous page (nextCursor in JSON output)").action(
11262
11324
  async (opts) => {
11263
11325
  try {
@@ -11278,13 +11340,15 @@ var listCmd2 = new Command19("list").description(
11278
11340
  // Offers to a worker are reserved hires; a requester's hires include quotes and requests.
11279
11341
  ...opts.role === "worker" ? { hireKind: HireKind.enum.reserved, reservedWorker: address3 } : { requester: address3 },
11280
11342
  hireState: opts.state,
11343
+ hireTab: tab,
11281
11344
  hireServiceId: opts.service,
11282
11345
  limit: opts.limit,
11283
11346
  cursor: opts.cursor
11284
11347
  });
11285
- const hires = withChainNames(result.tasks).map((task) => ({ ...task, tab: hireTab(task) })).filter((task) => tab === void 0 || task.tab === tab);
11348
+ const hires = withChainNames(result.tasks).map((task) => ({ ...task, tab: hireTab(task) }));
11286
11349
  printResult({
11287
11350
  hires,
11351
+ ...result.hireTabCounts ? { tabCounts: result.hireTabCounts } : {},
11288
11352
  hasMore: result.hasMore,
11289
11353
  nextCursor: result.nextCursor
11290
11354
  });
@@ -11373,7 +11437,8 @@ var pitchCmd = new Command21("pitch").description("Submit a pitch for a task (co
11373
11437
  ...opts.duration ? { estimatedDuration: parseInt(opts.duration, 10) } : {},
11374
11438
  signature
11375
11439
  },
11376
- ...tap ? [{ tap }] : []
11440
+ // TAP-signed, each round with its own nonce, when the task requires tap.
11441
+ { maxAmount: ACTION_FEE_MAX_AMOUNT, ...tap ? { tap } : {} }
11377
11442
  )
11378
11443
  );
11379
11444
  printResult({ pitchId: result.pitchId }, { idempotencyKey });
@@ -11408,12 +11473,16 @@ var selectWorkerCmd = new Command23("select-worker").description(
11408
11473
  const keystore = await loadKeystore();
11409
11474
  const message = buildSelectWorkerMessage(taskId, opts.pitch, opts.worker);
11410
11475
  const signature = await signMessage(message, keystore);
11411
- const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/pitches/select`, {
11412
- taskId,
11413
- pitchId: opts.pitch,
11414
- workerAddress: opts.worker,
11415
- signature
11416
- });
11476
+ const { data: result, idempotencyKey } = await x402Post(
11477
+ `/api/tasks/${taskId}/pitches/select`,
11478
+ {
11479
+ taskId,
11480
+ pitchId: opts.pitch,
11481
+ workerAddress: opts.worker,
11482
+ signature
11483
+ },
11484
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
11485
+ );
11417
11486
  printResult(
11418
11487
  { selected: true, ...await settleRecording(result, idempotencyKey) },
11419
11488
  { idempotencyKey }
@@ -11438,7 +11507,8 @@ var proofCmd = new Command24("proof").description("Submit a benchmark proof (cos
11438
11507
  ...opts.metric ? { metricValue: opts.metric } : {},
11439
11508
  signature
11440
11509
  },
11441
- ...tap ? [{ tap }] : []
11510
+ // TAP-signed, each round with its own nonce, when the task requires tap.
11511
+ { maxAmount: ACTION_FEE_MAX_AMOUNT, ...tap ? { tap } : {} }
11442
11512
  )
11443
11513
  );
11444
11514
  printResult({ proofId: result.proofId, submissionId: result.submissionId }, { idempotencyKey });
@@ -11478,11 +11548,12 @@ var bidCmd = new Command26("bid").description("Submit a bid on an auction task")
11478
11548
  taskId,
11479
11549
  await loadKeystore(),
11480
11550
  async (tap) => x402Post(path8, body, {
11551
+ maxAmount: ACTION_FEE_MAX_AMOUNT,
11481
11552
  headers: (await signReadAuth())?.headers ?? {},
11482
11553
  ...tap ? { tap } : {}
11483
11554
  }),
11484
11555
  task
11485
- ) : await x402Post(path8, body);
11556
+ ) : await x402Post(path8, body, { maxAmount: ACTION_FEE_MAX_AMOUNT });
11486
11557
  printResult({ bidId: result.bidId }, { idempotencyKey });
11487
11558
  });
11488
11559
 
@@ -11508,11 +11579,12 @@ var auctionAcceptCmd = new Command27("auction-accept").description("Accept curre
11508
11579
  taskId,
11509
11580
  await loadKeystore(),
11510
11581
  async (tap) => x402Post(path8, body, {
11582
+ maxAmount: ACTION_FEE_MAX_AMOUNT,
11511
11583
  headers: (await signReadAuth())?.headers ?? {},
11512
11584
  ...tap ? { tap } : {}
11513
11585
  }),
11514
11586
  task
11515
- ) : await x402Post(path8, body);
11587
+ ) : await x402Post(path8, body, { maxAmount: ACTION_FEE_MAX_AMOUNT });
11516
11588
  const { chainId } = selectedNetwork();
11517
11589
  printResult(
11518
11590
  {
@@ -11703,7 +11775,8 @@ var cancelCmd = new Command34("cancel").description(
11703
11775
  }
11704
11776
  const { data: result, idempotencyKey } = await x402Post(
11705
11777
  `/api/tasks/${taskId}/cancel`,
11706
- { taskId }
11778
+ { taskId },
11779
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
11707
11780
  );
11708
11781
  printResult(
11709
11782
  { ...result, ...await settleRecording(result, idempotencyKey) },
@@ -11724,7 +11797,8 @@ var refundExpiredCmd = new Command35("refund-expired").description(
11724
11797
  try {
11725
11798
  const { data: result, idempotencyKey } = await x402Post(
11726
11799
  `/api/tasks/${taskId}/refund-expired`,
11727
- { taskId }
11800
+ { taskId },
11801
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
11728
11802
  );
11729
11803
  printResult(
11730
11804
  { ...result, ...await settleRecording(result, idempotencyKey) },
@@ -11780,7 +11854,8 @@ var requesterTimeoutCmd = new Command36("requester-timeout").description(
11780
11854
  try {
11781
11855
  const { data: result, idempotencyKey } = await x402Post(
11782
11856
  `/api/tasks/${taskId}/requester-timeout`,
11783
- { taskId }
11857
+ { taskId },
11858
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
11784
11859
  );
11785
11860
  printResult(
11786
11861
  { ...result, ...await settleRecording(result, idempotencyKey) },
@@ -11807,7 +11882,8 @@ var rejectSubmissionCmd = new Command37("reject-submission").description(
11807
11882
  {
11808
11883
  taskId,
11809
11884
  worker: opts.worker
11810
- }
11885
+ },
11886
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
11811
11887
  );
11812
11888
  printResult(
11813
11889
  { ...result, ...await settleRecording(result, idempotencyKey) },
@@ -11854,7 +11930,8 @@ var rejectAllSubmissionsCmd = new Command38("reject-all-submissions").descriptio
11854
11930
  try {
11855
11931
  const { data: res, idempotencyKey } = await x402Post(
11856
11932
  `/api/tasks/${taskId}/reject-submission`,
11857
- { taskId, worker }
11933
+ { taskId, worker },
11934
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
11858
11935
  );
11859
11936
  results.push({ worker, txHash: res.txHash, idempotencyKey });
11860
11937
  } catch (err) {
@@ -11895,7 +11972,8 @@ var rejectAllSubmissionsCmd = new Command38("reject-all-submissions").descriptio
11895
11972
  try {
11896
11973
  ({ data: cancelRes } = await x402Post(
11897
11974
  `/api/tasks/${taskId}/cancel`,
11898
- { taskId }
11975
+ { taskId },
11976
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
11899
11977
  ));
11900
11978
  } catch (err) {
11901
11979
  renderFailure(
@@ -12050,11 +12128,11 @@ var updateCmd = new Command40("update").description(
12050
12128
  const { data: result, idempotencyKey } = await x402Post(
12051
12129
  `/api/tasks/${taskId}/update`,
12052
12130
  body,
12053
- ...body.reward === void 0 || projectId !== null ? [] : [
12054
- {
12055
- maxAmount: (BigInt(TASKMARKET_FEE_DEFAULT_CEILING) + BigInt(String(body.reward))).toString()
12056
- }
12057
- ]
12131
+ // A reward increase is paid with the action fee, so the new reward bounds the extra. A
12132
+ // project task's increase comes from the project's budget: only the fee is paid.
12133
+ {
12134
+ maxAmount: body.reward === void 0 || projectId !== null ? ACTION_FEE_MAX_AMOUNT : (BigInt(ACTION_FEE_MAX_AMOUNT) + BigInt(String(body.reward))).toString()
12135
+ }
12058
12136
  );
12059
12137
  printResult(
12060
12138
  projectId !== null && increase > 0n ? { ...result, projectTopUp: projectTopUp(projectId, increase, "reward increase") } : result,
@@ -12181,7 +12259,7 @@ var assignEvaluatorCmd = new Command42("assign-evaluator").description(
12181
12259
  // The action fee plus the stake this command just confirmed; the fee alone when the
12182
12260
  // project's budget pays the stake.
12183
12261
  {
12184
- maxAmount: (BigInt(TASKMARKET_FEE_DEFAULT_CEILING) + (projectId === null ? BigInt(evaluatorStake) : 0n)).toString()
12262
+ maxAmount: (BigInt(ACTION_FEE_MAX_AMOUNT) + (projectId === null ? BigInt(evaluatorStake) : 0n)).toString()
12185
12263
  }
12186
12264
  );
12187
12265
  printResult(
@@ -12250,7 +12328,8 @@ var evaluateCmd = new Command43("evaluate").description("Submit an evaluation ve
12250
12328
  }
12251
12329
  const { data: result, idempotencyKey } = await x402Post(
12252
12330
  `/api/tasks/${taskId}/evaluate`,
12253
- body
12331
+ body,
12332
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
12254
12333
  );
12255
12334
  printResult(
12256
12335
  { txHash: result.txHash, ...await settleRecording(result, idempotencyKey) },
@@ -12265,7 +12344,7 @@ function collect2(val, prev) {
12265
12344
  // src/commands/task/appeal.ts
12266
12345
  import { Command as Command44 } from "commander";
12267
12346
  var appealCmd = new Command44("appeal").description("Appeal an evaluator verdict while in Appealing state").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
12268
- const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/appeal`, { taskId });
12347
+ const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/appeal`, { taskId }, { maxAmount: ACTION_FEE_MAX_AMOUNT });
12269
12348
  printResult(
12270
12349
  { txHash: result.txHash, ...await settleRecording(result, idempotencyKey) },
12271
12350
  { idempotencyKey }
@@ -12275,7 +12354,7 @@ var appealCmd = new Command44("appeal").description("Appeal an evaluator verdict
12275
12354
  // src/commands/task/evaluator-timeout.ts
12276
12355
  import { Command as Command45 } from "commander";
12277
12356
  var evaluatorTimeoutCmd = new Command45("evaluator-timeout").description("Trigger evaluator timeout after the evaluation window expires (anyone)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
12278
- const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/evaluator-timeout`, { taskId });
12357
+ const { data: result, idempotencyKey } = await x402Post(`/api/tasks/${taskId}/evaluator-timeout`, { taskId }, { maxAmount: ACTION_FEE_MAX_AMOUNT });
12279
12358
  printResult(
12280
12359
  { txHash: result.txHash, ...await settleRecording(result, idempotencyKey) },
12281
12360
  { idempotencyKey }
@@ -12337,7 +12416,8 @@ var resolveDisputeCmd = new Command47("resolve-dispute").description(
12337
12416
  taskId,
12338
12417
  verdict: opts.verdict,
12339
12418
  awards
12340
- }
12419
+ },
12420
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
12341
12421
  );
12342
12422
  printResult(
12343
12423
  { txHash: result.txHash, ...await settleRecording(result, idempotencyKey) },
@@ -12736,7 +12816,7 @@ async function runAgentCommand(options) {
12736
12816
  try {
12737
12817
  const { assertAgentCompatibility } = await import("./compatibility-636WJOEX.js");
12738
12818
  const pi = assertAgentCompatibility();
12739
- const { runAgent } = await import("./launch-DFIZTKMO.js");
12819
+ const { runAgent } = await import("./launch-RFRQPJAY.js");
12740
12820
  result = await runAgent({
12741
12821
  model: options.model,
12742
12822
  pi,
@@ -13170,13 +13250,13 @@ function agentManagementCommands() {
13170
13250
  const status = new Command57("status").description(
13171
13251
  "Show the agent channels (locked, charged, refundable), purchases with an unknown outcome, the sandbox and compute credit. Reads only."
13172
13252
  ).action(async () => {
13173
- const { collectAgentStatus } = await import("./status-P3NIGGYJ.js");
13253
+ const { collectAgentStatus } = await import("./status-CDPRDSYZ.js");
13174
13254
  await run(() => collectAgentStatus());
13175
13255
  });
13176
13256
  const doctor = new Command57("doctor").description(
13177
13257
  "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."
13178
13258
  ).action(async () => {
13179
- const { runDoctor } = await import("./doctor-JP77AWIU.js");
13259
+ const { runDoctor } = await import("./doctor-5KU2FAWD.js");
13180
13260
  const report = await run(() => runDoctor());
13181
13261
  if (report && !report.ok) process.exitCode = 1;
13182
13262
  });
@@ -13187,7 +13267,7 @@ function agentManagementCommands() {
13187
13267
  "Reconcile the open purchases of this channel, as status lists it; also reaches retired channels"
13188
13268
  ).action(
13189
13269
  async (invocationId, options) => {
13190
- const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-TD7RMO4A.js");
13270
+ const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-ZTCPP3G5.js");
13191
13271
  const choice = { rail: options.rail, channel: options.channel };
13192
13272
  if (invocationId !== void 0) {
13193
13273
  await run(() => reconcileInvocation(invocationId, { choice }));
@@ -13219,7 +13299,7 @@ function agentManagementCommands() {
13219
13299
  `Not a USDC amount: ${options.amount} (digits, at most 6 decimals)`
13220
13300
  );
13221
13301
  }
13222
- const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-WVJNWZHJ.js");
13302
+ const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-ZNOTOJIS.js");
13223
13303
  const { rails } = await openAgentChannels();
13224
13304
  const result = await requestTopUp(selectRail(rails, options.rail), amount);
13225
13305
  return {
@@ -13239,8 +13319,8 @@ function agentManagementCommands() {
13239
13319
  await run(async () => {
13240
13320
  await requireExperimental();
13241
13321
  const { AGENT_VIEW_VERSION } = await import("./budget-view-J6L7X6EY.js");
13242
- const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-WVJNWZHJ.js");
13243
- const { reconcileLeasedPurchase } = await import("./reconcile-TD7RMO4A.js");
13322
+ const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-ZNOTOJIS.js");
13323
+ const { reconcileLeasedPurchase } = await import("./reconcile-ZTCPP3G5.js");
13244
13324
  const opened = await openAgentChannels();
13245
13325
  const { rail, retired } = selectChannel(opened, options);
13246
13326
  const result = await closeChannel(
@@ -13294,7 +13374,7 @@ function agentManagementCommands() {
13294
13374
  async (options) => {
13295
13375
  await run(async () => {
13296
13376
  await requireExperimental();
13297
- const { runPull } = await import("./sync-pull-TH3U6DPI.js");
13377
+ const { runPull } = await import("./sync-pull-R7EBZKUG.js");
13298
13378
  const { terminalPrompter } = await import("./prompter-LSICEYSQ.js");
13299
13379
  return runPull(options, {
13300
13380
  interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
@@ -13681,27 +13761,8 @@ function buildNeedsYou(sources, limit = DASHBOARD_LIST_LIMIT) {
13681
13761
  }))
13682
13762
  };
13683
13763
  }
13684
- var IN_ESCROW = /* @__PURE__ */ new Set([
13685
- "open",
13686
- "claimed",
13687
- "worker_selected",
13688
- "pending_approval",
13689
- "review",
13690
- "appealing",
13691
- "disputed"
13692
- ]);
13693
- function escrowHeld(posted) {
13694
- let total = 0n;
13695
- let openTasks = 0;
13696
- for (const task of posted) {
13697
- if (!IN_ESCROW.has(task.status)) continue;
13698
- openTasks += 1;
13699
- try {
13700
- total += BigInt(task.reward);
13701
- } catch {
13702
- }
13703
- }
13704
- return { baseUnits: total.toString(), openTasks };
13764
+ function escrowHeld(escrow) {
13765
+ return { baseUnits: escrow?.units ?? "0", openTasks: escrow?.count ?? 0 };
13705
13766
  }
13706
13767
  function bucket(status) {
13707
13768
  switch (status) {
@@ -13844,7 +13905,10 @@ var dashboardCommand = new Command60("dashboard").description(
13844
13905
  })
13845
13906
  ),
13846
13907
  settle(
13847
- () => apiGet(`/api/agents/inbox?${new URLSearchParams({ address: address3 })}`, { headers })
13908
+ () => apiGet(
13909
+ `/api/agents/inbox?${new URLSearchParams({ address: address3, sort: "attention", limit: String(DASHBOARD_TASK_LIMIT) })}`,
13910
+ { headers }
13911
+ )
13848
13912
  ),
13849
13913
  settle(
13850
13914
  () => apiGet(withChainId(`/api/workflows?${owner}`))
@@ -13855,7 +13919,7 @@ var dashboardCommand = new Command60("dashboard").description(
13855
13919
  settle(
13856
13920
  () => apiGet(
13857
13921
  withChainId(
13858
- `/api/projects?${new URLSearchParams({ address: address3, role: "owner", limit: String(PROJECTS_READ_LIMIT) })}`
13922
+ `/api/projects?${new URLSearchParams({ address: address3, role: "owner", status: "open", limit: String(PROJECTS_READ_LIMIT) })}`
13859
13923
  )
13860
13924
  )
13861
13925
  ),
@@ -13902,7 +13966,7 @@ var dashboardCommand = new Command60("dashboard").description(
13902
13966
  usdc: balance.value.balanceUsdc,
13903
13967
  tokenSymbol: balance.value.tokenSymbol ?? null
13904
13968
  } : null,
13905
- escrow: inbox.value ? escrowHeld(posted) : null,
13969
+ escrow: inbox.value ? escrowHeld(inbox.value.escrow) : null,
13906
13970
  swarmBudget: null
13907
13971
  },
13908
13972
  posted: inbox.value ? buildPosted(posted) : [],
@@ -13936,11 +14000,26 @@ var inboxCommand = new Command61("inbox").description(
13936
14000
  ).option(
13937
14001
  "--cursor <token>",
13938
14002
  "Continue the action queue with its nextCursor; task/bid lists are unchanged"
14003
+ ).option(
14004
+ "--tasks-sort <order>",
14005
+ "Order of the task lists (newest or attention; default newest). attention picks, across ALL your tasks, disputed or awaiting-review first, then open or running (workers: due soonest), then paid"
14006
+ ).option(
14007
+ "--tasks-limit <n>",
14008
+ "Rows in each task list (1-50; default 50); the escrow total always covers every task you posted"
13939
14009
  ).option("--actions-only", "Read only the bounded action queue, without task/bid lists").option(
13940
14010
  "--stream <name>",
13941
14011
  "Read one stream instead: workflows (approval gates, failed runs and paused schedules, newest first)"
13942
14012
  ).action(
13943
14013
  async (opts) => {
14014
+ if (opts.tasksSort !== void 0 && !["newest", "attention"].includes(opts.tasksSort)) {
14015
+ printError("Unknown --tasks-sort. Use: newest or attention");
14016
+ return;
14017
+ }
14018
+ const tasksLimit = opts.tasksLimit === void 0 ? void 0 : Number(opts.tasksLimit);
14019
+ if (tasksLimit !== void 0 && !(Number.isInteger(tasksLimit) && tasksLimit >= 1 && tasksLimit <= 50)) {
14020
+ printError("--tasks-limit must be a whole number from 1 to 50");
14021
+ return;
14022
+ }
13944
14023
  if (opts.stream !== void 0 && opts.stream !== "workflows") {
13945
14024
  printError("Unknown stream. The only stream is: workflows");
13946
14025
  return;
@@ -13986,6 +14065,8 @@ var inboxCommand = new Command61("inbox").description(
13986
14065
  const address3 = auth.walletAddress;
13987
14066
  const hasReadAuth = Object.keys(auth.headers).length > 0;
13988
14067
  const inboxParams = new URLSearchParams({ address: address3 });
14068
+ if (opts.tasksSort) inboxParams.set("sort", opts.tasksSort);
14069
+ if (tasksLimit !== void 0) inboxParams.set("limit", String(tasksLimit));
13989
14070
  const actionParams = new URLSearchParams({ address: address3, limit: String(page.limit) });
13990
14071
  if (page.cursor) actionParams.set("cursor", page.cursor);
13991
14072
  if (opts.actionsOnly) {
@@ -18171,6 +18252,18 @@ import { Command as Command99 } from "commander";
18171
18252
 
18172
18253
  // src/commands/bug/browse.ts
18173
18254
  import { Command as Command91 } from "commander";
18255
+
18256
+ // src/commands/bug/known-problem.ts
18257
+ async function fetchKnownProblem() {
18258
+ try {
18259
+ const { notice } = await apiGet("/api/bug-tracker-notice");
18260
+ return notice ?? null;
18261
+ } catch {
18262
+ return null;
18263
+ }
18264
+ }
18265
+
18266
+ // src/commands/bug/browse.ts
18174
18267
  var browseCommand = new Command91("browse").description(
18175
18268
  "Browse public bug reports, to check whether a bug is already known; no wallet needed"
18176
18269
  ).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(
@@ -18206,7 +18299,11 @@ var browseCommand = new Command91("browse").description(
18206
18299
  if (opts.status) params.set("status", opts.status);
18207
18300
  if (query4) params.set("query", query4);
18208
18301
  try {
18209
- printResult(await apiGet(`/api/bug-tracker?${params.toString()}`));
18302
+ const [result, knownProblem] = await Promise.all([
18303
+ apiGet(`/api/bug-tracker?${params.toString()}`),
18304
+ fetchKnownProblem()
18305
+ ]);
18306
+ printResult({ ...result, knownProblem });
18210
18307
  } catch (error) {
18211
18308
  return renderFailure(error);
18212
18309
  }
@@ -18333,9 +18430,13 @@ var listCommand2 = new Command93("list").description("List the bug reports you s
18333
18430
  const params = new URLSearchParams({ limit: String(limit) });
18334
18431
  if (opts.status) params.set("status", opts.status);
18335
18432
  try {
18336
- printResult(
18337
- await apiGet(`/api/bug-reports/mine?${params.toString()}`, { headers: auth.headers })
18338
- );
18433
+ const [result, knownProblem] = await Promise.all([
18434
+ apiGet(`/api/bug-reports/mine?${params.toString()}`, {
18435
+ headers: auth.headers
18436
+ }),
18437
+ fetchKnownProblem()
18438
+ ]);
18439
+ printResult({ ...result, knownProblem });
18339
18440
  } catch (error) {
18340
18441
  return renderFailure(error);
18341
18442
  }
@@ -18515,9 +18616,11 @@ var submitCommand = new Command97("submit").description(
18515
18616
  { ...parsed.data, ...proof },
18516
18617
  { headers: auth.headers }
18517
18618
  );
18619
+ const knownProblem = await fetchKnownProblem();
18518
18620
  printResult(
18519
18621
  {
18520
18622
  ...data,
18623
+ knownProblem,
18521
18624
  visibility: parsed.data.visibility,
18522
18625
  ...parsed.data.visibility === "public" ? { notice: PUBLIC_NOTICE } : {}
18523
18626
  },
@@ -18712,7 +18815,7 @@ var removeCommand = new Command101("remove").description("Remove a bookmark; an
18712
18815
  return renderFailure(error);
18713
18816
  }
18714
18817
  });
18715
- var listCommand4 = new Command101("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("--limit <n>", "Maximum bookmarks to return (1-100)", "50").action(async (opts) => {
18818
+ var listCommand4 = new Command101("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("--limit <n>", "Maximum bookmarks to return (1-100)", "50").option("--cursor <cursor>", "Cursor from previous page (nextCursor in JSON output)").action(async (opts) => {
18716
18819
  const entityType = opts.type === void 0 ? void 0 : parseEntityType(opts.type, "--type");
18717
18820
  if (entityType === null) return;
18718
18821
  const limit = Number(opts.limit);
@@ -18725,6 +18828,7 @@ var listCommand4 = new Command101("list").description("List your bookmarks, newe
18725
18828
  const params = new URLSearchParams({ limit: String(limit) });
18726
18829
  if (entityType) params.set("entityType", entityType);
18727
18830
  if (opts.collection) params.set("collectionId", opts.collection);
18831
+ if (opts.cursor) params.set("cursor", opts.cursor);
18728
18832
  try {
18729
18833
  printResult(await apiGet(`/api/bookmarks?${params.toString()}`, { headers: auth.headers }));
18730
18834
  } catch (error) {
@@ -25100,11 +25204,11 @@ async function postProjectWrite(path8, body, options) {
25100
25204
  const { data: result, idempotencyKey } = await x402Post(
25101
25205
  path8,
25102
25206
  { chainId: selectedNetwork().chainId, ...body },
25103
- options?.maxAmount !== void 0 ? { maxAmount: options.maxAmount } : void 0
25207
+ { maxAmount: options.maxAmount }
25104
25208
  );
25105
25209
  printResult(
25106
- { ...result, ...options?.extra, ...await settleRecording(result, idempotencyKey) },
25107
- { idempotencyKey, ...options?.warnings?.length ? { warnings: options.warnings } : {} }
25210
+ { ...result, ...options.extra, ...await settleRecording(result, idempotencyKey) },
25211
+ { idempotencyKey, ...options.warnings?.length ? { warnings: options.warnings } : {} }
25108
25212
  );
25109
25213
  }
25110
25214
 
@@ -25134,7 +25238,11 @@ var projectAcceptCommand = new Command127("accept").description(
25134
25238
  if (!mine) return void printError("No grant to this wallet on the project");
25135
25239
  termsHash = mine.termsHash;
25136
25240
  }
25137
- await postProjectWrite(`/api/projects/${projectId}/grants/accept`, { projectId, termsHash });
25241
+ await postProjectWrite(
25242
+ `/api/projects/${projectId}/grants/accept`,
25243
+ { projectId, termsHash },
25244
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
25245
+ );
25138
25246
  });
25139
25247
 
25140
25248
  // src/commands/project/add-task.ts
@@ -25254,10 +25362,14 @@ var projectClaimCommand = new Command129("claim").description(
25254
25362
  if (backer !== void 0 && (!ADDRESS.test(backer) || /^0x0{40}$/i.test(backer))) {
25255
25363
  return void printError("Invalid Ethereum address for --backer");
25256
25364
  }
25257
- await postProjectWrite(`/api/projects/${projectId}/claim`, {
25258
- projectId,
25259
- ...backer ? { backer } : {}
25260
- });
25365
+ await postProjectWrite(
25366
+ `/api/projects/${projectId}/claim`,
25367
+ {
25368
+ projectId,
25369
+ ...backer ? { backer } : {}
25370
+ },
25371
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
25372
+ );
25261
25373
  });
25262
25374
 
25263
25375
  // src/commands/project/close.ts
@@ -25267,7 +25379,11 @@ var projectCloseCommand = new Command130("close").description(
25267
25379
  ).argument("<projectId>", "Project id").action(async (id) => {
25268
25380
  const projectId = parseProjectId(id);
25269
25381
  if (typeof projectId !== "number") return void printError(projectId.error);
25270
- await postProjectWrite(`/api/projects/${projectId}/close`, { projectId });
25382
+ await postProjectWrite(
25383
+ `/api/projects/${projectId}/close`,
25384
+ { projectId },
25385
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
25386
+ );
25271
25387
  });
25272
25388
 
25273
25389
  // src/commands/project/create.ts
@@ -25373,7 +25489,9 @@ var projectGrantCommand = new Command133("grant").description(
25373
25489
  if (typeof projectId !== "number") return void printError(projectId.error);
25374
25490
  const body = grantBody(projectId, opts);
25375
25491
  if ("error" in body) return void printError(String(body.error));
25376
- await postProjectWrite(`/api/projects/${projectId}/grants`, body);
25492
+ await postProjectWrite(`/api/projects/${projectId}/grants`, body, {
25493
+ maxAmount: ACTION_FEE_MAX_AMOUNT
25494
+ });
25377
25495
  });
25378
25496
 
25379
25497
  // src/commands/project/review.ts
@@ -25412,7 +25530,7 @@ var projectReviewCommand = new Command134("review").description(
25412
25530
  await postProjectWrite(
25413
25531
  `/api/projects/${projectId}/review`,
25414
25532
  { projectId, evaluator },
25415
- { warnings: await ownerEvaluatorWarnings(evaluator) }
25533
+ { maxAmount: ACTION_FEE_MAX_AMOUNT, warnings: await ownerEvaluatorWarnings(evaluator) }
25416
25534
  );
25417
25535
  });
25418
25536
  async function ownerEvaluatorWarnings(evaluator) {
@@ -25443,10 +25561,14 @@ var projectRevokeCommand = new Command135("revoke").description(
25443
25561
  if (!ADDRESS.test(opts.operator)) {
25444
25562
  return void printError("--operator must be a wallet address (0x + 40 hex chars)");
25445
25563
  }
25446
- await postProjectWrite(`/api/projects/${projectId}/grants/${opts.operator}/revoke`, {
25447
- projectId,
25448
- operator: opts.operator
25449
- });
25564
+ await postProjectWrite(
25565
+ `/api/projects/${projectId}/grants/${opts.operator}/revoke`,
25566
+ {
25567
+ projectId,
25568
+ operator: opts.operator
25569
+ },
25570
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
25571
+ );
25450
25572
  });
25451
25573
 
25452
25574
  // src/commands/project/schedule.ts
@@ -25587,7 +25709,11 @@ var createCommand3 = new Command136("create").description(
25587
25709
  ).requiredOption("--file <path>", "The template, JSON").action(async (opts) => {
25588
25710
  const template = await readValidTemplate(opts.file);
25589
25711
  if (!template) return;
25590
- await postProjectWrite("/api/project-workflow-templates", { template });
25712
+ await postProjectWrite(
25713
+ "/api/project-workflow-templates",
25714
+ { template },
25715
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
25716
+ );
25591
25717
  });
25592
25718
  var updateCommand = new Command136("update").description(
25593
25719
  "Replace a saved template with a JSON file, as the wallet that saved it; workflows already made from it keep their document. Costs 0.001 in the payment token"
@@ -25600,10 +25726,14 @@ var updateCommand = new Command136("update").description(
25600
25726
  }
25601
25727
  const template = await readValidTemplate(opts.file);
25602
25728
  if (!template) return;
25603
- await postProjectWrite(`/api/project-workflow-templates/${choice.templateId}/update`, {
25604
- templateId: choice.templateId,
25605
- template
25606
- });
25729
+ await postProjectWrite(
25730
+ `/api/project-workflow-templates/${choice.templateId}/update`,
25731
+ {
25732
+ templateId: choice.templateId,
25733
+ template
25734
+ },
25735
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
25736
+ );
25607
25737
  });
25608
25738
  var listCommand6 = new Command136("list").description(
25609
25739
  "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)"
@@ -25671,9 +25801,13 @@ var deleteCommand2 = new Command136("delete").description(
25671
25801
  "Presets and official templates are read-only; delete takes a saved template id (UUID)"
25672
25802
  );
25673
25803
  }
25674
- await postProjectWrite(`/api/project-workflow-templates/${choice.templateId}/delete`, {
25675
- templateId: choice.templateId
25676
- });
25804
+ await postProjectWrite(
25805
+ `/api/project-workflow-templates/${choice.templateId}/delete`,
25806
+ {
25807
+ templateId: choice.templateId
25808
+ },
25809
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
25810
+ );
25677
25811
  });
25678
25812
  var workflowTemplateCommand = new Command136("template").description(
25679
25813
  "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"
@@ -25683,11 +25817,15 @@ async function createWorkflowFromTemplate(projectId, template, pairs) {
25683
25817
  if ("error" in choice) return void printError(choice.error);
25684
25818
  const parsed = parseParams(pairs);
25685
25819
  if ("error" in parsed) return void printError(parsed.error);
25686
- await postProjectWrite(`/api/projects/${projectId}/workflows/from-template`, {
25687
- projectId,
25688
- ...choice,
25689
- params: parsed.params
25690
- });
25820
+ await postProjectWrite(
25821
+ `/api/projects/${projectId}/workflows/from-template`,
25822
+ {
25823
+ projectId,
25824
+ ...choice,
25825
+ params: parsed.params
25826
+ },
25827
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
25828
+ );
25691
25829
  }
25692
25830
 
25693
25831
  // src/commands/project/schedule.ts
@@ -25918,7 +26056,9 @@ var createCommand4 = new Command137("create").description(
25918
26056
  if (workflow !== null && "error" in workflow) return void printError(workflow.error);
25919
26057
  const body = scheduleCreateBody(projectId, opts, workflow ?? void 0);
25920
26058
  if ("error" in body) return void printError(String(body.error));
25921
- await postProjectWrite(`/api/projects/${projectId}/schedules`, body);
26059
+ await postProjectWrite(`/api/projects/${projectId}/schedules`, body, {
26060
+ maxAmount: ACTION_FEE_MAX_AMOUNT
26061
+ });
25922
26062
  });
25923
26063
  var OWNER_SCHEDULE_STATUSES = [...STATUSES, "needs_action", "all"];
25924
26064
  var listCommand7 = new Command137("list").description(
@@ -25965,7 +26105,11 @@ function actionCommand(action, description) {
25965
26105
  return new Command137(action).description(description).argument("<scheduleId>", "Schedule id").action(async (value) => {
25966
26106
  const id = scheduleId(value);
25967
26107
  if (typeof id !== "string") return void printError(id.error);
25968
- await postProjectWrite(`/api/project-schedules/${id}/${action}`, { scheduleId: id });
26108
+ await postProjectWrite(
26109
+ `/api/project-schedules/${id}/${action}`,
26110
+ { scheduleId: id },
26111
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
26112
+ );
25969
26113
  });
25970
26114
  }
25971
26115
  var settingsCommand = new Command137("settings").description(
@@ -25986,7 +26130,9 @@ var settingsCommand = new Command137("settings").description(
25986
26130
  return;
25987
26131
  }
25988
26132
  if ("error" in body) return void printError(String(body.error));
25989
- await postProjectWrite(`/api/projects/${projectId}/schedules/settings`, body);
26133
+ await postProjectWrite(`/api/projects/${projectId}/schedules/settings`, body, {
26134
+ maxAmount: ACTION_FEE_MAX_AMOUNT
26135
+ });
25990
26136
  });
25991
26137
  var projectScheduleCommand = new Command137("schedule").description(
25992
26138
  "Schedules: a task from the project's budget on a cadence, created by the platform runner under your grant to it"
@@ -26058,6 +26204,9 @@ var projectListCommand = new Command138("list").description(
26058
26204
  ).option(
26059
26205
  "--funding",
26060
26206
  "List every project open for backing now (not closed, end date ahead), newest first, instead of a wallet's; --address and --role are not used"
26207
+ ).option(
26208
+ "--open",
26209
+ "Only the wallet's projects that are still open (not closed, end date ahead); applied before --limit"
26061
26210
  ).option("--address <address>", "The wallet to list (default: your keystore wallet)").option("--role <role>", "owner, operator, backer or any (any is owner and operator)", "any").option("--limit <count>", "Projects per page (1-100, default 50)").option("--before <projectId>", "The next page: projects with a smaller id than this").action(
26062
26211
  async (opts) => {
26063
26212
  if (opts.funding && opts.address !== void 0) {
@@ -26093,6 +26242,7 @@ var projectListCommand = new Command138("list").description(
26093
26242
  }
26094
26243
  if (!ADDRESS.test(address3)) return void printError("Invalid Ethereum address for --address");
26095
26244
  const params = new URLSearchParams({ address: address3, role: opts.role });
26245
+ if (opts.open) params.set("status", "open");
26096
26246
  if (opts.limit !== void 0) params.set("limit", opts.limit.trim());
26097
26247
  if (before !== void 0) params.set("before", String(before));
26098
26248
  printResult(await apiGet(withChainId(`/api/projects?${params.toString()}`)));
@@ -26261,10 +26411,14 @@ var createCommand5 = new Command140("create").description(
26261
26411
  }
26262
26412
  );
26263
26413
  }
26264
- await postProjectWrite(`/api/projects/${projectId}/workflows`, {
26265
- projectId,
26266
- document: parsed.document
26267
- });
26414
+ await postProjectWrite(
26415
+ `/api/projects/${projectId}/workflows`,
26416
+ {
26417
+ projectId,
26418
+ document: parsed.document
26419
+ },
26420
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
26421
+ );
26268
26422
  });
26269
26423
  var OWNER_WORKFLOW_STATUSES = ["needs_action", "running", "failed", "idle", "all"];
26270
26424
  var listCommand8 = new Command140("list").description(
@@ -26326,7 +26480,11 @@ var runCommand2 = new Command140("run").description(
26326
26480
  ).argument("<workflowId>", "Workflow id").action(async (value) => {
26327
26481
  const id = uuid(value, "workflow");
26328
26482
  if (typeof id !== "string") return void printError(id.error);
26329
- await postProjectWrite(`/api/project-workflows/${id}/runs`, { workflowId: id });
26483
+ await postProjectWrite(
26484
+ `/api/project-workflows/${id}/runs`,
26485
+ { workflowId: id },
26486
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
26487
+ );
26330
26488
  });
26331
26489
  function stepCommand(action, description) {
26332
26490
  return new Command140(action).description(description).argument("<runId>", "Run id").requiredOption(
@@ -26337,7 +26495,11 @@ function stepCommand(action, description) {
26337
26495
  if (typeof id !== "string") return void printError(id.error);
26338
26496
  const step = stepKey(opts.step);
26339
26497
  if (typeof step !== "string") return void printError(step.error);
26340
- await postProjectWrite(`/api/project-workflow-runs/${id}/${action}`, { runId: id, step });
26498
+ await postProjectWrite(
26499
+ `/api/project-workflow-runs/${id}/${action}`,
26500
+ { runId: id, step },
26501
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
26502
+ );
26341
26503
  });
26342
26504
  }
26343
26505
  var cancelCommand = new Command140("cancel").description(
@@ -26345,21 +26507,33 @@ var cancelCommand = new Command140("cancel").description(
26345
26507
  ).argument("<runId>", "Run id").action(async (value) => {
26346
26508
  const id = uuid(value, "run");
26347
26509
  if (typeof id !== "string") return void printError(id.error);
26348
- await postProjectWrite(`/api/project-workflow-runs/${id}/cancel`, { runId: id });
26510
+ await postProjectWrite(
26511
+ `/api/project-workflow-runs/${id}/cancel`,
26512
+ { runId: id },
26513
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
26514
+ );
26349
26515
  });
26350
26516
  var stopAutoPayoutCommand = new Command140("stop-auto-payout").description(
26351
26517
  "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"
26352
26518
  ).argument("<runId>", "Run id").action(async (value) => {
26353
26519
  const id = uuid(value, "run");
26354
26520
  if (typeof id !== "string") return void printError(id.error);
26355
- await postProjectWrite(`/api/project-workflow-runs/${id}/stop-auto-payout`, { runId: id });
26521
+ await postProjectWrite(
26522
+ `/api/project-workflow-runs/${id}/stop-auto-payout`,
26523
+ { runId: id },
26524
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
26525
+ );
26356
26526
  });
26357
26527
  var deleteCommand3 = new Command140("delete").description(
26358
26528
  "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"
26359
26529
  ).argument("<workflowId>", "Workflow id").action(async (value) => {
26360
26530
  const id = uuid(value, "workflow");
26361
26531
  if (typeof id !== "string") return void printError(id.error);
26362
- await postProjectWrite(`/api/project-workflows/${id}/delete`, { workflowId: id });
26532
+ await postProjectWrite(
26533
+ `/api/project-workflows/${id}/delete`,
26534
+ { workflowId: id },
26535
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
26536
+ );
26363
26537
  });
26364
26538
  async function ownerGet(path8) {
26365
26539
  const auth = await signReadAuth();
@@ -26406,7 +26580,7 @@ var payoutConfirmCommand = new Command140("confirm").description(
26406
26580
  await postProjectWrite(
26407
26581
  `/api/project-workflow-payouts/${id}/confirm`,
26408
26582
  { proposalId: id },
26409
- { extra: { accept: view.accept } }
26583
+ { maxAmount: ACTION_FEE_MAX_AMOUNT, extra: { accept: view.accept } }
26410
26584
  );
26411
26585
  });
26412
26586
  var payoutCommand = new Command140("payout").description(
@@ -26434,10 +26608,14 @@ var settingsCommand2 = new Command140("settings").description(
26434
26608
  `--step-limit must be an integer from ${WORKFLOW_STEP_LIMIT_MIN} to ${WORKFLOW_STEP_LIMIT_MAX}`
26435
26609
  );
26436
26610
  }
26437
- await postProjectWrite(`/api/projects/${projectId}/workflows/settings`, {
26438
- projectId,
26439
- stepLimit: limit
26440
- });
26611
+ await postProjectWrite(
26612
+ `/api/projects/${projectId}/workflows/settings`,
26613
+ {
26614
+ projectId,
26615
+ stepLimit: limit
26616
+ },
26617
+ { maxAmount: ACTION_FEE_MAX_AMOUNT }
26618
+ );
26441
26619
  });
26442
26620
  var workflowCommand = new Command140("workflow").description(
26443
26621
  "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"
@@ -26569,28 +26747,40 @@ var listCommand10 = new Command142("list").description(
26569
26747
  ).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(
26570
26748
  "--cursor <cursor>",
26571
26749
  "The observation index page after this one: pass the previous page's nextCursor (implies --observed)"
26572
- ).action(async (opts) => {
26573
- try {
26574
- const input = parseInput(HookIndexInputSchema, {
26575
- limit: optionalInt(opts.limit),
26576
- ...opts.cursor !== void 0 ? { cursor: opts.cursor } : {}
26577
- });
26578
- if (opts.observed || input.cursor !== void 0) {
26579
- const params = new URLSearchParams({ limit: String(input.limit) });
26580
- if (input.cursor !== void 0) params.set("cursor", input.cursor);
26581
- printResult(await apiGet(withChainId(`/api/hooks?${params.toString()}`)));
26582
- return;
26750
+ ).option(
26751
+ "--q <hex>",
26752
+ "Only hooks whose address contains these hex digits, searched over every observed hook (implies --observed)"
26753
+ ).option(
26754
+ "--mode <mode>",
26755
+ "Only hooks used by tasks of this mode: bounty, claim, pitch, benchmark or auction (implies --observed)"
26756
+ ).action(
26757
+ async (opts) => {
26758
+ try {
26759
+ const input = parseInput(HookIndexInputSchema, {
26760
+ limit: optionalInt(opts.limit),
26761
+ ...opts.cursor !== void 0 ? { cursor: opts.cursor } : {},
26762
+ ...opts.q !== void 0 ? { q: opts.q } : {},
26763
+ ...opts.mode !== void 0 ? { mode: opts.mode } : {}
26764
+ });
26765
+ if (opts.observed || input.cursor !== void 0 || input.q !== void 0 || input.mode !== void 0) {
26766
+ const params = new URLSearchParams({ limit: String(input.limit) });
26767
+ if (input.cursor !== void 0) params.set("cursor", input.cursor);
26768
+ if (input.q !== void 0) params.set("q", input.q);
26769
+ if (input.mode !== void 0) params.set("mode", input.mode);
26770
+ printResult(await apiGet(withChainId(`/api/hooks?${params.toString()}`)));
26771
+ return;
26772
+ }
26773
+ const registry = await fetchHookRegistry();
26774
+ printResult({
26775
+ ...registry,
26776
+ listed: registry.listed.map(withV2Declarations),
26777
+ unlisted: registry.unlisted.slice(0, input.limit).map(withV2Declarations)
26778
+ });
26779
+ } catch (err) {
26780
+ renderFailure(err);
26583
26781
  }
26584
- const registry = await fetchHookRegistry();
26585
- printResult({
26586
- ...registry,
26587
- listed: registry.listed.map(withV2Declarations),
26588
- unlisted: registry.unlisted.slice(0, input.limit).map(withV2Declarations)
26589
- });
26590
- } catch (err) {
26591
- renderFailure(err);
26592
26782
  }
26593
- });
26783
+ );
26594
26784
  var showCommand7 = new Command142("show").description(
26595
26785
  "Show one hook on the selected --network: its registry listing, or its onchain observation marked unlisted"
26596
26786
  ).argument("<address>", "Hook contract address").action(async (address3) => {