Add hero_office selfstart CLI (hero_proc_service_selfstart pattern) #2
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_office#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
This repo does not follow the
hero_proc_service_selfstartpattern used by every other Hero service. Specifically:hero_office_server,hero_office_ui,hero_office_sdk,hero_office_examples— no top-levelhero_officeCLI crate.buildenv.shdeclares onlyBINARIES="hero_office_server hero_office_ui".hero_zero/services/hero_office.tomlfurther references a non-existent__HERO_BIN__/hero_officebinary and has no[ui]block.As a consequence,
tools/modules/services/service_office.nuinhero_skillshas to hand-transcribe the full hero_proc action spec (retry policy, kill_other, health checks, env pass-through) rather than delegating to the canonical Rust definition — mirroring howhero_claude,hero_books,hero_agent,hero_voice,hero_collab, and ~8 other services encode it once in Rust.Proposed solution
Add a small top-level
hero_officeCLI crate that follows the selfstart pattern:Scope
crates/hero_office/(lib-less, onesrc/main.rs) added to the workspace members list.[[bin]] name = "hero_office".hero_proc_sdk(git, branchdevelopment) andclap.main.rspattern: identical tohero_claude/crates/hero_claude/src/main.rsorhero_voice/crates/hero_voice/src/bin/hero_voice.rs:clapstruct with--start/--stopflags (conflicting).build_service_definition()that returns aServiceBuildResultwith both actions (hero_office_server,hero_office_ui), their env (RUST_LOG base + the OnlyOffice pass-through vars:ONLYOFFICE_JWT_SECRET,OO_SERVER_URL,CONNECTOR_EXTERNAL_URL,DEFAULT_CONTEXT,HERO_SOCKET_DIR— forwarded only when set), their retry / health / kill_other / stop timeouts, and the service wrapper.self_start()/self_stop()→hero_proc_sdk::lifecycle::restart_service/stop_service.buildenv.sh→BINARIES="hero_office hero_office_server hero_office_ui".Cargo.toml[workspace].membersto includecrates/hero_office.README.mdwith thehero_office --start/--stopusage block.scripts/nu_service.nuto delegate tohero_office --start/--stopinstead of duplicating the spec, OR simply note that it's a legacy pre-selfstart path.Reference exemplars
lhumina_code/hero_claude/crates/hero_claude/src/main.rs— closest match (single service, two actions, soft preflight env).lhumina_code/hero_voice/crates/hero_voice/src/bin/hero_voice.rs— even cleaner shape for the two-binary case.lhumina_code/hero_agent/crates/hero_agent_daemon/src/main.rs— shows the_daemoncrate naming if a separate crate is preferred.Downstream effect
Once this lands,
tools/modules/services/service_office.nuinhero_skillscan be refactored to a thin delegator (~150 lines instead of ~400), removing the drift risk noted inhero_skills/issues/99.See the
hero_proc_service_selfstartskill for the canonical pattern description.Refs: lhumina_code/hero_skills#75