No description
  • Rust 61.3%
  • HTML 16.7%
  • Shell 13.7%
  • JavaScript 5.7%
  • CSS 1.7%
  • Other 0.9%
Find a file
Timur Gordon 760e682309
Some checks failed
Build & Test / check (push) Failing after 38s
Add global multi-service agent with intelligent service selection (#31)
Two-step pipeline: LLM first selects which services the prompt needs
from a catalog of all healthy services, then generates a multi-service
Python script using all selected clients.

- Add run_global_agent() with build_service_catalog() and LLM selector
- Add POST /api/agent global endpoint (no service name in URL)
- Add Agent button to navbar with full agent panel UI
- Supports model selection, retries, answer/output/script tabs
- Shows which services were selected in the result badge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 04:14:55 +02:00
.forgejo/workflows fix: main is the only allowed branch 2026-04-02 15:05:39 +02:00
crates/hero_router Add global multi-service agent with intelligent service selection (#31) 2026-04-10 04:14:55 +02:00
docs fix: change port 2026-04-08 13:29:56 +02:00
scripts cleanup scripts and migrate to CLI-managed service registration 2026-04-05 05:25:59 +02:00
.gitignore Add *.db to .gitignore to exclude database files from version control 2026-03-22 10:15:32 +01:00
buildenv.sh chore: bump version to 0.2.1 2026-04-09 14:41:48 +02:00
Cargo.lock chore: bump version to 0.1.1 2026-04-08 14:21:49 +02:00
Cargo.toml chore: bump version to 0.2.1 2026-04-09 14:41:48 +02:00
Makefile fix: change port 2026-04-08 13:29:56 +02:00
README.md fix: change port 2026-04-08 13:29:56 +02:00

Hero Router

The single TCP entry point for all Hero services. Scans Unix sockets, routes HTTP traffic by URL prefix, provides service discovery, documentation, and an MCP gateway.

Quick Start

# Build and start
make run

# Stop
make stop

# CLI: list discovered services
hero_router list

Open the admin dashboard at http://localhost:9997.

Architecture

Internet / Browser / hero_proxy
       │
  :9988 (TCP, localhost only)
       │
  hero_router
    ├── /{service}/rpc/*    → {service}/rpc.sock
    ├── /{service}/admin/*  → {service}/ui.sock
    ├── /{service}/{web}/*  → {service}/web_{name}.sock
    ├── /rpc                → management API
    ├── /mcp                → MCP gateway
    └── :9997               → admin dashboard
       │
  Unix sockets (auto-discovered)
    ~/hero/var/sockets/
      hero_compute/rpc.sock
      hero_compute/ui.sock
      hero_proxy/rpc.sock
      hero_proc/rpc.sock
      ...

Features

  • Auto-discovery — scans $HERO_SOCKET_DIR/ for service sockets
  • URL prefix routing/{service}/{socket_type}/* stripped and forwarded
  • Header injectionX-Hero-Context, X-Hero-Claims, X-Forwarded-Prefix
  • MCP gateway — exposes services as MCP-compatible tools for AI agents
  • Admin dashboard — interactive web UI with service status
  • CLIlist, scan, spec, markdown, html subcommands
  • Documentation generation — Markdown and HTML from OpenRPC specs

Crate

Crate Type Description
hero_router binary + library Single binary with CLI, server, admin UI, and core library (herolib_router)

All crates were consolidated into a single binary in v0.2.0.

Sockets

All sockets under $HERO_SOCKET_DIR/hero_router/ (default: ~/hero/var/sockets/hero_router/).

Socket Protocol Description
rpc.sock JSON-RPC 2.0 Management API
ui.sock HTTP Admin dashboard

Ports (TCP, localhost only)

Port Description
9988 Routing entry point — proxies /{service}/* to Unix sockets
9997 Admin dashboard

Documentation

Development

make check          # cargo check
make test           # cargo test
make lint           # clippy
make fmt            # rustfmt
make rundev         # debug build
make test-all       # full CI suite

Installation

make install        # build release + install to ~/hero/bin/

Security

  • TCP listeners bind to 127.0.0.1 only (never 0.0.0.0)
  • No authentication required (localhost-only access)
  • Use hero_proxy for external/TLS access