Livekit single crate to start, stop, install, etc in hero_proc services #1

Closed
opened 2026-04-19 20:59:28 +00:00 by mahmoud · 4 comments
Owner
see https://forge.ourworld.tf/lhumina_code/hero_skills/src/branch/development/claude/skills/hero_proc_service_selfstart
mahmoud added this to the ACTIVE project 2026-04-19 20:59:38 +00:00
Member

Implementation Spec for Issue #1

Objective

Wire up the auto-generated hero_livekit single-binary orchestrator so it compiles and works with hero_proc for lifecycle management (--start/--stop). The binary already exists at crates/hero_livekit/src/bin/hero_livekit.rs (generated by single_bin() in build.rs) but is disabled (autobins = false, no [[bin]] section, missing dependencies).

Requirements

  • Enable the hero_livekit binary by adding [[bin]] section and required dependencies
  • Refactor hero_livekit_ui into a library + binary so the single-binary can embed the UI router
  • The hero_livekit binary supports --start (register with hero_proc), --stop (stop via hero_proc), and plain foreground mode
  • Update Makefile install targets to include the new binary

Files to Modify/Create

  • crates/hero_livekit_ui/src/lib.rs (new) -- Library exporting build_router() and UiMeta
  • crates/hero_livekit_ui/src/main.rs -- Simplify to call library
  • crates/hero_livekit_ui/Cargo.toml -- Add [lib] section
  • crates/hero_livekit/Cargo.toml -- Add [[bin]] section and dependencies
  • Makefile -- Add hero_livekit to install/installdev targets

Implementation Plan

Step 1: Refactor hero_livekit_ui into lib + bin

  • Create lib.rs exporting UiMeta struct, build_router function, and all route handlers
  • Simplify main.rs to use the library
  • Add [lib] section to Cargo.toml

Step 2: Wire up hero_livekit binary

  • Add bin section and dependencies to crates/hero_livekit/Cargo.toml
  • Add hero_livekit to Makefile install targets

Step 3: Build and test

Acceptance Criteria

  • cargo build -p hero_livekit --bin hero_livekit compiles successfully
  • hero_livekit --help shows --start, --stop, --contexts flags
  • hero_livekit_ui standalone binary still works
  • Makefile install targets include hero_livekit
  • All existing tests pass
## Implementation Spec for Issue #1 ### Objective Wire up the auto-generated `hero_livekit` single-binary orchestrator so it compiles and works with hero_proc for lifecycle management (--start/--stop). The binary already exists at `crates/hero_livekit/src/bin/hero_livekit.rs` (generated by `single_bin()` in build.rs) but is disabled (`autobins = false`, no `[[bin]]` section, missing dependencies). ### Requirements - Enable the `hero_livekit` binary by adding `[[bin]]` section and required dependencies - Refactor `hero_livekit_ui` into a library + binary so the single-binary can embed the UI router - The `hero_livekit` binary supports `--start` (register with hero_proc), `--stop` (stop via hero_proc), and plain foreground mode - Update Makefile install targets to include the new binary ### Files to Modify/Create - `crates/hero_livekit_ui/src/lib.rs` (new) -- Library exporting `build_router()` and `UiMeta` - `crates/hero_livekit_ui/src/main.rs` -- Simplify to call library - `crates/hero_livekit_ui/Cargo.toml` -- Add `[lib]` section - `crates/hero_livekit/Cargo.toml` -- Add `[[bin]]` section and dependencies - `Makefile` -- Add `hero_livekit` to install/installdev targets ### Implementation Plan #### Step 1: Refactor hero_livekit_ui into lib + bin - Create lib.rs exporting UiMeta struct, build_router function, and all route handlers - Simplify main.rs to use the library - Add [lib] section to Cargo.toml #### Step 2: Wire up hero_livekit binary - Add [[bin]] section and dependencies to crates/hero_livekit/Cargo.toml - Add hero_livekit to Makefile install targets #### Step 3: Build and test ### Acceptance Criteria - [ ] `cargo build -p hero_livekit --bin hero_livekit` compiles successfully - [ ] `hero_livekit --help` shows --start, --stop, --contexts flags - [ ] `hero_livekit_ui` standalone binary still works - [ ] Makefile install targets include hero_livekit - [ ] All existing tests pass
Member

Test Results

  • Total: 34
  • Passed: 34
  • Failed: 0

The hero_livekit binary builds and all workspace tests pass. The --help output confirms --start, --stop, --contexts, --seed-dir, --seed-domains flags are available.

## Test Results - Total: 34 - Passed: 34 - Failed: 0 The hero_livekit binary builds and all workspace tests pass. The --help output confirms --start, --stop, --contexts, --seed-dir, --seed-domains flags are available.
Member

Implementation Summary

Changes Made

hero_livekit_ui refactored into lib + bin:

  • Created crates/hero_livekit_ui/src/lib.rs exporting UiMeta, build_router(), bind_unix_socket(), ui_socket_path(), service_socket_path()
  • Simplified crates/hero_livekit_ui/src/main.rs to use the library
  • Added [lib] section to crates/hero_livekit_ui/Cargo.toml
  • Downgraded axum from 0.8 to 0.7 to match hero_rpc_server's Router type
  • Added WhitelistState::new_blocking() for synchronous initialization in embedded mode

hero_livekit binary enabled:

  • Added [[bin]] section and dependencies (hero_rpc_server, hero_livekit_ui, clap, tracing-subscriber, axum) to crates/hero_livekit/Cargo.toml
  • Removed autobins = false
  • Fixed fn item to fn pointer coercion in the auto-generated binary
  • Added hero_livekit_ui as workspace dependency

Makefile updated:

  • Added hero_livekit binary to install/installdev targets

Result

The hero_livekit binary now supports the hero_proc_service_selfstart pattern:

  • hero_livekit --start registers with hero_proc and starts
  • hero_livekit --stop stops via hero_proc
  • hero_livekit (no flags) runs foreground (hero_proc launches it this way)
  • The standalone hero_livekit_ui binary continues to work independently
## Implementation Summary ### Changes Made **hero_livekit_ui refactored into lib + bin:** - Created `crates/hero_livekit_ui/src/lib.rs` exporting `UiMeta`, `build_router()`, `bind_unix_socket()`, `ui_socket_path()`, `service_socket_path()` - Simplified `crates/hero_livekit_ui/src/main.rs` to use the library - Added `[lib]` section to `crates/hero_livekit_ui/Cargo.toml` - Downgraded axum from 0.8 to 0.7 to match hero_rpc_server's Router type - Added `WhitelistState::new_blocking()` for synchronous initialization in embedded mode **hero_livekit binary enabled:** - Added `[[bin]]` section and dependencies (hero_rpc_server, hero_livekit_ui, clap, tracing-subscriber, axum) to `crates/hero_livekit/Cargo.toml` - Removed `autobins = false` - Fixed fn item to fn pointer coercion in the auto-generated binary - Added `hero_livekit_ui` as workspace dependency **Makefile updated:** - Added `hero_livekit` binary to install/installdev targets ### Result The `hero_livekit` binary now supports the hero_proc_service_selfstart pattern: - `hero_livekit --start` registers with hero_proc and starts - `hero_livekit --stop` stops via hero_proc - `hero_livekit` (no flags) runs foreground (hero_proc launches it this way) - The standalone `hero_livekit_ui` binary continues to work independently
Member

Pull request opened: #28

This PR implements the changes discussed in this issue.

Pull request opened: https://forge.ourworld.tf/lhumina_code/hero_livekit/pulls/28 This PR implements the changes discussed in this issue.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
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_livekit#1
No description provided.