Hero OS service running Rhai, Nushell, and Python scripts in isolated worker pools.
  • Rust 49%
  • JavaScript 35.6%
  • HTML 11.2%
  • CSS 4.2%
Find a file
Kristof e225fb44b8
Some checks failed
Tests / test (push) Failing after 13s
Build and Test / build (push) Failing after 20s
lab release / release (push) Successful in 1h2m18s
feat: branch management, bulk tagging, job proxy, and cache fixes
- hero_code CLI simplified to --info discovery only; lifecycle (start/stop
  of hero_code_server/admin) is now owned by the Hero supervisor
- Admin UI: branch management modal for local and remote Forge branches
  (list, switch, create, delete, set default, push-and-set-default)
- Admin UI: bulk tag editing across selected repos with suggestion chips,
  Enter key to save, and "Remove all" action
- Admin UI: org/owner prefix shown in repo name column; single-row rebuild
  after clone avoids full list reload
- Server: new forge.branches / forge.set_default_branch / forge.push_branch
  RPC methods calling Forgejo REST API via ureq
- Server: new job.* RPC module (list, get, logs, submit, cancel, purge)
  proxying to the local hero_proc daemon via hero_proc_sdk
- Server: list cache invalidated on hide/unhide/tag mutations so UI reflects
  changes immediately without waiting for the 120s TTL
- Server: code.import now clones to PATH_CODE/<repo_name> (flat, no org
  subdirectory) matching Hero's local-scan convention
- Add .codegraph/.gitignore, gitignore .hero/, remove stale status file

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-15 10:08:30 +02:00
.cargo hero_builder: add musl cross-compilation support and documentation 2026-05-08 22:19:37 +02:00
.codegraph feat: branch management, bulk tagging, job proxy, and cache fixes 2026-06-15 10:08:30 +02:00
.forgejo/workflows ci: canonical lab-release (cargo check + multi-arch + hero.releaser) 2026-06-10 19:54:29 +02:00
.hero chore: rename FORGEJO_TOKEN→FORGE_TOKEN and HERO_SOCKET_DIR→PATH_SOCKET, prune stale env vars 2026-05-26 12:28:19 +02:00
crates feat: branch management, bulk tagging, job proxy, and cache fixes 2026-06-15 10:08:30 +02:00
examples/runner chore: remove deprecated hero_runner crates 2026-04-05 17:11:46 +02:00
schema refactor(service.toml): migrate to canonical field names and add oschema definitions 2026-05-31 22:51:43 +02:00
testcases feat(runner): embed nushell alongside rhai and python 2026-04-19 10:28:27 +02:00
tests/integration Refactor: add hero_builder and reorganize code architecture 2026-05-08 21:31:43 +02:00
.gitignore feat: branch management, bulk tagging, job proxy, and cache fixes 2026-06-15 10:08:30 +02:00
Cargo.lock feat: branch management, bulk tagging, job proxy, and cache fixes 2026-06-15 10:08:30 +02:00
Cargo.toml development_freeze: derive->frozen hero_derive (no _lib derive/blueprint); builds green 2026-06-09 04:13:18 +00:00
Cargo.toml.hero_builder_backup chore: downgrade rust-version to 1.95.0 and restore builder backup 2026-06-01 12:59:38 +02:00
PURPOSE.md chore: rename FORGEJO_TOKEN→FORGE_TOKEN and HERO_SOCKET_DIR→PATH_SOCKET, prune stale env vars 2026-05-26 12:28:19 +02:00
README.md chore: rename FORGEJO_TOKEN→FORGE_TOKEN and HERO_SOCKET_DIR→PATH_SOCKET, prune stale env vars 2026-05-26 12:28:19 +02:00
rust-toolchain.toml refactor: migrate service_base! to baso_info! and pin rust-version to 1.95.0 2026-06-01 07:36:41 +02:00

hero_code

Hero OS service — multi-language script execution engine.

Runs Rhai, Nushell, and Python scripts in isolated worker pools and exposes a JSON-RPC 2.0 interface over Unix sockets.

Binaries

Binary Role
hero_code_server Main RPC daemon — executes scripts, stores jobs
hero_code_admin Admin dashboard web UI (Unix socket: admin.sock)
hero_code CLI — registers and manages the service lifecycle

Sockets

Socket Purpose
$PATH_SOCKET/hero_code/rpc.sock JSON-RPC 2.0 API for script execution
$PATH_SOCKET/hero_code/admin.sock Admin dashboard HTTP

Languages Supported

  • Rhai — embedded scripting (pre-forked worker pool)
  • Nushell — shell-style scripting (pre-forked worker pool)
  • Python — via uv external process runner

Service Lifecycle

lab service code --install # build + install all binaries
lab service code --start # register with hero_proc and start
lab service code --stop # stop all binaries
lab service code --status # status of all binaries

Architecture

  1. Worker pools for Rhai and Nushell are pre-forked before the tokio runtime starts (required to avoid unsafe fork() in a multithreaded process).
  2. The tokio runtime then starts the JSON-RPC HTTP server on rpc.sock.
  3. Jobs are stored in a local SQLite database (~/hero/var/hero_code.db).
  4. The admin UI is a separate Axum process registered with hero_proc.