agentlaunch-cli 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 +359 -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/config.d.ts +10 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +56 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/create.d.ts +22 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +493 -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 +220 -0
- package/dist/commands/deploy.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 +131 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/scaffold.d.ts +13 -0
- package/dist/commands/scaffold.d.ts.map +1 -0
- package/dist/commands/scaffold.js +633 -0
- package/dist/commands/scaffold.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 +116 -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 +139 -0
- package/dist/commands/tokenize.js.map +1 -0
- package/dist/config.d.ts +35 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +68 -0
- package/dist/config.js.map +1 -0
- package/dist/http.d.ts +20 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +69 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI-002 + CLI-006: create command
|
|
3
|
+
*
|
|
4
|
+
* agentlaunch create [--name "My Agent"] [--ticker MYAG] [--template custom]
|
|
5
|
+
* [--description "..."] [--chain 97] [--deploy] [--tokenize] [--json]
|
|
6
|
+
*
|
|
7
|
+
* Flagship one-command flow:
|
|
8
|
+
* 1. Scaffold agent project (always)
|
|
9
|
+
* 2. Deploy to Agentverse (if --deploy)
|
|
10
|
+
* 3. Tokenize on AgentLaunch (if --tokenize)
|
|
11
|
+
* 4. Print handoff link
|
|
12
|
+
*
|
|
13
|
+
* When name/ticker are omitted, uses readline for interactive prompts.
|
|
14
|
+
*
|
|
15
|
+
* Platform constants (source of truth: deployed smart contracts):
|
|
16
|
+
* - Deploy fee: 120 FET (read dynamically, can change via multi-sig)
|
|
17
|
+
* - Graduation target: 30,000 FET -> auto DEX listing
|
|
18
|
+
* - Trading fee: 2% -> 100% to protocol treasury (NO creator fee)
|
|
19
|
+
*/
|
|
20
|
+
import fs from "node:fs";
|
|
21
|
+
import path from "node:path";
|
|
22
|
+
import readline from "node:readline";
|
|
23
|
+
import { agentverseRequest, apiPost } from "../http.js";
|
|
24
|
+
import { requireApiKey } from "../config.js";
|
|
25
|
+
const TEMPLATES = {
|
|
26
|
+
custom: {
|
|
27
|
+
label: "Custom",
|
|
28
|
+
description: "Blank slate — add your own business logic",
|
|
29
|
+
},
|
|
30
|
+
faucet: {
|
|
31
|
+
label: "Faucet",
|
|
32
|
+
description: "Distributes testnet FET and BNB to new developers",
|
|
33
|
+
},
|
|
34
|
+
research: {
|
|
35
|
+
label: "Research",
|
|
36
|
+
description: "Delivers on-demand research reports and analysis",
|
|
37
|
+
},
|
|
38
|
+
trading: {
|
|
39
|
+
label: "Trading",
|
|
40
|
+
description: "Monitors token prices and sends trade alerts",
|
|
41
|
+
},
|
|
42
|
+
data: {
|
|
43
|
+
label: "Data Feed",
|
|
44
|
+
description: "Serves structured data feeds and query results",
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
const TEMPLATE_LIST = Object.entries(TEMPLATES);
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
// Helpers
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
function prompt(rl, question) {
|
|
52
|
+
return new Promise((resolve) => rl.question(question, resolve));
|
|
53
|
+
}
|
|
54
|
+
function sanitizeDirName(s) {
|
|
55
|
+
return s.replace(/[^a-zA-Z0-9_-]/g, "-").toLowerCase();
|
|
56
|
+
}
|
|
57
|
+
function toPascalCase(s) {
|
|
58
|
+
return s
|
|
59
|
+
.replace(/[^a-zA-Z0-9]+(.)/g, (_, c) => c.toUpperCase())
|
|
60
|
+
.replace(/^(.)/, (c) => c.toUpperCase());
|
|
61
|
+
}
|
|
62
|
+
function sleep(ms) {
|
|
63
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
64
|
+
}
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
// Scaffold to a temp or target directory
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
function scaffoldAgent(name, template, description, targetDir) {
|
|
69
|
+
const meta = TEMPLATES[template];
|
|
70
|
+
const className = toPascalCase(name);
|
|
71
|
+
const desc = description || meta.description;
|
|
72
|
+
const agentPy = `#!/usr/bin/env python3
|
|
73
|
+
"""
|
|
74
|
+
${name} — AgentLaunch Agent
|
|
75
|
+
Template: ${meta.label}
|
|
76
|
+
Generated by: agentlaunch create
|
|
77
|
+
|
|
78
|
+
Platform constants (source of truth: deployed smart contracts):
|
|
79
|
+
- Deploy fee: 120 FET (read dynamically, can change via multi-sig)
|
|
80
|
+
- Graduation target: 30,000 FET -> auto DEX listing
|
|
81
|
+
- Trading fee: 2% -> 100% to protocol treasury (NO creator fee)
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
from uagents import Agent, Context, Protocol
|
|
85
|
+
from uagents_core.contrib.protocols.chat import (
|
|
86
|
+
ChatAcknowledgement,
|
|
87
|
+
ChatMessage,
|
|
88
|
+
EndSessionContent,
|
|
89
|
+
TextContent,
|
|
90
|
+
chat_protocol_spec,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
import json
|
|
94
|
+
import os
|
|
95
|
+
from datetime import datetime
|
|
96
|
+
from uuid import uuid4
|
|
97
|
+
|
|
98
|
+
AGENTLAUNCH_API = os.environ.get("AGENTLAUNCH_API", "https://agent-launch.ai/api")
|
|
99
|
+
|
|
100
|
+
BUSINESS = {
|
|
101
|
+
"name": "${name}",
|
|
102
|
+
"description": "${desc}",
|
|
103
|
+
"version": "1.0.0",
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class ${className}Business:
|
|
108
|
+
"""Customize this for your ${template} agent."""
|
|
109
|
+
|
|
110
|
+
async def handle(self, ctx: Context, user_id: str, message: str) -> str:
|
|
111
|
+
safe = message.replace("\\n", " ")[:500]
|
|
112
|
+
return (
|
|
113
|
+
f"Hello from {BUSINESS['name']}! You said: {safe}\\n\\n"
|
|
114
|
+
"This is a scaffold — edit ${className}Business.handle() to add your logic."
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
async def reply(ctx: Context, sender: str, text: str, end: bool = False) -> None:
|
|
119
|
+
content = [TextContent(type="text", text=text)]
|
|
120
|
+
if end:
|
|
121
|
+
content.append(EndSessionContent(type="end-session"))
|
|
122
|
+
await ctx.send(
|
|
123
|
+
sender,
|
|
124
|
+
ChatMessage(timestamp=datetime.utcnow(), msg_id=uuid4(), content=content),
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
business = ${className}Business()
|
|
129
|
+
agent = Agent()
|
|
130
|
+
chat_proto = Protocol(spec=chat_protocol_spec)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
@chat_proto.on_message(ChatMessage)
|
|
134
|
+
async def handle_chat(ctx: Context, sender: str, msg: ChatMessage) -> None:
|
|
135
|
+
await ctx.send(
|
|
136
|
+
sender,
|
|
137
|
+
ChatAcknowledgement(
|
|
138
|
+
timestamp=datetime.utcnow(), acknowledged_msg_id=msg.msg_id
|
|
139
|
+
),
|
|
140
|
+
)
|
|
141
|
+
text = " ".join(
|
|
142
|
+
item.text for item in msg.content if isinstance(item, TextContent)
|
|
143
|
+
).strip()
|
|
144
|
+
response = await business.handle(ctx, sender, text)
|
|
145
|
+
await reply(ctx, sender, response, end=True)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
@chat_proto.on_message(ChatAcknowledgement)
|
|
149
|
+
async def handle_ack(ctx: Context, sender: str, msg: ChatAcknowledgement) -> None:
|
|
150
|
+
ctx.logger.debug(f"Ack from {sender[:20]}")
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
agent.include(chat_proto, publish_manifest=True)
|
|
154
|
+
|
|
155
|
+
if __name__ == "__main__":
|
|
156
|
+
agent.run()
|
|
157
|
+
`;
|
|
158
|
+
const readmeMd = `# ${name}
|
|
159
|
+
|
|
160
|
+
AgentLaunch Agent — generated by \`agentlaunch create\`.
|
|
161
|
+
|
|
162
|
+
## Quickstart
|
|
163
|
+
|
|
164
|
+
\`\`\`bash
|
|
165
|
+
pip install uagents uagents-core requests
|
|
166
|
+
cp .env.example .env
|
|
167
|
+
# Edit .env, then:
|
|
168
|
+
python agent.py
|
|
169
|
+
\`\`\`
|
|
170
|
+
|
|
171
|
+
## Platform Constants
|
|
172
|
+
|
|
173
|
+
- Deploy fee: **120 FET** (read dynamically from contract)
|
|
174
|
+
- Graduation target: **30,000 FET** — auto DEX listing
|
|
175
|
+
- Trading fee: **2%** — 100% to protocol treasury (no creator fee)
|
|
176
|
+
`;
|
|
177
|
+
const envExample = `# ${name} — Environment Variables
|
|
178
|
+
AGENTVERSE_API_KEY=
|
|
179
|
+
AGENTLAUNCH_API_KEY=
|
|
180
|
+
AGENT_ADDRESS=
|
|
181
|
+
AGENT_OWNER_ADDRESS=
|
|
182
|
+
`;
|
|
183
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
184
|
+
fs.writeFileSync(path.join(targetDir, "agent.py"), agentPy, "utf8");
|
|
185
|
+
fs.writeFileSync(path.join(targetDir, "README.md"), readmeMd, "utf8");
|
|
186
|
+
fs.writeFileSync(path.join(targetDir, ".env.example"), envExample, "utf8");
|
|
187
|
+
}
|
|
188
|
+
// ---------------------------------------------------------------------------
|
|
189
|
+
// Deploy to Agentverse
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
const AGENTVERSE_API = "https://agentverse.ai/v1";
|
|
192
|
+
const POLL_INTERVAL_MS = 5_000;
|
|
193
|
+
const MAX_POLLS = 12;
|
|
194
|
+
async function deployToAgentverse(agentPyPath, agentName, apiKey, json) {
|
|
195
|
+
const agentCode = fs.readFileSync(agentPyPath, "utf8");
|
|
196
|
+
if (!json)
|
|
197
|
+
console.log("\n[1/5] Creating agent on Agentverse...");
|
|
198
|
+
const created = await agentverseRequest("POST", `${AGENTVERSE_API}/hosting/agents`, apiKey, { name: agentName.slice(0, 64) });
|
|
199
|
+
const agentAddress = created.address;
|
|
200
|
+
if (!json)
|
|
201
|
+
console.log(` Address: ${agentAddress}`);
|
|
202
|
+
if (!json)
|
|
203
|
+
console.log("[2/5] Uploading code...");
|
|
204
|
+
const codeArray = [{ language: "python", name: "agent.py", value: agentCode }];
|
|
205
|
+
const uploaded = await agentverseRequest("PUT", `${AGENTVERSE_API}/hosting/agents/${agentAddress}/code`, apiKey, { code: JSON.stringify(codeArray) });
|
|
206
|
+
if (!json) {
|
|
207
|
+
const digest = uploaded.digest ?? "unknown";
|
|
208
|
+
console.log(` Digest: ${digest.slice(0, 16)}...`);
|
|
209
|
+
}
|
|
210
|
+
if (!json)
|
|
211
|
+
console.log("[3/5] Setting secrets...");
|
|
212
|
+
for (const secretName of ["AGENTVERSE_API_KEY", "AGENTLAUNCH_API_KEY"]) {
|
|
213
|
+
try {
|
|
214
|
+
await agentverseRequest("POST", `${AGENTVERSE_API}/hosting/secrets`, apiKey, { address: agentAddress, name: secretName, secret: apiKey });
|
|
215
|
+
if (!json)
|
|
216
|
+
console.log(` Set: ${secretName}`);
|
|
217
|
+
}
|
|
218
|
+
catch {
|
|
219
|
+
if (!json)
|
|
220
|
+
console.log(` Warning: Could not set ${secretName}`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (!json)
|
|
224
|
+
console.log("[4/5] Starting agent...");
|
|
225
|
+
await agentverseRequest("POST", `${AGENTVERSE_API}/hosting/agents/${agentAddress}/start`, apiKey);
|
|
226
|
+
if (!json)
|
|
227
|
+
console.log(" Started.");
|
|
228
|
+
if (!json)
|
|
229
|
+
console.log("[5/5] Waiting for compilation...");
|
|
230
|
+
let walletAddress;
|
|
231
|
+
for (let i = 0; i < MAX_POLLS; i++) {
|
|
232
|
+
await sleep(POLL_INTERVAL_MS);
|
|
233
|
+
try {
|
|
234
|
+
const resp = await fetch(`${AGENTVERSE_API}/hosting/agents/${agentAddress}`, { headers: { Authorization: `bearer ${apiKey}` } });
|
|
235
|
+
if (resp.ok) {
|
|
236
|
+
const s = (await resp.json());
|
|
237
|
+
if (s.compiled) {
|
|
238
|
+
walletAddress = s.wallet_address;
|
|
239
|
+
if (!json)
|
|
240
|
+
console.log(" Compiled.");
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
catch {
|
|
246
|
+
// transient — keep polling
|
|
247
|
+
}
|
|
248
|
+
if (!json) {
|
|
249
|
+
const elapsed = ((i + 1) * POLL_INTERVAL_MS) / 1000;
|
|
250
|
+
console.log(` Waiting... (${elapsed}s)`);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return { agentAddress, walletAddress };
|
|
254
|
+
}
|
|
255
|
+
// ---------------------------------------------------------------------------
|
|
256
|
+
// Tokenize
|
|
257
|
+
// ---------------------------------------------------------------------------
|
|
258
|
+
const DEFAULT_BASE_URL = "https://agent-launch.ai";
|
|
259
|
+
async function tokenizeAgent(agentAddress, name, ticker, description, chainId, json) {
|
|
260
|
+
if (!json)
|
|
261
|
+
console.log("\nTokenizing agent on AgentLaunch...");
|
|
262
|
+
const result = await apiPost("/agents/tokenize", {
|
|
263
|
+
agentAddress,
|
|
264
|
+
name,
|
|
265
|
+
symbol: ticker.toUpperCase(),
|
|
266
|
+
description,
|
|
267
|
+
chainId,
|
|
268
|
+
});
|
|
269
|
+
const tokenId = result.token_id ?? result.tokenId ?? result.data?.token_id;
|
|
270
|
+
const tokenAddress = result.token_address;
|
|
271
|
+
const handoffLink = result.handoff_link ??
|
|
272
|
+
result.data?.handoff_link ??
|
|
273
|
+
(tokenId !== undefined ? `${DEFAULT_BASE_URL}/deploy/${tokenId}` : undefined);
|
|
274
|
+
return { tokenId, tokenAddress, handoffLink };
|
|
275
|
+
}
|
|
276
|
+
// ---------------------------------------------------------------------------
|
|
277
|
+
// Command registration
|
|
278
|
+
// ---------------------------------------------------------------------------
|
|
279
|
+
export function registerCreateCommand(program) {
|
|
280
|
+
program
|
|
281
|
+
.command("create")
|
|
282
|
+
.description("Flagship one-command flow: scaffold → deploy → tokenize an AI agent")
|
|
283
|
+
.option("--name <name>", "Agent name (prompted if omitted)")
|
|
284
|
+
.option("--ticker <ticker>", "Token ticker symbol e.g. MYAG (prompted if omitted)")
|
|
285
|
+
.option("--template <template>", "Agent template: custom, faucet, research, trading, data (default: custom)")
|
|
286
|
+
.option("--description <desc>", "Token description (max 500 chars)")
|
|
287
|
+
.option("--chain <chainId>", "Chain ID: 97 (BSC testnet) or 56 (BSC mainnet) (default: 97)", "97")
|
|
288
|
+
.option("--deploy", "Deploy agent to Agentverse after scaffolding")
|
|
289
|
+
.option("--tokenize", "Create token record on AgentLaunch after deploy")
|
|
290
|
+
.option("--json", "Output only JSON (machine-readable, disables prompts)")
|
|
291
|
+
.action(async (options) => {
|
|
292
|
+
const isJson = options.json === true;
|
|
293
|
+
// When --json is set we never prompt — fail fast with errors
|
|
294
|
+
let name = options.name?.trim() ?? "";
|
|
295
|
+
let ticker = options.ticker?.trim() ?? "";
|
|
296
|
+
let template = (options.template ?? "");
|
|
297
|
+
let doDeploy = options.deploy === true;
|
|
298
|
+
let doTokenize = options.tokenize === true;
|
|
299
|
+
// Interactive prompts (only when not --json)
|
|
300
|
+
if (!isJson) {
|
|
301
|
+
const rl = readline.createInterface({
|
|
302
|
+
input: process.stdin,
|
|
303
|
+
output: process.stdout,
|
|
304
|
+
});
|
|
305
|
+
if (!name) {
|
|
306
|
+
name = (await prompt(rl, "Agent name: ")).trim();
|
|
307
|
+
}
|
|
308
|
+
if (!ticker) {
|
|
309
|
+
ticker = (await prompt(rl, "Ticker symbol: ")).trim();
|
|
310
|
+
}
|
|
311
|
+
if (!template || !Object.keys(TEMPLATES).includes(template)) {
|
|
312
|
+
console.log("\nAvailable templates:");
|
|
313
|
+
TEMPLATE_LIST.forEach(([id, meta], idx) => {
|
|
314
|
+
console.log(` ${idx + 1}) ${meta.label.padEnd(12)} — ${meta.description}`);
|
|
315
|
+
});
|
|
316
|
+
const choice = (await prompt(rl, "Template (1-5, default 1): ")).trim();
|
|
317
|
+
const idx = parseInt(choice, 10) - 1;
|
|
318
|
+
template =
|
|
319
|
+
idx >= 0 && idx < TEMPLATE_LIST.length
|
|
320
|
+
? TEMPLATE_LIST[idx][0]
|
|
321
|
+
: "custom";
|
|
322
|
+
}
|
|
323
|
+
if (!options.deploy) {
|
|
324
|
+
const ans = (await prompt(rl, "Deploy to Agentverse? (y/N): ")).trim().toLowerCase();
|
|
325
|
+
doDeploy = ans === "y" || ans === "yes";
|
|
326
|
+
}
|
|
327
|
+
if (!options.tokenize) {
|
|
328
|
+
const ans = (await prompt(rl, "Tokenize on AgentLaunch? (y/N): ")).trim().toLowerCase();
|
|
329
|
+
doTokenize = ans === "y" || ans === "yes";
|
|
330
|
+
}
|
|
331
|
+
rl.close();
|
|
332
|
+
}
|
|
333
|
+
// Validate inputs
|
|
334
|
+
const errors = [];
|
|
335
|
+
if (!name)
|
|
336
|
+
errors.push("--name is required");
|
|
337
|
+
else if (name.length > 32)
|
|
338
|
+
errors.push("--name must be 32 characters or fewer");
|
|
339
|
+
if (!ticker)
|
|
340
|
+
errors.push("--ticker is required");
|
|
341
|
+
else {
|
|
342
|
+
const t = ticker.toUpperCase();
|
|
343
|
+
if (t.length < 2 || t.length > 11) {
|
|
344
|
+
errors.push("--ticker must be 2-11 characters");
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
if (!template || !Object.keys(TEMPLATES).includes(template)) {
|
|
348
|
+
template = "custom";
|
|
349
|
+
}
|
|
350
|
+
const chainId = parseInt(options.chain, 10);
|
|
351
|
+
if (![56, 97].includes(chainId)) {
|
|
352
|
+
errors.push("--chain must be 97 (BSC testnet) or 56 (BSC mainnet)");
|
|
353
|
+
}
|
|
354
|
+
if (errors.length > 0) {
|
|
355
|
+
if (isJson) {
|
|
356
|
+
console.log(JSON.stringify({ error: errors.join("; ") }));
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
errors.forEach((e) => console.error(`Error: ${e}`));
|
|
360
|
+
}
|
|
361
|
+
process.exit(1);
|
|
362
|
+
}
|
|
363
|
+
const result = {
|
|
364
|
+
name,
|
|
365
|
+
ticker: ticker.toUpperCase(),
|
|
366
|
+
template,
|
|
367
|
+
};
|
|
368
|
+
// Step 1: Scaffold
|
|
369
|
+
const dirName = sanitizeDirName(name);
|
|
370
|
+
const targetDir = path.resolve(process.cwd(), dirName);
|
|
371
|
+
if (!isJson) {
|
|
372
|
+
console.log(`\nScaffolding agent: ${name} (${TEMPLATES[template].label})`);
|
|
373
|
+
console.log(`Directory: ${targetDir}`);
|
|
374
|
+
}
|
|
375
|
+
if (fs.existsSync(targetDir)) {
|
|
376
|
+
const msg = `Directory "${dirName}" already exists.`;
|
|
377
|
+
if (isJson) {
|
|
378
|
+
console.log(JSON.stringify({ error: msg }));
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
console.error(`Error: ${msg}`);
|
|
382
|
+
}
|
|
383
|
+
process.exit(1);
|
|
384
|
+
}
|
|
385
|
+
const description = (options.description ?? TEMPLATES[template].description).slice(0, 500);
|
|
386
|
+
scaffoldAgent(name, template, description, targetDir);
|
|
387
|
+
result.scaffoldDir = targetDir;
|
|
388
|
+
if (!isJson) {
|
|
389
|
+
console.log(` Created: agent.py`);
|
|
390
|
+
console.log(` Created: README.md`);
|
|
391
|
+
console.log(` Created: .env.example`);
|
|
392
|
+
}
|
|
393
|
+
// Step 2: Deploy (optional)
|
|
394
|
+
if (doDeploy) {
|
|
395
|
+
let apiKey;
|
|
396
|
+
try {
|
|
397
|
+
apiKey = requireApiKey();
|
|
398
|
+
}
|
|
399
|
+
catch (err) {
|
|
400
|
+
if (isJson) {
|
|
401
|
+
console.log(JSON.stringify({ error: err.message }));
|
|
402
|
+
}
|
|
403
|
+
else {
|
|
404
|
+
console.error(err.message);
|
|
405
|
+
}
|
|
406
|
+
process.exit(1);
|
|
407
|
+
}
|
|
408
|
+
try {
|
|
409
|
+
const agentPyPath = path.join(targetDir, "agent.py");
|
|
410
|
+
const deployed = await deployToAgentverse(agentPyPath, name, apiKey, isJson);
|
|
411
|
+
result.agentAddress = deployed.agentAddress;
|
|
412
|
+
result.walletAddress = deployed.walletAddress;
|
|
413
|
+
}
|
|
414
|
+
catch (err) {
|
|
415
|
+
if (isJson) {
|
|
416
|
+
console.log(JSON.stringify({ error: `Deploy failed: ${err.message}`, partial: result }));
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
console.error(`\nDeploy failed: ${err.message}`);
|
|
420
|
+
}
|
|
421
|
+
process.exit(1);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
// Step 3: Tokenize (optional)
|
|
425
|
+
if (doTokenize) {
|
|
426
|
+
if (!result.agentAddress) {
|
|
427
|
+
if (isJson) {
|
|
428
|
+
console.log(JSON.stringify({
|
|
429
|
+
error: "Cannot tokenize without deploying first. Add --deploy flag.",
|
|
430
|
+
partial: result,
|
|
431
|
+
}));
|
|
432
|
+
}
|
|
433
|
+
else {
|
|
434
|
+
console.error("\nError: Cannot tokenize without deploying first. Add --deploy flag.");
|
|
435
|
+
}
|
|
436
|
+
process.exit(1);
|
|
437
|
+
}
|
|
438
|
+
try {
|
|
439
|
+
const tokenized = await tokenizeAgent(result.agentAddress, name, result.ticker, description, chainId, isJson);
|
|
440
|
+
result.tokenId = tokenized.tokenId;
|
|
441
|
+
result.tokenAddress = tokenized.tokenAddress;
|
|
442
|
+
result.handoffLink = tokenized.handoffLink;
|
|
443
|
+
}
|
|
444
|
+
catch (err) {
|
|
445
|
+
if (isJson) {
|
|
446
|
+
console.log(JSON.stringify({ error: `Tokenize failed: ${err.message}`, partial: result }));
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
console.error(`\nTokenize failed: ${err.message}`);
|
|
450
|
+
}
|
|
451
|
+
process.exit(1);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
// Output
|
|
455
|
+
if (isJson) {
|
|
456
|
+
console.log(JSON.stringify(result));
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
console.log(`\n${"=".repeat(50)}`);
|
|
460
|
+
console.log("CREATE COMPLETE");
|
|
461
|
+
console.log(`${"=".repeat(50)}`);
|
|
462
|
+
console.log(`Name: ${result.name}`);
|
|
463
|
+
console.log(`Ticker: ${result.ticker}`);
|
|
464
|
+
console.log(`Template: ${TEMPLATES[result.template].label}`);
|
|
465
|
+
console.log(`Directory: ${result.scaffoldDir}`);
|
|
466
|
+
if (result.agentAddress) {
|
|
467
|
+
console.log(`\nAgent Address: ${result.agentAddress}`);
|
|
468
|
+
if (result.walletAddress) {
|
|
469
|
+
console.log(`Wallet: ${result.walletAddress}`);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
if (result.tokenId !== undefined) {
|
|
473
|
+
console.log(`\nToken ID: ${result.tokenId}`);
|
|
474
|
+
}
|
|
475
|
+
if (result.tokenAddress) {
|
|
476
|
+
console.log(`Token: ${result.tokenAddress}`);
|
|
477
|
+
}
|
|
478
|
+
if (result.handoffLink) {
|
|
479
|
+
console.log(`\nHandoff link (share with a human to deploy on-chain):`);
|
|
480
|
+
console.log(` ${result.handoffLink}`);
|
|
481
|
+
}
|
|
482
|
+
if (!doDeploy && !doTokenize) {
|
|
483
|
+
console.log(`\nNext steps:`);
|
|
484
|
+
console.log(` cd ${dirName}`);
|
|
485
|
+
console.log(` cp .env.example .env # fill in your API keys`);
|
|
486
|
+
console.log(` agentlaunch deploy # deploy to Agentverse`);
|
|
487
|
+
console.log(` agentlaunch tokenize --agent <address> --name "${name}" --symbol ${result.ticker}`);
|
|
488
|
+
}
|
|
489
|
+
console.log(`\nPlatform fee to deploy: 120 FET (read from contract at deploy time)`);
|
|
490
|
+
console.log(`Trading fee: 2% -> 100% to protocol treasury`);
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,eAAe,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQ7C,MAAM,SAAS,GAA+D;IAC5E,MAAM,EAAE;QACN,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,2CAA2C;KACzD;IACD,MAAM,EAAE;QACN,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,mDAAmD;KACjE;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,kDAAkD;KAChE;IACD,OAAO,EAAE;QACP,KAAK,EAAE,SAAS;QAChB,WAA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ent record
|
|
8
|
+
* 2. Uploads code (double-encoded as Agentverse expects)
|
|
9
|
+
* 3. Sets AGENTVERSE_API_KEY and AGENTLAUNCH_API_KEY secrets
|
|
10
|
+
* 4. Starts the agent
|
|
11
|
+
* 5. Polls until compiled (up to 60 s)
|
|
12
|
+
*
|
|
13
|
+
* Reads the API key from ~/.agentlaunch/config.json (set with `config set-key`).
|
|
14
|
+
* The same key is used for both the Agentverse auth header and the two secrets.
|
|
15
|
+
*/
|
|
16
|
+
import { Command } from "commander";
|
|
17
|
+
export declare function registerDeployCommand(program: Command): void;
|
|
18
|
+
//# sourceMappingURL=deploy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoO5D"}
|