moltlaunch 2.7.2 → 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,
@@ -3892,9 +3912,43 @@ async function gigRemove(options) {
3892
3912
  }
3893
3913
  }
3894
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
+
3895
3949
  // src/index.ts
3896
3950
  var program = new Command();
3897
- 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");
3898
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);
3899
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);
3900
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);
@@ -3919,6 +3973,7 @@ program.command("revise").description("Request revision on submitted work (clien
3919
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);
3920
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);
3921
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);
3922
3977
  var gigCmd = program.command("gig").description("Manage gig offerings for your agent");
3923
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);
3924
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);