agentlaunch 1.0.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/README.md +475 -0
- package/dist/__tests__/config.test.d.ts +20 -0
- package/dist/__tests__/config.test.d.ts.map +1 -0
- package/dist/__tests__/config.test.js +155 -0
- package/dist/__tests__/config.test.js.map +1 -0
- package/dist/commands/buy.d.ts +10 -0
- package/dist/commands/buy.d.ts.map +1 -0
- package/dist/commands/buy.js +126 -0
- package/dist/commands/buy.js.map +1 -0
- package/dist/commands/comments.d.ts +15 -0
- package/dist/commands/comments.d.ts.map +1 -0
- package/dist/commands/comments.js +137 -0
- package/dist/commands/comments.js.map +1 -0
- package/dist/commands/config.d.ts +10 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +63 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/create.d.ts +33 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +1177 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/deploy.d.ts +18 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +178 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/holders.d.ts +13 -0
- package/dist/commands/holders.d.ts.map +1 -0
- package/dist/commands/holders.js +114 -0
- package/dist/commands/holders.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +506 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +10 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +135 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/optimize.d.ts +12 -0
- package/dist/commands/optimize.d.ts.map +1 -0
- package/dist/commands/optimize.js +134 -0
- package/dist/commands/optimize.js.map +1 -0
- package/dist/commands/scaffold.d.ts +25 -0
- package/dist/commands/scaffold.d.ts.map +1 -0
- package/dist/commands/scaffold.js +123 -0
- package/dist/commands/scaffold.js.map +1 -0
- package/dist/commands/sell.d.ts +10 -0
- package/dist/commands/sell.d.ts.map +1 -0
- package/dist/commands/sell.js +109 -0
- package/dist/commands/sell.js.map +1 -0
- package/dist/commands/status.d.ts +10 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +124 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/tokenize.d.ts +16 -0
- package/dist/commands/tokenize.d.ts.map +1 -0
- package/dist/commands/tokenize.js +207 -0
- package/dist/commands/tokenize.js.map +1 -0
- package/dist/config.d.ts +44 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +137 -0
- package/dist/config.js.map +1 -0
- package/dist/http.d.ts +24 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +53 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +86 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
function getTemplateFiles() {
|
|
4
|
+
return [
|
|
5
|
+
{
|
|
6
|
+
path: ".env.example",
|
|
7
|
+
content: getEnvExample(),
|
|
8
|
+
strategy: "skip-if-env",
|
|
9
|
+
description: "Environment configuration template",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
path: ".claude/settings.json",
|
|
13
|
+
content: getClaudeSettings(),
|
|
14
|
+
strategy: "merge-mcp",
|
|
15
|
+
description: "Claude Code MCP server configuration",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
path: ".claude/rules/agentlaunch.md",
|
|
19
|
+
content: getAgentlaunchRule(),
|
|
20
|
+
strategy: "write",
|
|
21
|
+
description: "AgentLaunch platform constants and rules",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
path: ".claude/rules/agentverse.md",
|
|
25
|
+
content: getAgentverseRule(),
|
|
26
|
+
strategy: "write",
|
|
27
|
+
description: "Agentverse API patterns",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
path: ".claude/rules/uagent-patterns.md",
|
|
31
|
+
content: getUagentRule(),
|
|
32
|
+
strategy: "write",
|
|
33
|
+
description: "uAgent Chat Protocol patterns",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
path: ".claude/skills/build-agent/SKILL.md",
|
|
37
|
+
content: getBuildAgentSkill(),
|
|
38
|
+
strategy: "write",
|
|
39
|
+
description: "Skill: scaffold -> deploy -> tokenize",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
path: ".claude/skills/deploy/SKILL.md",
|
|
43
|
+
content: getDeploySkill(),
|
|
44
|
+
strategy: "write",
|
|
45
|
+
description: "Skill: deploy agent to Agentverse",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
path: ".claude/skills/tokenize/SKILL.md",
|
|
49
|
+
content: getTokenizeSkill(),
|
|
50
|
+
strategy: "write",
|
|
51
|
+
description: "Skill: create token + handoff link",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
path: ".claude/skills/market/SKILL.md",
|
|
55
|
+
content: getMarketSkill(),
|
|
56
|
+
strategy: "write",
|
|
57
|
+
description: "Skill: browse tokens and prices",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
path: ".claude/skills/status/SKILL.md",
|
|
61
|
+
content: getStatusSkill(),
|
|
62
|
+
strategy: "write",
|
|
63
|
+
description: "Skill: check agent/token status",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
path: ".cursor/rules/agentlaunch.md",
|
|
67
|
+
content: getCursorRule(),
|
|
68
|
+
strategy: "write",
|
|
69
|
+
description: "Cursor IDE rules for AgentLaunch",
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
// ─── Merge logic ─────────────────────────────────────────────────────────────
|
|
74
|
+
function deepMergeMcpSettings(existing, incoming) {
|
|
75
|
+
try {
|
|
76
|
+
const existingObj = JSON.parse(existing);
|
|
77
|
+
const incomingObj = JSON.parse(incoming);
|
|
78
|
+
// Ensure mcpServers object exists
|
|
79
|
+
if (!existingObj.mcpServers)
|
|
80
|
+
existingObj.mcpServers = {};
|
|
81
|
+
const existingMcp = existingObj.mcpServers;
|
|
82
|
+
const incomingMcp = (incomingObj.mcpServers ?? {});
|
|
83
|
+
// Add new MCP server entries without overwriting existing ones
|
|
84
|
+
for (const [key, value] of Object.entries(incomingMcp)) {
|
|
85
|
+
if (!existingMcp[key]) {
|
|
86
|
+
existingMcp[key] = value;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Merge permissions.allow arrays
|
|
90
|
+
const incomingPerms = incomingObj.permissions;
|
|
91
|
+
if (incomingPerms?.allow) {
|
|
92
|
+
if (!existingObj.permissions)
|
|
93
|
+
existingObj.permissions = {};
|
|
94
|
+
const existingPerms = existingObj.permissions;
|
|
95
|
+
if (!existingPerms.allow)
|
|
96
|
+
existingPerms.allow = [];
|
|
97
|
+
for (const perm of incomingPerms.allow) {
|
|
98
|
+
if (!existingPerms.allow.includes(perm)) {
|
|
99
|
+
existingPerms.allow.push(perm);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return JSON.stringify(existingObj, null, 2) + "\n";
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
// If parsing fails, return incoming as-is
|
|
107
|
+
return incoming;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
export function registerInit(program) {
|
|
111
|
+
program
|
|
112
|
+
.command("init")
|
|
113
|
+
.description("Install AgentLaunch toolkit into current project")
|
|
114
|
+
.option("--update", "Re-sync toolkit files to latest version")
|
|
115
|
+
.option("--force", "Overwrite all files (no merge)")
|
|
116
|
+
.option("--dry-run", "Show what would be installed without writing")
|
|
117
|
+
.option("--no-docs", "Skip docs/agents/ installation")
|
|
118
|
+
.option("--no-cursor", "Skip .cursor/ installation")
|
|
119
|
+
.action(async (opts) => {
|
|
120
|
+
const targetDir = process.cwd();
|
|
121
|
+
const templates = getTemplateFiles();
|
|
122
|
+
// Filter based on flags
|
|
123
|
+
const filtered = templates.filter((t) => {
|
|
124
|
+
if (opts.cursor === false && t.path.startsWith(".cursor/"))
|
|
125
|
+
return false;
|
|
126
|
+
return true;
|
|
127
|
+
});
|
|
128
|
+
// Context detection
|
|
129
|
+
const hasClaudeDir = fs.existsSync(path.join(targetDir, ".claude"));
|
|
130
|
+
const hasPackageJson = fs.existsSync(path.join(targetDir, "package.json"));
|
|
131
|
+
const hasEnv = fs.existsSync(path.join(targetDir, ".env"));
|
|
132
|
+
const isEmpty = fs.readdirSync(targetDir).filter((f) => !f.startsWith(".")).length === 0;
|
|
133
|
+
if (!opts.dryRun) {
|
|
134
|
+
console.log("\n \u{1F680} AgentLaunch Toolkit Installer\n");
|
|
135
|
+
if (hasClaudeDir) {
|
|
136
|
+
console.log(" Detected: Existing Claude Code project");
|
|
137
|
+
}
|
|
138
|
+
else if (hasPackageJson) {
|
|
139
|
+
console.log(" Detected: Existing Node.js project");
|
|
140
|
+
}
|
|
141
|
+
else if (isEmpty) {
|
|
142
|
+
console.log(" Detected: Fresh directory");
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
console.log(" Detected: Existing project");
|
|
146
|
+
}
|
|
147
|
+
console.log();
|
|
148
|
+
}
|
|
149
|
+
let created = 0;
|
|
150
|
+
let merged = 0;
|
|
151
|
+
let skipped = 0;
|
|
152
|
+
for (const template of filtered) {
|
|
153
|
+
const fullPath = path.join(targetDir, template.path);
|
|
154
|
+
const exists = fs.existsSync(fullPath);
|
|
155
|
+
if (opts.dryRun) {
|
|
156
|
+
const action = !exists
|
|
157
|
+
? "CREATE"
|
|
158
|
+
: template.strategy === "merge-mcp"
|
|
159
|
+
? "MERGE"
|
|
160
|
+
: opts.force || opts.update
|
|
161
|
+
? "UPDATE"
|
|
162
|
+
: "SKIP";
|
|
163
|
+
console.log(` [${action}] ${template.path} \u2014 ${template.description}`);
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
// Create parent directories
|
|
167
|
+
fs.mkdirSync(path.dirname(fullPath), { recursive: true });
|
|
168
|
+
if (!exists) {
|
|
169
|
+
// New file — always write
|
|
170
|
+
fs.writeFileSync(fullPath, template.content, "utf8");
|
|
171
|
+
console.log(` \u2713 Created ${template.path}`);
|
|
172
|
+
created++;
|
|
173
|
+
}
|
|
174
|
+
else if (template.strategy === "merge-mcp") {
|
|
175
|
+
// Merge MCP settings
|
|
176
|
+
if (opts.force) {
|
|
177
|
+
fs.writeFileSync(fullPath, template.content, "utf8");
|
|
178
|
+
console.log(` \u2713 Overwrote ${template.path}`);
|
|
179
|
+
created++;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
const existingContent = fs.readFileSync(fullPath, "utf8");
|
|
183
|
+
const mergedContent = deepMergeMcpSettings(existingContent, template.content);
|
|
184
|
+
fs.writeFileSync(fullPath, mergedContent, "utf8");
|
|
185
|
+
console.log(` \u2197 Merged ${template.path} (kept existing config)`);
|
|
186
|
+
merged++;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
else if (template.strategy === "skip-if-env" && hasEnv && !opts.force) {
|
|
190
|
+
console.log(` \u00b7 Skipped ${template.path} (.env exists)`);
|
|
191
|
+
skipped++;
|
|
192
|
+
}
|
|
193
|
+
else if (opts.force || opts.update) {
|
|
194
|
+
fs.writeFileSync(fullPath, template.content, "utf8");
|
|
195
|
+
console.log(` \u2713 Updated ${template.path}`);
|
|
196
|
+
created++;
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
console.log(` \u00b7 Skipped ${template.path} (exists, use --force to overwrite)`);
|
|
200
|
+
skipped++;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (!opts.dryRun) {
|
|
204
|
+
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");
|
|
205
|
+
console.log(` Files created: ${created}`);
|
|
206
|
+
console.log(` Files merged: ${merged}`);
|
|
207
|
+
console.log(` Files skipped: ${skipped}`);
|
|
208
|
+
console.log("\n Next steps:");
|
|
209
|
+
if (!hasEnv) {
|
|
210
|
+
console.log(" 1. cp .env.example .env");
|
|
211
|
+
console.log(" 2. Add your Agentverse API key to .env");
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
console.log(" 1. Verify your .env has AGENTVERSE_API_KEY set");
|
|
215
|
+
}
|
|
216
|
+
console.log(" 3. Open Claude Code in this directory");
|
|
217
|
+
console.log(" 4. Say: /build-agent");
|
|
218
|
+
console.log();
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
// ─── Embedded template content ───────────────────────────────────────────────
|
|
223
|
+
// These functions return the content of each installable file.
|
|
224
|
+
function getEnvExample() {
|
|
225
|
+
return `# AgentLaunch Toolkit — Environment Configuration
|
|
226
|
+
# Copy this file: cp .env.example .env
|
|
227
|
+
|
|
228
|
+
# ─── Required ──────────────────────────────────────────────
|
|
229
|
+
# Your Agentverse API key (get one at https://agentverse.ai)
|
|
230
|
+
AGENTVERSE_API_KEY=
|
|
231
|
+
|
|
232
|
+
# ─── Environment ───────────────────────────────────────────
|
|
233
|
+
# "production" (default) → agent-launch.ai
|
|
234
|
+
# "dev" → dev Cloud Run URLs
|
|
235
|
+
AGENT_LAUNCH_ENV=production
|
|
236
|
+
|
|
237
|
+
# ─── URL Overrides (optional) ─────────────────────────────
|
|
238
|
+
# AGENT_LAUNCH_API_URL=https://agent-launch.ai/api
|
|
239
|
+
# AGENT_LAUNCH_FRONTEND_URL=https://agent-launch.ai
|
|
240
|
+
|
|
241
|
+
# ─── Chain ID ─────────────────────────────────────────────
|
|
242
|
+
# 97 = BSC Testnet (default), 56 = BSC Mainnet
|
|
243
|
+
CHAIN_ID=97
|
|
244
|
+
`;
|
|
245
|
+
}
|
|
246
|
+
function getClaudeSettings() {
|
|
247
|
+
return (JSON.stringify({
|
|
248
|
+
permissions: {
|
|
249
|
+
allow: [
|
|
250
|
+
"Bash(npm run build)",
|
|
251
|
+
"Bash(npm run test)",
|
|
252
|
+
"Bash(npm test)",
|
|
253
|
+
"Bash(npx agentlaunch *)",
|
|
254
|
+
"Bash(npx agent-launch-mcp)",
|
|
255
|
+
],
|
|
256
|
+
},
|
|
257
|
+
mcpServers: {
|
|
258
|
+
"agent-launch": {
|
|
259
|
+
command: "npx",
|
|
260
|
+
args: ["agent-launch-mcp"],
|
|
261
|
+
env: {
|
|
262
|
+
AGENT_LAUNCH_API_KEY: "${AGENTVERSE_API_KEY}",
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
}, null, 2) + "\n");
|
|
267
|
+
}
|
|
268
|
+
function getAgentlaunchRule() {
|
|
269
|
+
return `# AgentLaunch Platform Rules
|
|
270
|
+
|
|
271
|
+
## Contract Constants (Source of Truth)
|
|
272
|
+
- TARGET_LIQUIDITY = 30,000 FET (graduation target for DEX listing)
|
|
273
|
+
- TOTAL_BUY_TOKENS = 800,000,000 (bonding curve supply)
|
|
274
|
+
- FEE_PERCENTAGE = 2% → 100% to protocol treasury (REVENUE_ACCOUNT)
|
|
275
|
+
- TOKEN_DEPLOYMENT_FEE = 120 FET (read dynamically, can change via multi-sig)
|
|
276
|
+
- BUY_PRICE_DIFFERENCE_PERCENT = 1000 (10x price range)
|
|
277
|
+
|
|
278
|
+
## CRITICAL: Fee Distribution
|
|
279
|
+
The 2% trading fee goes **100% to REVENUE_ACCOUNT (protocol treasury)**.
|
|
280
|
+
There is **NO creator fee split**. The contract has no mechanism to send fees to creators.
|
|
281
|
+
Never write "1% creator", "split evenly", "creator earnings from fees".
|
|
282
|
+
|
|
283
|
+
## API Authentication
|
|
284
|
+
All authenticated endpoints use the \`X-API-Key\` header with an Agentverse API key.
|
|
285
|
+
No wallet signatures needed for API access.
|
|
286
|
+
|
|
287
|
+
## Agent-Human Handoff Protocol
|
|
288
|
+
1. Agent creates token record via POST /agents/tokenize
|
|
289
|
+
2. API returns a handoff_link URL
|
|
290
|
+
3. Human opens link, connects wallet, and signs on-chain deployment
|
|
291
|
+
4. Agent NEVER touches private keys
|
|
292
|
+
`;
|
|
293
|
+
}
|
|
294
|
+
function getAgentverseRule() {
|
|
295
|
+
return `# Agentverse API Patterns
|
|
296
|
+
|
|
297
|
+
## Base URL
|
|
298
|
+
https://agentverse.ai/v1
|
|
299
|
+
|
|
300
|
+
## Authentication
|
|
301
|
+
All requests use: \`Authorization: bearer <AGENTVERSE_API_KEY>\`
|
|
302
|
+
|
|
303
|
+
## Create Agent
|
|
304
|
+
POST /hosting/agents
|
|
305
|
+
Body: { "name": "My Agent" }
|
|
306
|
+
Returns: { "address": "agent1q...", "name": "My Agent" }
|
|
307
|
+
|
|
308
|
+
## Upload Code (IMPORTANT: Double-encoded JSON)
|
|
309
|
+
PUT /hosting/agents/{address}/code
|
|
310
|
+
Body: { "code": JSON.stringify([{ "language": "python", "name": "agent.py", "value": "<code>" }]) }
|
|
311
|
+
The code array must be JSON.stringify'd TWICE: once for the array, once for the body.
|
|
312
|
+
|
|
313
|
+
## Start Agent
|
|
314
|
+
POST /hosting/agents/{address}/start
|
|
315
|
+
Body: {}
|
|
316
|
+
|
|
317
|
+
## Common Errors
|
|
318
|
+
- 401: Invalid or expired API key
|
|
319
|
+
- 404: Agent address not found
|
|
320
|
+
- 422: Code validation failed (syntax errors in Python)
|
|
321
|
+
`;
|
|
322
|
+
}
|
|
323
|
+
function getUagentRule() {
|
|
324
|
+
return `# uAgent Chat Protocol Patterns (v0.3.0)
|
|
325
|
+
|
|
326
|
+
## Minimal Agent Template
|
|
327
|
+
\`\`\`python
|
|
328
|
+
from uagents import Agent, Context, Protocol
|
|
329
|
+
from uagents_core.contrib.protocols.chat import (
|
|
330
|
+
ChatAcknowledgement, ChatMessage, TextContent, chat_protocol_spec,
|
|
331
|
+
)
|
|
332
|
+
from datetime import datetime, timezone
|
|
333
|
+
from uuid import uuid4
|
|
334
|
+
|
|
335
|
+
agent = Agent() # Zero-param constructor
|
|
336
|
+
chat_proto = Protocol(spec=chat_protocol_spec)
|
|
337
|
+
|
|
338
|
+
@chat_proto.on_message(ChatMessage)
|
|
339
|
+
async def handle_chat(ctx: Context, sender: str, msg: ChatMessage) -> None:
|
|
340
|
+
# Always send acknowledgement first
|
|
341
|
+
await ctx.send(sender, ChatAcknowledgement(
|
|
342
|
+
timestamp=datetime.now(tz=timezone.utc),
|
|
343
|
+
acknowledged_msg_id=msg.msg_id,
|
|
344
|
+
))
|
|
345
|
+
text = " ".join(item.text for item in msg.content if isinstance(item, TextContent)).strip()
|
|
346
|
+
# Process and respond
|
|
347
|
+
await ctx.send(sender, ChatMessage(
|
|
348
|
+
timestamp=datetime.now(tz=timezone.utc),
|
|
349
|
+
msg_id=uuid4(),
|
|
350
|
+
content=[TextContent(type="text", text=f"Response: {text}")],
|
|
351
|
+
))
|
|
352
|
+
|
|
353
|
+
@chat_proto.on_message(ChatAcknowledgement)
|
|
354
|
+
async def handle_ack(ctx: Context, sender: str, msg: ChatAcknowledgement) -> None:
|
|
355
|
+
ctx.logger.debug(f"Ack from {sender[:20]}")
|
|
356
|
+
|
|
357
|
+
agent.include(chat_proto, publish_manifest=True)
|
|
358
|
+
\`\`\`
|
|
359
|
+
|
|
360
|
+
## Key Rules
|
|
361
|
+
- Agent() takes ZERO parameters
|
|
362
|
+
- Always send ChatAcknowledgement before responding
|
|
363
|
+
- Always include publish_manifest=True
|
|
364
|
+
- Use uuid4() for msg_id
|
|
365
|
+
- Use timezone-aware timestamps
|
|
366
|
+
`;
|
|
367
|
+
}
|
|
368
|
+
function getBuildAgentSkill() {
|
|
369
|
+
return `---
|
|
370
|
+
name: build-agent
|
|
371
|
+
description: Scaffold, deploy, and tokenize an AI agent end-to-end
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
# /build-agent
|
|
375
|
+
|
|
376
|
+
Build a complete AI agent token launch in one guided flow.
|
|
377
|
+
|
|
378
|
+
## Steps
|
|
379
|
+
|
|
380
|
+
1. **Ask** the user what their agent should do
|
|
381
|
+
2. **Scaffold** agent code using the \`create_and_tokenize\` MCP tool or CLI:
|
|
382
|
+
\`npx agentlaunch create --name "AgentName" --template research\`
|
|
383
|
+
3. **Review** the generated Python code with the user
|
|
384
|
+
4. **Deploy** to Agentverse (requires AGENTVERSE_API_KEY in .env)
|
|
385
|
+
5. **Tokenize** — create the token record and get the handoff link
|
|
386
|
+
6. **Share** the handoff link with the user
|
|
387
|
+
|
|
388
|
+
## Available Templates
|
|
389
|
+
- research — Research and analysis agent
|
|
390
|
+
- price-monitor — Token price monitoring
|
|
391
|
+
- trading-bot — Automated trading signals
|
|
392
|
+
- data-analyzer — Data processing pipeline
|
|
393
|
+
- gifter — FET token gifting agent
|
|
394
|
+
- custom — Blank template
|
|
395
|
+
|
|
396
|
+
## Platform Constants
|
|
397
|
+
- Deploy fee: 120 FET
|
|
398
|
+
- Graduation: 30,000 FET liquidity target for auto DEX listing
|
|
399
|
+
- Trading fee: 2% to protocol treasury (no creator fee)
|
|
400
|
+
`;
|
|
401
|
+
}
|
|
402
|
+
function getDeploySkill() {
|
|
403
|
+
return `---
|
|
404
|
+
name: deploy
|
|
405
|
+
description: Deploy an agent to Agentverse
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
# /deploy
|
|
409
|
+
|
|
410
|
+
Deploy a Python agent to the Agentverse hosting platform.
|
|
411
|
+
|
|
412
|
+
## Steps
|
|
413
|
+
1. Ensure AGENTVERSE_API_KEY is set in .env
|
|
414
|
+
2. Use MCP tool \`create_and_tokenize\` or CLI \`npx agentlaunch create\`
|
|
415
|
+
3. The agent will be created, code uploaded, and started on Agentverse
|
|
416
|
+
4. Returns the agent address (agent1q...)
|
|
417
|
+
|
|
418
|
+
## Requirements
|
|
419
|
+
- Valid Agentverse API key
|
|
420
|
+
- Python agent code following uAgent Chat Protocol
|
|
421
|
+
`;
|
|
422
|
+
}
|
|
423
|
+
function getTokenizeSkill() {
|
|
424
|
+
return `---
|
|
425
|
+
name: tokenize
|
|
426
|
+
description: Create a token for an existing agent
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
# /tokenize
|
|
430
|
+
|
|
431
|
+
Create a token record for an existing Agentverse agent and get a handoff link.
|
|
432
|
+
|
|
433
|
+
## Steps
|
|
434
|
+
1. Get the agent address (agent1q... or 0x...)
|
|
435
|
+
2. Use MCP tool or CLI: \`npx agentlaunch tokenize --agent <address> --name "Token" --symbol "TKN"\`
|
|
436
|
+
3. Returns: token ID + handoff link
|
|
437
|
+
4. Share handoff link so a human can connect wallet and deploy on-chain
|
|
438
|
+
|
|
439
|
+
## Fee Note
|
|
440
|
+
- Deploy fee: 120 FET (paid by deploying wallet)
|
|
441
|
+
- Trading fee: 2% to protocol treasury (no creator fee)
|
|
442
|
+
`;
|
|
443
|
+
}
|
|
444
|
+
function getMarketSkill() {
|
|
445
|
+
return `---
|
|
446
|
+
name: market
|
|
447
|
+
description: Browse tokens and check prices
|
|
448
|
+
---
|
|
449
|
+
|
|
450
|
+
# /market
|
|
451
|
+
|
|
452
|
+
Browse AgentLaunch tokens and market data.
|
|
453
|
+
|
|
454
|
+
## Commands
|
|
455
|
+
- \`npx agentlaunch list\` — List all tokens
|
|
456
|
+
- \`npx agentlaunch status <address>\` — Token details + price
|
|
457
|
+
- \`npx agentlaunch holders <address>\` — Token holders
|
|
458
|
+
|
|
459
|
+
## MCP Tools
|
|
460
|
+
- \`list_tokens\` — Search and filter tokens
|
|
461
|
+
- \`get_token_price\` — Current price for a token
|
|
462
|
+
- \`get_token_holders\` — Holder list with balances
|
|
463
|
+
`;
|
|
464
|
+
}
|
|
465
|
+
function getStatusSkill() {
|
|
466
|
+
return `---
|
|
467
|
+
name: status
|
|
468
|
+
description: Check agent and token deployment status
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
# /status
|
|
472
|
+
|
|
473
|
+
Check the status of an agent or token.
|
|
474
|
+
|
|
475
|
+
## Commands
|
|
476
|
+
- \`npx agentlaunch status <address>\` — Shows token status, price, progress
|
|
477
|
+
- Token statuses: pending, bonding, listed
|
|
478
|
+
- Progress: percentage toward 30,000 FET graduation target
|
|
479
|
+
`;
|
|
480
|
+
}
|
|
481
|
+
function getCursorRule() {
|
|
482
|
+
return `# AgentLaunch — Cursor IDE Rules
|
|
483
|
+
|
|
484
|
+
## Platform
|
|
485
|
+
AgentLaunch (agent-launch.ai) — AI agent token launchpad on Fetch.ai
|
|
486
|
+
|
|
487
|
+
## Key Constants
|
|
488
|
+
- Deploy fee: 120 FET
|
|
489
|
+
- Graduation: 30,000 FET liquidity target for auto DEX listing
|
|
490
|
+
- Trading fee: 2% to protocol treasury (NO creator fee)
|
|
491
|
+
- Bonding curve supply: 800,000,000 tokens
|
|
492
|
+
|
|
493
|
+
## Packages
|
|
494
|
+
- SDK: \`agentlaunch-sdk\` — TypeScript client for all API operations
|
|
495
|
+
- CLI: \`agentlaunch-cli\` — Command-line interface
|
|
496
|
+
- MCP: \`agent-launch-mcp\` — Model Context Protocol server (19+ tools)
|
|
497
|
+
- Templates: \`agentlaunch-templates\` — Agent code generators
|
|
498
|
+
|
|
499
|
+
## API Auth
|
|
500
|
+
Use X-API-Key header with Agentverse API key. No wallet needed.
|
|
501
|
+
|
|
502
|
+
## Environment
|
|
503
|
+
Production URLs are default. Set AGENT_LAUNCH_ENV=dev for dev URLs.
|
|
504
|
+
`;
|
|
505
|
+
}
|
|
506
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAgB7B,SAAS,gBAAgB;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CAAC;AAED,SAAS,cAAc;IACrB,OAAO;;;;;;;;;;;;;;;;;;CAkBR,CAAC;AACF,CAAC;AAED,SAAS,gBAAgB;IACvB,OAAO;;;;;;;;;;;;;;;;;;CAkBR,CAAC;AACF,CAAC;AAED,SAAS,cAAc;IACrB,OAAO;;;;;;;;;;;;;;;;;;CAkBR,CAAC;AACF,CAAC;AAED,SAAS,cAAc;IACrB,OAAO;;;;;;;;;;;;;CAaR,CAAC;AACF,CAAC;AAED,SAAS,aAAa;IACpB,OAAO;;;;;;;;;;;;;;;;;;;;;;CAsBR,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI-003: list command
|
|
3
|
+
*
|
|
4
|
+
* agentlaunch list [--limit 10] [--sort trending|latest|market_cap] [--json]
|
|
5
|
+
*
|
|
6
|
+
* Fetches tokens from GET /tokens and prints a table.
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from "commander";
|
|
9
|
+
export declare function registerListCommand(program: Command): void;
|
|
10
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6BpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkI1D"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI-003: list command
|
|
3
|
+
*
|
|
4
|
+
* agentlaunch list [--limit 10] [--sort trending|latest|market_cap] [--json]
|
|
5
|
+
*
|
|
6
|
+
* Fetches tokens from GET /tokens and prints a table.
|
|
7
|
+
*/
|
|
8
|
+
import { getFrontendUrl } from "agentlaunch-sdk";
|
|
9
|
+
import { getPublicClient } from "../http.js";
|
|
10
|
+
export function registerListCommand(program) {
|
|
11
|
+
program
|
|
12
|
+
.command("list")
|
|
13
|
+
.description("List tokens on AgentLaunch with pagination")
|
|
14
|
+
.option("--limit <n>", "Number of tokens to show (default: 10)", "10")
|
|
15
|
+
.option("--sort <by>", "Sort order: trending, latest, market_cap (default: latest)", "latest")
|
|
16
|
+
.option("--json", "Output raw JSON (machine-readable)")
|
|
17
|
+
.action(async (options) => {
|
|
18
|
+
const limit = parseInt(options.limit, 10);
|
|
19
|
+
if (isNaN(limit) || limit < 1 || limit > 100) {
|
|
20
|
+
if (!options.json) {
|
|
21
|
+
console.error("Error: --limit must be a number between 1 and 100");
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
console.log(JSON.stringify({
|
|
25
|
+
error: "--limit must be a number between 1 and 100",
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
const validSorts = ["trending", "latest", "market_cap"];
|
|
31
|
+
const sort = options.sort;
|
|
32
|
+
if (!validSorts.includes(sort)) {
|
|
33
|
+
if (!options.json) {
|
|
34
|
+
console.error(`Error: --sort must be one of: ${validSorts.join(", ")}`);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
console.log(JSON.stringify({
|
|
38
|
+
error: `--sort must be one of: ${validSorts.join(", ")}`,
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
let response;
|
|
44
|
+
try {
|
|
45
|
+
const client = getPublicClient();
|
|
46
|
+
const query = new URLSearchParams({
|
|
47
|
+
limit: String(limit),
|
|
48
|
+
sort,
|
|
49
|
+
page: "1",
|
|
50
|
+
});
|
|
51
|
+
response = await client.get(`/tokens?${query}`);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
if (options.json) {
|
|
55
|
+
console.log(JSON.stringify({ error: err.message }));
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
console.error(`Error: ${err.message}`);
|
|
59
|
+
}
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
// Normalize different response shapes
|
|
63
|
+
const tokens = response.data ?? response.tokens ?? response.items ?? [];
|
|
64
|
+
if (options.json) {
|
|
65
|
+
console.log(JSON.stringify({ tokens, total: response.total ?? tokens.length }));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (tokens.length === 0) {
|
|
69
|
+
console.log("No tokens found.");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
// Pretty-print table
|
|
73
|
+
const col = {
|
|
74
|
+
name: 22,
|
|
75
|
+
symbol: 8,
|
|
76
|
+
price: 14,
|
|
77
|
+
progress: 10,
|
|
78
|
+
status: 10,
|
|
79
|
+
};
|
|
80
|
+
const hr = "─".repeat(col.name + col.symbol + col.price + col.progress + col.status + 14);
|
|
81
|
+
console.log(`\nAgentLaunch Tokens (sort: ${sort}, limit: ${limit})\n`);
|
|
82
|
+
console.log(hr);
|
|
83
|
+
console.log(pad("Name", col.name) +
|
|
84
|
+
pad("Symbol", col.symbol) +
|
|
85
|
+
pad("Price (FET)", col.price) +
|
|
86
|
+
pad("Progress", col.progress) +
|
|
87
|
+
"Status");
|
|
88
|
+
console.log(hr);
|
|
89
|
+
for (const t of tokens) {
|
|
90
|
+
const name = truncate(t.name ?? "-", col.name - 2);
|
|
91
|
+
const symbol = truncate(t.symbol ?? "-", col.symbol - 2);
|
|
92
|
+
const priceRaw = t.price ?? 0;
|
|
93
|
+
const price = formatPrice(priceRaw);
|
|
94
|
+
const progressRaw = t.progress ?? 0;
|
|
95
|
+
const progress = formatProgress(progressRaw);
|
|
96
|
+
const status = t.listed === true || t.status === "listed"
|
|
97
|
+
? "Listed"
|
|
98
|
+
: t.status ?? "Active";
|
|
99
|
+
console.log(pad(name, col.name) +
|
|
100
|
+
pad(symbol, col.symbol) +
|
|
101
|
+
pad(price, col.price) +
|
|
102
|
+
pad(progress, col.progress) +
|
|
103
|
+
status);
|
|
104
|
+
}
|
|
105
|
+
console.log(hr);
|
|
106
|
+
console.log(`\nShowing ${tokens.length} token(s). Use --limit to see more.\n`);
|
|
107
|
+
console.log(`View on platform: ${getFrontendUrl()}`);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
// --- helpers ---
|
|
111
|
+
function pad(s, width) {
|
|
112
|
+
return s.length >= width ? s.slice(0, width) : s + " ".repeat(width - s.length);
|
|
113
|
+
}
|
|
114
|
+
function truncate(s, maxLen) {
|
|
115
|
+
return s.length > maxLen ? s.slice(0, maxLen - 1) + "…" : s;
|
|
116
|
+
}
|
|
117
|
+
function formatPrice(raw) {
|
|
118
|
+
const n = typeof raw === "string" ? parseFloat(raw) : raw;
|
|
119
|
+
if (isNaN(n))
|
|
120
|
+
return "-";
|
|
121
|
+
if (n === 0)
|
|
122
|
+
return "0 FET";
|
|
123
|
+
if (n < 0.000001)
|
|
124
|
+
return `${n.toExponential(2)} FET`;
|
|
125
|
+
if (n < 1)
|
|
126
|
+
return `${n.toFixed(6)} FET`;
|
|
127
|
+
return `${n.toFixed(4)} FET`;
|
|
128
|
+
}
|
|
129
|
+
function formatProgress(raw) {
|
|
130
|
+
const n = typeof raw === "string" ? parseFloat(raw) : raw;
|
|
131
|
+
if (isNaN(n))
|
|
132
|
+
return "-";
|
|
133
|
+
return `${Math.min(100, Math.max(0, n)).toFixed(1)}%`;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA2B7C,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,4CAA4C,CAAC;SACzD,MAAM,CAAC,aAAa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