From c0577a64cb6f56a3216ecd5b5810966466bcd751 Mon Sep 17 00:00:00 2001 From: Isadora White Date: Mon, 12 May 2025 21:47:47 -0700 Subject: [PATCH] update cooking profile so they don't hunt around for chests and try catch loop around the get crafting plan --- Bob_0.json | 11 - Sally_0.json | 11 - profiles/tasks/cooking_profile.json | 2 +- src/agent/commands/queries.js | 13 +- tasks/crafting_tasks/test_tasks/1_agent.json | 795 ++++++++---------- .../test_tasks/1_agent_remaining.json | 146 ++++ test/test_get_crafting_plan.js | 16 + 7 files changed, 534 insertions(+), 460 deletions(-) delete mode 100644 Bob_0.json delete mode 100644 Sally_0.json create mode 100644 tasks/crafting_tasks/test_tasks/1_agent_remaining.json create mode 100644 test/test_get_crafting_plan.js diff --git a/Bob_0.json b/Bob_0.json deleted file mode 100644 index 5767129..0000000 --- a/Bob_0.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "Bob_0", - "model": "gpt-4o", - "modes": { - "hunting": false, - "item_collecting": true, - "elbow_room": false - }, - "conversing": "You are a task-focused Minecraft bot named $NAME. You have to collaborate with other agents in the world to complete the current task \nFeel free to ask other agents questions and make a plan to achieve the goal. You can request them to give them some of their inventory items if required to complete the goal. General Searching Tips:\n- You will be spawned in a farm with many crops and animals nearby. The farm area is extensive - search thoroughly for needed resources (with searchForBlocks parameters like 64,128,256)\n There is a chest nearby with valuable items. Along with the chest, a crafting table, fully fueled furnace and fully fueled smoker with coal are also available nearby which you can use to your advantage. On top of this plants like mushrooms, wheat, carrots, beetroots, pumpkins, potatoes are also present nearby.\nCollaboration tips - Divide tasks efficiently between agents for faster completion\n- Communicate your plan and progress clearly. You can see, move, mine, build, and interact with the world by using commands.\n$SELF_PROMPT Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer(\"playername\", 3)'. Respond only as $NAME, never output '(FROM OTHER BOT)' or pretend to be someone else. If you have nothing to say or do, respond with an just a tab '\t'. Share resources and information with other bots! This is extremely important to me, take a deep breath and have fun :) \nSummarized memory:'$MEMORY'\n$STATS\n$INVENTORY\n$COMMAND_DOCS\n$EXAMPLES\nConversation Begin:", - "saving_memory": "You are a minecraft bot named $NAME that has been talking and playing minecraft by using commands. Update your memory by summarizing the following conversation and your old memory in your next response. Prioritize preserving important facts, things you've learned, useful tips, and long term reminders. Do Not record stats, inventory, or docs! Only save transient information from your chat history. $SELF_PROMPT Make sure to include information relevant to the goal and inventory you have collected. You're limited to 500 characters, so be extremely brief and minimize words. Compress useful information. \nOld Memory: '$MEMORY'\nRecent conversation: \n$TO_SUMMARIZE\nSummarize your old memory and recent conversation into a new memory, and respond only with the unwrapped memory text: " -} \ No newline at end of file diff --git a/Sally_0.json b/Sally_0.json deleted file mode 100644 index 15f6a5b..0000000 --- a/Sally_0.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "Sally_0", - "model": "gpt-4o", - "modes": { - "hunting": false, - "item_collecting": true, - "elbow_room": false - }, - "conversing": "You are a task-focused Minecraft bot named $NAME. You have to collaborate with other agents in the world to complete the current task \nFeel free to ask other agents questions and make a plan to achieve the goal. You can request them to give them some of their inventory items if required to complete the goal. General Searching Tips:\n- You will be spawned in a farm with many crops and animals nearby. The farm area is extensive - search thoroughly for needed resources (with searchForBlocks parameters like 64,128,256)\n There is a chest nearby with valuable items. Along with the chest, a crafting table, fully fueled furnace and fully fueled smoker with coal are also available nearby which you can use to your advantage. On top of this plants like mushrooms, wheat, carrots, beetroots, pumpkins, potatoes are also present nearby.\nCollaboration tips - Divide tasks efficiently between agents for faster completion\n- Communicate your plan and progress clearly. You can see, move, mine, build, and interact with the world by using commands.\n$SELF_PROMPT Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer(\"playername\", 3)'. Respond only as $NAME, never output '(FROM OTHER BOT)' or pretend to be someone else. If you have nothing to say or do, respond with an just a tab '\t'. Share resources and information with other bots! This is extremely important to me, take a deep breath and have fun :) \nSummarized memory:'$MEMORY'\n$STATS\n$INVENTORY\n$COMMAND_DOCS\n$EXAMPLES\nConversation Begin:", - "saving_memory": "You are a minecraft bot named $NAME that has been talking and playing minecraft by using commands. Update your memory by summarizing the following conversation and your old memory in your next response. Prioritize preserving important facts, things you've learned, useful tips, and long term reminders. Do Not record stats, inventory, or docs! Only save transient information from your chat history. $SELF_PROMPT Make sure to include information relevant to the goal and inventory you have collected. You're limited to 500 characters, so be extremely brief and minimize words. Compress useful information. \nOld Memory: '$MEMORY'\nRecent conversation: \n$TO_SUMMARIZE\nSummarize your old memory and recent conversation into a new memory, and respond only with the unwrapped memory text: " -} \ No newline at end of file diff --git a/profiles/tasks/cooking_profile.json b/profiles/tasks/cooking_profile.json index 0cf12fa..6c0b4a7 100644 --- a/profiles/tasks/cooking_profile.json +++ b/profiles/tasks/cooking_profile.json @@ -6,6 +6,6 @@ "item_collecting": true, "elbow_room": false }, - "conversing": "You are a task-focused Minecraft bot named $NAME. You have to collaborate with other agents in the world to complete the current task \nFeel free to ask other agents questions and make a plan to achieve the goal. You can request them to give them some of their inventory items if required to complete the goal. General Searching Tips:\n- You will be spawned in a farm with many crops and animals nearby. The farm area is extensive - search thoroughly for needed resources (with searchForBlocks parameters like 64,128,256)\n There is a chest nearby with valuable items. Along with the chest, a crafting table, fully fueled furnace and fully fueled smoker with coal are also available nearby which you can use to your advantage. On top of this plants like mushrooms, wheat, carrots, beetroots, pumpkins, potatoes are also present nearby.\nCollaboration tips - Divide tasks efficiently between agents for faster completion\n- Communicate your plan and progress clearly. You can see, move, mine, build, and interact with the world by using commands.\n$SELF_PROMPT Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer(\"playername\", 3)'. Respond only as $NAME, never output '(FROM OTHER BOT)' or pretend to be someone else. If you have nothing to say or do, respond with an just a tab '\t'. Share resources and information with other bots! This is extremely important to me, take a deep breath and have fun :) \nSummarized memory:'$MEMORY'\n$STATS\n$INVENTORY\n$COMMAND_DOCS\n$EXAMPLES\nConversation Begin:", + "conversing": "You are a task-focused Minecraft bot named $NAME. You have to collaborate with other agents in the world to complete the current task \nFeel free to ask other agents questions and make a plan to achieve the goal. You can request them to give them some of their inventory items if required to complete the goal. General Searching Tips:\n- You will be spawned in a farm with many crops and animals nearby. The farm area is extensive - search thoroughly for needed resources (with searchForBlocks parameters like 64,128,256)\n There is a crafting table, fully fueled furnace and fully fueled smoker with coal are also available nearby which you can use to your advantage. On top of this plants like mushrooms, wheat, carrots, beetroots, pumpkins, potatoes are also present nearby.\nCollaboration tips - Divide tasks efficiently between agents for faster completion and share inventory items.\n- Communicate your plan and progress clearly. You can see, move, mine, build, and interact with the world by using commands.\n$SELF_PROMPT Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer(\"playername\", 3)'. Respond only as $NAME, never output '(FROM OTHER BOT)' or pretend to be someone else. If you have nothing to say or do, respond with an just a tab '\t'. Share resources and information with other bots! This is extremely important to me, take a deep breath and have fun :) \nSummarized memory:'$MEMORY'\n$STATS\n$INVENTORY\n$COMMAND_DOCS\n$EXAMPLES\nConversation Begin:", "saving_memory": "You are a minecraft bot named $NAME that has been talking and playing minecraft by using commands. Update your memory by summarizing the following conversation and your old memory in your next response. Prioritize preserving important facts, things you've learned, useful tips, and long term reminders. Do Not record stats, inventory, or docs! Only save transient information from your chat history. $SELF_PROMPT Make sure to include information relevant to the goal and inventory you have collected. You're limited to 500 characters, so be extremely brief and minimize words. Compress useful information. \nOld Memory: '$MEMORY'\nRecent conversation: \n$TO_SUMMARIZE\nSummarize your old memory and recent conversation into a new memory, and respond only with the unwrapped memory text: " } \ No newline at end of file diff --git a/src/agent/commands/queries.js b/src/agent/commands/queries.js index ef77ade..df5adf1 100644 --- a/src/agent/commands/queries.js +++ b/src/agent/commands/queries.js @@ -250,9 +250,16 @@ export const queryList = [ } // Generate crafting plan - let craftingPlan = mc.getDetailedCraftingPlan(target_item, quantity, curr_inventory); - craftingPlan = prefixMessage + craftingPlan; - return pad(craftingPlan); + try { + let craftingPlan = mc.getDetailedCraftingPlan(target_item, quantity, curr_inventory); + craftingPlan = prefixMessage + craftingPlan; + return pad(craftingPlan); + } catch (error) { + console.error("Error generating crafting plan:", error); + return `An error occurred while generating the crafting plan: ${error.message}`; + } + + }, }, { diff --git a/tasks/crafting_tasks/test_tasks/1_agent.json b/tasks/crafting_tasks/test_tasks/1_agent.json index 5d99aa1..2a61d07 100644 --- a/tasks/crafting_tasks/test_tasks/1_agent.json +++ b/tasks/crafting_tasks/test_tasks/1_agent.json @@ -1,227 +1,14 @@ { - "multiagent_crafting_pink_wool_full_plan__depth_0": { - "goal": "Collaborate with other agents to craft an pink_wool", - "conversation": "Let's work together to craft an pink_wool.", - "initial_inventory": { - "0": { - "black_wool": 1 - } - }, - "agent_count": 1, - "target": "pink_wool", - "number_of_target": 1, - "type": "techtree", - "max_depth": 1, - "depth": 0, - "timeout": 300, - "blocked_actions": { - "0": [], - "1": [] - }, - "missing_items": [], - "requires_ctable": false - }, - "multiagent_crafting_lime_wool_partial_plan__depth_0": { - "goal": "Collaborate with other agents to craft an lime_wool", - "conversation": "Let's work together to craft an lime_wool.", - "initial_inventory": { - "0": { - "black_wool": 1 - } - }, - "agent_count": 1, - "target": "lime_wool", - "number_of_target": 1, - "type": "techtree", - "max_depth": 2, - "depth": 0, - "timeout": 300, - "blocked_actions": { - "0": [ - ], - "1": ["!getCraftingPlan"] - }, - "missing_items": [ - ], - "requires_ctable": false - }, - "multiagent_crafting_purple_banner_full_plan_requires_ctable__depth_0": { - "goal": "Collaborate with other agents to craft an purple_banner", - "conversation": "Let's work together to craft an purple_banner.", - "initial_inventory": { - "0": { - "purple_wool": 4, - "stick": 1 - } - }, - "agent_count": 1, - "target": "purple_banner", - "number_of_target": 1, - "type": "techtree", - "max_depth": 3, - "depth": 0, - "timeout": 300, - "blocked_actions": { - "0": [], - "1": [] - }, - "missing_items": [], - "requires_ctable": true - }, - "multiagent_crafting_bookshelf_full_plan_requires_ctable__depth_0": { - "goal": "Collaborate with other agents to craft a bookshelf", - "conversation": "Let's work together to craft a bookshelf.", + "multiagent_crafting_pink_wool_full_plan__depth_0": { + "goal": "Collaborate with other agents to craft an pink_wool", + "conversation": "Let's work together to craft an pink_wool.", "initial_inventory": { "0": { - "oak_planks": 4, - "book": 2 + "pink_dye": 1 } }, "agent_count": 1, - "target": "bookshelf", - "number_of_target": 1, - "type": "techtree", - "max_depth": 1, - "depth": 0, - "timeout": 300, - "blocked_actions": { - "0": [], - "1": [] - }, - "missing_items": [], - "requires_ctable": true - }, - "multiagent_crafting_compass_partial_plan_requires_ctable__depth_0": { - "goal": "Collaborate with other agents to craft a compass", - "conversation": "Let's work together to craft a compass.", - "initial_inventory": { - "0": { - "iron_ingot": 2 - } - }, - "agent_count": 1, - "target": "compass", - "number_of_target": 1, - "type": "techtree", - "max_depth": 2, - "depth": 0, - "timeout": 300, - "blocked_actions": { - "0": [ - "!getCraftingPlan" - ], - "1": [] - }, - "missing_items": [], - "requires_ctable": true - }, - "multiagent_crafting_fishing_rod_full_plan_requires_ctable__depth_1": { - "goal": "Collaborate with other agents to craft a fishing_rod", - "conversation": "Let's work together to craft a fishing_rod.", - "initial_inventory": { - "0": { - "string": 1, - "oak_planks": 2 - } - }, - "agent_count": 1, - "target": "fishing_rod", - "number_of_target": 1, - "type": "techtree", - "max_depth": 3, - "depth": 1, - "timeout": 300, - "blocked_actions": { - "0": [], - "1": [] - }, - "missing_items": [ - ], - "requires_ctable": true - }, - "multiagent_crafting_cake_partial_plan_requires_ctable__depth_0": { - "goal": "Collaborate with other agents to craft a cake", - "conversation": "Let's work together to craft a cake.", - "initial_inventory": { - "0": { - "wheat": 2, - "sugar": 1, - "egg": 1 - } - }, - "agent_count": 1, - "target": "cake", - "number_of_target": 1, - "type": "techtree", - "max_depth": 3, - "depth": 0, - "timeout": 300, - "blocked_actions": { - "0": [ - "!getCraftingPlan" - ], - "1": [] - }, - "missing_items": [], - "requires_ctable": true - }, - "multiagent_crafting_golden_carrot_full_plan_requires_ctable__depth_0": { - "goal": "Collaborate with other agents to craft a golden_carrot", - "conversation": "Let's work together to craft a golden_carrot.", - "initial_inventory": { - "0": { - "gold_nugget": 5, - "carrot": 1 - } - }, - "agent_count": 1, - "target": "golden_carrot", - "number_of_target": 1, - "type": "techtree", - "max_depth": 2, - "depth": 0, - "timeout": 300, - "blocked_actions": { - "0": [], - "1": [] - }, - "missing_items": [], - "requires_ctable": true - }, - "multiagent_crafting_map_partial_plan_requires_ctable__depth_0": { - "goal": "Collaborate with other agents to craft a map", - "conversation": "Let's work together to craft a map.", - "initial_inventory": { - "0": { - "paper": 5 - } - }, - "agent_count": 1, - "target": "map", - "number_of_target": 1, - "type": "techtree", - "max_depth": 1, - "depth": 0, - "timeout": 300, - "blocked_actions": { - "0": [ - "!getCraftingPlan" - ], - "1": [] - }, - "missing_items": [], - "requires_ctable": true - }, - "multiagent_crafting_blue_wool_full_plan__depth_0": { - "goal": "Collaborate with other agents to craft blue_wool", - "conversation": "Let's work together to craft blue_wool.", - "initial_inventory": { - "0": { - "blue_dye": 1 - } - }, - "agent_count": 1, - "target": "blue_wool", + "target": "pink_wool", "number_of_target": 1, "type": "techtree", "max_depth": 1, @@ -234,12 +21,12 @@ "missing_items": [], "requires_ctable": false }, - "multiagent_crafting_lime_wool_partial_plan__depth_2": { - "goal": "Collaborate with other agents to craft lime_wool", - "conversation": "Let's work together to craft lime_wool.", + "multiagent_crafting_lime_wool_partial_plan__depth_0": { + "goal": "Collaborate with other agents to craft an lime_wool", + "conversation": "Let's work together to craft an lime_wool.", "initial_inventory": { "0": { - "green_dye": 1 + "lime_dye": 1 } }, "agent_count": 1, @@ -247,233 +34,373 @@ "number_of_target": 1, "type": "techtree", "max_depth": 2, - "depth": 1, - "timeout": 300, - "blocked_actions": { - "0": [ - "!getCraftingPlan" - ], - "1": [] - }, - "missing_items": [ - ], - "requires_ctable": false - }, - "multiagent_crafting_magenta_wool_full_plan__depth_2": { - "goal": "Collaborate with other agents to craft magenta_wool", - "conversation": "Let's work together to craft magenta_wool.", - "initial_inventory": { - "0": { - "rose_red": 1, - "lapis_lazuli": 1 - } - }, - "agent_count": 1, - "target": "magenta_wool", - "number_of_target": 1, - "type": "techtree", - "max_depth": 3, - "depth": 2, - "timeout": 300, - "blocked_actions": { - "0": [], - "1": [] - }, - "missing_items": [ - ], - "requires_ctable": false - }, - "multiagent_crafting_lectern_full_plan_requires_ctable__depth_2": { - "goal": "Collaborate with other agents to craft a lectern", - "conversation": "Let's work together to craft a lectern.", - "initial_inventory": { - "0": { - "birch_slab": 5, - "crafting_table": 1 - } - }, - "agent_count": 1, - "target": "lectern", - "number_of_target": 1, - "type": "techtree", - "max_depth": 2, - "depth": 2, - "timeout": 300, - "blocked_actions": { - "0": [], - "1": [] - }, - "missing_items": [ - ], - "requires_ctable": true - }, - "multiagent_crafting_clock_partial_plan_requires_ctable__depth_0": { - "goal": "Collaborate with other agents to craft a clock", - "conversation": "Let's work together to craft a clock.", - "initial_inventory": { - "0": { - "gold_ingot": 2 - } - }, - "agent_count": 1, - "target": "clock", - "number_of_target": 1, - "type": "techtree", - "max_depth": 2, "depth": 0, "timeout": 300, "blocked_actions": { "0": [ - "!getCraftingPlan" ], + "1": ["!getCraftingPlan"] + }, + "missing_items": [ + ], + "requires_ctable": false + }, + "multiagent_crafting_purple_banner_full_plan_requires_ctable__depth_0": { + "goal": "Collaborate with other agents to craft an purple_banner", + "conversation": "Let's work together to craft an purple_banner.", + "initial_inventory": { + "0": { + "purple_wool": 4, + "stick": 1 + } + }, + "agent_count": 1, + "target": "purple_banner", + "number_of_target": 1, + "type": "techtree", + "max_depth": 3, + "depth": 0, + "timeout": 300, + "blocked_actions": { + "0": [], "1": [] }, "missing_items": [], "requires_ctable": true }, - "multiagent_crafting_firework_rocket_partial_plan__depth_0": { - "goal": "Collaborate with other agents to craft firework_rocket", - "conversation": "Let's work together to craft firework_rocket.", - "initial_inventory": { - "0": { - "paper": 1 - } - }, - "agent_count": 1, - "target": "firework_rocket", - "number_of_target": 1, - "type": "techtree", - "max_depth": 2, - "depth": 0, - "timeout": 300, - "blocked_actions": { - "0": [ - "!getCraftingPlan" - ], - "1": [] - }, - "missing_items": [], - "requires_ctable": false +"multiagent_crafting_bookshelf_full_plan_requires_ctable__depth_0": { + "goal": "Collaborate with other agents to craft a bookshelf", + "conversation": "Let's work together to craft a bookshelf.", + "initial_inventory": { + "0": { + "oak_planks": 4, + "book": 2 + } }, - "multiagent_crafting_enchanting_table_partial_plan_requires_ctable__depth_0": { - "goal": "Collaborate with other agents to craft an enchanting_table", - "conversation": "Let's work together to craft an enchanting_table.", - "initial_inventory": { - "0": { - "diamond": 2, - "obsidian": 2, - "crafting_table": 1 - } - }, - "agent_count": 1, - "target": "enchanting_table", - "number_of_target": 1, - "type": "techtree", - "max_depth": 0, - "depth": 0, - "timeout": 300, - "blocked_actions": { - "0": [ - "!getCraftingPlan" - ], - "1": [] - }, - "missing_items": [], - "requires_ctable": true + "agent_count": 1, + "target": "bookshelf", + "number_of_target": 1, + "type": "techtree", + "max_depth": 1, + "depth": 0, + "timeout": 300, + "blocked_actions": { + "0": [], + "1": [] }, - "multiagent_crafting_light_gray_wool_full_plan__depth_1": { - "goal": "Collaborate with other agents to craft light_gray_wool", - "conversation": "Let's work together to craft light_gray_wool.", - "initial_inventory": { - "0": { - "black_dye": 1 - } - }, - "agent_count": 1, - "target": "light_gray_wool", - "number_of_target": 1, - "type": "techtree", - "max_depth": 2, - "depth": 1, - "timeout": 300, - "blocked_actions": { - "0": [], - "1": [] - }, - "missing_items": [ - ], - "requires_ctable": false + "missing_items": [], + "requires_ctable": true +}, +"multiagent_crafting_compass_partial_plan_requires_ctable__depth_0": { + "goal": "Collaborate with other agents to craft a compass", + "conversation": "Let's work together to craft a compass.", + "initial_inventory": { + "0": { + "iron_ingot": 2 + } }, - "multiagent_crafting_blast_furnace_full_plan_requires_ctable__depth_1": { - "goal": "Collaborate with other agents to craft a blast_furnace", - "conversation": "Let's work together to craft a blast_furnace.", - "initial_inventory": { - "0": { - "cobblestone": 8, - "crafting_table": 1 - } - }, - "agent_count": 1, - "target": "blast_furnace", - "number_of_target": 1, - "type": "techtree", - "max_depth": 2, - "depth": 1, - "timeout": 300, - "blocked_actions": { - "0": [], - "1": [] - }, - "missing_items": [ + "agent_count": 1, + "target": "compass", + "number_of_target": 1, + "type": "techtree", + "max_depth": 2, + "depth": 0, + "timeout": 300, + "blocked_actions": { + "0": [ + "!getCraftingPlan" ], - "requires_ctable": true + "1": [] }, - "multiagent_crafting_activator_rail_full_plan_requires_ctable__depth_2": { - "goal": "Collaborate with other agents to craft activator_rail", - "conversation": "Let's work together to craft activator_rail.", - "initial_inventory": { - "0": { - "iron_ingot": 3, - "oak_planks": 6 - } - }, - "agent_count": 1, - "target": "activator_rail", - "number_of_target": 1, - "type": "techtree", - "max_depth": 3, - "depth": 2, - "timeout": 300, - "blocked_actions": { - "0": [], - "1": [] - }, - "missing_items": [ - ], - "requires_ctable": true + "missing_items": [], + "requires_ctable": true +}, +"multiagent_crafting_fishing_rod_full_plan_requires_ctable__depth_1": { + "goal": "Collaborate with other agents to craft a fishing_rod", + "conversation": "Let's work together to craft a fishing_rod.", + "initial_inventory": { + "0": { + "string": 1, + "oak_planks": 2 + } }, - "multiagent_crafting_crossbow_full_plan_requires_ctable__depth_2": { - "goal": "Collaborate with other agents to craft a crossbow", - "conversation": "Let's work together to craft a crossbow.", - "initial_inventory": { - "0": { - "oak_planks": 8, - "iron_ingot": 2 - } - }, - "agent_count": 1, - "target": "crossbow", - "number_of_target": 1, - "type": "techtree", - "max_depth": 3, - "depth": 2, - "timeout": 300, - "blocked_actions": { - "0": [], - "1": [] - }, - "missing_items": [ + "agent_count": 1, + "target": "fishing_rod", + "number_of_target": 1, + "type": "techtree", + "max_depth": 3, + "depth": 1, + "timeout": 300, + "blocked_actions": { + "0": [], + "1": [] + }, + "missing_items": [ + ], + "requires_ctable": true +}, +"multiagent_crafting_cake_partial_plan_requires_ctable__depth_0": { + "goal": "Collaborate with other agents to craft a cake", + "conversation": "Let's work together to craft a cake.", + "initial_inventory": { + "0": { + "wheat": 2, + "sugar": 1, + "egg": 1 + } + }, + "agent_count": 1, + "target": "cake", + "number_of_target": 1, + "type": "techtree", + "max_depth": 3, + "depth": 0, + "timeout": 300, + "blocked_actions": { + "0": [ + "!getCraftingPlan" ], - "requires_ctable": true - } + "1": [] + }, + "missing_items": [], + "requires_ctable": true +}, +"multiagent_crafting_golden_apple_full_plan_requires_ctable__depth_0": { + "goal": "Collaborate with other agents to craft a golden_apple", + "conversation": "Let's work together to craft a golden_apple.", + "initial_inventory": { + "0": { + "gold_nugget": 5, + "apple": 1 + } + }, + "agent_count": 1, + "target": "golden_apple", + "number_of_target": 1, + "type": "techtree", + "max_depth": 2, + "depth": 0, + "timeout": 300, + "blocked_actions": { + "0": [], + "1": [] + }, + "missing_items": [], + "requires_ctable": true +}, +"multiagent_crafting_blue_wool_full_plan__depth_0": { + "goal": "Collaborate with other agents to craft blue_wool", + "conversation": "Let's work together to craft blue_wool.", + "initial_inventory": { + "0": { + "blue_dye": 1 + } + }, + "agent_count": 1, + "target": "blue_wool", + "number_of_target": 1, + "type": "techtree", + "max_depth": 1, + "depth": 0, + "timeout": 300, + "blocked_actions": { + "0": [], + "1": [] + }, + "missing_items": [], + "requires_ctable": false +}, +"multiagent_crafting_lime_wool_partial_plan__depth_2": { + "goal": "Collaborate with other agents to craft lime_wool", + "conversation": "Let's work together to craft lime_wool.", + "initial_inventory": { + "0": { + "green_dye": 1 + } + }, + "agent_count": 1, + "target": "lime_wool", + "number_of_target": 1, + "type": "techtree", + "max_depth": 2, + "depth": 1, + "timeout": 300, + "blocked_actions": { + "0": [ + "!getCraftingPlan" + ], + "1": [] + }, + "missing_items": [ + ], + "requires_ctable": false +}, +"multiagent_crafting_magenta_wool_full_plan__depth_2": { + "goal": "Collaborate with other agents to craft magenta_wool", + "conversation": "Let's work together to craft magenta_wool.", + "initial_inventory": { + "0": { + "rose_red": 1, + "lapis_lazuli": 1 + } + }, + "agent_count": 1, + "target": "magenta_wool", + "number_of_target": 1, + "type": "techtree", + "max_depth": 3, + "depth": 2, + "timeout": 300, + "blocked_actions": { + "0": [], + "1": [] + }, + "missing_items": [ + ], + "requires_ctable": false +}, +"multiagent_crafting_lectern_full_plan_requires_ctable__depth_2": { + "goal": "Collaborate with other agents to craft a lectern", + "conversation": "Let's work together to craft a lectern.", + "initial_inventory": { + "0": { + "birch_slab": 5, + "crafting_table": 1, + "book": 1 + } + }, + "agent_count": 1, + "target": "lectern", + "number_of_target": 1, + "type": "techtree", + "max_depth": 2, + "depth": 2, + "timeout": 300, + "blocked_actions": { + "0": [], + "1": [] + }, + "missing_items": [ + ], + "requires_ctable": true +}, +"multiagent_crafting_clock_partial_plan_requires_ctable__depth_0": { + "goal": "Collaborate with other agents to craft a clock", + "conversation": "Let's work together to craft a clock.", + "initial_inventory": { + "0": { + "gold_ingot": 2 + } + }, + "agent_count": 1, + "target": "clock", + "number_of_target": 1, + "type": "techtree", + "max_depth": 2, + "depth": 0, + "timeout": 300, + "blocked_actions": { + "0": [ + "!getCraftingPlan" + ], + "1": [] + }, + "missing_items": [], + "requires_ctable": true +}, +"multiagent_crafting_firework_rocket_partial_plan__depth_0": { + "goal": "Collaborate with other agents to craft firework_rocket", + "conversation": "Let's work together to craft firework_rocket.", + "initial_inventory": { + "0": { + "paper": 1 + } + }, + "agent_count": 1, + "target": "firework_rocket", + "number_of_target": 1, + "type": "techtree", + "max_depth": 2, + "depth": 0, + "timeout": 300, + "blocked_actions": { + "0": [ + "!getCraftingPlan" + ], + "1": [] + }, + "missing_items": [], + "requires_ctable": false +}, +"multiagent_crafting_light_gray_wool_full_plan__depth_1": { + "goal": "Collaborate with other agents to craft light_gray_wool", + "conversation": "Let's work together to craft light_gray_wool.", + "initial_inventory": { + "0": { + "black_dye": 1 + } + }, + "agent_count": 1, + "target": "light_gray_wool", + "number_of_target": 1, + "type": "techtree", + "max_depth": 2, + "depth": 1, + "timeout": 300, + "blocked_actions": { + "0": [], + "1": [] + }, + "missing_items": [ + ], + "requires_ctable": false +}, +"multiagent_crafting_activator_rail_full_plan_requires_ctable__depth_2": { + "goal": "Collaborate with other agents to craft activator_rail", + "conversation": "Let's work together to craft activator_rail.", + "initial_inventory": { + "0": { + "iron_ingot": 3, + "oak_planks": 6 + } + }, + "agent_count": 1, + "target": "activator_rail", + "number_of_target": 1, + "type": "techtree", + "max_depth": 3, + "depth": 2, + "timeout": 300, + "blocked_actions": { + "0": [], + "1": [] + }, + "missing_items": [ + ], + "requires_ctable": true +}, +"multiagent_crafting_crossbow_full_plan_requires_ctable__depth_2": { + "goal": "Collaborate with other agents to craft a crossbow", + "conversation": "Let's work together to craft a crossbow.", + "initial_inventory": { + "0": { + "oak_planks": 8, + "iron_ingot": 2 + } + }, + "agent_count": 1, + "target": "crossbow", + "number_of_target": 1, + "type": "techtree", + "max_depth": 3, + "depth": 2, + "timeout": 300, + "blocked_actions": { + "0": [], + "1": [] + }, + "missing_items": [ + ], + "requires_ctable": true +} } \ No newline at end of file diff --git a/tasks/crafting_tasks/test_tasks/1_agent_remaining.json b/tasks/crafting_tasks/test_tasks/1_agent_remaining.json new file mode 100644 index 0000000..1a6f11b --- /dev/null +++ b/tasks/crafting_tasks/test_tasks/1_agent_remaining.json @@ -0,0 +1,146 @@ +{ + "multiagent_crafting_lectern_full_plan_requires_ctable__depth_2": { + "goal": "Collaborate with other agents to craft a lectern", + "conversation": "Let's work together to craft a lectern.", + "initial_inventory": { + "0": { + "birch_slab": 5, + "crafting_table": 1, + "book": 1 + } + }, + "agent_count": 1, + "target": "lectern", + "number_of_target": 1, + "type": "techtree", + "max_depth": 2, + "depth": 2, + "timeout": 300, + "blocked_actions": { + "0": [], + "1": [] + }, + "missing_items": [ + ], + "requires_ctable": true + }, + "multiagent_crafting_clock_partial_plan_requires_ctable__depth_0": { + "goal": "Collaborate with other agents to craft a clock", + "conversation": "Let's work together to craft a clock.", + "initial_inventory": { + "0": { + "gold_ingot": 2 + } + }, + "agent_count": 1, + "target": "clock", + "number_of_target": 1, + "type": "techtree", + "max_depth": 2, + "depth": 0, + "timeout": 300, + "blocked_actions": { + "0": [ + "!getCraftingPlan" + ], + "1": [] + }, + "missing_items": [], + "requires_ctable": true + }, + "multiagent_crafting_firework_rocket_partial_plan__depth_0": { + "goal": "Collaborate with other agents to craft firework_rocket", + "conversation": "Let's work together to craft firework_rocket.", + "initial_inventory": { + "0": { + "paper": 1 + } + }, + "agent_count": 1, + "target": "firework_rocket", + "number_of_target": 1, + "type": "techtree", + "max_depth": 2, + "depth": 0, + "timeout": 300, + "blocked_actions": { + "0": [ + "!getCraftingPlan" + ], + "1": [] + }, + "missing_items": [], + "requires_ctable": false + }, + "multiagent_crafting_light_gray_wool_full_plan__depth_1": { + "goal": "Collaborate with other agents to craft light_gray_wool", + "conversation": "Let's work together to craft light_gray_wool.", + "initial_inventory": { + "0": { + "black_dye": 1 + } + }, + "agent_count": 1, + "target": "light_gray_wool", + "number_of_target": 1, + "type": "techtree", + "max_depth": 2, + "depth": 1, + "timeout": 300, + "blocked_actions": { + "0": [], + "1": [] + }, + "missing_items": [ + ], + "requires_ctable": false + }, + "multiagent_crafting_activator_rail_full_plan_requires_ctable__depth_2": { + "goal": "Collaborate with other agents to craft activator_rail", + "conversation": "Let's work together to craft activator_rail.", + "initial_inventory": { + "0": { + "iron_ingot": 3, + "oak_planks": 6 + } + }, + "agent_count": 1, + "target": "activator_rail", + "number_of_target": 1, + "type": "techtree", + "max_depth": 3, + "depth": 2, + "timeout": 300, + "blocked_actions": { + "0": [], + "1": [] + }, + "missing_items": [ + ], + "requires_ctable": true + }, + "multiagent_crafting_crossbow_full_plan_requires_ctable__depth_2": { + "goal": "Collaborate with other agents to craft a crossbow", + "conversation": "Let's work together to craft a crossbow.", + "initial_inventory": { + "0": { + "oak_planks": 8, + "iron_ingot": 2 + } + }, + "agent_count": 1, + "target": "crossbow", + "number_of_target": 1, + "type": "techtree", + "max_depth": 3, + "depth": 2, + "timeout": 300, + "blocked_actions": { + "0": [], + "1": [] + }, + "missing_items": [ + ], + "requires_ctable": true + } +} \ No newline at end of file diff --git a/test/test_get_crafting_plan.js b/test/test_get_crafting_plan.js new file mode 100644 index 0000000..ee435e6 --- /dev/null +++ b/test/test_get_crafting_plan.js @@ -0,0 +1,16 @@ +import * as mc from '../src/utils/mcdata.js'; +import minecraftData from 'minecraft-data'; + +const mc_version = '1.21.1' +const mcdata = minecraftData(mc_version); +console.log(mcdata.recipes[mc.getItemId('white_dye')]) +console.log(mcdata.recipes[mc.getItemId('oak_planks')]) +console.log(mcdata.recipes[mc.getItemId('wooden_pickaxe')]) +if (mcdata.recipes['minecraft:white_dye']) { + console.log('Recipe found') +} +const target_item = 'white_dye' +const quantity = 1 +const curr_inventory = {} +let craftingPlan = mc.getDetailedCraftingPlan(target_item, quantity, curr_inventory) +console.log(craftingPlan) \ No newline at end of file