moltlaunch 2.0.1 → 2.0.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/README.md CHANGED
@@ -53,7 +53,7 @@ moltlaunch-v2/
53
53
 
54
54
 
55
55
  ┌──────────────────────────────────────────────────────────┐
56
- MANDATE Worker (Cloudflare)
56
+ moltlaunch Worker (Cloudflare)
57
57
  │ Task queue (KV) · REST API · Auth (EIP-191 signatures) │
58
58
  └──────────────────────────────────────────────────────────┘
59
59
  ```
@@ -64,7 +64,7 @@ moltlaunch-v2/
64
64
  |-------|----------|---------|
65
65
  | **Identity** | ERC-8004 | Agent registration, skills, endpoints |
66
66
  | **Reputation** | ERC-8004 | Onchain feedback from hirers |
67
- | **Task Queue** | MANDATE Worker | Quote-based async task coordination |
67
+ | **Task Queue** | moltlaunch Worker | Quote-based async task coordination |
68
68
  | **Escrow** | MandateEscrowV4 | Trustless payment with buyback-and-burn + disputes |
69
69
  | **Valuation** | Flaunch | Token price = market belief in agent |
70
70
 
package/dist/index.js CHANGED
@@ -33,7 +33,7 @@ var REVENUE_MANAGER_ADDRESS = "0x3Bc08524d9DaaDEC9d1Af87818d809611F0fD669";
33
33
  var APIS = {
34
34
  FLAUNCH: "https://web2-api.flaunch.gg",
35
35
  FLAUNCH_DATA: "https://api.flayerlabs.xyz",
36
- MANDATE: "https://api.moltlaunch.com"
36
+ MOLTLAUNCH: "https://api.moltlaunch.com"
37
37
  };
38
38
  var CHAIN = {
39
39
  id: 8453,
@@ -820,7 +820,7 @@ async function register(options) {
820
820
  const symbol = options.symbol?.toUpperCase() || "";
821
821
  if (!options.json) {
822
822
  console.log("\n\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");
823
- console.log(" MANDATE Agent Registration");
823
+ console.log(" moltlaunch \u2014 Agent Registration");
824
824
  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\n");
825
825
  console.log(`Name: ${options.name}`);
826
826
  if (hasExistingToken) {
@@ -891,14 +891,19 @@ async function register(options) {
891
891
  priceWei: parseEther(options.price),
892
892
  flaunchToken: tokenAddress
893
893
  });
894
+ let registrationStatus = "unknown";
894
895
  try {
895
896
  const agentIdStr = agentResult.agentId.toString();
896
897
  const { signature, timestamp, nonce } = await signAction(wallet2, "register", agentIdStr);
897
- await fetch(`${APIS.MANDATE}/api/agents/register`, {
898
+ const regRes = await fetch(`${APIS.MOLTLAUNCH}/api/agents/register`, {
898
899
  method: "POST",
899
900
  headers: { "Content-Type": "application/json" },
900
901
  body: JSON.stringify({ agentId: agentIdStr, signature, timestamp, nonce })
901
902
  });
903
+ if (regRes.ok) {
904
+ const regData = await regRes.json();
905
+ registrationStatus = regData.status === "approved" ? "approved" : "pending";
906
+ }
902
907
  } catch {
903
908
  }
904
909
  if (options.json) {
@@ -917,13 +922,18 @@ async function register(options) {
917
922
  skills,
918
923
  endpoint: options.endpoint,
919
924
  priceEth: options.price,
920
- registry: CONTRACTS.IDENTITY_REGISTRY
925
+ registry: CONTRACTS.IDENTITY_REGISTRY,
926
+ registrationStatus
921
927
  })
922
928
  );
923
929
  return;
924
930
  }
925
931
  console.log("\n\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");
926
- console.log(" \u2705 Registration Complete!");
932
+ if (registrationStatus === "pending") {
933
+ console.log(" \u23F3 Registration Submitted \u2014 Pending Approval");
934
+ } else {
935
+ console.log(" \u2705 Registration Complete!");
936
+ }
927
937
  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\n");
928
938
  console.log(`Agent ID: ${agentResult.agentId}`);
929
939
  console.log(`Name: ${options.name}`);
@@ -956,6 +966,11 @@ async function register(options) {
956
966
  }
957
967
  console.log("\nOthers can invest in your agent at:");
958
968
  console.log(` ${flaunchUrl}`);
969
+ if (registrationStatus === "pending") {
970
+ console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
971
+ console.log("\n\u23F3 Your agent is pending admin approval.");
972
+ console.log(" It will appear in the marketplace once approved.");
973
+ }
959
974
  } catch (err) {
960
975
  const errorMsg = err instanceof Error ? err.message : String(err);
961
976
  if (options.json) {
@@ -989,7 +1004,7 @@ Provide an image with: --image <path>`);
989
1004
  }
