moltlaunch 2.6.0 → 2.7.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.
package/dist/index.js CHANGED
@@ -1950,7 +1950,11 @@ async function inbox(options) {
1950
1950
  console.log(JSON.stringify({
1951
1951
  tasks: [],
1952
1952
  total: 0,
1953
- polling: { recommended: "5m", note: "No active tasks. Check less frequently." }
1953
+ polling: { recommended: "5m", note: "No active tasks. Check less frequently." },
1954
+ meta: {
1955
+ skillFile: "https://moltlaunch.com/skill.md",
1956
+ hint: "Re-read the skill file periodically \u2014 guardrails and features are updated frequently."
1957
+ }
1954
1958
  }));
1955
1959
  return;
1956
1960
  }
@@ -1979,7 +1983,11 @@ async function inbox(options) {
1979
1983
  tasks: tasks2,
1980
1984
  total: tasks2.length,
1981
1985
  polling: { recommended: pollingInterval, note: pollingNote },
1982
- flow: "requested \u2192 quoted \u2192 accepted \u2192 submitted \u2192 completed"
1986
+ flow: "requested \u2192 quoted \u2192 accepted \u2192 submitted \u2192 completed",
1987
+ meta: {
1988
+ skillFile: "https://moltlaunch.com/skill.md",
1989
+ hint: "Re-read the skill file periodically \u2014 guardrails and features are updated frequently."
1990
+ }
1983
1991
  }));
1984
1992
  return;
1985
1993
  }
@@ -2736,7 +2744,11 @@ async function tasks(options) {
2736
2744
  tasks: allTasks,
2737
2745
  total: allTasks.length,
2738
2746
  polling: { recommended: pollingInterval, note: pollingNote },
2739
- flow: "requested \u2192 quoted \u2192 accepted \u2192 submitted \u2192 completed"
2747
+ flow: "requested \u2192 quoted \u2192 accepted \u2192 submitted \u2192 completed",
2748
+ meta: {
2749
+ skillFile: "https://moltlaunch.com/skill.md",
2750
+ hint: "Re-read the skill file periodically \u2014 guardrails and features are updated frequently."
2751
+ }
2740
2752
  }));
2741
2753
  return;
2742
2754
  }
@@ -2990,12 +3002,12 @@ async function claim(options) {
2990
3002
  if (escrow.status === 5 /* Released */ || escrow.status === 6 /* Refunded */) {
2991
3003
  throw new Error("Payment already released or refunded");
2992
3004
  }
2993
- if (escrow.status !== 2 /* Submitted */) {
2994
- throw new Error("Work not yet submitted. Run 'mltl submit' first.");
2995
- }
2996
3005
  if (escrow.status === 3 /* Disputed */) {
2997
3006
  throw new Error("Task is disputed. Cannot claim until dispute is resolved.");
2998
3007
  }
3008
+ if (escrow.status !== 2 /* Submitted */) {
3009
+ throw new Error("Work not yet submitted. Run 'mltl submit' first.");
3010
+ }
2999
3011
  const priceEth = formatEther10(escrow.amount);
3000
3012
  const timedOut = await isEscrowTimedOut(options.task);
3001
3013
  if (!timedOut) {
@@ -3486,21 +3498,31 @@ Failed to fetch messages: ${errorMsg}`);
3486
3498
  }
3487
3499
  }
3488
3500
  const { wallet: wallet2 } = await loadOrCreateWallet();
3489
- if (!options.json) {
3490
- console.log("\nSending message...");
3491
- }
3492
3501
  try {
3502
+ const taskCheck = await getTask(options.task);
3503
+ const isAgent = taskCheck.agentId && wallet2.address.toLowerCase() !== taskCheck.clientAddress?.toLowerCase();
3504
+ const preFunded = ["requested", "quoted"].includes(taskCheck.status);
3505
+ if (isAgent && preFunded && !options.json) {
3506
+ console.log("\n\u26A0\uFE0F ESCROW NOT FUNDED \u2014 this task is still in '" + taskCheck.status + "' status.");
3507
+ console.log(" The client has not deposited ETH yet. Do not deliver work in messages.");
3508
+ console.log(" Wait for status 'accepted' before sharing deliverables.\n");
3509
+ }
3510
+ if (!options.json) {
3511
+ console.log("Sending message...");
3512
+ }
3493
3513
  const task = await sendMessage(wallet2, options.task, options.content);
3514
+ const escrowWarning = isAgent && preFunded ? "Escrow not funded. Do not deliver work in messages \u2014 wait for 'accepted' status." : void 0;
3494
3515
  const lastMsg = task.messages?.[task.messages.length - 1];
3495
3516
  if (options.json) {
3496
- console.log(
3497
- JSON.stringify({
3498
- success: true,
3499
- taskId: task.id,
3500
- messageCount: task.messages?.length || 0,
3501
- role: lastMsg?.role
3502
- })
3503
- );
3517
+ const jsonOut = {
3518
+ success: true,
3519
+ taskId: task.id,
3520
+ status: task.status,
3521
+ messageCount: task.messages?.length || 0,
3522
+ role: lastMsg?.role
3523
+ };
3524
+ if (escrowWarning) jsonOut.warning = escrowWarning;
3525
+ console.log(JSON.stringify(jsonOut));
3504
3526
  return;
3505
3527
  }
3506
3528
  console.log(`
@@ -3871,7 +3893,7 @@ async function gigRemove(options) {
3871
3893
 
3872
3894
  // src/index.ts
3873
3895
  var program = new Command();
3874
- program.name("mltl").description("moltlaunch \u2014 hire AI agents with onchain reputation").version("2.0.2");
3896
+ program.name("mltl").description("moltlaunch \u2014 hire AI agents with onchain reputation").version("2.7.1");
3875
3897
  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);
3876
3898
  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);
3877
3899
  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);