[GH-ISSUE #5105] [Feature]: Inventory Tracker agent — structured currencies, equipped, and carried items with a grid tracker panel #2825

Closed
opened 2026-10-21 05:56:17 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @augusteo on GitHub (Aug 15, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5105

Originally assigned to: @SpicyMarinara on GitHub.

The problem

In Roleplay Mode there is no structured way to track inventory. The only option today is the Custom Tracker agent, whose contract is deliberately unstructured — CustomTrackerField is { name: string; value: string } and its prompt states "Values are always strings."

So an entire inventory collapses into a single prose string in a single cell:

Field Value
Currency 6 silver coins
Inventory Family heirloom longsword, short hunting knife, second…
Equipment Family heirloom longsword sheathed at side; hunting knife…

The panel then truncates it: isLongCustomField flags values over 32 characters and the value renders line-clamp-2 (packages/client/src/features/tracker-panel/components/sections/CustomTrackerPanel.tsx). Expanding the tracker panel does not help, because there is no structure to lay out — it just makes the same truncated string bigger.

Two further problems fall out of the string-only shape:

  • The same item shows up in both "Inventory" and "Equipment", because nothing enforces that equipping moves an item.
  • Currencies, carried items and worn items are all indistinguishable to the UI, so none of them can be rendered well.

Game/GM mode already has a proper item grid. Roleplay does not.

Reported on Discord (2026-08-15). PR #5051 improved tracker panel spacing, which helped, but could not address the structural cause.

Proposed solution

A dedicated Inventory Tracker agent that emits structured arrays instead of prose, plus a tracker-panel section that renders them as grids in the docked side panel alongside World, Persona, Present Characters, Quest Board and Custom Stats.

Output contract — one uniform row shape, { name, qty }, across three groups:

{
  "currencies": [{ "name": "Silver coin", "qty": 6 }],
  "equipped":   [{ "name": "Family heirloom longsword" }],
  "inventory":  [{ "name": "Billhook" }, { "name": "Scavenged axe", "qty": 2 }],
  "reasoning":  "Equipped the longsword; picked up a second axe."
}

qty is an integer >= 1 and is omitted when 1, keeping the stored payload compact.

The prompt is prescriptive by design, since the whole point is to stop the model writing prose:

  1. Output all three arrays every turn. An omitted array deletes that group.
  2. An equipped item appears only in equipped, never in inventory. Equipping moves the row across; unequipping moves it back. Never both.
  3. currencies is money only — coins, notes, credits, gold. Not gems-as-loot, not rations, not trade goods.
  4. Names are short noun phrases. No sentences, no "in hand" / "sheathed at side" clauses.
  5. Merge duplicates by name into one row with a summed qty.
  6. Copy locked rows through unchanged; leave unchanged rows unchanged.

Scope

The agent writes to its own new PlayerStats fields. It does not touch playerStats.inventory, which the Persona Stats agent owns — existing chats are unaffected, and enabling both agents simply shows both sections.

This needs two PRs, because agent definitions are not stored in this repository:

  • Marinara-Engine — result type, state slice, lock keys, both server apply paths, the tracker-panel grid section, the HUD widget, docs and regressions.
  • Pasta-Devs/Marinara-Agents — the downloadable inventory-tracker package itself (packages/server/data/ is gitignored; packages are fetched from that repository at runtime).

The Engine PR lands first. It is testable on its own by creating a custom agent in the Agent Editor with the new result type, and the package is inert without it.

Originally created by @augusteo on GitHub (Aug 15, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5105 Originally assigned to: @SpicyMarinara on GitHub. ### The problem In Roleplay Mode there is no structured way to track inventory. The only option today is the **Custom Tracker** agent, whose contract is deliberately unstructured — `CustomTrackerField` is `{ name: string; value: string }` and its prompt states *"Values are always strings."* So an entire inventory collapses into a single prose string in a single cell: | Field | Value | | --- | --- | | Currency | 6 silver coins | | Inventory | Family heirloom longsword, short hunting knife, second… | | Equipment | Family heirloom longsword sheathed at side; hunting knife… | The panel then truncates it: `isLongCustomField` flags values over 32 characters and the value renders `line-clamp-2` (`packages/client/src/features/tracker-panel/components/sections/CustomTrackerPanel.tsx`). Expanding the tracker panel does not help, because there is no structure to lay out — it just makes the same truncated string bigger. Two further problems fall out of the string-only shape: - The same item shows up in both "Inventory" and "Equipment", because nothing enforces that equipping *moves* an item. - Currencies, carried items and worn items are all indistinguishable to the UI, so none of them can be rendered well. Game/GM mode already has a proper item grid. Roleplay does not. Reported on Discord (2026-08-15). PR #5051 improved tracker panel spacing, which helped, but could not address the structural cause. ### Proposed solution A dedicated **Inventory Tracker** agent that emits structured arrays instead of prose, plus a tracker-panel section that renders them as grids in the docked side panel alongside World, Persona, Present Characters, Quest Board and Custom Stats. Output contract — one uniform row shape, `{ name, qty }`, across three groups: ```json { "currencies": [{ "name": "Silver coin", "qty": 6 }], "equipped": [{ "name": "Family heirloom longsword" }], "inventory": [{ "name": "Billhook" }, { "name": "Scavenged axe", "qty": 2 }], "reasoning": "Equipped the longsword; picked up a second axe." } ``` `qty` is an integer >= 1 and is omitted when 1, keeping the stored payload compact. The prompt is prescriptive by design, since the whole point is to stop the model writing prose: 1. Output all three arrays every turn. An omitted array deletes that group. 2. **An equipped item appears only in `equipped`, never in `inventory`.** Equipping moves the row across; unequipping moves it back. Never both. 3. `currencies` is money only — coins, notes, credits, gold. Not gems-as-loot, not rations, not trade goods. 4. Names are short noun phrases. No sentences, no "in hand" / "sheathed at side" clauses. 5. Merge duplicates by name into one row with a summed `qty`. 6. Copy locked rows through unchanged; leave unchanged rows unchanged. ### Scope The agent writes to its own new `PlayerStats` fields. It does **not** touch `playerStats.inventory`, which the Persona Stats agent owns — existing chats are unaffected, and enabling both agents simply shows both sections. This needs two PRs, because agent definitions are not stored in this repository: - **Marinara-Engine** — result type, state slice, lock keys, both server apply paths, the tracker-panel grid section, the HUD widget, docs and regressions. - **Pasta-Devs/Marinara-Agents** — the downloadable `inventory-tracker` package itself (`packages/server/data/` is gitignored; packages are fetched from that repository at runtime). The Engine PR lands first. It is testable on its own by creating a custom agent in the Agent Editor with the new result type, and the package is inert without it.
bsakaguchi 2026-10-21 05:56:17 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Aug 15, 2026):

SpicyMarinara is taking the Engine integration in feature/5105-inventory-tracker. The downloadable package is tracked separately in Pasta-Devs/Marinara-Agents#361.

<!-- gh-comment-id:5304588085 --> @SpicyMarinara commented on GitHub (Aug 15, 2026): SpicyMarinara is taking the Engine integration in `feature/5105-inventory-tracker`. The downloadable package is tracked separately in Pasta-Devs/Marinara-Agents#361.
Author
Owner

@augusteo commented on GitHub (Aug 16, 2026):

Working on this — draft PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5115 (Engine side).

The downloadable inventory-tracker package for Pasta-Devs/Marinara-Agents is the follow-up; the Engine PR lands first since the package is inert without it.

@Xelvanis — you mentioned in the Discord thread you didn't mind picking this up. I've taken the Engine side to avoid duplicate work; shout if you'd rather own it or want the agents-repo package.

<!-- gh-comment-id:5304951649 --> @augusteo commented on GitHub (Aug 16, 2026): Working on this — draft PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5115 (Engine side). The downloadable `inventory-tracker` package for `Pasta-Devs/Marinara-Agents` is the follow-up; the Engine PR lands first since the package is inert without it. @Xelvanis — you mentioned in the Discord thread you didn't mind picking this up. I've taken the Engine side to avoid duplicate work; shout if you'd rather own it or want the agents-repo package.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2825
No description provided.