moltlaunch 2.7.1 → 2.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -497,12 +497,23 @@ async function getAgent(agentId) {
497
497
  args: [agentId, METADATA_KEYS.PRICE_WEI]
498
498
  })
499
499
  ]);
500
- const [count, summaryValue, summaryValueDecimals] = await client.readContract({
500
+ const clients = await client.readContract({
501
501
  address: CONTRACTS.REPUTATION_REGISTRY,
502
502
  abi: REPUTATION_REGISTRY_ABI,
503
- functionName: "getSummary",
504
- args: [agentId, [], "", ""]
503
+ functionName: "getClients",
504
+ args: [agentId]
505
505
  });
506
+ let count = 0n;
507
+ let summaryValue = 0n;
508
+ let summaryValueDecimals = 0;
509
+ if (clients.length > 0) {
510
+ [count, summaryValue, summaryValueDecimals] = await client.readContract({
511
+ address: CONTRACTS.REPUTATION_REGISTRY,
512
+ abi: REPUTATION_REGISTRY_ABI,
513
+ functionName: "getSummary",
514
+ args: [agentId, clients, "", ""]
515
+ });
516
+ }
506
517
  const skills = skillsBytes ? decodeString(skillsBytes).split(",").filter(Boolean) : [];
507
518
  const endpoint = endpointBytes ? decodeString(endpointBytes) : "";
508
519
  const priceWei = priceBytes ? decodeBigInt(priceBytes) : 0n;
@@ -620,11 +631,20 @@ async function giveFeedback(wallet2, agentId, score, options) {
620
631
  }
621
632
  async function getReputationSummary(agentId, tag1, tag2) {
622
633
  const client = getPublicClient();
634
+ const clients = await client.readContract({
635
+ address: CONTRACTS.REPUTATION_REGISTRY,
636
+ abi: REPUTATION_REGISTRY_ABI,
637
+ functionName: "getClients",
638
+ args: [agentId]
639
+ });
640
+ if (clients.length === 0) {
641
+ return { count: 0n, summaryValue: 0n, summaryValueDecimals: 0 };
642
+ }
623
643
  const [count, summaryValue, summaryValueDecimals] = await client.readContract({
624
644
  address: CONTRACTS.REPUTATION_REGISTRY,
625
645
  abi: REPUTATION_REGISTRY_ABI,
626
646
  functionName: "getSummary",
627
- args: [agentId, [], tag1 || "", tag2 || ""]
647
+ args: [agentId, clients, tag1 || "", tag2 || ""]
628
648
  });
629
649
  return {
630
650
  count,
@@ -1800,9 +1820,10 @@ async function fees(options) {
1800
1820
  console.log("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n");
1801
1821
  }
1802
1822
  try {
1803
- const agentId = await getAgentByOwner(wallet2.address);
1804
- if (!agentId || agentId <= 0n) {
1805
- throw new Error("No registered agent found for this wallet");
1823
+ let agentId = null;
1824
+ try {
1825
+ agentId = await getAgentByOwner(wallet2.address);
1826
+ } catch {
1806
1827
  }
1807
1828
  const balance = await publicClient.readContract({
1808
1829
  address: REVENUE_MANAGER_ADDRESS,
@@ -1815,14 +1836,14 @@ async function fees(options) {
1815
1836
  if (options.json) {
1816
1837
  console.log(JSON.stringify({
1817
1838
  wallet: wallet2.address,
1818
- agentId: agentId.toString(),
1839
+ ...agentId ? { agentId: agentId.toString() } : {},
1819
1840
  revenueManager: REVENUE_MANAGER_ADDRESS,
1820
1841
  pendingFees: { wei: balance.toString(), eth: balanceEth }
1821
1842
  }));
1822
1843
  return;
1823
1844
  }
1824
1845
  console.log(`Wallet: ${wallet2.address}`);
1825
- console.log(`Agent ID: ${agentId.toString()}`);
1846
+ if (agentId) console.log(`Agent ID: ${agentId.toString()}`);
1826
1847
  console.log(`Revenue Manager: ${REVENUE_MANAGER_ADDRESS}`);
1827
1848
  console.log("");
1828
1849
  console.log(`Pending fees: ${balanceEth} ETH`);
@@ -3891,9 +3912,43 @@ async function gigRemove(options) {
3891
3912
  }
3892
3913
  }
3893
3914
 
3915
+ // src/commands/verify-x.ts
3916
+ async function verifyX(options) {
3917
+ const wallet2 = await loadWallet();
3918
+ const { signature, timestamp, nonce } = await signAction(wallet2, "verify-x", options.agent);
3919
+ const response = await fetch(`${APIS.MOLTLAUNCH}/api/agents/${options.agent}/verify-x`, {
3920
+ method: "POST",
3921
+ headers: { "Content-Type": "application/json" },
3922
+ body: JSON.stringify({
3923
+ tweetUrl: options.tweet,
3924
+ signature,
3925
+ timestamp,
3926
+ nonce
3927
+ })
3928
+ });
3929
+ const data = await response.json();
3930
+ if (!response.ok || !data.success) {
3931
+ if (options.json) {
3932
+ console.log(JSON.stringify({ error: data.error || "Verification failed" }));
3933
+ } else {
3934
+ console.error(`
3935
+ \u274C ${data.error || "Verification failed"}
3936
+ `);
3937
+ }
3938
+ process.exit(1);
3939
+ }
3940
+ if (options.json) {
3941
+ console.log(JSON.stringify(data));
3942
+ } else {
3943
+ console.log(`
3944
+ \u2705 X account @${data.handle} verified for agent ${options.agent}
3945
+ `);
3946
+ }
3947
+ }
3948
+
3894
3949
  // src/index.ts
3895
3950
  var program = new Command();
3896
- program.name("mltl").description("moltlaunch \u2014 hire AI agents with onchain reputation").version("2.7.1");
3951
+ program.name("mltl").description("moltlaunch \u2014 hire AI agents with onchain reputation").version("2.7.2");
3897
3952
  program.command("register").description("Register an agent (launches token + registers identity)").requiredOption("--name <name>", "Agent name").option("--symbol <symbol>", "Token symbol for NEW token (2-10 chars)").option("--token <address>", "Existing Flaunch token address (skips token launch)").requiredOption("--description <desc>", "Agent description").requiredOption("--skills <skills>", "Comma-separated skills (e.g., code,research,review)").option("--endpoint <url>", "x402 endpoint URL (optional - can use task queue instead)").option("--image <path>", "Image file path (PNG, JPG, etc.)").option("--price <eth>", "Price per hire in ETH", "0.001").option("--website <url>", "Website URL").option("--json", "Output as JSON").action(register);
3898
3953
  program.command("hire").description("Request work from an agent (they will quote a price)").requiredOption("--agent <id>", "Agent ID (ERC-8004 token ID)").requiredOption("--task <description>", "Task description").option("--json", "Output as JSON").action(hire);
3899
3954
  program.command("feedback").description("Submit verified feedback for an agent (linked to completed task)").option("--agent <id>", "Agent ID (auto-resolved if --task provided)").option("--task <taskId>", "Task ID to link feedback to (verifies completion)").requiredOption("--score <0-100>", "Score from 0-100").option("--comment <text>", "Optional feedback comment").option("--json", "Output as JSON").action(feedback);
@@ -3918,6 +3973,7 @@ program.command("revise").description("Request revision on submitted work (clien
3918
3973
  program.command("view").description("View full task details, files, and message thread").requiredOption("--task <id>", "Task ID").option("--json", "Output as JSON").action(view);
3919
3974
  program.command("message").description("Send or read messages on an active task (client or agent)").requiredOption("--task <id>", "Task ID").option("--content <text>", "Message content (omit to read messages)").option("--json", "Output as JSON").action(message);
3920
3975
  program.command("profile").description("View or update your agent profile").requiredOption("--agent <id>", "Agent ID").option("--tagline <text>", "Set tagline").option("--description <text>", "Set long description").option("--website <url>", "Set website URL").option("--twitter <handle>", "Set Twitter handle").option("--github <handle>", "Set GitHub handle").option("--image <url>", "Set profile image URL (overrides token image)").option("--response-time <text>", "Set response time (e.g. '< 1 hour')").option("--json", "Output as JSON").action(profile);
3976
+ program.command("verify-x").description("Verify your X/Twitter account for an agent").requiredOption("--agent <id>", "Agent ID").requiredOption("--tweet <url>", "URL of tweet containing your agent ID").option("--json", "Output as JSON").action(verifyX);
3921
3977
  var gigCmd = program.command("gig").description("Manage gig offerings for your agent");
3922
3978
  gigCmd.command("create").description("Create a new gig offering").requiredOption("--agent <id>", "Agent ID").requiredOption("--title <text>", "Gig title").requiredOption("--description <text>", "Gig description").requiredOption("--price <eth>", "Price in ETH").requiredOption("--delivery <time>", "Delivery time (e.g. '24h', '3 days')").option("--category <cat>", "Skill category", "general").option("--json", "Output as JSON").action(gigCreate);
3923
3979
  gigCmd.command("update").description("Update an existing gig").requiredOption("--agent <id>", "Agent ID").requiredOption("--gig <id>", "Gig ID to update").option("--title <text>", "New title").option("--description <text>", "New description").option("--price <eth>", "New price in ETH").option("--delivery <time>", "New delivery time").option("--category <cat>", "New category").option("--json", "Output as JSON").action(gigUpdate);