service_editor.nu — hero_editor lifecycle module #156

Open
opened 2026-04-28 09:35:12 +00:00 by mahmoud · 1 comment
Owner

Add service_editor.nu per the tracker in #75. Module exposes install | start [--reset] | stop | status for the hero_editor stack.

Scope

  • Module file: tools/modules/services/service_editor.nu
  • Follow the standard pattern documented in the nu_service and nu_service_use skills.
  • Template to copy from: service_browser.nu (user-level) — but note hero_editor has no manager binary, so register the server + UI as two separate hero_proc actions.
  • Source repo: hero_editor.

Service-specific notes

  • Hybrid Rust + JS workspace. The Rust workspace builds the backend server and UI host; a JavaScript web component (CodeMirror 5 + marked.js + highlight.js) is bundled into the binary at build time.
  • Two binaries to install to ~/hero/bin/ (per buildenv.sh::BINARIES): hero_editor_server, hero_editor_ui. There is no hero_editor manager binary, so the service_editor.nu module must register both binaries directly with hero_proc (no selfstart umbrella).
  • User-level service. buildenv.sh::PORTS="" — no privileged ports. No --root.
  • Build-time prerequisite: bun is required to minify the JavaScript web component (scripts/minify.js). Reuse the existing installers.nu::install_bun helper (already used by service_books.nu); call it from the module's install step the same way.
  • Backend HTTP listener: TCP 2769 in standalone dev. For hero_proc deployment, confirm whether the binaries can bind a Unix socket under ~/hero/var/sockets/hero_editor/ — if not, a small repo-level change is needed (a sibling task, not blocking this issue).
  • Crates: hero_editor_server, hero_editor_sdk, hero_editor_ui, hero_editor_examples (the canonical four-crate hero_skills layout).
  • Build commands: make install then make run is the dev path; the nu module's install should run cargo build --release plus the bun bundle/minify step (or the make install that wraps both).

Acceptance criteria

  1. use services/mod.nu * makes service_editor available.
  2. On a target host:
    • service_editor install clones the repo, ensures bun is present (via install_bun), runs the bundle/minify + cargo build, and copies hero_editor_server + hero_editor_ui to ~/hero/bin/.
    • service_editor start [--reset] registers both binaries as separate hero_proc actions and becomes healthy.
    • service_editor status reports state for both.
    • service_editor stop cleanly unregisters both.
  3. The start output prints sockets / UI URL / a short test plan, per the nu_service_use skill.

References

  • Parent tracker: #75
  • Pattern skills: nu_service, nu_service_use
  • bun installer helper: installers.nu::install_bun (precedent in #137 / service_books.nu)
Add `service_editor.nu` per the tracker in #75. Module exposes `install | start [--reset] | stop | status` for the `hero_editor` stack. ## Scope - Module file: `tools/modules/services/service_editor.nu` - Follow the standard pattern documented in the [`nu_service`](../../src/branch/development/claude/skills/nu_service/SKILL.md) and [`nu_service_use`](../../src/branch/development/claude/skills/nu_service_use/SKILL.md) skills. - Template to copy from: `service_browser.nu` (user-level) — but note hero_editor has **no manager binary**, so register the server + UI as two separate hero_proc actions. - Source repo: [`hero_editor`](https://forge.ourworld.tf/lhumina_code/hero_editor). ## Service-specific notes - **Hybrid Rust + JS workspace.** The Rust workspace builds the backend server and UI host; a JavaScript web component (CodeMirror 5 + marked.js + highlight.js) is bundled into the binary at build time. - Two binaries to install to `~/hero/bin/` (per `buildenv.sh::BINARIES`): `hero_editor_server`, `hero_editor_ui`. **There is no `hero_editor` manager binary**, so the `service_editor.nu` module must register both binaries directly with hero_proc (no selfstart umbrella). - **User-level service.** `buildenv.sh::PORTS=""` — no privileged ports. No `--root`. - Build-time prerequisite: **bun** is required to minify the JavaScript web component (`scripts/minify.js`). Reuse the existing `installers.nu::install_bun` helper (already used by `service_books.nu`); call it from the module's `install` step the same way. - Backend HTTP listener: TCP `2769` in standalone dev. For hero_proc deployment, confirm whether the binaries can bind a Unix socket under `~/hero/var/sockets/hero_editor/` — if not, a small repo-level change is needed (a sibling task, not blocking this issue). - Crates: `hero_editor_server`, `hero_editor_sdk`, `hero_editor_ui`, `hero_editor_examples` (the canonical four-crate hero_skills layout). - Build commands: `make install` then `make run` is the dev path; the nu module's `install` should run `cargo build --release` plus the `bun` bundle/minify step (or the `make install` that wraps both). ## Acceptance criteria 1. `use services/mod.nu *` makes `service_editor` available. 2. On a target host: - `service_editor install` clones the repo, ensures bun is present (via `install_bun`), runs the bundle/minify + cargo build, and copies `hero_editor_server` + `hero_editor_ui` to `~/hero/bin/`. - `service_editor start [--reset]` registers both binaries as separate hero_proc actions and becomes healthy. - `service_editor status` reports state for both. - `service_editor stop` cleanly unregisters both. 3. The `start` output prints sockets / UI URL / a short test plan, per the `nu_service_use` skill. ## References - Parent tracker: #75 - Pattern skills: `nu_service`, `nu_service_use` - bun installer helper: `installers.nu::install_bun` (precedent in #137 / `service_books.nu`)
mahmoud self-assigned this 2026-04-28 09:35:12 +00:00
mahmoud removed their assignment 2026-04-28 10:04:15 +00:00
Author
Owner

Updated scope after research on the actual repo. Hero_editor is hybrid Rust + JS — two Rust binaries (hero_editor_server + hero_editor_ui, no manager), with a JavaScript web component (CodeMirror + marked + highlight.js) minified at build time via bun. The bun dependency is build-time only and matches the install_bun precedent from service_books.nu (#137). User-level service confirmed (PORTS="").

Updated scope after research on the actual repo. Hero_editor is hybrid Rust + JS — two Rust binaries (`hero_editor_server` + `hero_editor_ui`, no manager), with a JavaScript web component (CodeMirror + marked + highlight.js) minified at build time via bun. The bun dependency is build-time only and matches the `install_bun` precedent from `service_books.nu` (#137). User-level service confirmed (`PORTS=""`).
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
lhumina_code/hero_skills#156
No description provided.