moltlaunch 2.6.0 → 2.7.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.
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
  }
@@ -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(`