45 Commits

Author SHA1 Message Date
MayaTheShy
bb15c78ca9 fix: improve monitor alias detection and registration for better peripheral handling 2026-03-29 00:23:59 -04:00
MayaTheShy
9396fbd81a fix: enhance monitor detection to handle adjacent peripherals correctly 2026-03-28 23:41:20 -04:00
MayaTheShy
ec1a681924 fix: replace custom event wake-up with polling, remove craftItem double-capture
Two robustness improvements to the Network capture/processor split:

1. Processor wake-up: replaced os.queueEvent('network_queued') /
   os.pullEvent('network_queued') with sleep(0) polling. Custom events
   can be consumed by other coroutines (e.g. craftItem's unfiltered
   os.pullEvent()) or swallowed by the OS event layer. Polling the
   shared queue every tick is simpler and guaranteed reliable.

2. craftItem: removed ORDER_CHANNEL message buffering and re-queuing.
   With the dedicated Network-capture task, ORDER_CHANNEL messages are
   already safely captured into networkQueue. The old buffering caused
   double-capture: capture task adds to queue, craftItem also buffers,
   then re-queues via os.queueEvent -> capture captures again -> dup.
   The commandId dedup caught these, but removing the source is cleaner.
2026-03-28 23:40:09 -04:00
MayaTheShy
38ff3f61bd feat: enhance billboard rendering with pie chart and storage ring display 2026-03-26 14:44:51 -04:00
MayaTheShy
664741504f feat: update billboard monitor text scale configuration to use BILLBOARD_TEXT_SCALE 2026-03-26 14:27:31 -04:00
MayaTheShy
c830642dc8 feat: add BILLBOARD_TEXT_SCALE configuration option for billboard display size 2026-03-26 14:27:28 -04:00
MayaTheShy
29026175b7 feat: enhance billboard monitor setup with explicit configuration and auto-detection 2026-03-26 14:23:33 -04:00
MayaTheShy
fe6a6df6a3 feat: update BILLBOARD_MONITOR comment for clarity on auto-detection 2026-03-26 14:23:29 -04:00
MayaTheShy
c7a1b7066a feat: rename BILLBOARD_MONITOR_SIDE to BILLBOARD_MONITOR for consistency 2026-03-26 14:21:15 -04:00
MayaTheShy
8a50bc586d feat: implement billboard monitor support and remove legacy code 2026-03-26 14:16:23 -04:00
MayaTheShy
b2d55feb98 feat: add collection hopper emptying function to improve item management 2026-03-25 21:53:56 -04:00
MayaTheShy
54cad8b92b feat: add collection hoppers and interval configuration for improved item management 2026-03-25 21:53:51 -04:00
MayaTheShy
62a9ab811d feat: enhance crafting function to support batch processing with ingredient validation 2026-03-25 21:45:39 -04:00
MayaTheShy
1606d60a06 feat: add new crafting recipes for cobblestone and stone variants; enhance auto-crafting logic for excess items 2026-03-25 18:11:23 -04:00
MayaTheShy
f327f82677 feat: implement auto-crafting feature for excess stock management 2026-03-25 18:07:26 -04:00
MayaTheShy
3f79645bb8 feat: add discarding activity flag to state management 2026-03-25 17:47:21 -04:00
MayaTheShy
8468134919 feat: implement auto-discard feature for excess stock management 2026-03-25 17:47:13 -04:00
MayaTheShy
d9638cdc69 feat: add discarding activity to activity string and bottom message 2026-03-25 17:47:05 -04:00
MayaTheShy
2d2b8835b1 feat: add configurable trash droppers and discard interval for stock management 2026-03-25 17:46:58 -04:00
MayaTheShy
e343ab8b4e feat: enhance smelter tab event handling and optimize stock lookup logic 2026-03-22 22:31:39 -04:00
MayaTheShy
8b8279878a Fix craft dispatch: add turtle attach/detach handlers, re-scan on craft, log failures
- Add peripheral_attach handler to auto-detect crafting turtle connecting after boot
- Update peripheral_detach handler to clear craftTurtleName when turtle disconnects
- Re-scan peripherals for turtle in display.lua craft handler if none known
- Add log.warn when craft turtle check fails (was silent notification only)
- Sync ctx.craftTurtleOk from broadcastState so display.lua has current value
2026-03-22 22:26:10 -04:00
MayaTheShy
18bdac03b1 Fix config.lua crash: move _configPath before first use
_configPath was called at lines 26/28 (CACHE_FILE, DISABLED_RECIPES_FILE)
but only defined at line 79. Moved the definition to the top of the
function body so it exists before the first call.
2026-03-22 20:55:33 -04:00
MayaTheShy
173a0a9f95 Persist config files across Opus package updates
The Opus package manager deletes the entire package directory on
update (fs.delete(packageDir)) before re-downloading files. This
wiped all config files (.manager_config, .client_config, etc.) that
were stored inside packages/inventory-manager/.