990
1005
 
991
1006
  // src/lib/tasks.ts
992
- var API_BASE = APIS.MANDATE;
1007
+ var API_BASE = APIS.MOLTLAUNCH;
993
1008
  async function createTask(agentId, clientAddress, taskDescription) {
994
1009
  const response = await fetch(`${API_BASE}/api/tasks`, {
995
1010
  method: "POST",
@@ -1227,7 +1242,7 @@ async function removeGigRequest(agentId, gigId, signature, timestamp, nonce) {
1227
1242
 
1228
1243
  // src/commands/hire.ts
1229
1244
  async function fetchAgent(agentId) {
1230
- const res = await fetch(`${APIS.MANDATE}/api/agents/${agentId}`);
1245
+ const res = await fetch(`${APIS.MOLTLAUNCH}/api/agents/${agentId}`);
1231
1246
  if (!res.ok) return null;
1232
1247
  const data = await res.json();
1233
1248
  return data.agent;
@@ -1442,7 +1457,7 @@ async function searchAgents(options) {
1442
1457
  async function agents(options) {
1443
1458
  const limit = parseInt(options.limit, 10);
1444
1459
  if (!options.json) {
1445
- console.log("\nMANDATE Agent Network");
1460
+ console.log("\nmoltlaunch Agent Network");
1446
1461
  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");
1447
1462
  console.log("Fetching registered agents via Agent0 SDK...\n");
1448
1463
  }
@@ -1608,7 +1623,7 @@ async function wallet(options) {
1608
1623
  if (isNew) {
1609
1624
  console.log("\n\u2728 Created new wallet\n");
1610
1625
  }
1611
- console.log("MANDATE Wallet");
1626
+ console.log("moltlaunch Wallet");
1612
1627
  console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
1613
1628
  console.log(`Address: ${wallet2.address}`);
1614
1629
  console.log(`Balance: ${balance} ETH`);
@@ -1623,7 +1638,7 @@ async function wallet(options) {
1623
1638
  async function earnings(options) {
1624
1639
  const { wallet: wallet2 } = await loadOrCreateWallet();
1625
1640
  if (!options.json) {
1626
- console.log("\nMANDATE Earnings");
1641
+ console.log("\nmoltlaunch Earnings");
1627
1642
  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");
1628
1643
  }
1629
1644
  try {
@@ -1705,7 +1720,7 @@ async function resolveAgentId(options) {
1705
1720
  if (!wallet2) {
1706
1721
  throw new Error("No wallet found. Register first with: mltl register");
1707
1722
  }
1708
- const res = await fetch(`${APIS.MANDATE}/api/agents`);
1723
+ const res = await fetch(`${APIS.MOLTLAUNCH}/api/agents`);
1709
1724
  if (!res.ok) throw new Error("Failed to fetch agents");
1710
1725
  const data = await res.json();
1711
1726
  const match = data.agents.find(
@@ -1989,7 +2004,7 @@ async function resolveEscrowDispute(wallet2, taskId, clientWins) {
1989
2004
 
1990
2005
  // src/commands/accept.ts
1991
2006
  async function fetchAgent2(agentId) {
1992
- const res = await fetch(`${APIS.MANDATE}/api/agents/${agentId}`);
2007
+ const res = await fetch(`${APIS.MOLTLAUNCH}/api/agents/${agentId}`);
1993
2008
  if (!res.ok) return null;
1994
2009
  const data = await res.json();
1995
2010
  return data.agent;
@@ -2134,7 +2149,7 @@ import { formatEther as formatEther5 } from "viem";
2134
2149
  // src/lib/files.ts
2135
2150
  import { readFileSync, statSync } from "fs";
2136
2151
  import { basename } from "path";
2137
- var API_BASE2 = APIS.MANDATE;
2152
+ var API_BASE2 = APIS.MOLTLAUNCH;
2138
2153
  async function uploadFile(wallet2, taskId, filePath) {
2139
2154
  const { signature, timestamp, nonce } = await signAction(wallet2, "upload", taskId);
2140
2155
  const filename = basename(filePath);
@@ -2271,7 +2286,7 @@ ${options.result}
2271
2286
  // src/commands/approve.ts
2272
2287
  import { formatEther as formatEther6 } from "viem";
2273
2288
  async function fetchAgent3(agentId) {
2274
- const res = await fetch(`${APIS.MANDATE}/api/agents/${agentId}`);
2289
+ const res = await fetch(`${APIS.MOLTLAUNCH}/api/agents/${agentId}`);
2275
2290
  if (!res.ok) return null;
2276
2291
  const data = await res.json();
2277
2292
  return data.agent;
@@ -2812,7 +2827,7 @@ Task ID: ${task.id}`);
2812
2827
  }
2813
2828
  const txHash = await disputeEscrow(wallet2, task.id, feeWei);
2814
2829
  const { signature, timestamp, nonce } = await signAction(wallet2, "dispute", task.id);
2815
- await fetch(`${APIS.MANDATE}/api/tasks/${task.id}/dispute`, {
2830
+ await fetch(`${APIS.MOLTLAUNCH}/api/tasks/${task.id}/dispute`, {
2816
2831
  method: "POST",
2817
2832
  headers: { "Content-Type": "application/json" },
2818
2833
  body: JSON.stringify({ txHash, signature, timestamp, nonce })
@@ -2882,7 +2897,7 @@ Task ID: ${task.id}`);
2882
2897
  }
2883
2898
  const txHash = await resolveEscrowDispute(wallet2, task.id, clientWins);
2884
2899
  const { signature, timestamp, nonce } = await signAction(wallet2, "resolve", task.id);
2885
- await fetch(`${APIS.MANDATE}/api/tasks/${task.id}/resolve`, {
2900
+ await fetch(`${APIS.MOLTLAUNCH}/api/tasks/${task.id}/resolve`, {
2886
2901
  method: "POST",
2887
2902
  headers: { "Content-Type": "application/json" },
2888
2903
  body: JSON.stringify({
@@ -3207,7 +3222,7 @@ function formatTimestamp5(ts) {
3207
3222
  }
3208
3223
  async function reviews(options) {
3209
3224
  try {
3210
- const res = await fetch(`${APIS.MANDATE}/api/agents/${encodeURIComponent(options.agent)}/reviews`);
3225
+ const res = await fetch(`${APIS.MOLTLAUNCH}/api/agents/${encodeURIComponent(options.agent)}/reviews`);
3211
3226
  if (!res.ok) {
3212
3227
  const err = await res.json();
3213
3228
  throw new Error(err.error || `HTTP ${res.status}`);
@@ -3345,11 +3360,11 @@ async function gigRemove(options) {
3345
3360
 
3346
3361
  // src/index.ts
3347
3362
  var program = new Command();
3348
- program.name("mltl").description("MANDATE: Molt's Autonomous Network for Distributed Agent Task Execution").version("2.0.0-alpha.0");
3349
- program.command("register").description("Register an agent in MANDATE (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);
3363
+ program.name("mltl").description("moltlaunch \u2014 hire AI agents with onchain reputation").version("2.0.2");
3364
+ 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);
3350
3365
  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);
3351
3366
  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);
3352
- program.command("agents").description("Browse agents in MANDATE").option("--skill <skill>", "Filter by skill").option("--sort <field>", "Sort by: reputation, price, hires", "reputation").option("--limit <n>", "Number of results", "20").option("--json", "Output as JSON").action(agents);
3367
+ program.command("agents").description("Browse registered agents").option("--skill <skill>", "Filter by skill").option("--sort <field>", "Sort by: reputation, price, hires", "reputation").option("--limit <n>", "Number of results", "20").option("--json", "Output as JSON").action(agents);
3353
3368
  program.command("reviews").description("View verified reviews for an agent").requiredOption("--agent <id>", "Agent ID").option("--json", "Output as JSON").action(reviews);
3354
3369
  program.command("wallet").description("Show wallet info and balance").option("--json", "Output as JSON").action(wallet);
3355
3370
  program.command("earnings").description("View your earnings from being hired").option("--json", "Output as JSON").action(earnings);