Merge development_mik_6_1 into development #27

Merged
despiegk merged 5 commits from development_mik_6_1 into development 2026-03-19 08:34:22 +00:00
Owner

Summary

  • Renamed crates to follow naming convention: hero_aibroker_openrpc → server, hero_aibroker_http → ui, hero_aibroker_client → sdk
  • Added zinit lifecycle CLI + ZinitLifecycle API
  • Added mcp_hero crate for Hero service discovery and code execution
  • Added agent_hero crate with ACP interface, then pivoted to mcp_hero stdio server
  • Removed hero_aibroker_ctl crate (unused)
  • Removed hardcoded dark styles, switched to Bootstrap CSS variables for theme sync
  • Fixed BASE_PATH and script ordering for Hero OS integration
  • Set gpt-4o-mini as default LLM model

Test plan

  • Verify AI broker UI loads in Hero OS iframe
  • Verify mcp_hero integration works
  • Check theme sync in light/dark mode
## Summary - Renamed crates to follow naming convention: hero_aibroker_openrpc → server, hero_aibroker_http → ui, hero_aibroker_client → sdk - Added zinit lifecycle CLI + ZinitLifecycle API - Added mcp_hero crate for Hero service discovery and code execution - Added agent_hero crate with ACP interface, then pivoted to mcp_hero stdio server - Removed hero_aibroker_ctl crate (unused) - Removed hardcoded dark styles, switched to Bootstrap CSS variables for theme sync - Fixed BASE_PATH and script ordering for Hero OS integration - Set gpt-4o-mini as default LLM model ## Test plan - [x] Verify AI broker UI loads in Hero OS iframe - [x] Verify mcp_hero integration works - [x] Check theme sync in light/dark mode
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: 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 3m54s
3000853203
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
Owner

@thabeta lmk what you think! It is live at hero.gent04.grid.tf (admin, admin, for credentials).
As I see it, we can merge this and then you make an issue/review if we need to change/update something, for example you had good deep design feedback lately.

Thanks!

@thabeta lmk what you think! It is live at hero.gent04.grid.tf (admin, admin, for credentials). As I see it, we can merge this and then you make an issue/review if we need to change/update something, for example you had good deep design feedback lately. Thanks!
thabeta left a comment
Owner

Reviewed against origin/development. cargo test --workspace --no-fail-fast passes in a clean worktree, but I found several release-affecting regressions:

  1. crates/hero_aibroker_server/src/main.rs and crates/hero_aibroker_ui/src/main.rs: zinit lifecycle is pinned to development_timur. After merge into development, start and run will still deploy from a personal branch, because ZinitLifecycle checks out and pulls that branch before building.

  2. mcp_servers.json + buildenv.sh + crates/hero_aibroker/src/mcp/client.rs: the default MCP config now uses bare binary names (mcp_hero, mcp_ping, etc.), but the broker spawns them directly with Command::new(...) and packaging only installs hero_aibroker_server, hero_aibroker_ui, and hero_aibroker_cli. On a normal checkout or packaged install, the default MCP config now points at executables that are not available in PATH.

  3. crates/mcp/mcp_hero/src/main.rs + crates/mcp/mcp_hero/src/cache.rs: generated Python clients are only staged into the executor during register_service. They are cached on disk, but never restaged on process startup. After restarting mcp_hero, list_services still shows cached services while execute_code can fail with missing <service>_client imports until every service is re-registered.

  4. The new Ui subcommands are wired through hero_rpc_server::ZinitLifecycle::open_ui(), but that helper still derives socket names using the old _openrpc to _http.sock convention. With this branch rename to hero_aibroker_server and hero_aibroker_ui, the new Ui commands point at socket names that will never exist.

  5. crates/hero_aibroker_examples/examples/basic_usage.rs and health.rs still hardcode http://localhost:3385, but this branch removed the old TCP dev UI path and now binds a Unix socket by default. The new SDK examples target an endpoint this branch no longer starts.

  6. Makefile:run starts the UI with start and only the server with run, so Ctrl-C stops the server but leaves the UI service running.

Also, the BASE_PATH work in crates/hero_aibroker_ui/templates/base.html is incomplete: XHRs use BASE_PATH, but the navbar links are still hard-coded to / and /openrpc.json, which breaks prefixed deployments.

Requesting changes because the branch is buildable, but the zinit branch pinning and MCP runtime wiring issues are deployment blockers.

Reviewed against `origin/development`. `cargo test --workspace --no-fail-fast` passes in a clean worktree, but I found several release-affecting regressions: 1. `crates/hero_aibroker_server/src/main.rs` and `crates/hero_aibroker_ui/src/main.rs`: zinit lifecycle is pinned to `development_timur`. After merge into `development`, `start` and `run` will still deploy from a personal branch, because `ZinitLifecycle` checks out and pulls that branch before building. 2. `mcp_servers.json` + `buildenv.sh` + `crates/hero_aibroker/src/mcp/client.rs`: the default MCP config now uses bare binary names (`mcp_hero`, `mcp_ping`, etc.), but the broker spawns them directly with `Command::new(...)` and packaging only installs `hero_aibroker_server`, `hero_aibroker_ui`, and `hero_aibroker_cli`. On a normal checkout or packaged install, the default MCP config now points at executables that are not available in `PATH`. 3. `crates/mcp/mcp_hero/src/main.rs` + `crates/mcp/mcp_hero/src/cache.rs`: generated Python clients are only staged into the executor during `register_service`. They are cached on disk, but never restaged on process startup. After restarting `mcp_hero`, `list_services` still shows cached services while `execute_code` can fail with missing `<service>_client` imports until every service is re-registered. 4. The new `Ui` subcommands are wired through `hero_rpc_server::ZinitLifecycle::open_ui()`, but that helper still derives socket names using the old `_openrpc` to `_http.sock` convention. With this branch rename to `hero_aibroker_server` and `hero_aibroker_ui`, the new `Ui` commands point at socket names that will never exist. 5. `crates/hero_aibroker_examples/examples/basic_usage.rs` and `health.rs` still hardcode `http://localhost:3385`, but this branch removed the old TCP dev UI path and now binds a Unix socket by default. The new SDK examples target an endpoint this branch no longer starts. 6. `Makefile:run` starts the UI with `start` and only the server with `run`, so Ctrl-C stops the server but leaves the UI service running. Also, the BASE_PATH work in `crates/hero_aibroker_ui/templates/base.html` is incomplete: XHRs use `BASE_PATH`, but the navbar links are still hard-coded to `/` and `/openrpc.json`, which breaks prefixed deployments. Requesting changes because the branch is buildable, but the zinit branch pinning and MCP runtime wiring issues are deployment blockers.
Wire hero_books as an MCP server via mcp_books stdio-to-HTTP bridge.
Exposes 6 MCP tools: libraries_list, books_list, book_pages, page_read,
search, ask — enabling AI agents to search and read the Hero OS guide.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wire hero_auth as MCP server via mcp_auth stdio-to-HTTP bridge.
Socket: ~/hero/var/sockets/hero_auth_ui.sock

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: add foundry, inspector, indexer, osis to MCP server config
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 53s
382050658e
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: inspector MCP socket points to UI (gateway) not server
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 52s
6dd4c9f4f1
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
refactor: remove MCP aggregation — aibroker is LLM-proxy only
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 36s
2b37446e69
- Delete entire src/mcp/ module (client, config, manager, server, types)
- Remove MCP init, state, and RPC handlers from main.rs
- Remove mcp_servers.json config
- Aibroker now only handles LLM routing/proxy requests

Part of #36
despiegk merged commit b193069624 into development 2026-03-19 08:34:22 +00:00
Sign in to join this conversation.
No reviewers
No labels
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_aibroker!27
No description provided.