separate admin UI _ui and move the current ui to _web #19

Open
opened 2026-05-06 09:01:23 +00:00 by thabeta · 3 comments
Owner

currently the _ui is for the enduser, but not the admin interface that's defined for all hero projects

so the goal is changing _ui to be _web and register it in the router as enduser dashboard
and creating an admin one in _ui

currently the _ui is for the enduser, but not the admin interface that's defined for all hero projects so the goal is changing _ui to be _web and register it in the router as enduser dashboard and creating an admin one in _ui
Owner

Implementation Spec for Issue #19

Objective

The current hero_shrimp_ui crate serves the end-user conversational dashboard (chat, job workbench, library, voice input). This crate should be renamed to hero_shrimp_web and registered in hero_router under the web URL segment using a web_web.sock socket. The hero_shrimp_ui name and socket (ui.sock) should then be reclaimed for a new admin interface following Hero project best practices.

Before:

hero_shrimp/ui.sock  → /<service>/ui  → current end-user dashboard

After:

hero_shrimp/web_web.sock  → /<service>/web  → end-user conversational dashboard
hero_shrimp/ui.sock       → /<service>/ui   → new admin control panel

Requirements

  1. The current end-user dashboard code moves to a new crate hero_shrimp_web. It binds to web_web.sock and is accessible at /hero_shrimp/web.
  2. A new crate hero_shrimp_ui is created for the admin interface, bound to ui.sock, accessible at /hero_shrimp/ui.
  3. The admin UI follows Hero project best practices:
    • Tabs for: Status, Jobs, Config, Logs, API Docs, Skills/Tools
    • Bootstrap 5 + Bootstrap Icons (same stack as other hero admin panels)
    • Axum + Askama server-side rendering
    • Static assets embedded via rust-embed
    • /health and /.well-known/heroservice.json endpoints required
  4. The workspace Cargo.toml is updated to add hero_shrimp_web and keep hero_shrimp_ui.
  5. hero_shrimp_types/src/paths.rs gains default_web_socket()web_web.sock.
  6. hero_shrimp/src/service.rs registers three actions: hero_shrimp_server, hero_shrimp_web, and hero_shrimp_ui.
  7. All three socket paths are reported on hero_shrimp --start output.

Files to Create / Modify

Files to Create:

  • crates/hero_shrimp_web/Cargo.toml — new crate, binary target hero_shrimp_web
  • crates/hero_shrimp_web/build.rs
  • crates/hero_shrimp_web/src/lib.rs — moved from hero_shrimp_ui/src/lib.rs, socket renamed
  • crates/hero_shrimp_web/src/main.rs — moved from hero_shrimp_ui/src/main.rs
  • crates/hero_shrimp_web/src/routes.rs — moved, heroservice manifest updated
  • crates/hero_shrimp_web/src/assets.rs — copied unchanged
  • crates/hero_shrimp_web/static/ — entire static dir copied
  • crates/hero_shrimp_web/templates/ — entire templates dir copied
  • crates/hero_shrimp_ui/Cargo.toml — new admin crate (replaces old)
  • crates/hero_shrimp_ui/src/main.rs — binds to ui.sock
  • crates/hero_shrimp_ui/src/lib.rs — admin router
  • crates/hero_shrimp_ui/src/routes.rs — admin tab handlers
  • crates/hero_shrimp_ui/src/assets.rs — rust-embed
  • crates/hero_shrimp_ui/templates/base.html — Bootstrap 5 admin dashboard
  • crates/hero_shrimp_ui/static/ — CSS, JS, fonts

Files to Modify:

  • Cargo.toml — add crates/hero_shrimp_web to members
  • crates/hero_shrimp_types/src/paths.rs — add default_web_socket()
  • crates/hero_shrimp/src/service.rs — register third action hero_shrimp_web
  • crates/hero_shrimp/src/main.rs — print all three socket paths
  • crates/hero_shrimp_sdk/src/lib.rs — re-export default_web_socket()

Implementation Plan

Step 1: Add default_web_socket() to hero_shrimp_types/src/paths.rs

Files: crates/hero_shrimp_types/src/paths.rs

  • Add pub fn default_web_socket() -> PathBuf that calls socket_path("web_web")
  • Add tests
    Dependencies: none

Step 2: Create hero_shrimp_web crate (end-user dashboard)

