Add zinit lifecycle to UI binary (hero_aibroker_ui) #23

Open
opened 2026-03-10 09:40:29 +00:00 by timur · 1 comment
Owner

Problem

The server binary (hero_aibroker_openrpc, soon hero_aibroker_server) already has zinit lifecycle CLI subcommands (run, start, stop, serve, status, logs), but the UI/HTTP binary does not.

Per the hero_os reference implementation, both _server and _ui binaries must support the same zinit lifecycle subcommands.

What to do

  1. Add the same CLI subcommand structure to the UI binary:
    • run — start via zinit + stream logs + stop on Ctrl-C
    • start — register with zinit, start in background
    • stop — stop the zinit-managed service
    • serve — actually run the HTTP server (internal, zinit calls this)
    • status / logs — query zinit
  2. Add lifecycle.rs (or reuse from server) with ZinitLifecycle
  3. Update Makefile to use cargo run -p hero_aibroker_ui -- run for UI startup

Reference

## Problem The server binary (`hero_aibroker_openrpc`, soon `hero_aibroker_server`) already has zinit lifecycle CLI subcommands (`run`, `start`, `stop`, `serve`, `status`, `logs`), but the UI/HTTP binary does not. Per the hero_os reference implementation, **both** `_server` and `_ui` binaries must support the same zinit lifecycle subcommands. ## What to do 1. Add the same CLI subcommand structure to the UI binary: - `run` — start via zinit + stream logs + stop on Ctrl-C - `start` — register with zinit, start in background - `stop` — stop the zinit-managed service - `serve` — actually run the HTTP server (internal, zinit calls this) - `status` / `logs` — query zinit 2. Add `lifecycle.rs` (or reuse from server) with `ZinitLifecycle` 3. Update Makefile to use `cargo run -p hero_aibroker_ui -- run` for UI startup ## Reference - hero_os_ui reference: `crates/hero_os_ui/src/main.rs` on `development_timur` branch - Convention: https://forge.ourworld.tf/lhumina_code/home/issues/6 - hero_rpc#7: https://forge.ourworld.tf/lhumina_code/hero_rpc/issues/7
Author
Owner

The server binary already has zinit lifecycle (commits 0c273a0 + 415ac19 on development_timur, PR #21).

The lifecycle.rs module and CLI pattern can be reused directly for the UI binary. The reference implementation is hero_os_ui (crates/hero_os_ui/src/main.rs on development_timur branch of hero_os).

The server binary already has zinit lifecycle (commits `0c273a0` + `415ac19` on `development_timur`, PR #21). The `lifecycle.rs` module and CLI pattern can be reused directly for the UI binary. The reference implementation is `hero_os_ui` (`crates/hero_os_ui/src/main.rs` on `development_timur` branch of hero_os).
Sign in to join this conversation.
No labels
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
lhumina_code/hero_aibroker#23
No description provided.