feat: docs, config, profiles, settings, and utility updates#727
feat: docs, config, profiles, settings, and utility updates#727Z0mb13V1 wants to merge 1 commit intomindcraft-bots:developfrom
Conversation
- README.md, FAQ.md, CLAUDE.md, SECURITY.md: updated project documentation - settings.js, main.js: core config and entry-point updates - package.json, eslint.config.js, .gitignore, .env.example: tooling - .husky/pre-commit: lint enforcement hook - .github/: dependabot config, CI and deploy workflows - keys.example.json: API key template - whitelist.json: server player whitelist - data/minecraft_wiki.json: game data reference - docs/: index, mod-packs guide, notebook-llm guide, references - patches/: mineflayer-baritone and prismarine-viewer patches - profiles/: 24 bot personality profiles + 5 default base profiles + 3 task-specific profiles (construction, cooking, crafting) - services/viaproxy/README.md: ViaProxy bridge setup guide - src/utils/examples.js, mcdata.js, usage_tracker.js: shared utilities
There was a problem hiding this comment.
Pull request overview
This PR finalizes a large “hybrid research rig” fork setup by expanding repo documentation, adding/refreshing many bot profiles, tightening configuration/launch behavior, and introducing new tooling (linting, workflows, patches, deps) to support multi-bot + EC2 deployment.
Changes:
- Add substantial documentation (README overhaul, CLAUDE.md, SECURITY.md, docs index + folders) and repo automation (CI, deploy workflow, Dependabot, Husky/lint-staged).
- Update runtime configuration and startup flow (
settings.js,main.js) including safer JSON parsing, task file validation, and optional remote MindServer mode. - Add/refresh many bot profiles + whitelist data, introduce usage tracking utility, and integrate/patch additional Mineflayer ecosystem components (baritone + prismarine-viewer patch).
Reviewed changes
Copilot reviewed 53 out of 54 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| whitelist.json | Adds offline-mode whitelist entries for bot/player names. |
| tasks/construction_tasks/get_blueprint.js | Minor cleanup in blueprint task script (but contains a write bug; see comments). |
| src/utils/usage_tracker.js | New usage/cost tracking utility with rolling RPM/TPM snapshot. |
| src/utils/mcdata.js | Updates auto-eat import usage and adds baritone plugin + config on spawn. |
| src/utils/examples.js | Small lint/style cleanups (unused catch var, semicolon). |
| settings.js | Updates defaults, adds deepSanitize() for SETTINGS_JSON, adds MindServer public binding option. |
| services/viaproxy/README.md | Improves ViaProxy setup documentation formatting. |
| profiles/vllm.json | Expands vLLM profile with mode blocks and local URL defaults. |
| profiles/tasks/crafting_profile.json | Adds TODO header and formatting cleanup. |
| profiles/tasks/cooking_profile.json | Adds TODO header and formatting cleanup. |
| profiles/tasks/construction_profile.json | Adds TODO header. |
| profiles/qwen.json | Expands qwen profile with mode blocks and local/hybrid options. |
| profiles/mistral.json | Expands mistral profile with mode blocks and local/hybrid options. |
| profiles/mercury.json | Expands mercury profile with mode blocks and local/hybrid options. |
| profiles/local-research.json | Adds a detailed LocalAndy research/survival profile. |
| profiles/llama.json | Expands llama profile with mode blocks and local/hybrid options. |
| profiles/grok.json | Reworks grok profile into Grok_En with richer prompts + modes. |
| profiles/gpt.json | Updates GPT model selection and adds modes. |
| profiles/gemini.json | Reworks gemini profile into Gemini_1 with richer prompts + modes. |
| profiles/freeguy.json | Expands Freeguy profile with mode blocks and local/hybrid options. |
| profiles/ensemble.json | Adds ensemble profile configuration and prompts. |
| profiles/defaults/survival.json | Adds TODO header and enables additional survival modes. |
| profiles/defaults/god_mode.json | Adds TODO header. |
| profiles/defaults/creative.json | Adds TODO header. |
| profiles/defaults/assistant.json | Adds TODO header. |
| profiles/defaults/_default.json | Updates default prompts, cooldown, and enabled modes. |
| profiles/deepseek.json | Expands deepseek profile with mode blocks and local/hybrid options. |
| profiles/cloud-persistent.json | Adds a CloudGrok always-on ensemble profile with extensive rules/prompts. |
| profiles/claude_thinker.json | Expands claude_thinker profile with mode blocks and local/hybrid options. |
| profiles/claude.json | Expands claude profile (routing prompts + coding prompt + modes). |
| profiles/azure.json | Expands azure profile with mode blocks and local/hybrid options. |
| profiles/andy-4.json | Expands andy-4 profile with mode blocks and local/hybrid options. |
| profiles/andy-4-reasoning.json | Expands andy-4-thinking profile with modes and prompt updates. |
| patches/prismarine-viewer+1.33.0.patch | Hardens prismarine-viewer against missing bones/unknown entities. |
| patches/@miner-org+mineflayer-baritone+4.5.0.patch | Adds a null-guard in baritone movement logic. |
| package.json | Adds version, new deps, overrides, lint/husky scripts, and lint-staged config. |
| main.js | Adds safe JSON parsing, task/profile validation, env parsing updates, and remote MindServer mode. |
| keys.example.json | Adds Discord token key (formatting issue noted in comments). |
| eslint.config.js | Major ESLint config updates + globals/rule adjustments (critical issue noted in comments). |
| docs/references/README.md | Adds references folder README. |
| docs/notebook-llm/README.md | Adds NotebookLM exports folder README and guidelines. |
| docs/mod-packs/README.md | Adds mod-pack research folder README. |
| docs/index.md | Adds docs index and table-of-contents. |
| data/minecraft_wiki.json | Adds a starter wiki/recipes/mobs data file. |
| SECURITY.md | Adds security policy and hardening overview. |
| README.md | Major README rewrite for fork + hybrid rig deployment/ops guidance. |
| FAQ.md | Small formatting improvements and section headings. |
| CLAUDE.md | Adds Claude Code repo guidance and architecture overview. |
| .husky/pre-commit | Adds pre-commit lint-staged hook. |
| .gitignore | Expands ignores for env/secrets, PDFs, AWS runtime config, etc. |
| .github/workflows/deploy.yml | Adds GitHub Actions workflow to deploy to EC2 on main push. |
| .github/workflows/ci.yml | Adds CI workflow running ESLint on Node 20. |
| .github/dependabot.yml | Adds Dependabot config for actions + npm. |
| .env.example | Adds example env vars for ports, LiteLLM, EC2, Discord. |
Comments suppressed due to low confidence (1)
tasks/construction_tasks/get_blueprint.js:48
fs.writeFileSyncis being called with a callback as the 3rd argument.writeFileSyncis synchronous and its 3rd parameter isoptions; passing a function will throw aTypeError(and the callback will never run). Usefs.writeFile(async) if you want a callback, or keepwriteFileSyncand wrap it intry/catchfor error handling.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Globals used in real source files (not action-code only) | ||
| Compartment: "readonly", // SES Compartment, provided by ses lockdown (lockdown.js) | ||
| res: "writable", // NPC item_goal.js | ||
| sendRequest: "readonly", // novita.js and other model files | ||
| chat_model_profile: "readonly", // prompter.js |
There was a problem hiding this comment.
The top-level globals list includes res and sendRequest, but these are not real runtime globals in this codebase (ES modules run in strict mode). This masks genuine no-undef/runtime errors (e.g., res = ... without a declaration in src/agent/npc/item_goal.js, and sendRequest(...) instead of this.sendRequest(...) in src/models/novita.js). Remove these from the global set and fix the underlying references (or scope any unavoidable globals to the specific files that truly inject them).
| // Globals used in real source files (not action-code only) | |
| Compartment: "readonly", // SES Compartment, provided by ses lockdown (lockdown.js) | |
| res: "writable", // NPC item_goal.js | |
| sendRequest: "readonly", // novita.js and other model files | |
| chat_model_profile: "readonly", // prompter.js | |
| // Additional globals used in real source files (not action-code only) | |
| Compartment: "readonly", // SES Compartment, provided by ses lockdown (lockdown.js) | |
| chat_model_profile: "readonly", // prompter.js |
| "host": "localhost", // Set via MINECRAFT_HOST env var or SETTINGS_JSON override; for EC2 use your instance's public IP | ||
| "port": 42069, // set to -1 to automatically scan for open ports |
There was a problem hiding this comment.
The host comment says it can be set via MINECRAFT_HOST, but there is no MINECRAFT_HOST env override implemented (only MINECRAFT_PORT is handled in main.js). Either implement the env var override or adjust the comment to avoid misleading configuration docs.
| if (process.env.MINECRAFT_PORT) { | ||
| settings.port = process.env.MINECRAFT_PORT; | ||
| settings.port = parseInt(process.env.MINECRAFT_PORT, 10) || 42069; | ||
| } | ||
| if (process.env.MINDSERVER_PORT) { | ||
| settings.mindserver_port = process.env.MINDSERVER_PORT; | ||
| settings.mindserver_port = parseInt(process.env.MINDSERVER_PORT, 10) || 8080; | ||
| } | ||
| if (process.env.PROFILES && JSON.parse(process.env.PROFILES).length > 0) { | ||
| settings.profiles = JSON.parse(process.env.PROFILES); | ||
| if (process.env.PROFILES) { | ||
| const profiles = safeJsonParse(process.env.PROFILES, 'PROFILES env var'); | ||
| if (Array.isArray(profiles) && profiles.length > 0) { | ||
| settings.profiles = profiles; | ||
| } | ||
| } | ||
| if (process.env.INSECURE_CODING) { | ||
| settings.allow_insecure_coding = true; | ||
| } | ||
| if (process.env.BLOCKED_ACTIONS) { | ||
| settings.blocked_actions = JSON.parse(process.env.BLOCKED_ACTIONS); | ||
| settings.blocked_actions = safeJsonParse(process.env.BLOCKED_ACTIONS, 'BLOCKED_ACTIONS env var'); | ||
| } | ||
| if (process.env.MAX_MESSAGES) { | ||
| settings.max_messages = process.env.MAX_MESSAGES; | ||
| settings.max_messages = parseInt(process.env.MAX_MESSAGES, 10) || settings.max_messages; | ||
| } | ||
| if (process.env.NUM_EXAMPLES) { | ||
| settings.num_examples = process.env.NUM_EXAMPLES; | ||
| settings.num_examples = parseInt(process.env.NUM_EXAMPLES, 10) || settings.num_examples; | ||
| } |
There was a problem hiding this comment.
Using parseInt(...) || <fallback> will treat valid values like 0 as falsy and silently replace them with the fallback. It also silently accepts invalid input (e.g. MINECRAFT_PORT=abc becomes the default). Prefer parsing once, checking Number.isNaN, and (for ports) validating range 1–65535, so misconfiguration fails fast and intentional values aren’t overridden.
| "MERCURY_API_KEY":"" | ||
| ,"DISCORD_BOT_TOKEN": "" |
There was a problem hiding this comment.
keys.example.json uses a leading comma on the DISCORD_BOT_TOKEN line and inconsistent spacing ("MERCURY_API_KEY":""). While valid JSON, this is non-idiomatic and easy to mis-edit. Prefer a normal trailing comma on the previous line and consistent ": " spacing.
| "MERCURY_API_KEY":"" | |
| ,"DISCORD_BOT_TOKEN": "" | |
| "MERCURY_API_KEY": "", | |
| "DISCORD_BOT_TOKEN": "" |
| const isLocal = provider === 'ollama' || provider === 'vllm'; | ||
| const costInfo = isLocal ? COST_TABLE._vllm_default : getCostPerMillion(modelName); | ||
| if (costInfo) { | ||
| const callCost = (pt * costInfo.input + ct * costInfo.output) / 1_000_000; | ||
| m.estimated_cost_usd += callCost; |
There was a problem hiding this comment.
For local providers you set isLocal for both ollama and vllm, but then always select COST_TABLE._vllm_default. Since the table defines both _ollama_default and _vllm_default, pick the matching default (or just hardcode 0 cost for local) to avoid incorrect accounting if you later assign non-zero local costs.
| + if (jsonBone.parent) { | ||
| + if (bones[jsonBone.parent]) bones[jsonBone.parent].add(bones[jsonBone.name]) | ||
| + } else rootBones.push(bones[jsonBone.name]) |
There was a problem hiding this comment.
In the bone-parenting loop, when jsonBone.parent is set but bones[jsonBone.parent] is missing, the bone is silently dropped (not attached anywhere, not added to rootBones). Instead of skipping, treat it as a root bone (or attach to a safe fallback) so entities still render correctly while avoiding the crash.
| + if (jsonBone.parent) { | |
| + if (bones[jsonBone.parent]) bones[jsonBone.parent].add(bones[jsonBone.name]) | |
| + } else rootBones.push(bones[jsonBone.name]) | |
| + if (jsonBone.parent && bones[jsonBone.parent]) { | |
| + bones[jsonBone.parent].add(bones[jsonBone.name]) | |
| + } else { | |
| + rootBones.push(bones[jsonBone.name]) | |
| + } |
Comprehensive documentation, configuration, and profile additions including README, FAQ, CLAUDE.md, 24+ bot profiles, CI/CD workflows, Dependabot config, tooling, patches, and shared utility modules. This is the final PR completing the 8-branch decomposition.