Commit Graph
2671 Commits
Author SHA1 Message Date
Rin 5a72898fd0 chore(minecraft): add callable-only reminder and evaluation-loop escape rules to brain prompt
Add callable-only reminder section enforcing function call syntax (query.inventory().summary() not .summary), add invSummary composable pattern example, extend value-first rule with evaluation-loop escape requirement (after one eval turn must call action/chat tool or giveUp), add tests verifying callable reminder/summary example/loop-escape rules appear in prompt
2026-02-18 11:14:41 +08:00
Rin ca109ba9b8 feat(minecraft): compact brain prompt tool descriptions to reduce token usage
Replace verbose JSDoc-style tool formatting with pipe-delimited compact format (name|description|sig:positional|obj:object|args:params), abbreviate common words in descriptions (Automatically→Auto, approximately→approx, coordinate→coord, inventory→inv, nearest→near, number of→#, player→plyr, resource→res, position→pos, whether→if), flatten parameter descriptions from multi-line @param blocks to semic
2026-02-18 11:14:40 +08:00
Rin b124de0f47 feat(minecraft): add pause/resume control for cognitive engine via !pause command and Brain.setPaused/togglePaused/isPaused methods
Add paused state to Brain with setPaused/togglePaused/isPaused methods, suppress all event processing while paused (log suppression to llmLogEntries with scheduler/paused/suppressed tags), add !pause chat command in CognitiveEngine to toggle pause state with confirmation message, expose paused flag in getReplState/getSnapshot for debug visibility, add test verifying ll
2026-02-18 11:14:40 +08:00
Rin 48ad59b1cc docs(minecraft): document query.self/snapshot helpers and remove degraded environment sentinel references
Update SKILL.md and mcp-surface.md to recommend compact value reads (query.self/snapshot/inventory helpers), document query runtime shortcuts (self/count/has/summary/snapshot) in mcp-surface.md, add query.self/snapshot usage examples to brain-prompt.md composable patterns, remove degraded environment sentinel warnings now that inject_chat refreshes reflex context first
2026-02-18 11:14:40 +08:00
Rin 5642b1e204 feat(minecraft): add query.self/snapshot helpers and inventory count/has/summary methods
Add query.self() returning one-shot self state (pos/health/food/heldItem/gameMode/isRaining/timeOfDay), add query.snapshot(range) returning combined self/inventory/nearby snapshot with counts/summary/emptySlots/totalStacks and blocks/entities/ores within range, add inventory.count(name)/has(name, atLeast)/summary() helpers for item queries, register query.self/snapshot as readonly functions in JavaScriptPlanner sandbox
2026-02-18 11:14:40 +08:00
Rin a9f95aeb53 fix(minecraft): mcp-initiated chat no longer cause "SOMETHING WENT WRONG" 2026-02-18 11:14:40 +08:00
Rin 447f779393 fix(minecraft): re-equip tool after ensurePickaxe and throw typed error for missing harvest tools
Re-equip block-appropriate tool after ensurePickaxe crafting/ensuring workflow to capture newly crafted pickaxe, add second canHarvest check post-equip to verify harvestability with new tool, replace generic Error with ActionError(RESOURCE_MISSING) for missing tool failures to enable proper error handling
2026-02-18 11:14:40 +08:00
Rin 843b149e3d fix(minecraft): render nested return objects without [Object] truncation in planner output
Set inspect depth to null (unlimited) in JavaScriptPlanner.evaluate to fully expand nested objects instead of truncating with [Object] placeholder, add maxArrayLength/maxStringLength limits (100/10000) to prevent unbounded output, add test verifying nested pos objects render as `{ x: 10, y: 64, z: -2 }` instead of `[Object]`
2026-02-18 11:14:40 +08:00
Rin da4af1b9d1 feat(minecraft): document forget_conversation and value-first prompt workflow in MCP skill reference
Add forget_conversation() usage examples to SKILL.md and mcp-surface.md, document two-turn value-first flow (read/query returns data first, follow-up turn acts on returned value), add prompt-behavior validation workflow for testing read->action patterns, note forget_conversation clears only conversation memory without touching llm state
2026-02-18 11:14:40 +08:00
Rin b5978a74d5 feat(minecraft): add forgetConversation runtime function for prompt/debug reset workflows
Add forgetConversation method to Brain that clears conversationHistory and lastLlmInputSnapshot, expose as forget_conversation() global in JavaScriptPlanner sandbox, update brain-prompt with value-first rule mandating read->return->act pattern for world/query-dependent requests to avoid acting on unresolved variables, add tests verifying forgetConversation only clears conversation state without touching ll
2026-02-18 11:14:39 +08:00
Rin 27c3b7f84a fix(minecraft): llm can now obtain expression results
Add rewriteTrailingExpressionToReturn helper that rewrites final non-statement expressions to return statements, apply to both normalizeReplCode and LLM planner evaluation paths to capture trailing expression values (e.g. `inv;` returns inventory array), skip rewrite if code contains explicit return/ends with block syntax/is statement keyword, add tests verifying debug REPL and multi-line LLM scripts capture trailing expression
2026-02-18 11:14:39 +08:00
Rin b32c2cac89 feat(minecraft): add llm trace endpoint and compact prompt payloads 2026-02-18 11:14:39 +08:00
Rin 10251a9a80 feat(minecraft): interesting stuff happening! minecraft mcp 2026-02-18 11:14:39 +08:00
Rin 1ecedb203b fix(minecraft): correct gaze ray pitch direction 2026-02-18 11:14:39 +08:00
Rin e700676335 feat(minecraft): extract brain prompt to markdown template with hot-reload support
Move brain-prompt system prompt from inline TypeScript string to external brain-prompt.md file, implement template loading with fs.watch hot-reload in development mode, add renderTemplate helper for {{variable}} substitution to inject toolsFormatted, cache loaded template with ensureTemplateLoaded/ensureWatcher helpers to avoid repeated disk reads
2026-02-18 11:14:39 +08:00
Rin dc599dff25 refactor(minecraft): remove chat suppression logic and human chat timestamp tracking
Remove shouldAllowChatForEvent/updateHumanChatTimestamp methods, delete lastHumanChatAt/botUsername state fields, remove chat action suppression check in processEvent planner callback to simplify brain state management
2026-02-18 11:14:39 +08:00
Rin 4f382e0289 feat(minecraft): expose LLM log to runtime for introspection
Add LlmLogEntry interface with id/turnId/kind/timestamp/eventType/sourceType/sourceId/tags/text/metadata fields, implement createLlmLogRuntime helper exposing query API with chainable filters (byTurn/byKind/byEventType/byTag/last/list/count/clear), track llmLogEntries array with appendLlmLog method logging turn_input/llm_attempt/planner_result/planner_error/feedback/scheduler events, inject llmLog/currentInput globals
2026-02-18 11:14:39 +08:00
Rin 034f0f30af fix(minecraft): fix repl results not feeding to llm 2026-02-18 11:14:38 +08:00
Rin e9087a341b feat(minecraft): add query DSL for read-only runtime introspection with composable block/entity/inventory queries
Add createQueryRuntime helper exposing query.blocks/blockAt/entities/inventory/craftable with chainable filters (within/limit/whereName/whereType/isOre/sortByDistance/names/first/list/countByName/uniq/whereIncludes), inject query/bot/mineflayer globals into JavaScriptPlanner sandbox and RuntimeGlobals, remove redundant inventory/nearbyBlocks/craftable/entities/searchForBlock/searchForEntity
2026-02-18 11:14:38 +08:00
Rin 1384161f42 feat(minecraft): add no-action follow-up system to prevent silent observation loops
Add NO_ACTION_FOLLOWUP_SOURCE_ID constant, implement queueNoActionFollowup method that schedules system_alert event with no_actions reason when planner returns zero actions during observation mode, suppress follow-up if already in follow-up chain to prevent infinite loops, update brain-prompt with feedback loop guard guidance to avoid chat->feedback->chat cycles and clarify feedback:true usage for diagnostic verification only
2026-02-18 11:14:38 +08:00
Rin f70f9fac46 feat(minecraft): capture and expose LLM input snapshot in REPL with source tracking
Add LlmInputSnapshot interface tracking systemPrompt/userMessage/messages/conversationHistory/updatedAt/attempt, store lastLlmInputSnapshot in Brain and inject into RuntimeGlobals as llmInput, expose llmInput/llmMessages/llmSystemPrompt/llmUserMessage/llmConversationHistory as frozen readonly globals in JavaScriptPlanner sandbox, add source:'manual'|'llm' field to DebugReplResult to distinguish user-triggered vs autonomous
2026-02-18 11:14:38 +08:00
Rin cce492f685 feat(minecraft): add REPL dashboard tab with live execution 2026-02-18 11:14:38 +08:00
Rin 6d7db23f6c feat(minecraft): expect guardrails and a working gaze api
Add toCoord/cloneVec3 helpers, return structured telemetry from goToPlayer/goToCoordinate with ok/startPos/endPos/movedDistance/distanceToTargetBefore/distanceToTargetAfter fields, track lastPlannerOutcome summary (actionCount/okCount/errorCount/returnValue/logs) in Brain and inject as [SCRIPT] context with truncation, implement expect/expectMoved/expectNear guardrail tools in JavaScriptPlanner to validate action
2026-02-18 11:14:38 +08:00
Rin 7438361008 refactor(minecraft): replace blocking followPlayer with reflex auto-follow system
Replace async followPlayer skill with sync reflex-based auto-follow that runs during idle mode, add clearFollowTarget action to disable auto-follow before independent movement, add autonomy state to ReflexContext tracking followPlayer/followDistance/followActive/followLastError, implement reconcileAutoFollow in ReflexRuntime using pathfinder GoalFollow that pauses during work/wander/alert modes, add followControl:
2026-02-18 11:14:38 +08:00
Rin 80aa5ba66d fix(minecraft): clamp unsolicited chat and ignore harness wrappers 2026-02-18 11:14:38 +08:00
Rin 9e31bf33d5 refactor(minecraft): change action return types from string to unknown and improve search actions
Replace string return type with unknown in ActionRegistry/TaskExecutor to support structured responses, change searchForBlock/searchForEntity from navigation to pure search returning structured data with found/block/entity/distance fields, add validation result handling in js-planner to return failed validations as ActionRuntimeResult instead of throwing, use nullish coalescing (??) instead of OR (
2026-02-18 11:14:37 +08:00
Rin e69e6608b8 feat(minecraft): add giveUp tool with cooldown suppression 2026-02-18 11:14:37 +08:00
Rin b02d4a9b8b feat(minecraft): run conscious brain in js repl with runtime globals 2026-02-18 11:14:37 +08:00
Rin 4e1ba4537a feat(minecraft): use js REPL for llm interface, would could possibly go wrong 2026-02-18 11:14:37 +08:00
Rin c250ecfeec feat(minecraft): add automatic reconnection with configurable retry limit
Add reconnect option to MineflayerOptions with enabled flag and maxRetries (default: 5), implement tryReconnect method to handle kicked/end events, extract setupBotEventHandlers to reuse on reconnect, track reconnect state with reconnectAttempts/isReconnecting/isStopping flags, add @types/node dependency for setTimeout typing
2026-02-18 11:14:37 +08:00
Rin b20d55508e feat(minecraft): (does it work???)use native reasoning field instead of [REASONING] prefix hack
Replace manual reasoning prefix concatenation with proper reasoning field in Message type, enable reasoning with configurable effort (default: low) in LLM calls, extract reasoningText from response instead of reasoning property
2026-02-18 11:14:37 +08:00
Rin 6488a3b43c feat(minecraft): back to xsai, again :D 2026-02-18 11:14:36 +08:00
Rin edde03216f refactor(minecraft): switch brain to stateless conversation with explicit history management
Replace stateful neuri.handle with handleStateless, maintain conversation history manually using Message[] array, append user/assistant messages only after successful parsing to avoid dirty data on retry
2026-02-18 11:14:08 +08:00
Rin b237ac846d feat(minecraft): add rate limit detection and backoff to brain retry logic
Add isRateLimitError helper to detect 429 status and rate limit messages, implement 500ms sleep on rate limit errors before retry
2026-02-18 11:14:08 +08:00
Rin 62f16570ca feat(minecraft): reasoning hack 2026-02-18 11:14:08 +08:00
Rin f59a11a5d6 fix(minecraft): sane tool description in system mesage 2026-02-18 11:14:08 +08:00
Rin 54b3bfdc06 refactor(minecraft): remove legacy action adapter and simplify execution model
- Remove unused ActionLLMHandler and createActionNeuriAgent from adapter.ts
- Replace execution:'parallel'/'sequential' with readonly:true for query tools
- Add 'skip' action for explicit no-op turns
- Remove error suggestion logic (now handled by brain retry)
- Simplify TaskExecutor to use ActionAgent.performAction directly
- Update tests to use createNeuriAgent() without bot parameter
2026-02-18 11:14:08 +08:00
Rin 1c942a84c8 fix(minecraft): validate LLM response structure to retry on invalid format 2026-02-18 11:14:08 +08:00
Rin c21b997569 fix(minecraft): simplify brain error retry logic to catch edge cases
Remove isLikelyRecoverableError helper and retry all non-auth/bad-arg errors
2026-02-18 11:14:07 +08:00
Rin 02d3f38663 fix(minecraft): make logging actually meaningful
Ported from commit f8b73bbf (partial - debug files only):
- Add /api/logs endpoint for listing and loading persisted log files
- Add log file selector UI to debug dashboard
- Filter persistEvent to only save relevant event types
- Add refreshFileList and loadPersistedLog methods to LogsPanel
2026-02-18 11:14:07 +08:00
Rin cb13baf108 chore(minecraft): speckit 2026-02-18 11:14:07 +08:00
Rin e07d775202 refactor(minecraft): remove auto-follow behavior from reflex social mode 2026-02-18 11:14:07 +08:00
Rin a70c2e158f chore(minecraft): minecraft debug config 2026-02-18 11:14:07 +08:00
Rin 4b8f00ce99 feat(minecraft): borrow patch from mindcraft 2026-02-18 11:14:07 +08:00
Neko Ayaka 59b274b91a feat(minecraft-hub): init, but bugged 2026-02-18 11:13:33 +08:00
Rin 9ee5aa86ad chore(minecraft): TODO cleanup and ignore .agent/ 2026-02-18 11:13:08 +08:00
Rin f85b0d805e chore(minecraft): update brain prompt 2026-02-18 11:12:47 +08:00
Rin 260bc37935 fix(minecraft): invalid LLM output breaks blackboard 2026-02-18 11:12:47 +08:00
Rin 02c3949a40 feat(minecraft): use native tool calling for instant tasks 2026-02-18 11:12:47 +08:00
Rin d9b99bdda1 feat(minecraft): improve error handling and auto-craft intermediates...but it doesn't work very well
1. Wrap neuri tool invocations to catch ActionError and return as
   result strings instead of throwing. This allows the LLM to learn
   from tool failures during its reasoning phase.

2. Enhance craftRecipe to use the recipe planner for auto-crafting
   intermediate materials. If the bot has raw materials (e.g., logs)
   but not direct ingredients (e.g., planks), it will automatically
   craft the intermediates first.

3. Add memory note about the dual tool interface discovery (neuri
   native tool calls vs JSON actions through TaskExecutor) for future
   optimization work.
2026-02-18 11:12:46 +08:00