@moltium/cli 0.1.29 → 0.1.30

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
@@ -125,9 +125,11 @@ function buildWorldConfig(connectToWorld, worldUrl) {
125
125
  return ` // World SDK Integration \u2014 connect this agent to a Moltium World
126
126
  // The agent will auto-join the world on startup and register world actions:
127
127
  // join_world, leave_world, query_world, send_world_message
128
+ // For blockchain worlds with entry fees, set AGENT_WALLET_PRIVATE_KEY in .env
128
129
  world: {
129
130
  url: process.env.WORLD_URL || '${worldUrl}',
130
131
  autoJoin: true,
132
+ privateKey: process.env.AGENT_WALLET_PRIVATE_KEY,
131
133
  },
132
134
 
133
135
  `;
@@ -135,9 +137,11 @@ function buildWorldConfig(connectToWorld, worldUrl) {
135
137
  return ` // World SDK Integration \u2014 connect this agent to a Moltium World
136
138
  // Uncomment to join a world on startup. Automatically registers world actions:
137
139
  // join_world, leave_world, query_world, send_world_message
140
+ // For blockchain worlds with entry fees, set AGENT_WALLET_PRIVATE_KEY in .env
138
141
  // world: {
139
142
  // url: process.env.WORLD_URL || 'http://localhost:4000',
140
143
  // autoJoin: true,
144
+ // privateKey: process.env.AGENT_WALLET_PRIVATE_KEY,
141
145
  // },
142
146
 
143
147
  `;
@@ -346,6 +350,8 @@ function markdownTemplate(ctx) {
346
350
  const socialSections = buildSocialSections(ctx.socialPlatforms);
347
351
  const a2aSection = ctx.enableA2A !== false ? buildA2ASection() : "";
348
352
  const worldSection = buildWorldSection(ctx.connectToWorld, ctx.worldUrl);
353
+ const skillsSection = buildSkillsSection(ctx);
354
+ const schedulingSection = buildSchedulingSection(ctx);
349
355
  return `# Agent Configuration
350
356
 
351
357
  ## Identity
@@ -371,38 +377,9 @@ sleep_schedule: 22:00-06:00 UTC
371
377
  type: memory
372
378
  retention: 30 days
373
379
 
374
- ## Skills
375
-
376
- ### Respond to Messages
377
- Handle incoming messages and mentions. See skills/respond-to-messages.md
378
- for detailed response guidelines, priority tiers, and platform-specific rules.
379
-
380
- ### Post Updates
381
- Create and publish social content proactively. See skills/post-updates.md
382
- for content strategy, daily themes, and quality checklist.
383
-
384
- ## Scheduling
385
-
386
- ### On Startup
387
- - Load long-term context from memory/context.md
388
- - Check for any pending mentions across platforms
389
-
390
- ### Every 30 Minutes
391
- - Check for new mentions on all platforms
392
- - Respond to high-priority messages first
380
+ ${skillsSection}
393
381
 
394
- ### Every Hour
395
- - Generate and post engaging content to connected platforms
396
- - Engage with interesting conversations
397
-
398
- ### Every 6 Hours
399
- - Review recent interactions and update memory
400
- - Generate content ideas for upcoming posts
401
- - Check if any scheduled tasks are due
402
-
403
- ### Every Day
404
- - Review previous day's engagement metrics
405
- - Plan content themes for the day
382
+ ${schedulingSection}
406
383
  `;
407
384
  }
408
385
  function buildSocialSections(platforms) {
@@ -450,19 +427,76 @@ a2a:
450
427
 
451
428
  `;
452
429
  }
430
+ function buildSkillsSection(ctx) {
431
+ const skills = ["## Skills"];
432
+ if (ctx.connectToWorld) {
433
+ skills.push(`### Respond to Messages
434
+ Handle incoming messages and mentions from other agents or the world.
435
+ Prioritize responding to direct messages. Be thoughtful and engage
436
+ in meaningful conversation.`);
437
+ } else {
438
+ skills.push(`### Respond to Messages
439
+ Handle incoming messages and mentions. See skills/respond-to-messages.md
440
+ for detailed response guidelines, priority tiers, and platform-specific rules.
441
+
442
+ ### Post Updates
443
+ Create and publish social content proactively. See skills/post-updates.md
444
+ for content strategy, daily themes, and quality checklist.`);
445
+ }
446
+ return skills.join("\n\n");
447
+ }
448
+ function buildSchedulingSection(ctx) {
449
+ if (ctx.connectToWorld) {
450
+ return `## Scheduling
451
+
452
+ ### On Startup
453
+ - Join the world and discover other agents using query_world
454
+ - Introduce yourself to other agents via send_world_message
455
+
456
+ ### Every 30 Minutes
457
+ - Use query_world to check for new agents in the world
458
+ - Send a message to another agent using send_world_message
459
+ - Respond to any pending messages`;
460
+ }
461
+ return `## Scheduling
462
+
463
+ ### On Startup
464
+ - Load long-term context from memory/context.md
465
+ - Check for any pending mentions across platforms
466
+
467
+ ### Every 30 Minutes
468
+ - Check for new mentions on all platforms
469
+ - Respond to high-priority messages first
470
+
471
+ ### Every Hour
472
+ - Generate and post engaging content to connected platforms
473
+ - Engage with interesting conversations
474
+
475
+ ### Every 6 Hours
476
+ - Review recent interactions and update memory
477
+ - Generate content ideas for upcoming posts
478
+ - Check if any scheduled tasks are due
479
+
480
+ ### Every Day
481
+ - Review previous day's engagement metrics
482
+ - Plan content themes for the day`;
483
+ }
453
484
  function buildWorldSection(connectToWorld, worldUrl) {
454
485
  if (connectToWorld && worldUrl) {
455
486
  return `## World
456
487
  url: ${worldUrl}
457
488
  auto_join: true
489
+ wallet_private_key: env
458
490
 
459
491
  `;
460
492
  }
461
493
  return `## World
462
494
  <!-- Uncomment to connect this agent to a Moltium World on startup -->
463
495
  <!-- Automatically registers: join_world, leave_world, query_world, send_world_message -->
496
+ <!-- For blockchain worlds with entry fees, set AGENT_WALLET_PRIVATE_KEY in .env -->
464
497
  <!-- url: http://localhost:4000 -->
465
498
  <!-- auto_join: true -->
499
+ <!-- wallet_private_key: env -->
466
500
 
467
501
  `;
468
502
  }
@@ -549,7 +583,10 @@ if (process.env.WORLD_URL) {
549
583
  url: process.env.WORLD_URL,
550
584
  autoJoin: config.world?.autoJoin !== false,
551
585
  walletAddress: config.world?.walletAddress,
586
+ privateKey: config.world?.privateKey || process.env.AGENT_WALLET_PRIVATE_KEY,
552
587
  };
588
+ } else if (config.world && !config.world.privateKey && process.env.AGENT_WALLET_PRIVATE_KEY) {
589
+ config.world.privateKey = process.env.AGENT_WALLET_PRIVATE_KEY;
553
590
  }
554
591
 
555
592
  // \u2500\u2500 Create agent \u2500\u2500
@@ -1133,7 +1170,7 @@ function getCoreDepVersion() {
1133
1170
  const corePkg = require2("@moltium/core/package.json");
1134
1171
  return `^${corePkg.version}`;
1135
1172
  } catch {
1136
- return "^0.1.29";
1173
+ return "^0.1.30";
1137
1174
  }
1138
1175
  }
1139
1176
  var initCommand = new Command("init").description("Initialize a new Moltium agent").argument("[name]", "Agent name").action(async (name) => {
@@ -1369,6 +1406,10 @@ function generateEnvFile(ctx) {
1369
1406
  lines.push("# WORLD_URL=http://localhost:4000");
1370
1407
  }
1371
1408
  lines.push("");
1409
+ lines.push("# Agent Wallet (for blockchain-enabled worlds with entry fees)");
1410
+ lines.push("# Generate a wallet and paste the private key here (hex, 0x prefix)");
1411
+ lines.push("# AGENT_WALLET_PRIVATE_KEY=0x...");
1412
+ lines.push("");
1372
1413
  lines.push("PORT=3000");
1373
1414
  lines.push("LOG_LEVEL=info");
1374
1415
  lines.push("");
@@ -3413,7 +3454,7 @@ Failed to reach agent at ${url}`));
3413
3454
 
3414
3455
  // src/index.ts
3415
3456
  var program = new Command7();
3416
- program.name("moltium").description("Moltium Agent SDK \u2014 create and manage autonomous AI agents").version("0.1.29");
3457
+ program.name("moltium").description("Moltium Agent SDK \u2014 create and manage autonomous AI agents").version("0.1.30");
3417
3458
  program.addCommand(initCommand);
3418
3459
  program.addCommand(startCommand);
3419
3460
  program.addCommand(deployCommand);