moltlaunch 2.0.1 → 2.0.2
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 +2 -2
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ moltlaunch-v2/
|
|
|
53
53
|
│
|
|
54
54
|
▼
|
|
55
55
|
┌──────────────────────────────────────────────────────────┐
|
|
56
|
-
│
|
|
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** |
|
|
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
|
-
|
|
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("
|
|
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) {
|
|
@@ -894,7 +894,7 @@ async function register(options) {
|
|
|
894
894
|
try {
|
|
895
895
|
const agentIdStr = agentResult.agentId.toString();
|
|
896
896
|
const { signature, timestamp, nonce } = await signAction(wallet2, "register", agentIdStr);
|
|
897
|
-
await fetch(`${APIS.
|
|
897
|
+
await fetch(`${APIS.MOLTLAUNCH}/api/agents/register`, {
|
|
898
898
|
method: "POST",
|
|
899
899
|
headers: { "Content-Type": "application/json" },
|
|
900
900
|
body: JSON.stringify({ agentId: agentIdStr, signature, timestamp, nonce })
|
|
@@ -989,7 +989,7 @@ Provide an image with: --image <path>`);
|
|
|
989
989
|
}
|
|
990
990
|
|
|
991
991
|
// src/lib/tasks.ts
|
|
992
|
-
var API_BASE = APIS.
|
|
992
|
+
var API_BASE = APIS.MOLTLAUNCH;
|
|
993
993
|
async function createTask(agentId, clientAddress, taskDescription) {
|
|
994
994
|
const response = await fetch(`${API_BASE}/api/tasks`, {
|
|
995
995
|
method: "POST",
|
|
@@ -1227,7 +1227,7 @@ async function removeGigRequest(agentId, gigId, signature, timestamp, nonce) {
|
|
|
1227
1227
|
|
|
1228
1228
|
// src/commands/hire.ts
|
|
1229
1229
|
async function fetchAgent(agentId) {
|
|
1230
|
-
const res = await fetch(`${APIS.
|
|
1230
|
+
const res = await fetch(`${APIS.MOLTLAUNCH}/api/agents/${agentId}`);
|
|
1231
1231
|
if (!res.ok) return null;
|
|
1232
1232
|
const data = await res.json();
|
|
1233
1233
|
return data.agent;
|
|
@@ -1442,7 +1442,7 @@ async function searchAgents(options) {
|
|
|
1442
1442
|
async function agents(options) {
|
|
1443
1443
|
const limit = parseInt(options.limit, 10);
|
|
1444
1444
|
if (!options.json) {
|
|
1445
|
-
console.log("\
|
|
1445
|
+
console.log("\nmoltlaunch Agent Network");
|
|
1446
1446
|
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
1447
|
console.log("Fetching registered agents via Agent0 SDK...\n");
|
|
1448
1448
|
}
|
|
@@ -1608,7 +1608,7 @@ async function wallet(options) {
|
|
|
1608
1608
|
if (isNew) {
|
|
1609
1609
|
console.log("\n\u2728 Created new wallet\n");
|
|
1610
1610
|
}
|
|
1611
|
-
console.log("
|
|
1611
|
+
console.log("moltlaunch Wallet");
|
|
1612
1612
|
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
1613
|
console.log(`Address: ${wallet2.address}`);
|
|
1614
1614
|
console.log(`Balance: ${balance} ETH`);
|
|
@@ -1623,7 +1623,7 @@ async function wallet(options) {
|
|
|
1623
1623
|
async function earnings(options) {
|
|
1624
1624
|
const { wallet: wallet2 } = await loadOrCreateWallet();
|
|
1625
1625
|
if (!options.json) {
|
|
1626
|
-
console.log("\
|
|
1626
|
+
console.log("\nmoltlaunch Earnings");
|
|
1627
1627
|
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
1628
|
}
|
|
1629
1629
|
try {
|
|
@@ -1705,7 +1705,7 @@ async function resolveAgentId(options) {
|
|
|
1705
1705
|
if (!wallet2) {
|
|
1706
1706
|
throw new Error("No wallet found. Register first with: mltl register");
|
|
1707
1707
|
}
|
|
1708
|
-
const res = await fetch(`${APIS.
|
|
1708
|
+
const res = await fetch(`${APIS.MOLTLAUNCH}/api/agents`);
|
|
1709
1709
|
if (!res.ok) throw new Error("Failed to fetch agents");
|
|
1710
1710
|
const data = await res.json();
|
|
1711
1711
|
const match = data.agents.find(
|
|
@@ -1989,7 +1989,7 @@ async function resolveEscrowDispute(wallet2, taskId, clientWins) {
|
|
|
1989
1989
|
|
|
1990
1990
|
// src/commands/accept.ts
|
|
1991
1991
|
async function fetchAgent2(agentId) {
|
|
1992
|
-
const res = await fetch(`${APIS.
|
|
1992
|
+
const res = await fetch(`${APIS.MOLTLAUNCH}/api/agents/${agentId}`);
|
|
1993
1993
|
if (!res.ok) return null;
|
|
1994
1994
|
const data = await res.json();
|
|
1995
1995
|
return data.agent;
|
|
@@ -2134,7 +2134,7 @@ import { formatEther as formatEther5 } from "viem";
|
|
|
2134
2134
|
// src/lib/files.ts
|
|
2135
2135
|
import { readFileSync, statSync } from "fs";
|
|
2136
2136
|
import { basename } from "path";
|
|
2137
|
-
var API_BASE2 = APIS.
|
|
2137
|
+
var API_BASE2 = APIS.MOLTLAUNCH;
|
|
2138
2138
|
async function uploadFile(wallet2, taskId, filePath) {
|
|
2139
2139
|
const { signature, timestamp, nonce } = await signAction(wallet2, "upload", taskId);
|
|
2140
2140
|
const filename = basename(filePath);
|
|
@@ -2271,7 +2271,7 @@ ${options.result}
|
|
|
2271
2271
|
// src/commands/approve.ts
|
|
2272
2272
|
import { formatEther as formatEther6 } from "viem";
|
|
2273
2273
|
async function fetchAgent3(agentId) {
|
|
2274
|
-
const res = await fetch(`${APIS.
|
|
2274
|
+
const res = await fetch(`${APIS.MOLTLAUNCH}/api/agents/${agentId}`);
|
|
2275
2275
|
if (!res.ok) return null;
|
|
2276
2276
|
const data = await res.json();
|
|
2277
2277
|
return data.agent;
|
|
@@ -2812,7 +2812,7 @@ Task ID: ${task.id}`);
|
|
|
2812
2812
|
}
|
|
2813
2813
|
const txHash = await disputeEscrow(wallet2, task.id, feeWei);
|
|
2814
2814
|
const { signature, timestamp, nonce } = await signAction(wallet2, "dispute", task.id);
|
|
2815
|
-
await fetch(`${APIS.
|
|
2815
|
+
await fetch(`${APIS.MOLTLAUNCH}/api/tasks/${task.id}/dispute`, {
|
|
2816
2816
|
method: "POST",
|
|
2817
2817
|
headers: { "Content-Type": "application/json" },
|
|
2818
2818
|
body: JSON.stringify({ txHash, signature, timestamp, nonce })
|
|
@@ -2882,7 +2882,7 @@ Task ID: ${task.id}`);
|
|
|
2882
2882
|
}
|
|
2883
2883
|
const txHash = await resolveEscrowDispute(wallet2, task.id, clientWins);
|
|
2884
2884
|
const { signature, timestamp, nonce } = await signAction(wallet2, "resolve", task.id);
|
|
2885
|
-
await fetch(`${APIS.
|
|
2885
|
+
await fetch(`${APIS.MOLTLAUNCH}/api/tasks/${task.id}/resolve`, {
|
|
2886
2886
|
method: "POST",
|
|
2887
2887
|
headers: { "Content-Type": "application/json" },
|
|
2888
2888
|
body: JSON.stringify({
|
|
@@ -3207,7 +3207,7 @@ function formatTimestamp5(ts) {
|
|
|
3207
3207
|
}
|
|
3208
3208
|
async function reviews(options) {
|
|
3209
3209
|
try {
|
|
3210
|
-
const res = await fetch(`${APIS.
|
|
3210
|
+
const res = await fetch(`${APIS.MOLTLAUNCH}/api/agents/${encodeURIComponent(options.agent)}/reviews`);
|
|
3211
3211
|
if (!res.ok) {
|
|
3212
3212
|
const err = await res.json();
|
|
3213
3213
|
throw new Error(err.error || `HTTP ${res.status}`);
|
|
@@ -3345,11 +3345,11 @@ async function gigRemove(options) {
|
|
|
3345
3345
|
|
|
3346
3346
|
// src/index.ts
|
|
3347
3347
|
var program = new Command();
|
|
3348
|
-
program.name("mltl").description("
|
|
3349
|
-
program.command("register").description("Register an agent
|
|
3348
|
+
program.name("mltl").description("moltlaunch \u2014 hire AI agents with onchain reputation").version("2.0.2");
|
|
3349
|
+
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
3350
|
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
3351
|
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
|
|
3352
|
+
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
3353
|
program.command("reviews").description("View verified reviews for an agent").requiredOption("--agent <id>", "Agent ID").option("--json", "Output as JSON").action(reviews);
|
|
3354
3354
|
program.command("wallet").description("Show wallet info and balance").option("--json", "Output as JSON").action(wallet);
|
|
3355
3355
|
program.command("earnings").description("View your earnings from being hired").option("--json", "Output as JSON").action(earnings);
|