Standardize zinit lifecycle + serve rename convention #21

Closed
timur wants to merge 21 commits from development_timur into development
Owner

Summary

  • Add zinit lifecycle CLI subcommands to hero_aibroker_openrpc
  • Apply the serve rename convention (matching hero_rpc 9d338ad and hero_os reference):
    • run = developer command (start via zinit + stream logs + stop on Ctrl-C)
    • serve = internal (what zinit invokes to actually run the server process)
    • start/stop/status/logs = zinit management
  • Update Makefile to use new CLI subcommands instead of direct zinit CLI calls
  • Add lifecycle.rs with ZinitLifecycle (zinit_sdk Pattern B)

Follow-up issues (created for remaining work)

  • #22 — Rename _openrpc_server, _http_ui, _client_sdk crates
  • #23 — Add zinit lifecycle to UI binary

Test plan

  • cargo check -p hero_aibroker_openrpc compiles clean
  • hero_aibroker_openrpc serve starts the server
  • hero_aibroker_openrpc run starts via zinit + streams logs
  • hero_aibroker_openrpc stop stops the zinit service

🤖 Generated with Claude Code

## Summary - Add zinit lifecycle CLI subcommands to `hero_aibroker_openrpc` - Apply the **serve rename convention** (matching hero_rpc `9d338ad` and hero_os reference): - `run` = developer command (start via zinit + stream logs + stop on Ctrl-C) - `serve` = internal (what zinit invokes to actually run the server process) - `start/stop/status/logs` = zinit management - Update Makefile to use new CLI subcommands instead of direct zinit CLI calls - Add `lifecycle.rs` with `ZinitLifecycle` (zinit_sdk Pattern B) ## Related issues - https://forge.ourworld.tf/lhumina_code/home/issues/6 — cross-repo standardization - https://forge.ourworld.tf/lhumina_code/hero_rpc/issues/7 — serve rename convention - https://forge.ourworld.tf/lhumina_code/hero_skills/issues/51 — skill reference ## Follow-up issues (created for remaining work) - #22 — Rename `_openrpc` → `_server`, `_http` → `_ui`, `_client` → `_sdk` crates - #23 — Add zinit lifecycle to UI binary ## Test plan - [x] `cargo check -p hero_aibroker_openrpc` compiles clean - [ ] `hero_aibroker_openrpc serve` starts the server - [ ] `hero_aibroker_openrpc run` starts via zinit + streams logs - [ ] `hero_aibroker_openrpc stop` stops the zinit service 🤖 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>
timur changed title from Zinit lifecycle serve rename convention to Standardize zinit lifecycle + serve rename convention 2026-03-10 09:40:43 +00:00
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>
timur closed this pull request 2026-03-13 08:58:48 +00:00
Some checks failed
Build and Test / build-and-test (pull_request) Failing after 31s

Pull request closed

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!21
No description provided.