Skip to content

Assistant: blockBuildStatus tool — built vs required machines per block #123

Description

@ApocDev

The companion mod already syncs built_machines (machine × recipe × count, from the save) into the project DB, and the app uses it for the block editor's built-vs-required comparison. The AI assistant can't see any of it: asking "what's left to build for the coke block?" or "which blocks are under-built?" currently forces it to propose a gameEval Lua snippet or guess.

Add a read-only blockBuildStatus tool to app/src/server/agent-tools.server.ts:

  • blockBuildStatus(blockId?) — for one block (or, with no id, every block with a shortfall): per recipe, the machine, the required count (ceiled solved count, same numbers the drafts' buildings field reports), the built count from built_machines, and the missing delta.
  • Works offline — it reads the synced tables, no live bridge needed. Note the staleness caveat in the tool description (data is as fresh as the last save-load/resync).
  • Mention it in the assistant system prompt's tool index (agent.ts) so the model reaches for it instead of gameEval for "what's built" questions.

Both sides of the comparison already exist in queries.server.ts; this is mostly wiring plus a compact result shape.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: aiAI planning supportarea: plannerProduction block / planning modelenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions