Refactor crate layout, add mcp_hero, Hero OS integration #25

Open
timur wants to merge 24 commits from development_timur into development
Owner

Supersedes #21, #19

Summary

  • Crate renames & restructure: hero_aibroker_openrpchero_aibroker_server, hero_aibroker_httphero_aibroker_ui, hero_aibroker_clienthero_aibroker_sdk; removed hero_aibroker_rhai and hero_aibroker_ctl
  • MCP reorganization: moved all MCP crates under crates/mcp/, renamed mcp-* to mcp_* (underscore convention); added new mcp_hero crate for Hero service discovery, spec caching, Python code generation & execution via stdio MCP server
  • Hero OS integration: ZinitLifecycle API updates, BASE_PATH convention, script ordering, Bootstrap CSS variable theming, dark/light mode fixes
  • Agent pivot: added then replaced agent_hero ACP layer with mcp_hero stdio server approach; chat service now supports MCP tool-use flow
  • UI improvements: theme sync using Bootstrap CSS variables, fixed chat contrast, removed hardcoded dark styles
  • Docs: replaced skills/ directory with proper mcp_hero/README.md

Test plan

  • cargo build succeeds for the full workspace
  • cargo test passes
  • hero_aibroker_server starts and listens on Unix socket
  • hero_aibroker_ui starts and serves the admin dashboard
  • mcp_hero discovers Hero services and responds to MCP tool calls via stdio
  • Dark/light theme toggle works correctly in the dashboard

🤖 Generated with Claude Code

Supersedes #21, #19 ## Summary - **Crate renames & restructure**: `hero_aibroker_openrpc` → `hero_aibroker_server`, `hero_aibroker_http` → `hero_aibroker_ui`, `hero_aibroker_client` → `hero_aibroker_sdk`; removed `hero_aibroker_rhai` and `hero_aibroker_ctl` - **MCP reorganization**: moved all MCP crates under `crates/mcp/`, renamed `mcp-*` to `mcp_*` (underscore convention); added new `mcp_hero` crate for Hero service discovery, spec caching, Python code generation & execution via stdio MCP server - **Hero OS integration**: ZinitLifecycle API updates, `BASE_PATH` convention, script ordering, Bootstrap CSS variable theming, dark/light mode fixes - **Agent pivot**: added then replaced `agent_hero` ACP layer with `mcp_hero` stdio server approach; chat service now supports MCP tool-use flow - **UI improvements**: theme sync using Bootstrap CSS variables, fixed chat contrast, removed hardcoded dark styles - **Docs**: replaced `skills/` directory with proper `mcp_hero/README.md` ## Test plan - [ ] `cargo build` succeeds for the full workspace - [ ] `cargo test` passes - [ ] `hero_aibroker_server` starts and listens on Unix socket - [ ] `hero_aibroker_ui` starts and serves the admin dashboard - [ ] `mcp_hero` discovers Hero services and responds to MCP tool calls via stdio - [ ] Dark/light theme toggle works correctly in the dashboard 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Standardize server lifecycle management using zinit Pattern B
(ZinitRPCAPIClient). Adds CLI subcommands: start, stop, run,
status, logs, ui, zinit.

Existing server logic moved under `run` subcommand.
`start` registers with zinit and starts as managed service.

Ref: lhumina_code/home#6

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rename Command::Run → Command::Serve (internal, what zinit invokes)
- Add new Command::Run (start + stream logs + stop on Ctrl-C)
- Update lifecycle.rs: exec_command uses "serve", add run() method
- Fix zinit socket path to ~/hero/var/sockets/zinit_server.sock
- Update Makefile: run/start/stop/logs use new CLI subcommands

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merge development into development_timur
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 25s
a39bd8d56c
Resolve import conflict in main.rs (duplicate providers, serde_json ordering).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adopt Hero crates naming convention: the raw JSON-RPC backend is now
hero_aibroker_server. Also moves openrpc.json into the server crate
and updates the socket path to hero_aibroker_server.sock.

Resolves part of #22.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adopt Hero crates naming convention: the HTTP admin UI service is now
hero_aibroker_ui. Updates socket proxy path to hero_aibroker_server.sock
and openrpc.json include path to the server crate.

Resolves part of #22.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adopt Hero crates naming convention: the client library is now
hero_aibroker_sdk. Removes hero_aibroker_rhai (Rhai bindings not
allowed per convention).

Resolves part of #22.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds CLI subcommands (run/start/stop/serve/status/logs/ui/zinit) to the
UI binary, matching the server crate pattern. Removes TCP fallback —
UI now binds exclusively to Unix socket. Adds Makefile targets for
UI lifecycle (run-ui, start-ui, stop-ui, logs-ui, rundev-ui).

Resolves #23.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds example crate with health check and basic usage examples that
demonstrate the hero_aibroker_sdk.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: correct include_str path for openrpc.json in UI api/mod.rs
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 24s
231e8dd1be
The path needs three levels up from src/api/ to reach the sibling
crate directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reorganize MCP server crates into crates/mcp/ subdirectory and
rename packages from hyphenated (mcp-ping) to underscore (mcp_ping)
for consistency with Rust conventions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New crate providing:
- Auto-discovery of Hero services via Unix sockets (rpc.discover)
- OpenRPC spec caching with SHA-256 hash-based regeneration
- Python code execution via uv with managed venv
- HTTP-over-Unix-socket client (hyper + tokio UnixStream)
  for self-referential LLM access through the broker's own socket

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Agent for Hero service orchestration:
- Intent detection and service reranking via LLM
- Python code generation from OpenRPC interface files
- Unified LLM client supporting both HTTP and Unix socket endpoints
- ACP types (runs, descriptors, content parts)

Note: agent loop will be replaced by Shrimp integration — these
primitives will be exposed as MCP tools instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: integrate agent_hero and mcp_hero into broker UI and server
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 39s
763d06bc6d
- Add ACP REST endpoints to hero_aibroker_ui (agents, runs, services)
- Add agent config fields (AGENT_LLM_ENDPOINT, AGENT_MODEL, AGENT_API_KEY)
- Default LLM endpoint to broker's own Unix socket (self-referential)
- Fix ZinitLifecycle::new() to 3-arg signature for server and UI
- Remove old lifecycle.rs files (now provided by hero_rpc_server)
- Add hero_aibroker_ctl crate
- Update workspace members and dependencies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
refactor: remove hero_aibroker_ctl crate
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 30s
7dbdb9e029
No longer needed — service registration will be handled via broker
config and MCP tools, not a separate CLI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
refactor: pivot to mcp_hero stdio server, remove agent_hero and ACP
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 31s
785b925c36
Shrimp becomes the agent loop; the broker provides Hero service
capabilities as MCP tools via a dedicated stdio server binary.

Changes:
- Add mcp_hero binary (src/main.rs): async tokio stdio JSON-RPC server
  exposing register_service, list_services, get_interface,
  generate_code, and execute_code tools
- Move codegen.rs + llm_client.rs from agent_hero into mcp_hero
  (git rename detected)
- Add discover_service_with_spec() to ServiceDiscovery for single-call
  metadata + spec retrieval
- Add [[bin]] target and tracing-subscriber to mcp_hero/Cargo.toml
- Remove agent_hero crate entirely
- Remove ACP endpoints (acp.rs) and agent init from hero_aibroker_ui
- Remove agent_* config fields from hero_aibroker Config
- Add mcp_hero entry to mcp_servers.example.json
- Add skills/hero_services.md Shrimp skill reference

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: update for Hero OS integration — ZinitLifecycle API, BASE_PATH, script ordering
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 42s
1e94e37c0f
- Fix ZinitLifecycle API: remove dead binary_path field, use .branch() builder
- Switch zinit_sdk from development_kristof to development branch
- Add BASE_PATH env var support for proxy routing in iframes
- Move rpcCall/showToast definitions before content block in base.html
- Prefix chat completions fetch with BASE_PATH
- Add hero_aibroker_server to buildenv.sh BINARIES

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: use Bootstrap CSS variables for theme sync and fix chat contrast
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 31s
aaa5d1c5c9
Replace hardcoded dark colors with Bootstrap CSS variables (--bs-body-bg,
--bs-body-color, --bs-tertiary-bg, --bs-border-color, --bs-secondary-color)
so light/dark theme from Hero OS propagates correctly. Fix chat message
bubbles using near-transparent backgrounds with no explicit text color.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: remove hardcoded dark styles from all templates for theme sync
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 31s
687c0fa18c
Strip bg-dark/text-white from form controls, modals, accordions, and
chat area across all template files. Bootstrap form controls inherit
theme automatically from data-bs-theme attribute.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: activate mcp_hero in mcp_servers.json, fix binary names
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 49s
aa8d0d1c1b
Add mcp_hero entry with Hero service discovery config.
Fix all binary names from old mcp-* dash format to mcp_* underscores
to match the crate rename in commit 02f7d6c.

Ref: lhumina_code/home#23

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: use gpt-4o-mini as default LLM model for mcp_hero
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 39s
4b04a7545a
The broker routes models by display name (gpt-4o-mini), not by
provider-prefixed ID (google/gemini-2.0-flash-001). Using a model
the broker doesn't know causes 500 errors during service registration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
docs: replace skills/ with mcp_hero README
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 31s
31fa4c47d5
Move tool documentation from skills/hero_services.md into
crates/mcp/mcp_hero/README.md where it belongs — covers tools,
config, architecture, and MCP client setup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: update Rust toolchain in CI to satisfy rust-version 1.93
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 2s
57bb3b842d
The builder image ships Rust 1.92 but zinit_sdk/zinit_lib require 1.93.
Add `rustup update stable` step before builds in all three workflows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
timur force-pushed development_timur from 57bb3b842d
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 2s
to 31fa4c47d5
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 31s
2026-03-13 09:11:53 +00:00
Compare
fix: remove rust-version pin from workspace Cargo.toml
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 1m11s
6cbed3120a
Drop rust-version = "1.93" to avoid CI failures when the builder
image ships an older toolchain. See rust_toolchain skill in hero_skills.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: cargo fmt
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 1m17s
9e4271680f
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: resolve clippy warnings — collapsible if, Default impls
All checks were successful
Build and Test / build-and-test (pull_request) Successful in 2m41s
3000853203
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All checks were successful
Build and Test / build-and-test (pull_request) Successful in 2m41s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin development_timur:development_timur
git switch development_timur
Sign in to join this conversation.
No reviewers
No labels
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_aibroker!25
No description provided.