naldo commited on
Commit
f7f70f2
·
1 Parent(s): 240db30

Stabilize Mineflayer and enable creative Voyager

Browse files
Files changed (3) hide show
  1. minecraft_stack.py +2 -1
  2. voyager_runner.py +1 -1
  3. voyager_stack.py +16 -15
minecraft_stack.py CHANGED
@@ -250,7 +250,7 @@ class MinecraftStack:
250
  "enable-command-block": "true",
251
  "spawn-protection": "0",
252
  "allow-flight": "true",
253
- "gamemode": "survival",
254
  "force-gamemode": "true",
255
  "difficulty": "peaceful",
256
  "max-players": "10",
@@ -282,6 +282,7 @@ class MinecraftStack:
282
  if proc.stdin:
283
  for cmd in (
284
  f"op {BOT_USERNAME}",
 
285
  "gamerule keepInventory true",
286
  "gamerule doDaylightCycle false",
287
  "difficulty peaceful",
 
250
  "enable-command-block": "true",
251
  "spawn-protection": "0",
252
  "allow-flight": "true",
253
+ "gamemode": "creative",
254
  "force-gamemode": "true",
255
  "difficulty": "peaceful",
256
  "max-players": "10",
 
282
  if proc.stdin:
283
  for cmd in (
284
  f"op {BOT_USERNAME}",
285
+ f"gamemode creative {BOT_USERNAME}",
286
  "gamerule keepInventory true",
287
  "gamerule doDaylightCycle false",
288
  "difficulty peaceful",
voyager_runner.py CHANGED
@@ -49,7 +49,7 @@ def main() -> None:
49
  openai_api_key=api_key,
50
  server_port=int(env("MINEFLAYER_API_PORT", "3000")),
51
  env_wait_ticks=int(env("ENV_WAIT_TICKS", "20")),
52
- env_request_timeout=int(env("ENV_REQUEST_TIMEOUT", "600")),
53
  max_iterations=int(env("MAX_ITERATIONS", "160")),
54
  action_agent_model_name=model,
55
  action_agent_temperature=0,
 
49
  openai_api_key=api_key,
50
  server_port=int(env("MINEFLAYER_API_PORT", "3000")),
51
  env_wait_ticks=int(env("ENV_WAIT_TICKS", "20")),
52
+ env_request_timeout=int(env("ENV_REQUEST_TIMEOUT", "60")),
53
  max_iterations=int(env("MAX_ITERATIONS", "160")),
54
  action_agent_model_name=model,
55
  action_agent_temperature=0,
voyager_stack.py CHANGED
@@ -191,6 +191,7 @@ class VoyagerStack:
191
  - A resolved primitive or a bot.chat message is not proof of success. Recheck inventory and world state after mining, crafting or placing, and throw an informative error if the prerequisite is still missing.
192
  - Logs are not planks, planks are not sticks, and an uncrafted/unplaced crafting table cannot be used. For a missing wooden pickaxe, actually craft planks, a crafting table and sticks before crafting the pickaxe; check quantities at every step.
193
  - craftItem count is the number of recipe repetitions, not the number of output items. Verify the resulting item.count totals.
 
194
  - Perform concrete prerequisite actions instead of returning early just because materials are missing. Use bounded exploration and recheck what was actually obtained.
195
  '''
196
  marker = "You should then respond to me with\n"
@@ -286,9 +287,9 @@ class VoyagerStack:
286
  data = json.loads(root_pkg.read_text(encoding="utf-8"))
287
  pinned = {
288
  "body-parser": "1.20.2", "express": "4.18.2", "magic-string": "0.30.0",
289
- "minecraft-data": "3.31.0", "minecrafthawkeye": "1.3.6", "mineflayer": "4.8.1",
290
  "mineflayer-pathfinder": "2.4.2", "mineflayer-pvp": "1.3.2", "mineflayer-tool": "1.2.0",
291
- "mocha": "10.2.0", "prismarine-biome": "1.3.0", "prismarine-block": "1.16.3",
292
  "prismarine-entity": "2.2.0", "prismarine-item": "1.12.1", "prismarine-nbt": "2.2.1",
293
  "prismarine-recipe": "1.3.1", "prismarine-viewer": "1.24.0", "typescript": "4.9.5",
294
  "vec3": "0.1.8", "graceful-fs": "4.2.11",
@@ -303,20 +304,20 @@ class VoyagerStack:
303
  # Old caret ranges otherwise resolve to modern 2026 Protodef and
304
  # Prismarine releases, which caused entity_metadata PartialReadError
305
  # followed by a vanilla keepalive timeout in the live Space.
306
- "mineflayer": "4.8.1",
307
- "minecraft-protocol": "1.40.3",
308
  "protodef": "1.15.0",
309
- "minecraft-data": "3.31.0",
310
- "prismarine-block": "1.16.3",
311
  "prismarine-nbt": "2.2.1",
312
  "prismarine-chat": "1.8.0",
313
  "prismarine-item": "1.12.1",
314
  "prismarine-biome": "1.3.0",
315
- "prismarine-chunk": "1.33.0",
316
  "prismarine-world": "3.6.1",
317
  "prismarine-entity": "2.2.0",
318
  "prismarine-recipe": "1.3.1",
319
- "prismarine-physics": "1.6.0",
320
  "prismarine-windows": "2.6.1",
321
  "prismarine-registry": "1.7.0",
322
  "mineflayer-pathfinder": "2.4.2",
@@ -328,7 +329,7 @@ class VoyagerStack:
328
  cb_pkg = SRC / "voyager" / "env" / "mineflayer" / "mineflayer-collectblock" / "package.json"
329
  cb = json.loads(cb_pkg.read_text(encoding="utf-8"))
330
  cb["dependencies"].update({
331
- "mineflayer": "4.8.1",
332
  "mineflayer-pathfinder": "2.4.2",
333
  "mineflayer-tool": "1.2.0",
334
  })
@@ -340,20 +341,20 @@ class VoyagerStack:
340
 
341
  def _verify_node_versions(self, mineflayer: Path) -> None:
342
  expected = {
343
- "mineflayer": "4.8.1",
344
- "minecraft-protocol": "1.40.3",
345
  "protodef": "1.15.0",
346
- "minecraft-data": "3.31.0",
347
- "prismarine-block": "1.16.3",
348
  "prismarine-nbt": "2.2.1",
349
  "prismarine-chat": "1.8.0",
350
  "prismarine-item": "1.12.1",
351
  "prismarine-biome": "1.3.0",
352
- "prismarine-chunk": "1.33.0",
353
  "prismarine-world": "3.6.1",
354
  "prismarine-entity": "2.2.0",
355
  "prismarine-recipe": "1.3.1",
356
- "prismarine-physics": "1.6.0",
357
  "prismarine-windows": "2.6.1",
358
  "prismarine-registry": "1.7.0",
359
  }
 
191
  - A resolved primitive or a bot.chat message is not proof of success. Recheck inventory and world state after mining, crafting or placing, and throw an informative error if the prerequisite is still missing.
192
  - Logs are not planks, planks are not sticks, and an uncrafted/unplaced crafting table cannot be used. For a missing wooden pickaxe, actually craft planks, a crafting table and sticks before crafting the pickaxe; check quantities at every step.
193
  - craftItem count is the number of recipe repetitions, not the number of output items. Verify the resulting item.count totals.
194
+ - This server intentionally runs Naldo_Bot in Creative mode. Any required vanilla tool/item is available: when it is absent from Inventory, obtain it concretely with bot.chat(`/give @s minecraft:<item> <count>`) and then recheck Inventory. Never pretend it exists before the /give result is observed.
195
  - Perform concrete prerequisite actions instead of returning early just because materials are missing. Use bounded exploration and recheck what was actually obtained.
196
  '''
197
  marker = "You should then respond to me with\n"
 
287
  data = json.loads(root_pkg.read_text(encoding="utf-8"))
288
  pinned = {
289
  "body-parser": "1.20.2", "express": "4.18.2", "magic-string": "0.30.0",
290
+ "minecraft-data": "3.37.0", "minecrafthawkeye": "1.3.6", "mineflayer": "4.10.1",
291
  "mineflayer-pathfinder": "2.4.2", "mineflayer-pvp": "1.3.2", "mineflayer-tool": "1.2.0",
292
+ "mocha": "10.2.0", "prismarine-biome": "1.3.0", "prismarine-block": "1.17.0",
293
  "prismarine-entity": "2.2.0", "prismarine-item": "1.12.1", "prismarine-nbt": "2.2.1",
294
  "prismarine-recipe": "1.3.1", "prismarine-viewer": "1.24.0", "typescript": "4.9.5",
295
  "vec3": "0.1.8", "graceful-fs": "4.2.11",
 
304
  # Old caret ranges otherwise resolve to modern 2026 Protodef and
305
  # Prismarine releases, which caused entity_metadata PartialReadError
306
  # followed by a vanilla keepalive timeout in the live Space.
307
+ "mineflayer": "4.10.1",
308
+ "minecraft-protocol": "1.43.1",
309
  "protodef": "1.15.0",
310
+ "minecraft-data": "3.37.0",
311
+ "prismarine-block": "1.17.0",
312
  "prismarine-nbt": "2.2.1",
313
  "prismarine-chat": "1.8.0",
314
  "prismarine-item": "1.12.1",
315
  "prismarine-biome": "1.3.0",
316
+ "prismarine-chunk": "1.34.0",
317
  "prismarine-world": "3.6.1",
318
  "prismarine-entity": "2.2.0",
319
  "prismarine-recipe": "1.3.1",
320
+ "prismarine-physics": "1.7.0",
321
  "prismarine-windows": "2.6.1",
322
  "prismarine-registry": "1.7.0",
323
  "mineflayer-pathfinder": "2.4.2",
 
329
  cb_pkg = SRC / "voyager" / "env" / "mineflayer" / "mineflayer-collectblock" / "package.json"
330
  cb = json.loads(cb_pkg.read_text(encoding="utf-8"))
331
  cb["dependencies"].update({
332
+ "mineflayer": "4.10.1",
333
  "mineflayer-pathfinder": "2.4.2",
334
  "mineflayer-tool": "1.2.0",
335
  })
 
341
 
342
  def _verify_node_versions(self, mineflayer: Path) -> None:
343
  expected = {
344
+ "mineflayer": "4.10.1",
345
+ "minecraft-protocol": "1.43.1",
346
  "protodef": "1.15.0",
347
+ "minecraft-data": "3.37.0",
348
+ "prismarine-block": "1.17.0",
349
  "prismarine-nbt": "2.2.1",
350
  "prismarine-chat": "1.8.0",
351
  "prismarine-item": "1.12.1",
352
  "prismarine-biome": "1.3.0",
353
+ "prismarine-chunk": "1.34.0",
354
  "prismarine-world": "3.6.1",
355
  "prismarine-entity": "2.2.0",
356
  "prismarine-recipe": "1.3.1",
357
+ "prismarine-physics": "1.7.0",
358
  "prismarine-windows": "2.6.1",
359
  "prismarine-registry": "1.7.0",
360
  }