bun start --advanced --agent-type "strategy-agent"
const gameContext = {
playerID: "0xabcdef1234567890",
resources: { gold: 500, wood: 100 },
turn: 7,
availableActions: ["build", "attack", "trade"],
};
leia.loadContext(gameContext);
const goal = {
description: "Build a fortress to protect resources",
subgoals: [
{ action: "GATHER_RESOURCES", conditions: { wood: 200, stone: 100 } },
{ action: "BUILD_FORTRESS", conditions: { location: [50, 75], resourcesSpent: { wood: 150, stone: 100 } } },
],
};
leia.executeGoal(goal);
// Monitoring agent's actions and reasoning
leia.on("action:start", (data) => {
console.log(`🔄 Agent action started: ${data.action}`);
});
leia.on("action:complete", (data) => {
console.log(`✅ Action completed: ${data.action.type} with result: ${data.result}`);
});