Hero OS OpenRPC Backend #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
everything which is relevant
keep state
full openrpc support on heroos, also link supportto Hero OS BackendHero OS Backendto Hero OS OpenRPC Backendbasically we want an openrpc backend for Hero OS so we can keep state of windows etc, and open windows in contexts and stuff in our backend instead of in the browser or memory.
Implementation Plan: Hero OS OpenRPC Backend Migration
Summary
Migrate hero_os_server to use the new
OServer::run_cli()pattern from hero_rpc#7, rename "contexts" to "spaces" for end-user friendliness, and ensure desktop state is persisted server-side (currently only in browser localStorage).Current State
UnixRpcServer::new()directly (old pattern)DesktopService,WindowService,LayoutService(529 lines of custom logic inrpc.rs)bin/hero_os_serviceorchestrator exists but becomes redundant after migrationTasks
1. Migrate to OServer::run_cli() (hero_rpc#7)
UnixRpcServer::new()inmain.rswithOServer::run_cli()hero_os_server start/stop/status/logs/runwrite_preserved()skips existing filesrpc.rs(custom service implementations) — it won't be touched by regenerationCargo.tomlto depend onhero_rpc_server2. Rename "contexts" → "spaces" everywhere
--contexts→--spacescontext_name→space_namein RPC methodsdb/{context}/→db/{space}/sockets/{context}/→sockets/{space}/3. Server-side state persistence
save_desktop_state()/load_desktop_state()to call server RPC instead of localStorage4. Remove hero_os_service
bin/hero_os_servicebecomes redundant —hero_os_server starthandles zinit registrationFiles to modify
crates/hero_os_server/src/main.rscrates/hero_os_server/Cargo.tomlcrates/hero_os_server/src/desktop/rpc.rscrates/hero_os/schemas/desktop.oschemacrates/hero_os_app/src/storage.rscrates/hero_os_app/src/controller.rscrates/hero_os_client/bin/hero_os_service/MakefileReference
hero_rpc/crates/server/src/server/server.rsProgress update: OServer migration + spaces rename
Branch:
development_timur— commitc14b6c7What changed
Server migrated to
OServer::run_cli()—hero_os_server/src/main.rsrewritten from manualUnixRpcServerto the unifiedOServer::run_cli()pattern fromhero_rpc_server. This gives us CLI subcommands:start,stop,run,status,logs,ui,zinit.Contexts → Spaces rename — All user-facing
context_namefields renamed tospace_nameacross:schemas/desktop/desktop.oschema)hero_os_app)Build system updated —
build.rsnow useshero_rpc_generator(moved fromhero_rpc_osis).herolib_sidaligned todevelopment_kristofbranch.Removed
bin/hero_os_service/— Redundant standalone binary, replaced byOServer::run_cli()inhero_os_server.New trigger hooks — Added
trigger_get_preandtrigger_list_premethods required by updated generator.Verification
cargo check— full workspace compiles (28 files changed, 587+, 546-)cargo test -p hero_os_server— 3/3 tests passUpstream fixes pushed
hero_rpc(development): restoreddbmodule inhero_rpc_osis(derive macro fix)hero_fossil/hero_foundry(development): renamedherofossil_webdav_client→hero_foundry_webdav_clientThe server binary already uses
OServer::run_cli()(seecrates/hero_os_server/src/main.rs), but the Makefile and README still document the oldmake run/make serviceflow. This is misleading — cleaning up now:run,stop,run-server,service,installMakefile targetshero_os_server run/hero_os_server startas the way to run the backendmake web,make check,make fmt, etc.)Zinit Lifecycle Adopted
Both
hero_os_serverandhero_os_uinow use the standardized zinit lifecycle:run— developer command (start + stream logs + stop on Ctrl-C)start— background start via zinitserve— internal (zinit calls this, never run manually)hero_os_uiusesZinitLifecycledirectly (non-OpenRPC binary pattern).hero_os_serverusesOServer::run_cli()which handles everything.Makefile updated:
make rundelegates tocargo run -p hero_os_server -- run(built-in log streaming).make startrunscargo updatefirst to pick up git dep changes.Commit:
4fa4073on development_timur