mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-21 21:52:07 +02:00
43 lines
No EOL
1.1 KiB
JavaScript
43 lines
No EOL
1.1 KiB
JavaScript
import { AgentProcess } from './src/process/agent-process.js';
|
|
import settings from './settings.js';
|
|
import yargs from 'yargs';
|
|
import { hideBin } from 'yargs/helpers';
|
|
import { createMindServer } from './src/server/mind_server.js';
|
|
|
|
function parseArguments() {
|
|
return yargs(hideBin(process.argv))
|
|
.option('profiles', {
|
|
type: 'array',
|
|
describe: 'List of agent profile paths',
|
|
})
|
|
.help()
|
|
.alias('help', 'h')
|
|
.parse();
|
|
}
|
|
|
|
function getProfiles(args) {
|
|
return args.profiles || settings.profiles;
|
|
}
|
|
|
|
function main() {
|
|
if (settings.host_mindserver) {
|
|
const mindServer = createMindServer();
|
|
}
|
|
|
|
const args = parseArguments();
|
|
const profiles = getProfiles(args);
|
|
console.log(profiles);
|
|
const { load_memory, init_message } = settings;
|
|
|
|
for (let i=0; i<profiles.length; i++) {
|
|
const agent = new AgentProcess();
|
|
agent.start(profiles[i], load_memory, init_message, i);
|
|
}
|
|
}
|
|
|
|
try {
|
|
main();
|
|
} catch (error) {
|
|
console.error('An error occurred:', error);
|
|
process.exit(1);
|
|
} |