@lucid-agents/taskmarket 1.11.0 → 1.12.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.
Files changed (2) hide show
  1. package/dist/index.js +168 -60
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/index.ts
4
- import { Command as Command72 } from "commander";
4
+ import { Command as Command74 } from "commander";
5
5
  import { createRequire } from "module";
6
6
 
7
7
  // src/commands/init.ts
@@ -346,6 +346,9 @@ var TaskCreateSchema = z3.object({
346
346
  });
347
347
  var TaskResponseSchema = z3.object({
348
348
  id: z3.string(),
349
+ // The task's public name (ADR-0098), e.g. 'TSK-4M0BXQ2E'. Nullable until the backfill in
350
+ // migration 0051 completes; `id` remains the canonical URL segment.
351
+ referenceCode: z3.string().nullable().optional(),
349
352
  requester: z3.string(),
350
353
  requesterPubkey: z3.string().nullable(),
351
354
  description: z3.string(),
@@ -440,7 +443,11 @@ var TaskListInputSchema = z3.object({
440
443
  requester: z3.string().optional(),
441
444
  worker: z3.string().optional(),
442
445
  taskDropId: z3.string().trim().min(1).optional(),
443
- sort: z3.enum(["newest", "reward_desc", "reward_asc", "deadline_asc"]).optional().default("newest")
446
+ // Free-text search (ADR-0099). Bounded at 200 characters so a single query cannot ask for
447
+ // unbounded work; longer input is refused by Zod with a machine-readable reason (ADR-0058)
448
+ // rather than silently truncated into a different query than the one the user typed.
449
+ q: z3.string().trim().min(1).max(200).optional(),
450
+ sort: z3.enum(["newest", "reward_desc", "reward_asc", "deadline_asc", "relevance"]).optional().default("newest")
444
451
  });
445
452
  var TaskListResponseSchema = z3.object({
446
453
  tasks: z3.array(TaskResponseSchema),
@@ -612,6 +619,9 @@ var SubmissionCreateSchema = z4.object({
612
619
  });
613
620
  var SubmissionResponseSchema = z4.object({
614
621
  id: z4.string(),
622
+ // The submission's public name (ADR-0098), e.g. 'SUB-7K2QA9XF'. This is what the UI shows and
623
+ // what search accepts; `id` stays the primary key and the idempotency key.
624
+ referenceCode: z4.string().nullable().optional(),
615
625
  taskId: z4.string(),
616
626
  workerAddress: z4.string(),
617
627
  fileUrl: z4.string(),
@@ -703,7 +713,10 @@ var AgentRegistrationInputSchema = z5.object({
703
713
  source: RegistrationSource.optional().default("cli")
704
714
  });
705
715
  var LeaderboardInputSchema = z5.object({
706
- limit: z5.number().optional().default(20),
716
+ // RFC-0013 (Phase 1): the rate limiter on this endpoint bounds request count, not rows
717
+ // returned per request -- an unbounded limit would let one request dump the whole agent
718
+ // population regardless of the limiter, defeating the point of rate-limiting it at all.
719
+ limit: z5.number().int().min(1).max(100).optional().default(20),
707
720
  offset: z5.number().optional().default(0),
708
721
  sort: z5.enum(["reputation", "tasks"]).optional().default("reputation"),
709
722
  skill: z5.string().optional(),
@@ -920,8 +933,29 @@ var SetWithdrawalAddressInputSchema = z12.object({
920
933
  withdrawalAddress: EthAddressSchema,
921
934
  signature: z12.string().min(1)
922
935
  });
936
+ var AccountRecoveryCodeSchema = z12.string().regex(/^\d{8}$/);
923
937
  var SetWithdrawalAddressOutputSchema = z12.object({
924
- withdrawalAddress: z12.string()
938
+ withdrawalAddress: z12.string(),
939
+ // Returned exactly once, in this same response -- there is no other way to see it again.
940
+ accountRecoveryCode: AccountRecoveryCodeSchema
941
+ });
942
+ var ChangeWithdrawalAddressInputSchema = z12.object({
943
+ address: EthAddressSchema,
944
+ accountRecoveryCode: AccountRecoveryCodeSchema,
945
+ newWithdrawalAddress: EthAddressSchema
946
+ });
947
+ var ChangeWithdrawalAddressOutputSchema = z12.object({
948
+ withdrawalAddress: z12.string(),
949
+ // A fresh code, minted the same way, immediately: using a code invalidates it and
950
+ // replaces it, so the operator always holds exactly one current, unused code.
951
+ accountRecoveryCode: AccountRecoveryCodeSchema
952
+ });
953
+ var RevealBackfilledRecoveryCodeInputSchema = z12.object({
954
+ address: EthAddressSchema,
955
+ signature: z12.string().min(1)
956
+ });
957
+ var RevealBackfilledRecoveryCodeOutputSchema = z12.object({
958
+ accountRecoveryCode: AccountRecoveryCodeSchema
925
959
  });
926
960
  var UsdcDomainSchema = z12.object({
927
961
  name: z12.string(),
@@ -2081,6 +2115,9 @@ function buildForfeitMessage(taskId) {
2081
2115
  function buildSetWithdrawalAddressMessage(withdrawalAddress) {
2082
2116
  return `taskmarket:set-withdrawal-address:${withdrawalAddress.toLowerCase()}`;
2083
2117
  }
2118
+ function buildRevealAccountRecoveryCodeMessage(address) {
2119
+ return `taskmarket:reveal-account-recovery-code:${address.toLowerCase()}`;
2120
+ }
2084
2121
  function buildWithdrawDreamsMessage(destination, nonce, validBefore) {
2085
2122
  return `taskmarket:withdraw-dreams:${destination.toLowerCase()}:${nonce}:${validBefore}`;
2086
2123
  }
@@ -4862,7 +4899,7 @@ var depositCommand = new Command45("deposit").description("Show wallet address a
4862
4899
  });
4863
4900
 
4864
4901
  // src/commands/wallet/index.ts
4865
- import { Command as Command51 } from "commander";
4902
+ import { Command as Command53 } from "commander";
4866
4903
 
4867
4904
  // src/commands/wallet/balance.ts
4868
4905
  import { Command as Command46 } from "commander";
@@ -5010,20 +5047,89 @@ var setWithdrawalAddressCommand = new Command48("set-withdrawal-address").descri
5010
5047
  const walletAddress = keystore.walletAddress;
5011
5048
  const message = buildSetWithdrawalAddressMessage(address);
5012
5049
  const signature = await signMessage(message, keystore);
5013
- const { data: result, idempotencyKey } = await apiPost(
5014
- "/api/wallet/set-withdrawal-address",
5050
+ const { data: result, idempotencyKey } = await apiPost("/api/wallet/set-withdrawal-address", {
5051
+ walletAddress,
5052
+ withdrawalAddress: address,
5053
+ signature
5054
+ });
5055
+ printResult(
5015
5056
  {
5016
- walletAddress,
5017
- withdrawalAddress: address,
5018
- signature
5019
- }
5057
+ withdrawalAddress: result.withdrawalAddress,
5058
+ accountRecoveryCode: result.accountRecoveryCode,
5059
+ warning: "SAVE THIS ACCOUNT RECOVERY CODE NOW. It will never be shown again, and there is no way to recover it if lost -- the withdrawal address could then never be changed again. Save it in more than one independent place (e.g. a password manager entry AND a printed copy)."
5060
+ },
5061
+ { idempotencyKey }
5020
5062
  );
5021
- printResult({ withdrawalAddress: result.withdrawalAddress }, { idempotencyKey });
5022
5063
  });
5023
5064
 
5024
- // src/commands/wallet/publish-key.ts
5065
+ // src/commands/wallet/change-withdrawal-address.ts
5025
5066
  import { Command as Command49 } from "commander";
5026
- var publishKeyCommand = new Command49("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
5067
+ function isValidAddress2(addr) {
5068
+ return /^0x[a-fA-F0-9]{40}$/.test(addr);
5069
+ }
5070
+ function isValidRecoveryCode(code) {
5071
+ return /^\d{8}$/.test(code);
5072
+ }
5073
+ var changeWithdrawalAddressCommand = new Command49("change-withdrawal-address").description("Change the withdrawal address using the account recovery code (RFC-0012)").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) => {
5074
+ if (!isValidRecoveryCode(recoveryCode)) {
5075
+ printError("Invalid account recovery code: must be 8 digits");
5076
+ return;
5077
+ }
5078
+ if (!isValidAddress2(newAddress)) {
5079
+ printError("Invalid Ethereum address: must be 0x followed by 40 hex characters");
5080
+ return;
5081
+ }
5082
+ let keystore;
5083
+ try {
5084
+ keystore = await loadKeystore();
5085
+ } catch {
5086
+ printError("No keystore found. Run `taskmarket init` first.");
5087
+ return;
5088
+ }
5089
+ const { data: result, idempotencyKey } = await apiPost("/api/wallet/change-withdrawal-address", {
5090
+ address: keystore.walletAddress,
5091
+ accountRecoveryCode: recoveryCode,
5092
+ newWithdrawalAddress: newAddress
5093
+ });
5094
+ printResult(
5095
+ {
5096
+ withdrawalAddress: result.withdrawalAddress,
5097
+ accountRecoveryCode: result.accountRecoveryCode,
5098
+ warning: "SAVE THIS NEW ACCOUNT RECOVERY CODE NOW. The code you just used is no longer valid. This new one will never be shown again, and there is no way to recover it if lost. Save it in more than one independent place (e.g. a password manager entry AND a printed copy)."
5099
+ },
5100
+ { idempotencyKey }
5101
+ );
5102
+ });
5103
+
5104
+ // src/commands/wallet/reveal-recovery-code.ts
5105
+ import { Command as Command50 } from "commander";
5106
+ var revealRecoveryCodeCommand = new Command50("reveal-recovery-code").description("One-time reveal of your account recovery code, if one has not been generated yet").action(async () => {
5107
+ let keystore;
5108
+ try {
5109
+ keystore = await loadKeystore();
5110
+ } catch {
5111
+ printError("No keystore found. Run `taskmarket init` first.");
5112
+ return;
5113
+ }
5114
+ const address = keystore.walletAddress;
5115
+ const message = buildRevealAccountRecoveryCodeMessage(address);
5116
+ const signature = await signMessage(message, keystore);
5117
+ const { data: result, idempotencyKey } = await apiPost("/api/wallet/reveal-backfilled-recovery-code", {
5118
+ address,
5119
+ signature
5120
+ });
5121
+ printResult(
5122
+ {
5123
+ accountRecoveryCode: result.accountRecoveryCode,
5124
+ warning: "SAVE THIS ACCOUNT RECOVERY CODE NOW. It will never be shown again, and there is no way to recover it if lost -- the withdrawal address could then never be changed again. Save it in more than one independent place (e.g. a password manager entry AND a printed copy)."
5125
+ },
5126
+ { idempotencyKey }
5127
+ );
5128
+ });
5129
+
5130
+ // src/commands/wallet/publish-key.ts
5131
+ import { Command as Command51 } from "commander";
5132
+ var publishKeyCommand = new Command51("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
5027
5133
  let keystore;
5028
5134
  try {
5029
5135
  keystore = await loadKeystore();
@@ -5043,13 +5149,13 @@ var publishKeyCommand = new Command49("publish-key").description("Publish your s
5043
5149
  });
5044
5150
 
5045
5151
  // src/commands/wallet/withdraw-dreams.ts
5046
- import { Command as Command50 } from "commander";
5152
+ import { Command as Command52 } from "commander";
5047
5153
  import { toHex as toHex2 } from "viem";
5048
5154
  var AUTHORIZATION_VALIDITY_SECONDS = 300;
5049
- function isValidAddress2(addr) {
5155
+ function isValidAddress3(addr) {
5050
5156
  return /^0x[a-fA-F0-9]{40}$/.test(addr);
5051
5157
  }
5052
- var withdrawDreamsCommand = new Command50("withdraw-dreams").description("Withdraw accumulated DREAMS rewards to the withdrawal address").option("--destination <addr>", "Destination address (defaults to registered withdrawal address)").action(async (opts) => {
5158
+ var withdrawDreamsCommand = new Command52("withdraw-dreams").description("Withdraw accumulated DREAMS rewards to the withdrawal address").option("--destination <addr>", "Destination address (defaults to registered withdrawal address)").action(async (opts) => {
5053
5159
  let keystore;
5054
5160
  try {
5055
5161
  keystore = await loadKeystore();
@@ -5059,7 +5165,7 @@ var withdrawDreamsCommand = new Command50("withdraw-dreams").description("Withdr
5059
5165
  }
5060
5166
  const workerAddress = keystore.walletAddress;
5061
5167
  let destination = opts.destination;
5062
- if (destination !== void 0 && !isValidAddress2(destination)) {
5168
+ if (destination !== void 0 && !isValidAddress3(destination)) {
5063
5169
  printError("Invalid Ethereum address: must be 0x followed by 40 hex characters");
5064
5170
  return;
5065
5171
  }
@@ -5103,15 +5209,17 @@ var withdrawDreamsCommand = new Command50("withdraw-dreams").description("Withdr
5103
5209
  });
5104
5210
 
5105
5211
  // src/commands/wallet/index.ts
5106
- var walletCommand = new Command51("wallet").description("Wallet management commands");
5212
+ var walletCommand = new Command53("wallet").description("Wallet management commands");
5107
5213
  walletCommand.addCommand(walletBalanceCommand);
5108
5214
  walletCommand.addCommand(walletImportCommand);
5109
5215
  walletCommand.addCommand(setWithdrawalAddressCommand);
5216
+ walletCommand.addCommand(changeWithdrawalAddressCommand);
5217
+ walletCommand.addCommand(revealRecoveryCodeCommand);
5110
5218
  walletCommand.addCommand(publishKeyCommand);
5111
5219
  walletCommand.addCommand(withdrawDreamsCommand);
5112
5220
 
5113
5221
  // src/commands/withdraw.ts
5114
- import { Command as Command52 } from "commander";
5222
+ import { Command as Command54 } from "commander";
5115
5223
  import { toHex as toHex3 } from "viem";
5116
5224
  var USDC_TYPES = {
5117
5225
  TransferWithAuthorization: [
@@ -5123,7 +5231,7 @@ var USDC_TYPES = {
5123
5231
  { name: "nonce", type: "bytes32" }
5124
5232
  ]
5125
5233
  };
5126
- var withdrawCommand = new Command52("withdraw").description("Withdraw USDC to the registered withdrawal address").argument("<amount>", "Amount in USDC (e.g. 5 for 5 USDC)").action(async (amount) => {
5234
+ var withdrawCommand = new Command54("withdraw").description("Withdraw USDC to the registered withdrawal address").argument("<amount>", "Amount in USDC (e.g. 5 for 5 USDC)").action(async (amount) => {
5127
5235
  const parsed = parseFloat(amount);
5128
5236
  if (isNaN(parsed) || parsed <= 0) {
5129
5237
  printError("Invalid amount: must be a positive number (e.g. 5 for 5 USDC)");
@@ -5182,9 +5290,9 @@ var withdrawCommand = new Command52("withdraw").description("Withdraw USDC to th
5182
5290
  });
5183
5291
 
5184
5292
  // src/commands/encrypt.ts
5185
- import { Command as Command53 } from "commander";
5293
+ import { Command as Command55 } from "commander";
5186
5294
  import { promises as fs3 } from "fs";
5187
- var encryptCommand = new Command53("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) => {
5295
+ var encryptCommand = new Command55("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) => {
5188
5296
  let plaintext;
5189
5297
  try {
5190
5298
  plaintext = await fs3.readFile(file);
@@ -5232,9 +5340,9 @@ var encryptCommand = new Command53("encrypt").description("Encrypt a file with E
5232
5340
  });
5233
5341
 
5234
5342
  // src/commands/decrypt.ts
5235
- import { Command as Command54 } from "commander";
5343
+ import { Command as Command56 } from "commander";
5236
5344
  import { promises as fs4 } from "fs";
5237
- var decryptCommand = new Command54("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) => {
5345
+ var decryptCommand = new Command56("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) => {
5238
5346
  let ciphertext;
5239
5347
  try {
5240
5348
  ciphertext = await fs4.readFile(file);
@@ -5274,7 +5382,7 @@ var decryptCommand = new Command54("decrypt").description("Decrypt a file using
5274
5382
  });
5275
5383
 
5276
5384
  // src/commands/xmtp.ts
5277
- import { Command as Command55 } from "commander";
5385
+ import { Command as Command57 } from "commander";
5278
5386
 
5279
5387
  // src/lib/xmtp-client.ts
5280
5388
  import os3 from "os";
@@ -6038,7 +6146,7 @@ function getDefaultQueryTimeoutMs() {
6038
6146
  }
6039
6147
  return Math.floor(parsed);
6040
6148
  }
6041
- var xmtpCommand = new Command55("xmtp").description("Manage XMTP messaging for this agent");
6149
+ var xmtpCommand = new Command57("xmtp").description("Manage XMTP messaging for this agent");
6042
6150
  xmtpCommand.command("init").description("Initialize XMTP client and register installation metadata with backend").action(async () => {
6043
6151
  const keystore = await loadKeystore();
6044
6152
  const client = await createXmtpClient({
@@ -6275,7 +6383,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
6275
6383
  });
6276
6384
 
6277
6385
  // src/commands/daemon.ts
6278
- import { Command as Command56 } from "commander";
6386
+ import { Command as Command58 } from "commander";
6279
6387
  function diffTaskStatuses(prev, next) {
6280
6388
  const changes = [];
6281
6389
  for (const [taskId, newStatus] of next) {
@@ -6303,7 +6411,7 @@ function sleepOrAbort(ms, signal) {
6303
6411
  });
6304
6412
  }
6305
6413
  var MAX_SEEN_TASK_IDS = 2e3;
6306
- var daemonCommand = new Command56("daemon").description("Long-running agent daemon: XMTP stream, heartbeats, and task polling").option("--heartbeat-interval <ms>", "Heartbeat interval in milliseconds", "1800000").option("--inbox-interval <ms>", "Inbox poll interval in milliseconds", "15000").option("--task-interval <ms>", "New task poll interval in milliseconds", "15000").option(
6414
+ var daemonCommand = new Command58("daemon").description("Long-running agent daemon: XMTP stream, heartbeats, and task polling").option("--heartbeat-interval <ms>", "Heartbeat interval in milliseconds", "1800000").option("--inbox-interval <ms>", "Inbox poll interval in milliseconds", "15000").option("--task-interval <ms>", "New task poll interval in milliseconds", "15000").option(
6307
6415
  "--auction-poll-interval <ms>",
6308
6416
  "Poll interval for clock-based auction tasks (dutch/reverse_dutch) in milliseconds",
6309
6417
  "15000"
@@ -6636,11 +6744,11 @@ var daemonCommand = new Command56("daemon").description("Long-running agent daem
6636
6744
  );
6637
6745
 
6638
6746
  // src/commands/email/index.ts
6639
- import { Command as Command65 } from "commander";
6747
+ import { Command as Command67 } from "commander";
6640
6748
 
6641
6749
  // src/commands/email/register.ts
6642
- import { Command as Command57 } from "commander";
6643
- var registerCommand = new Command57("register").description("Register an email address for this agent").requiredOption("--username <name>", "Desired username (e.g. myagent)").action(async (opts) => {
6750
+ import { Command as Command59 } from "commander";
6751
+ var registerCommand = new Command59("register").description("Register an email address for this agent").requiredOption("--username <name>", "Desired username (e.g. myagent)").action(async (opts) => {
6644
6752
  const check = await apiGet(
6645
6753
  `/api/emails/check-username?username=${encodeURIComponent(opts.username)}`
6646
6754
  );
@@ -6661,8 +6769,8 @@ var registerCommand = new Command57("register").description("Register an email a
6661
6769
  });
6662
6770
 
6663
6771
  // src/commands/email/inbox.ts
6664
- import { Command as Command58 } from "commander";
6665
- var inboxCommand2 = new Command58("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) => {
6772
+ import { Command as Command60 } from "commander";
6773
+ var inboxCommand2 = new Command60("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) => {
6666
6774
  const keystore = await loadKeystore();
6667
6775
  const params = new URLSearchParams({
6668
6776
  deviceId: keystore.deviceId,
@@ -6677,8 +6785,8 @@ var inboxCommand2 = new Command58("inbox").description("List emails in your inbo
6677
6785
  });
6678
6786
 
6679
6787
  // src/commands/email/read.ts
6680
- import { Command as Command59 } from "commander";
6681
- var readCommand = new Command59("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
6788
+ import { Command as Command61 } from "commander";
6789
+ var readCommand = new Command61("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
6682
6790
  const keystore = await loadKeystore();
6683
6791
  const params = new URLSearchParams({
6684
6792
  deviceId: keystore.deviceId,
@@ -6690,8 +6798,8 @@ var readCommand = new Command59("read").description("Read an email by ID (marks
6690
6798
  });
6691
6799
 
6692
6800
  // src/commands/email/send.ts
6693
- import { Command as Command60 } from "commander";
6694
- var sendCommand = new Command60("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) => {
6801
+ import { Command as Command62 } from "commander";
6802
+ var sendCommand = new Command62("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) => {
6695
6803
  const keystore = await loadKeystore();
6696
6804
  const { data: result, idempotencyKey } = await apiPost("/api/emails/send", {
6697
6805
  deviceId: keystore.deviceId,
@@ -6704,8 +6812,8 @@ var sendCommand = new Command60("send").description("Send an email").requiredOpt
6704
6812
  });
6705
6813
 
6706
6814
  // src/commands/email/reply.ts
6707
- import { Command as Command61 } from "commander";
6708
- var replyCommand = new Command61("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").action(async (id, opts) => {
6815
+ import { Command as Command63 } from "commander";
6816
+ var replyCommand = new Command63("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").action(async (id, opts) => {
6709
6817
  const keystore = await loadKeystore();
6710
6818
  const params = new URLSearchParams({
6711
6819
  deviceId: keystore.deviceId,
@@ -6727,8 +6835,8 @@ var replyCommand = new Command61("reply").description("Reply to an email").argum
6727
6835
  });
6728
6836
 
6729
6837
  // src/commands/email/delete.ts
6730
- import { Command as Command62 } from "commander";
6731
- var deleteCommand = new Command62("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
6838
+ import { Command as Command64 } from "commander";
6839
+ var deleteCommand = new Command64("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
6732
6840
  const keystore = await loadKeystore();
6733
6841
  const { data: result, idempotencyKey } = await apiPost(
6734
6842
  "/api/emails/delete",
@@ -6742,15 +6850,15 @@ var deleteCommand = new Command62("delete").description("Delete an email by ID")
6742
6850
  });
6743
6851
 
6744
6852
  // src/commands/email/address.ts
6745
- import { Command as Command63 } from "commander";
6746
- var addressCommand2 = new Command63("address").description("Show your registered email address").action(async () => {
6853
+ import { Command as Command65 } from "commander";
6854
+ var addressCommand2 = new Command65("address").description("Show your registered email address").action(async () => {
6747
6855
  const keystore = await loadKeystore();
6748
6856
  const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
6749
6857
  printResult({ emailAddress: result.emailAddress ?? null });
6750
6858
  });
6751
6859
 
6752
6860
  // src/commands/email/mark-read.ts
6753
- import { Command as Command64 } from "commander";
6861
+ import { Command as Command66 } from "commander";
6754
6862
  async function setReadStatus(id, read) {
6755
6863
  const keystore = await loadKeystore();
6756
6864
  const { data: result, idempotencyKey } = await apiPost(
@@ -6764,12 +6872,12 @@ async function setReadStatus(id, read) {
6764
6872
  );
6765
6873
  printResult({ id: result.id, isRead: result.isRead }, { idempotencyKey });
6766
6874
  }
6767
- var markReadCommand = new Command64("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) => {
6875
+ var markReadCommand = new Command66("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) => {
6768
6876
  await setReadStatus(id, !opts.unread);
6769
6877
  });
6770
6878
 
6771
6879
  // src/commands/email/index.ts
6772
- var emailCommand = new Command65("email").description("Email management commands");
6880
+ var emailCommand = new Command67("email").description("Email management commands");
6773
6881
  emailCommand.addCommand(registerCommand);
6774
6882
  emailCommand.addCommand(inboxCommand2);
6775
6883
  emailCommand.addCommand(readCommand);
@@ -6780,11 +6888,11 @@ emailCommand.addCommand(addressCommand2);
6780
6888
  emailCommand.addCommand(markReadCommand);
6781
6889
 
6782
6890
  // src/commands/requester/index.ts
6783
- import { Command as Command67 } from "commander";
6891
+ import { Command as Command69 } from "commander";
6784
6892
 
6785
6893
  // src/commands/requester/stats.ts
6786
- import { Command as Command66 } from "commander";
6787
- var requesterStatsCmd = new Command66("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address) => {
6894
+ import { Command as Command68 } from "commander";
6895
+ var requesterStatsCmd = new Command68("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address) => {
6788
6896
  if (!/^0x[0-9a-fA-F]{40}$/.test(address)) {
6789
6897
  printError("Address must be a 0x-prefixed 20-byte hex string");
6790
6898
  return;
@@ -6798,13 +6906,13 @@ var requesterStatsCmd = new Command66("stats").description("Get requester reputa
6798
6906
  });
6799
6907
 
6800
6908
  // src/commands/requester/index.ts
6801
- var requesterCmd = new Command67("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
6909
+ var requesterCmd = new Command69("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
6802
6910
 
6803
6911
  // src/commands/x402/index.ts
6804
- import { Command as Command71 } from "commander";
6912
+ import { Command as Command73 } from "commander";
6805
6913
 
6806
6914
  // src/commands/x402/payments.ts
6807
- import { Command as Command68, Option as Option2 } from "commander";
6915
+ import { Command as Command70, Option as Option2 } from "commander";
6808
6916
  import { createInterface as createInterface3 } from "readline";
6809
6917
 
6810
6918
  // src/lib/x402-journal.ts
@@ -7574,7 +7682,7 @@ async function confirmManualResolution() {
7574
7682
  readline.close();
7575
7683
  return answer.trim().toLowerCase() === "resolve";
7576
7684
  }
7577
- var x402PaymentsCommand = new Command68("payments").description(
7685
+ var x402PaymentsCommand = new Command70("payments").description(
7578
7686
  "Inspect and reconcile external x402 payment records"
7579
7687
  );
7580
7688
  x402PaymentsCommand.command("list").description("List current payment records").addOption(new Option2("--state <state>", "Filter by state").choices(PAYMENT_STATES)).action(async (options) => {
@@ -7598,7 +7706,7 @@ x402PaymentsCommand.command("resolve").description("Manually record an externall
7598
7706
 
7599
7707
  // src/commands/x402/policy.ts
7600
7708
  import { promises as fs7 } from "fs";
7601
- import { Command as Command69 } from "commander";
7709
+ import { Command as Command71 } from "commander";
7602
7710
  import { createInterface as createInterface4 } from "readline";
7603
7711
  async function confirmUnattendedRule(rule) {
7604
7712
  if (!process.stdin.isTTY) {
@@ -7624,7 +7732,7 @@ async function confirmUnattendedRule(rule) {
7624
7732
  readline.close();
7625
7733
  return answer.trim().toLowerCase() === "authorize";
7626
7734
  }
7627
- var x402PolicyCommand = new Command69("policy").description(
7735
+ var x402PolicyCommand = new Command71("policy").description(
7628
7736
  "Manage local external x402 spending policy"
7629
7737
  );
7630
7738
  x402PolicyCommand.command("init").description("Create a deny-all policy file").action(async () => {
@@ -7660,7 +7768,7 @@ for (const enabled of [true, false]) {
7660
7768
  }
7661
7769
 
7662
7770
  // src/commands/x402/request.ts
7663
- import { Command as Command70, Option as Option3 } from "commander";
7771
+ import { Command as Command72, Option as Option3 } from "commander";
7664
7772
  import { createInterface as createInterface5 } from "readline";
7665
7773
 
7666
7774
  // src/lib/external-x402-client.ts
@@ -8618,7 +8726,7 @@ async function confirm(lines) {
8618
8726
  readline.close();
8619
8727
  return answer.trim().toLowerCase() === "yes";
8620
8728
  }
8621
- var x402RequestCommand = new Command70("request").description("Request and pay for a direct external x402 HTTP resource").argument("<url>", "HTTPS resource URL").addOption(new Option3("--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(
8729
+ var x402RequestCommand = new Command72("request").description("Request and pay for a direct external x402 HTTP resource").argument("<url>", "HTTPS resource URL").addOption(new Option3("--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(
8622
8730
  "--header-env <header=ENV_VAR>",
8623
8731
  "Read one request header from an environment variable (repeatable)",
8624
8732
  collect2,
@@ -8662,7 +8770,7 @@ var x402RequestCommand = new Command70("request").description("Request and pay f
8662
8770
  );
8663
8771
 
8664
8772
  // src/commands/x402/index.ts
8665
- var x402Command = new Command71("x402").description(
8773
+ var x402Command = new Command73("x402").description(
8666
8774
  "Pay external x402 services with local spending policies"
8667
8775
  );
8668
8776
  x402Command.addCommand(x402RequestCommand);
@@ -8672,7 +8780,7 @@ x402Command.addCommand(x402PaymentsCommand);
8672
8780
  // src/index.ts
8673
8781
  var require2 = createRequire(import.meta.url);
8674
8782
  var { version } = require2("../package.json");
8675
- var program = new Command72();
8783
+ var program = new Command74();
8676
8784
  program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
8677
8785
  program.addCommand(initCommand);
8678
8786
  program.addCommand(walletCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucid-agents/taskmarket",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "taskmarket": "./dist/index.js"
@@ -22,8 +22,8 @@
22
22
  "typescript": "^5.3.3",
23
23
  "vitest": "^2.0.0",
24
24
  "@taskmarket/eslint-config": "0.0.0",
25
- "@taskmarket/prettier-config": "0.0.0",
26
- "@taskmarket/shared": "2.0.0"
25
+ "@taskmarket/shared": "2.0.0",
26
+ "@taskmarket/prettier-config": "0.0.0"
27
27
  },
28
28
  "files": [
29
29
  "dist"