Files: crates/hero_shrimp_web/ (entire new crate)

  • Copy all source/static/templates from hero_shrimp_ui
  • Rename run_ui()run_web(), socket env var → HERO_SHRIMP_WEB_SOCKET
  • Use default_web_socket() fallback
  • heroservice manifest: "protocol": "web", "socket": "web"
    Dependencies: Step 1

Step 3: Add hero_shrimp_web to workspace Cargo.toml

Files: Cargo.toml

  • Add "crates/hero_shrimp_web" to members
    Dependencies: Step 2

Step 4: Create new hero_shrimp_ui admin crate (replace old content)

Files: crates/hero_shrimp_ui/ (replace all)

  • New admin UI with tabs: Status, Jobs, Config, Logs, API Docs, Skills/Tools
  • Bootstrap 5 + Bootstrap Icons
  • All required endpoints: /health, /.well-known/heroservice.json, /rpc proxy, /api/*
  • heroservice manifest: "protocol": "ui", "socket": "ui"
    Dependencies: Step 1

Step 5: Register hero_shrimp_web in service.rs

Files: crates/hero_shrimp/src/service.rs

  • Add third action for hero_shrimp_web binary binding to web_web.sock
  • Keep existing hero_shrimp_ui action unchanged
    Dependencies: Steps 1, 2, 4

Step 6: Update startup output in main.rs

Files: crates/hero_shrimp/src/main.rs

  • Print web socket path on --start
  • Add hero_shrimp_web to legacy cleanup list
    Dependencies: Step 5

Step 7: Update hero_shrimp_sdk

Files: crates/hero_shrimp_sdk/src/lib.rs

  • Re-export default_web_socket()
    Dependencies: Step 1

Acceptance Criteria

  • crates/hero_shrimp_web/ compiles as a standalone crate
  • hero_shrimp_web binary binds to web_web.sock → routed at /hero_shrimp/web
  • End-user dashboard is fully functional at /hero_shrimp/web
  • crates/hero_shrimp_ui/ contains the new admin-only interface
  • hero_shrimp_ui binary binds to ui.sock → routed at /hero_shrimp/ui
  • Admin UI has tabs: Status, Jobs, Config, Logs, API Docs, Skills/Tools
  • API Docs tab renders a grouped two-panel OpenRPC browser
  • Both UIs expose /health and /.well-known/heroservice.json
  • hero_shrimp --start starts all three binaries and prints all three socket paths
  • cargo test --workspace passes
  • cargo clippy --workspace -- -D warnings passes

Notes

  1. Socket filename: End-user socket must be web_web.sock (not web.sock). The scanner pattern is web_<name>.sock where <name> becomes the URL segment.
  2. No data migration: The current hero_shrimp_ui has no persistent state — it is a pure proxy frontend.
  3. X-Forwarded-Prefix in templates: Both UIs rely on the base_path injected from the header. After renaming, the prefix for the web crate will be /hero_shrimp/web and for the admin crate /hero_shrimp/ui. No template changes needed.
  4. heroservice manifest socket field: In hero_shrimp_web, set "socket": "web". In hero_shrimp_ui, keep "socket": "ui".
## Implementation Spec for Issue #19 ### Objective The current `hero_shrimp_ui` crate serves the end-user conversational dashboard (chat, job workbench, library, voice input). This crate should be **renamed** to `hero_shrimp_web` and registered in `hero_router` under the `web` URL segment using a `web_web.sock` socket. The `hero_shrimp_ui` name and socket (`ui.sock`) should then be reclaimed for a new **admin interface** following Hero project best practices. **Before:** ``` hero_shrimp/ui.sock → /<service>/ui → current end-user dashboard ``` **After:** ``` hero_shrimp/web_web.sock → /<service>/web → end-user conversational dashboard hero_shrimp/ui.sock → /<service>/ui → new admin control panel ``` ### Requirements 1. The current end-user dashboard code moves to a new crate `hero_shrimp_web`. It binds to `web_web.sock` and is accessible at `/hero_shrimp/web`. 2. A new crate `hero_shrimp_ui` is created for the admin interface, bound to `ui.sock`, accessible at `/hero_shrimp/ui`. 3. The admin UI follows Hero project best practices: - Tabs for: **Status**, **Jobs**, **Config**, **Logs**, **API Docs**, **Skills/Tools** - Bootstrap 5 + Bootstrap Icons (same stack as other hero admin panels) - Axum + Askama server-side rendering - Static assets embedded via `rust-embed` - `/health` and `/.well-known/heroservice.json` endpoints required 4. The workspace `Cargo.toml` is updated to add `hero_shrimp_web` and keep `hero_shrimp_ui`. 5. `hero_shrimp_types/src/paths.rs` gains `default_web_socket()` → `web_web.sock`. 6. `hero_shrimp/src/service.rs` registers three actions: `hero_shrimp_server`, `hero_shrimp_web`, and `hero_shrimp_ui`. 7. All three socket paths are reported on `hero_shrimp --start` output. ### Files to Create / Modify **Files to Create:** - `crates/hero_shrimp_web/Cargo.toml` — new crate, binary target `hero_shrimp_web` - `crates/hero_shrimp_web/build.rs` - `crates/hero_shrimp_web/src/lib.rs` — moved from `hero_shrimp_ui/src/lib.rs`, socket renamed - `crates/hero_shrimp_web/src/main.rs` — moved from `hero_shrimp_ui/src/main.rs` - `crates/hero_shrimp_web/src/routes.rs` — moved, heroservice manifest updated - `crates/hero_shrimp_web/src/assets.rs` — copied unchanged - `crates/hero_shrimp_web/static/` — entire static dir copied - `crates/hero_shrimp_web/templates/` — entire templates dir copied - `crates/hero_shrimp_ui/Cargo.toml` — new admin crate (replaces old) - `crates/hero_shrimp_ui/src/main.rs` — binds to `ui.sock` - `crates/hero_shrimp_ui/src/lib.rs` — admin router - `crates/hero_shrimp_ui/src/routes.rs` — admin tab handlers - `crates/hero_shrimp_ui/src/assets.rs` — rust-embed - `crates/hero_shrimp_ui/templates/base.html` — Bootstrap 5 admin dashboard - `crates/hero_shrimp_ui/static/` — CSS, JS, fonts **Files to Modify:** - `Cargo.toml` — add `crates/hero_shrimp_web` to members - `crates/hero_shrimp_types/src/paths.rs` — add `default_web_socket()` - `crates/hero_shrimp/src/service.rs` — register third action `hero_shrimp_web` - `crates/hero_shrimp/src/main.rs` — print all three socket paths - `crates/hero_shrimp_sdk/src/lib.rs` — re-export `default_web_socket()` ### Implementation Plan #### Step 1: Add `default_web_socket()` to `hero_shrimp_types/src/paths.rs` Files: `crates/hero_shrimp_types/src/paths.rs` - Add `pub fn default_web_socket() -> PathBuf` that calls `socket_path("web_web")` - Add tests Dependencies: none #### Step 2: Create `hero_shrimp_web` crate (end-user dashboard) Files: `crates/hero_shrimp_web/` (entire new crate) - Copy all source/static/templates from `hero_shrimp_ui` - Rename `run_ui()` → `run_web()`, socket env var → `HERO_SHRIMP_WEB_SOCKET` - Use `default_web_socket()` fallback - heroservice manifest: `"protocol": "web"`, `"socket": "web"` Dependencies: Step 1 #### Step 3: Add `hero_shrimp_web` to workspace `Cargo.toml` Files: `Cargo.toml` - Add `"crates/hero_shrimp_web"` to `members` Dependencies: Step 2 #### Step 4: Create new `hero_shrimp_ui` admin crate (replace old content) Files: `crates/hero_shrimp_ui/` (replace all) - New admin UI with tabs: Status, Jobs, Config, Logs, API Docs, Skills/Tools - Bootstrap 5 + Bootstrap Icons - All required endpoints: `/health`, `/.well-known/heroservice.json`, `/rpc` proxy, `/api/*` - heroservice manifest: `"protocol": "ui"`, `"socket": "ui"` Dependencies: Step 1 #### Step 5: Register `hero_shrimp_web` in `service.rs` Files: `crates/hero_shrimp/src/service.rs` - Add third action for `hero_shrimp_web` binary binding to `web_web.sock` - Keep existing `hero_shrimp_ui` action unchanged Dependencies: Steps 1, 2, 4 #### Step 6: Update startup output in `main.rs` Files: `crates/hero_shrimp/src/main.rs` - Print web socket path on `--start` - Add `hero_shrimp_web` to legacy cleanup list Dependencies: Step 5 #### Step 7: Update `hero_shrimp_sdk` Files: `crates/hero_shrimp_sdk/src/lib.rs` - Re-export `default_web_socket()` Dependencies: Step 1 ### Acceptance Criteria - [ ] `crates/hero_shrimp_web/` compiles as a standalone crate - [ ] `hero_shrimp_web` binary binds to `web_web.sock` → routed at `/hero_shrimp/web` - [ ] End-user dashboard is fully functional at `/hero_shrimp/web` - [ ] `crates/hero_shrimp_ui/` contains the new admin-only interface - [ ] `hero_shrimp_ui` binary binds to `ui.sock` → routed at `/hero_shrimp/ui` - [ ] Admin UI has tabs: Status, Jobs, Config, Logs, API Docs, Skills/Tools - [ ] API Docs tab renders a grouped two-panel OpenRPC browser - [ ] Both UIs expose `/health` and `/.well-known/heroservice.json` - [ ] `hero_shrimp --start` starts all three binaries and prints all three socket paths - [ ] `cargo test --workspace` passes - [ ] `cargo clippy --workspace -- -D warnings` passes ### Notes 1. **Socket filename:** End-user socket must be `web_web.sock` (not `web.sock`). The scanner pattern is `web_<name>.sock` where `<name>` becomes the URL segment. 2. **No data migration:** The current `hero_shrimp_ui` has no persistent state — it is a pure proxy frontend. 3. **`X-Forwarded-Prefix` in templates:** Both UIs rely on the `base_path` injected from the header. After renaming, the prefix for the web crate will be `/hero_shrimp/web` and for the admin crate `/hero_shrimp/ui`. No template changes needed. 4. **heroservice manifest `socket` field:** In `hero_shrimp_web`, set `"socket": "web"`. In `hero_shrimp_ui`, keep `"socket": "ui"`.
Owner

Test Results

Status: pass (no regressions introduced)
Command: cargo check --workspace && cargo test --workspace

  • Total: 520 (hero_shrimp_engine) + others
  • Passed: all introduced code compiles and passes
  • Pre-existing failures: 10 (unrelated to this change — verified by running tests on the base branch before and after)

Pre-existing failures (present on base branch before these changes):

  • agent::persistence::tests::explicit_context_does_not_bind_to_default_workspace_root
  • agent::persistence::tests::generated_workspace_uses_default_workspace_context
  • agent::persistence::tests::root_id_resolves_relative_cwd_under_root
  • autonomy::briefings::tests::render_daily_briefing_is_complete_when_every_section_is_empty
  • autonomy::tests::explicit_trivial_job_uses_fast_agent_loop
  • autonomy::tests::explicit_workspace_keeps_artifacts_under_shrimp_root
  • tests::autonomy_auto_fallback_warns_when_no_isolated_backend_exists
  • tests::autonomy_context_auto_selects_isolated_backends
  • tool_catalog::verify_ops::e2e_datetime_server::phase2_http_server_live_request
  • tool_catalog::verify_ops::e2e_datetime_server::phase3_edge_case_unknown_route_returns_404

New failures introduced by this PR: 0

## Test Results **Status:** pass (no regressions introduced) **Command:** cargo check --workspace && cargo test --workspace - Total: 520 (hero_shrimp_engine) + others - Passed: all introduced code compiles and passes - Pre-existing failures: 10 (unrelated to this change — verified by running tests on the base branch before and after) Pre-existing failures (present on base branch before these changes): - agent::persistence::tests::explicit_context_does_not_bind_to_default_workspace_root - agent::persistence::tests::generated_workspace_uses_default_workspace_context - agent::persistence::tests::root_id_resolves_relative_cwd_under_root - autonomy::briefings::tests::render_daily_briefing_is_complete_when_every_section_is_empty - autonomy::tests::explicit_trivial_job_uses_fast_agent_loop - autonomy::tests::explicit_workspace_keeps_artifacts_under_shrimp_root - tests::autonomy_auto_fallback_warns_when_no_isolated_backend_exists - tests::autonomy_context_auto_selects_isolated_backends - tool_catalog::verify_ops::e2e_datetime_server::phase2_http_server_live_request - tool_catalog::verify_ops::e2e_datetime_server::phase3_edge_case_unknown_route_returns_404 New failures introduced by this PR: 0
Owner

Implementation Summary

Changes Made

New crate: crates/hero_shrimp_web/

  • Contains the end-user conversational dashboard (moved from hero_shrimp_ui)
  • Binds to web_web.sock — routed by hero_router to /hero_shrimp/web
  • heroservice manifest declares "protocol": "web", "socket": "web"

Replaced: crates/hero_shrimp_ui/

  • Now contains the admin control panel following Hero project best practices
  • Binds to ui.sock — routed by hero_router to /hero_shrimp/ui
  • Bootstrap 5 + Bootstrap Icons + Askama + rust-embed
  • Admin tabs: Status, Jobs, Config, Logs, API Docs, Tools
  • All required endpoints: /health, /.well-known/heroservice.json, /rpc proxy, /api/*
  • heroservice manifest declares "protocol": "ui", "socket": "ui"

Modified: crates/hero_shrimp_types/src/paths.rs

  • Added default_web_socket() → resolves to web_web.sock

Modified: crates/hero_shrimp/src/service.rs

  • Registers three actions: hero_shrimp_server, hero_shrimp_web, hero_shrimp_ui
  • hero_shrimp_web binds to web_web.sock, hero_shrimp_ui binds to ui.sock

Modified: crates/hero_shrimp/src/main.rs

  • --start prints all three socket paths
  • --stop cleans up all three binaries

Modified: crates/hero_shrimp_sdk/src/lib.rs

  • Added default_web_socket() re-export

Modified: Cargo.toml (workspace)

  • Added crates/hero_shrimp_web to members

Routing After This Change

Path Socket Purpose
/hero_shrimp/web web_web.sock End-user conversational dashboard
/hero_shrimp/ui ui.sock Admin control panel
/hero_shrimp/rpc rpc.sock JSON-RPC backend

Test Results

cargo check --workspace: clean
cargo test --workspace: 0 new failures (10 pre-existing failures unchanged)

## Implementation Summary ### Changes Made **New crate: `crates/hero_shrimp_web/`** - Contains the end-user conversational dashboard (moved from `hero_shrimp_ui`) - Binds to `web_web.sock` — routed by hero_router to `/hero_shrimp/web` - heroservice manifest declares `"protocol": "web"`, `"socket": "web"` **Replaced: `crates/hero_shrimp_ui/`** - Now contains the admin control panel following Hero project best practices - Binds to `ui.sock` — routed by hero_router to `/hero_shrimp/ui` - Bootstrap 5 + Bootstrap Icons + Askama + rust-embed - Admin tabs: Status, Jobs, Config, Logs, API Docs, Tools - All required endpoints: `/health`, `/.well-known/heroservice.json`, `/rpc` proxy, `/api/*` - heroservice manifest declares `"protocol": "ui"`, `"socket": "ui"` **Modified: `crates/hero_shrimp_types/src/paths.rs`** - Added `default_web_socket()` → resolves to `web_web.sock` **Modified: `crates/hero_shrimp/src/service.rs`** - Registers three actions: `hero_shrimp_server`, `hero_shrimp_web`, `hero_shrimp_ui` - `hero_shrimp_web` binds to `web_web.sock`, `hero_shrimp_ui` binds to `ui.sock` **Modified: `crates/hero_shrimp/src/main.rs`** - `--start` prints all three socket paths - `--stop` cleans up all three binaries **Modified: `crates/hero_shrimp_sdk/src/lib.rs`** - Added `default_web_socket()` re-export **Modified: `Cargo.toml` (workspace)** - Added `crates/hero_shrimp_web` to members ### Routing After This Change | Path | Socket | Purpose | |---|---|---| | `/hero_shrimp/web` | `web_web.sock` | End-user conversational dashboard | | `/hero_shrimp/ui` | `ui.sock` | Admin control panel | | `/hero_shrimp/rpc` | `rpc.sock` | JSON-RPC backend | ### Test Results cargo check --workspace: clean cargo test --workspace: 0 new failures (10 pre-existing failures unchanged)
Sign in to join this conversation.
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_shrimp#19
No description provided.