Fix: add _configPath() helper to every program that resolves config
file paths to usr/config/inventory-manager/ when running under Opus,
which lives outside the package directory and survives updates.
Falls back to the local _path() for standalone (non-Opus) use.

Updated files:
- inventoryManager.lua, manager/config.lua, inventoryClient.lua,
  inventoryWebBridge.lua, dropperController.lua, craftingTurtle.lua
- .package install script: saves configs to usr/config/inventory-manager/
- autorun/startup.lua: checks both persistent and package dirs
- startup/client.lua: uses persistent dir for .client_setup/.dropper_config
- web/server/Dockerfile: switch health check to wget (from prior fix)
2026-03-22 20:51:31 -04:00
MayaTheShy
a6bf84d6b8 fix: update order popup background color to gray 2026-03-22 20:42:08 -04:00
MayaTheShy
aaaf25350c fix: correct item drawing in main page refresh 2026-03-22 20:29:51 -04:00
MayaTheShy
ee76a61240 Refactor turtle status check in smelter page
- Updated the turtle status check logic to use ctx.craftTurtleOk for determining if the crafting turtle is available.
- Adjusted the logic to fall back on checking ctx.craftTurtleName and its peripheral presence if ctx.craftTurtleOk is not set.
2026-03-22 20:20:07 -04:00
MayaTheShy
85228b134b feat: add order quantity popup for item ordering in dashboard 2026-03-22 20:16:01 -04:00
MayaTheShy
d97167b21c Add client_display.lua for network client dashboard using Opus UI
- Implemented a client dashboard mirroring manager/display.lua
- Integrated state management via master broadcasts (ctx.cache, ctx.activity)
- Enabled action commands to master through ctx.sendToMaster()
- Established UI components for inventory management and smelting operations
- Included item filtering, stock tracking, and crafting capabilities
- Designed responsive layouts for main and smelter dashboards
2026-03-22 20:15:53 -04:00
MayaTheShy
02248ccc38 fix: keyboard overlay hidden behind bottom bars due to z-order
Opus initChildren uses pairs() which has non-deterministic ordering.
The keyboard overlay occupies the same screen space as alertBar,
footerBar, and bottomBar. If those bars end up later in the children
array, they render on top and hide the keyboard.

