service_shrimp.nu — hero_shrimp lifecycle module #155

Open
opened 2026-04-28 09:35:11 +00:00 by mahmoud · 0 comments
Owner

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

Scope

  • Module file: tools/modules/services/service_shrimp.nu
  • Follow the standard pattern documented in the nu_service and nu_service_use skills.
  • Template to copy from: service_codescalers.nu — user-level Rust multi-binary that selfstarts via hero_proc; same shape as the hero_shrimp manager.
  • Source repo: hero_shrimp.

Service-specific notes

  • Pure Rust workspace; build via cargo build --release.
  • Four binaries to install to ~/hero/bin/: hero_shrimp, hero_shrimp_server, hero_shrimp_cli, hero_shrimp_ui (per the repo's buildenv.sh::BINARIES).
  • hero_shrimp is the lifecycle manager — it registers and starts hero_shrimp_server / hero_shrimp_ui via the hero_proc_service_selfstart pattern.
  • User-level service. No privileged ports, no --root.
  • Sockets bind under ~/hero/var/sockets/hero_shrimp/ (rpc.sock, admin.sock, ui.sock) — already canonical.
  • SQLite database under $SHRIMP_DATA_DIR (default ~/hero/var/data/hero_shrimp/).
  • At least one LLM provider key must be present in env or $SHRIMP_HOME/secrets.env: OPENROUTER_API_KEYS is the bundled default; OPENAI_API_KEYS, ANTHROPIC_API_KEYS, GROQ_API_KEYS, SAMBANOVA_API_KEYS are also honoured. Daemon boots without one but the first chat fails with "no providers configured".
  • Optional config: shrimp.yml (channels, models, backends) — auto-discovered, with a compiled-in default. The nu module shouldn't generate this — let users opt in.
  • Reference systemd unit at hero_shrimp/deploy/shrimp-daemon.service shows the lifecycle shape to mirror.

Acceptance criteria

  1. use services/mod.nu * makes service_shrimp available.
  2. On a target host:
    • service_shrimp install clones the repo, runs the appropriate build, and copies binaries to ~/hero/bin/.
    • service_shrimp start [--reset] registers with hero_proc and becomes healthy.
    • service_shrimp status reports the state.
    • service_shrimp stop cleanly unregisters.
  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
  • Self-start pattern: hero_proc_service_selfstart
Add `service_shrimp.nu` per the tracker in #75. Module exposes `install | start [--reset] | stop | status` for the `hero_shrimp` stack. ## Scope - Module file: `tools/modules/services/service_shrimp.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_codescalers.nu` — user-level Rust multi-binary that selfstarts via hero_proc; same shape as the hero_shrimp manager. - Source repo: [`hero_shrimp`](https://forge.ourworld.tf/lhumina_code/hero_shrimp). ## Service-specific notes - Pure Rust workspace; build via `cargo build --release`. - Four binaries to install to `~/hero/bin/`: `hero_shrimp`, `hero_shrimp_server`, `hero_shrimp_cli`, `hero_shrimp_ui` (per the repo's `buildenv.sh::BINARIES`). - `hero_shrimp` is the lifecycle manager — it registers and starts `hero_shrimp_server` / `hero_shrimp_ui` via the [`hero_proc_service_selfstart`](../../src/branch/development/claude/skills/hero_proc_service_selfstart/SKILL.md) pattern. - **User-level** service. No privileged ports, no `--root`. - Sockets bind under `~/hero/var/sockets/hero_shrimp/` (`rpc.sock`, `admin.sock`, `ui.sock`) — already canonical. - SQLite database under `$SHRIMP_DATA_DIR` (default `~/hero/var/data/hero_shrimp/`). - At least one LLM provider key must be present in env or `$SHRIMP_HOME/secrets.env`: `OPENROUTER_API_KEYS` is the bundled default; `OPENAI_API_KEYS`, `ANTHROPIC_API_KEYS`, `GROQ_API_KEYS`, `SAMBANOVA_API_KEYS` are also honoured. Daemon boots without one but the first chat fails with "no providers configured". - Optional config: `shrimp.yml` (channels, models, backends) — auto-discovered, with a compiled-in default. The nu module shouldn't generate this — let users opt in. - Reference systemd unit at `hero_shrimp/deploy/shrimp-daemon.service` shows the lifecycle shape to mirror. ## Acceptance criteria 1. `use services/mod.nu *` makes `service_shrimp` available. 2. On a target host: - `service_shrimp install` clones the repo, runs the appropriate build, and copies binaries to `~/hero/bin/`. - `service_shrimp start [--reset]` registers with hero_proc and becomes healthy. - `service_shrimp status` reports the state. - `service_shrimp stop` cleanly unregisters. 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` - Self-start pattern: `hero_proc_service_selfstart`
mahmoud self-assigned this 2026-04-28 09:35:11 +00:00
mahmoud changed title from service_shrimp.nu — hero_shrimp (Bun/TS runtime) lifecycle module to service_shrimp.nu — hero_shrimp lifecycle module 2026-04-28 09:54:02 +00:00
mahmoud removed their assignment 2026-04-28 10:04:10 +00:00
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#155
No description provided.