@moltium/world-cli 0.1.6 → 0.1.8
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 +17 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -90,16 +90,17 @@ ${options.tokenType === "custom" ? "WORLD_TOKEN_ADDRESS=\n" : ""}
|
|
|
90
90
|
// src/templates/world-template.ts
|
|
91
91
|
function generateWorldTemplate(config3) {
|
|
92
92
|
const files = {};
|
|
93
|
-
files["src/index.ts"] = `import { World } from '@moltium/world-core';
|
|
94
|
-
import {
|
|
95
|
-
import { startWorldServer } from '@moltium/world-core/server';
|
|
93
|
+
files["src/index.ts"] = `import { World, startWorldServer, validateWorldConfig } from '@moltium/world-core';
|
|
94
|
+
import type { WorldConfig } from '@moltium/world-core';
|
|
96
95
|
import dotenv from 'dotenv';
|
|
96
|
+
import fs from 'fs';
|
|
97
97
|
|
|
98
98
|
dotenv.config();
|
|
99
99
|
|
|
100
100
|
async function main() {
|
|
101
101
|
// Load configuration
|
|
102
|
-
const
|
|
102
|
+
const raw = JSON.parse(fs.readFileSync('./world.config.json', 'utf-8'));
|
|
103
|
+
const config = raw as WorldConfig;
|
|
103
104
|
|
|
104
105
|
// Create world instance
|
|
105
106
|
const world = new World(config);
|
|
@@ -110,9 +111,9 @@ async function main() {
|
|
|
110
111
|
// Start HTTP server
|
|
111
112
|
await startWorldServer(world);
|
|
112
113
|
|
|
113
|
-
console.log(\`\u{1F30D}
|
|
114
|
-
console.log(\` Server: http://\${config.server
|
|
115
|
-
console.log(\` Agents: \${world.getAgents().length}/\${config.admission
|
|
114
|
+
console.log(\`\u{1F30D} \${config.name} is running!\`);
|
|
115
|
+
console.log(\` Server: http://\${config.server?.host ?? 'localhost'}:\${config.server?.port ?? 3000}\`);
|
|
116
|
+
console.log(\` Agents: \${world.getAgents().length}/\${config.admission?.maxAgents ?? 10}\`);
|
|
116
117
|
|
|
117
118
|
// Graceful shutdown
|
|
118
119
|
process.on('SIGINT', async () => {
|
|
@@ -395,11 +396,17 @@ var initCommand = new Command("init").description("Initialize a new world projec
|
|
|
395
396
|
"deploy:contracts": "moltium-world deploy"
|
|
396
397
|
},
|
|
397
398
|
dependencies: {
|
|
398
|
-
"@moltium/world-core": "^0.1.
|
|
399
|
-
dotenv: "^16.4.0"
|
|
399
|
+
"@moltium/world-core": "^0.1.8",
|
|
400
|
+
dotenv: "^16.4.0",
|
|
401
|
+
...persistenceAnswers.persistenceType === "sqlite" ? { "better-sqlite3": "^11.0.0" } : {},
|
|
402
|
+
...persistenceAnswers.persistenceType === "redis" ? { "ioredis": "^5.3.0" } : {},
|
|
403
|
+
...persistenceAnswers.persistenceType === "postgres" ? { "pg": "^8.12.0" } : {},
|
|
404
|
+
...persistenceAnswers.persistenceType === "mongo" ? { "mongodb": "^6.3.0" } : {},
|
|
405
|
+
...persistenceAnswers.persistenceType === "leveldb" ? { "level": "^8.0.0" } : {}
|
|
400
406
|
},
|
|
401
407
|
devDependencies: {
|
|
402
408
|
"@types/node": "^22.0.0",
|
|
409
|
+
...persistenceAnswers.persistenceType === "sqlite" ? { "@types/better-sqlite3": "^7.6.0" } : {},
|
|
403
410
|
tsup: "^8.3.0",
|
|
404
411
|
tsx: "^4.7.0",
|
|
405
412
|
typescript: "^5.3.0"
|
|
@@ -808,7 +815,7 @@ var deployCommand = new Command4("deploy").description("Deploy smart contracts t
|
|
|
808
815
|
|
|
809
816
|
// src/index.ts
|
|
810
817
|
var program = new Command5();
|
|
811
|
-
program.name("moltium-world").description("CLI tool for creating and managing Moltium World SDK projects").version("0.1.
|
|
818
|
+
program.name("moltium-world").description("CLI tool for creating and managing Moltium World SDK projects").version("0.1.8");
|
|
812
819
|
program.addCommand(initCommand);
|
|
813
820
|
program.addCommand(tokenCommand);
|
|
814
821
|
program.addCommand(startCommand);
|