Added raise() after enabling the keyboard to move it to the end
of the children array, ensuring it renders on top.
2026-03-22 20:04:51 -04:00
MayaTheShy
621902b3e8 fix: correct reference to parent page in keyboard toggle event 2026-03-22 19:47:18 -04:00
MayaTheShy
215652d47c feat: reimplement on-screen keyboard for monitor search
UI.TextEntry requires keyboard input which monitors don't have.
Replaced it with the original touch-friendly approach:
- Search bar shows query text with toggle button (? / X)
- Tapping the search row opens an on-screen keyboard overlay
- 3-row QWERTY layout with Bksp, Done, Space, Clr keys
- Keyboard overlays the bottom status bars when active
- All key zones use touch hit-testing for monitor_touch events
2026-03-22 19:22:03 -04:00
MayaTheShy
d4a9441b54 fix: resize pages after re-parenting to monitor device
Page:postInit defaults parent to UI.term (small computer terminal).
Window:postInit then calls setParent() which computes all child
dimensions from that small terminal. When we later re-parent to
the monitor device, the children retain their small dimensions.
Adding resize() before setParent() forces all children to
recompute dimensions from the correct monitor size.
2026-03-22 19:09:49 -04:00
MayaTheShy
5518161adf fix: call enable() on pages after attaching to device
Opus Canvas only renders children with enabled=true. Without
calling page:enable(), all widgets were skipped during render,
resulting in a blank black monitor.
2026-03-22 19:04:20 -04:00
MayaTheShy
4c329bbfb3 debug: add raw monitor write test after sync + fix boot window visible 2026-03-22 19:01:10 -04:00
MayaTheShy
fdc3c36cd7 debug: add diagnostic logging to drawDashboard to trace rendering 2026-03-22 18:58:04 -04:00
MayaTheShy
76772140aa feat: implement parallel inventory scanning and supply chest functionality 2026-03-22 18:15:50 -04:00
MayaTheShy
314fec5c47 feat: add parallel scanning and supply management configuration options 2026-03-22 18:15:43 -04:00
MayaTheShy
6f3a650e69 feat: add Opus autorun script and grid single-click for touch
- Add autorun/startup.lua for Opus package integration:
  - Detects role from config files (.manager_config, .client_config, etc.)
  - Registers reboot listener as kernel hook
  - Launches program via shell.openForegroundTab()
  - Client role also opens dropperController in separate tab

- Override grid eventHandler on actionable grids (itemGrid, smeltTab,
  craftTab) to emit grid_select on single mouse_click, enabling
  monitor touch to trigger actions immediately instead of requiring
  double-click
2026-03-22 17:17:56 -04:00
MayaTheShy
38727c5eeb fix: update selected amount assignment in main page event handling 2026-03-22 17:04:20 -04:00
MayaTheShy
d4a3b1cce9 Add dashboard rendering and touch handlers for inventory management
- Implemented main dashboard UI with item display, status bar, and pagination.
- Added touch zones for item ordering, quantity selection, and search functionality.
- Created smelter dashboard with tabs for status, smelting, crafting, and missing recipes.
- Integrated keyboard input for search queries and item management.
- Enhanced drawing functions for better UI representation and interaction.
2026-03-22 16:56:50 -04:00
MayaTheShy
57fd3e88bc fix: resolve all paths relative to script directory for Opus package compatibility
- Add _baseDir/_path() resolution using shell.getRunningProgram() in all
  entry-point scripts (inventoryManager, inventoryClient, craftingTurtle,
  inventoryWebBridge)
- Pass _path function through to manager/config.lua for data/ and config files
- Config files (.manager_config, .inventory_cache, etc.) now resolve relative
  to the package directory rather than CWD
- Exclude startup/ auto-updater scripts from Opus .package manifest
- All dofile() calls now use _path() for portable path resolution
2026-03-22 16:07:43 -04:00
MayaTheShy
5a99543fd6 Add display module for dashboard rendering and touch handling
- Implemented main dashboard UI with item selection, search functionality, and pagination.
- Added smelter dashboard with furnace status, crafting options, and recipe management.
- Introduced touch handlers for user interactions including item ordering and keyboard input.
- Integrated drawing helpers for UI elements and status messages.
- Established state management for UI updates and interactions.
2026-03-22 11:33:26 -04:00
MayaTheShy
79fdee1e29 Add shared mutable state management and cache implementation in state.lua 2026-03-22 11:31:03 -04:00
MayaTheShy
acfaad67f7 Add peripheral helpers and inventory operations in operations.lua 2026-03-22 11:30:57 -04:00
MayaTheShy
e664102807 Add configuration constants and data structures for inventory management 2026-03-22 11:30:38 -04:00