Re-align workspace layout with hero_compute (revisits #15) #29
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?
Context
PR #18 (closes-via-URL #15) restructured the workspace under the framing of a "canonical hero_voice/hero_osis pattern." A wider sweep of the ecosystem shows that framing was overstated — siblings actually disagree on layout:
build.rslives insingle_bin/bin_uihero_voiceschemas/hero_voice/hero_osisschemas/hero_computeschemas/hero_computeis a CLI bin only)hero_booksspecs/schemas/hero_books_libonlyhero_livekit(post-#18)schemas/hero_livekit/hero_livekitended up as a hybrid that matches no sibling exactly, plus two real smells from the merged config:bin_ui("hero_livekit_ui::build_router")references a function whose only caller is the auto-generatedsrc/bin/hero_livekit.rs— comment in #15 admitsautobins = falsewas needed to make it compile. Aspirational config, not canonical.sdk_types_crate("hero_livekit")was set, buthero_livekit_sdkends up using a hand-writtenopenrpc_client!macro path anyway — the flag did no useful work.This issue proposes realigning
hero_livekitwithhero_compute's simpler, more battle-tested model.Goal
Strip the aspirational machinery and reshape the workspace to match
hero_compute:build.rslives in the server crate, not in a separate core crate.corelibrary crate — domain types are emitted intohero_<svc>_server/src/<domain>/next to the boot.lib.rsusingopenrpc_client!("../hero_<svc>_server/openrpc.json", name = "...")plus hand-written socket/env helpers. No SDK build.rs.single_bin,bin_companions,bin_ui,client_crate_dir,sdk_types_crate,with_wasm,nested_layoutfrom the OschemaBuildConfig chain.Target layout
Crates to delete:
crates/hero_livekit/— its hand-written contents fold intohero_livekit_server.Decisions to confirm before implementation
Drop
hero_livekit_ui::build_router? Inhero_compute_uithe UI is a standalone bin with no library surface.build_routerexists today only because PR #18 wired it into the (broken) single-binary orchestrator. Recommendation: remove the lib surface, fold its contents intosrc/server.rslikehero_compute_uidoes.Delete the auto-generated
src/bin/hero_livekit.rs? It exists today but doesn't compile cleanly (per the comment trail on #15 —autobins = false).hero_computehas no equivalent — it has a separatehero_computeCLI crate that useshero_proc_sdkto register services. Recommendation: delete it. A hero_proc-style CLI is a separate follow-up issue if needed.hero_livekit_sdk/build.rshack — it currently re-injectspub mod openrpc;intolib.rson every build because the OSchema generator overwrites lib.rs. After we stop generating into the SDK crate, this hack disappears entirely.Step-by-step plan
Step 1 — collapse the core crate into the server crate
crates/hero_livekit/entirely (build.rs, src/livekit/, src/bin/hero_livekit.rs, src/services/, src/lib.rs, Cargo.toml)crates/hero_livekit/src/livekit/server/rpc.rs→crates/hero_livekit_server/src/livekit/server/rpc.rscrates/hero_livekit/src/livekit/core/types.rs(if any extensions) →crates/hero_livekit_server/src/livekit/core/types.rscrates/hero_livekit/src/livekit/tests.rs→crates/hero_livekit_server/src/livekit/tests.rs*_generated.rs, generatedmod.rs, generatedopenrpc.json) — re-emitted in step 2Step 2 — give the server crate a hero_compute-style build.rs
Create
crates/hero_livekit_server/build.rs:Add
[build-dependencies] hero_rpc_osis = { workspace = true }tohero_livekit_server/Cargo.toml.Step 3 — fix
hero_livekit_server/Cargo.tomlhero_livekit = { workspace = true }dep (the crate is gone)Step 4 — fix
hero_livekit_server/src/main.rsandsrc/livekit/mod.rsuse hero_livekit::livekit::server::OsisLivekitwithuse crate::livekit::server::OsisLivekitlivekit/mod.rsbecomespub mod core; pub mod server; #[cfg(test)] mod tests;— no re-exports fromhero_livekitStep 5 — relocate
openrpc.jsonfor SDK macro consumptionAfter build, the generator emits
crates/hero_livekit_server/src/livekit/openrpc.json. Matchhero_compute_serverby also havingcrates/hero_livekit_server/openrpc.jsonat crate root (compute keeps a copy there foropenrpc_client!consumption).Step 6 — simplify
hero_livekit_sdkcrates/hero_livekit_sdk/build.rs(no longer needed)crates/hero_livekit_sdk/src/livekit/(osis_client_generated.rs,types.rs,mod.rs— auto-generated by the oldclient_crate_dirflag)crates/hero_livekit_sdk/src/openrpc.rscrates/hero_livekit_sdk/src/lib.rsmodeled onhero_compute_sdk/src/lib.rs:Cargo.tomlto compute-style:hero_rpc_derive,hero_rpc_openrpc,herolib_core,tokio,serde,serde_json,dotenvy. Drophero_rpc_client,herolib_otoml,herolib_sidif unused.Step 7 — update consumers of old module paths
Audit
hero_livekit_ui/,hero_livekit_examples/examples/*.rs,hero_livekit_rhai/src/client.rs,hero_livekit_backend/src/main.rs:use hero_livekit_sdk::livekit::*patterns with imports of types from the macro-generated root.Step 8 —
hero_livekit_ui(pending decision #1)lib.rscontents (build_router, AppState, handlers, whitelist) intosrc/server.rssrc/main.rsbecomes ~9 lines likehero_compute_ui/src/main.rs[lib]target from Cargo.tomlStep 9 — workspace Cargo.toml
crates/hero_livekitfrommembershero_livekit = { path = "crates/hero_livekit" }from workspace dependenciesStep 10 — verify
cargo build --workspacecargo clippy --workspace -- -D warningscargo test --workspacesingle_bin,bin_companions,bin_ui,client_crate_dir,sdk_types_crate,with_wasm,nested_layout,autobins = false,hero_livekit::livekit::,crates/hero_livekit/Out of scope
hero_livekit_backend(Rust port of Golk-backend) — leave alonehero_livekit_rhai— leave alone (may need a small import path tweak in step 7)hero_proc_sdk-drivenhero_livekitCLI crate (analogue ofhero_compute) — separate follow-up if desiredAcceptance criteria
crates/hero_livekit/no longer existscrates/hero_livekit_server/build.rsexists with the minimal compute-style configcrates/hero_livekit_server/openrpc.jsonis the single source of truth for SDK consumerscrates/hero_livekit_sdk/src/lib.rsis one file, no build.rssingle_bin,bin_companions,bin_ui,client_crate_dir,sdk_types_crate,with_wasm,nested_layout,autobins = falseanywhere in the repocargo build --workspace,cargo clippy --workspace -- -D warnings,cargo test --workspaceall greenhero_livekit_backendandhero_livekit_rhairemain untouched in behaviorRelated
Implementation Spec for Issue #29
Objective
Realign hero_livekit's workspace layout with hero_compute's simpler model: a single
hero_livekit_servercrate that ownsbuild.rs, generates code intosrc/livekit/, and ships itsopenrpc.json; a one-filehero_livekit_sdkwhose only Rust content isopenrpc_client!plus socket/env helpers; deletion of the now-unusedcrates/hero_livekit/core crate; foldinghero_livekit_ui's library into its server module. No moresingle_bin,bin_companions,bin_ui,client_crate_dir,sdk_types_crate,with_wasm,nested_layout, orautobins=falseworkarounds.Requirements
crates/hero_livekit/deleted; its hand-written content (the orchestrator code insrc/livekit/server/rpc.rs, ~962 lines) moves intohero_livekit_server.crates/hero_livekit_server/build.rsexists with a minimalOschemaBuildConfig(compute-style: schemas_dir, docs_dir, single domain, generate_server, debug, plus a rustfmt step).crates/hero_livekit_server/openrpc.jsonat the crate root remains the canonical spec consumed byopenrpc_client!. The build also emitssrc/livekit/openrpc.json; both must be kept in sync (build.rs copy step).crates/hero_livekit_sdk/src/lib.rsis a single file modelled oncrates/hero_compute_sdk/src/lib.rs:openrpc_client!("../hero_livekit_server/openrpc.json", name = "LiveKitClient")plus env / socket helpers. Nobuild.rs. Nosrc/livekit/subtree. Nosrc/openrpc.rs.hero_livekit::livekit::*orhero_livekit_sdk::openrpc::*/hero_livekit_sdk::livekit::*.hero_livekit_uicollapseslib.rs + main.rsinto a single binary crate with code undersrc/server.rsandsrc/main.rs~10 lines, mirroringhero_compute_ui. The[lib]target is removed.hero_livekit_backendandhero_livekit_rhaisource code remain functionally unchanged (rhai gets a small import update only because it points through the SDK).Cargo.tomlno longer listscrates/hero_livekitas a member orhero_livekitas a workspace dep.cargo build,cargo clippy,cargo testall pass against--workspace.single_bin,bin_companions,bin_ui,client_crate_dir,sdk_types_crate,with_wasm,nested_layout,autobins = false,hero_livekit::livekit::, and any path containingcrates/hero_livekit/returns zero hits.Files to Modify/Create/Delete (high-level)
crates/hero_livekit/(whole directory)src/livekit/server/rpc.rs(handwritten orchestrator)crates/hero_livekit/src/bin/hero_livekit.rscrates/hero_livekit_server/build.rscrates/hero_livekit_server/Cargo.tomlhero_livekitdep; addreqwest,jsonwebtoken,flate2,tar,dirs,herolib_sid; add[build-dependencies] hero_rpc_osis = { workspace = true }; addbuild = "build.rs"crates/hero_livekit_server/src/main.rshero_livekit::livekit::*imports; usecrate::livekit::*crates/hero_livekit_server/src/livekit/mod.rspub mod core; pub use core::*; pub mod server; #[cfg(test)] mod tests;crates/hero_livekit_server/src/livekit/server/mod.rs#[path = "../osis_server_generated.rs"]etc.crates/hero_livekit_server/src/livekit/rpc.rscrates/hero_livekit_server/src/livekit/types.rsinclude!("types_generated.rs");crates/hero_livekit_server/src/livekit/{types,rpc,osis_server}_generated.rscrates/hero_livekit_server/src/livekit/openrpc.jsoncrates/hero_livekit_sdk/build.rscrates/hero_livekit_sdk/src/lib.rscrates/hero_livekit_sdk/src/openrpc.rscrates/hero_livekit_sdk/src/livekit/crates/hero_livekit_sdk/Cargo.tomlhero_rpc_client/herolib_otoml/herolib_sid/feature flags/lintscrates/hero_livekit_ui/Cargo.toml[lib]targetcrates/hero_livekit_ui/src/main.rsserver::run()crates/hero_livekit_ui/src/lib.rsserver.rscrates/hero_livekit_ui/src/server.rscrates/hero_livekit_ui/src/whitelist.rscrates/hero_livekit_examples/examples/{basic_usage,health}.rsuse hero_livekit_sdk::openrpc::*→use hero_livekit_sdk::*crates/hero_livekit_rhai/src/client.rscrates/hero_livekit_backend/Cargo.toml(workspace)crates/hero_livekitmember + workspace dep; adddotenvyworkspace depImplementation Plan
Step 1: Harvest the handwritten orchestrator
Files (read):
crates/hero_livekit/src/livekit/server/rpc.rs(962 lines)Files (write):
crates/hero_livekit_server/src/livekit/rpc.rsSubtasks:
crates/hero_livekit/src/livekit/server/rpc.rsintocrates/hero_livekit_server/src/livekit/rpc.rsverbatim.use crate::livekit::core::*;andpub use super::rpc_generated::*;.crate::paths in the copied file that need updating.Dependencies: none.
Step 2: Write the new server build.rs
Files (write):
crates/hero_livekit_server/build.rsContent (substituting
livekitfor compute'scloud):No
.with_wasm(), no.client_crate_dir(...), no.sdk_dir(...), no.single_bin(...). The simplest possible config plus a sync-copy ofopenrpc.jsonto the crate root.Dependencies: none — but the build won't succeed until Step 3 (Cargo.toml has the build-dep).
Step 3: Update hero_livekit_server/Cargo.toml
Files (modify):
crates/hero_livekit_server/Cargo.tomlSubtasks:
hero_livekit = { workspace = true }.build = "build.rs"to[package].rpc.rs:reqwest,jsonwebtoken,flate2,tar,dirs = "6",herolib_sid = { workspace = true }. Keephero_rpc_server(still used bymain.rs).[build-dependencies] hero_rpc_osis = { workspace = true }.[features]block (single domain, no flag needed).Dependencies: Step 1.
Step 4: Rewrite hero_livekit_server src/livekit module + main.rs
Files (modify/create):
crates/hero_livekit_server/src/livekit/mod.rscrates/hero_livekit_server/src/livekit/server/mod.rscrates/hero_livekit_server/src/livekit/types.rscrates/hero_livekit_server/src/livekit/core/mod.rscrates/hero_livekit_server/src/main.rscrates/hero_livekit_server/src/lib.rsSubtasks:
src/livekit/mod.rs:pub mod core; pub use core::*; pub mod server; #[cfg(test)] mod tests;src/livekit/server/mod.rs: compute bridge with#[path = "../osis_server_generated.rs"],#[path = "../rpc_generated.rs"],#[path = "../rpc.rs"]modules.src/livekit/types.rs:include!("types_generated.rs");src/livekit/core/mod.rs: cfg-gated bridge totypes.rs(native) andtypes_wasm_generated.rs(wasm).src/main.rs: keep all OServer/HeroLifecycle wiring; usecrate::livekit::*nothero_livekit::livekit::*. Dropmod services;ifsrc/services/deleted.src/lib.rs: keeppub mod livekit;; droppub mod services;if deleted.Dependencies: Step 1, Step 2.
Step 5: Delete the old core crate
Files (delete):
crates/hero_livekit/(entire directory)Subtasks:
crates/hero_livekit/(verified during spec generation: lib.rs, services/mod.rs, mod.rs files, types.rs, bin/hero_livekit.rs are all generated boilerplate or empty stubs; tests.rs is identical to the copy already in hero_livekit_server).rm -rf crates/hero_livekit/.Dependencies: Step 1.
Step 6: Rewrite hero_livekit_sdk
Files (delete):
crates/hero_livekit_sdk/build.rs,crates/hero_livekit_sdk/src/openrpc.rs,crates/hero_livekit_sdk/src/livekit/(entire).Files (modify):
crates/hero_livekit_sdk/Cargo.toml,crates/hero_livekit_sdk/src/lib.rs.Subtasks:
lib.rsmodelled onhero_compute_sdk/src/lib.rs:use hero_rpc_derive::openrpc_client;pub use herolib_core::openrpc::{OpenRpcError, OpenRpcTransport};openrpc_client!("../hero_livekit_server/openrpc.json", name = "LiveKitClient");livekitfor compute'scloud/compute):env_file_path,load_env,socket_dir,server_socket_path,ui_socket_path,HERO_PROXY_PORT,PROXY_SERVER_RPC_PREFIX,proxy_server_rpc_url,wrap_ipv6,normalize_rpc_method,read_http_response,http_rpc_tcp,http_rpc_unix.SERVER_RPC_PATH/connect_server_socket— current callers useLiveKitClient::connect_socket(...)which works as-is. Add the constant only if a real consumer needs it.Cargo.toml: Drophero_rpc_client,herolib_otoml,herolib_sid,[features],[lints.clippy].Verification:
openrpc_client!("../hero_livekit_server/openrpc.json", ...)resolves fromcrates/hero_livekit_sdk/up one tocrates/hero_livekit_server/openrpc.json. ✓ already exists.Dependencies: none (parallel with Steps 2–4).
Step 7: Update consumer crates' imports
Files (modify):
crates/hero_livekit_examples/examples/basic_usage.rscrates/hero_livekit_examples/examples/health.rscrates/hero_livekit_rhai/src/client.rsSubtasks:
use hero_livekit_sdk::openrpc::*;(orpub use hero_livekit_sdk::openrpc::*;) withuse hero_livekit_sdk::*;(orpub use hero_livekit_sdk::*;).socket_path()helpers withhero_livekit_sdk::server_socket_path().Dependencies: Step 6.
Step 8: Collapse hero_livekit_ui into a binary-only crate
Files (delete):
crates/hero_livekit_ui/src/lib.rsFiles (modify):
crates/hero_livekit_ui/Cargo.toml,crates/hero_livekit_ui/src/main.rsFiles (create):
crates/hero_livekit_ui/src/server.rs(and optionallysrc/assets.rs)Subtasks:
lib.rs(UiMeta, AppState, BasePath, IndexTemplate, JoinTemplate, socket_dir, service_socket_path, ui_socket_path, build_router, bind_unix_socket, all handlers) intosrc/server.rs.main.rsintopub async fn run() -> anyhow::Result<()>inserver.rs.server.rs:use hero_livekit_sdk::*;.src/main.rs(~10 lines): declare modules +server::run().await.[lib]section; keep[[bin]]and all current deps.Dependencies: Step 6.
Step 9: Update workspace Cargo.toml
Files (modify):
Cargo.toml(workspace root)Subtasks:
"crates/hero_livekit",from[workspace] members.hero_livekit = { path = "crates/hero_livekit" }from[workspace.dependencies].dotenvy = "0.15"to[workspace.dependencies].cargo tree, optionally removehero_rpc_clientfrom workspace deps (only used by old SDK).Dependencies: Step 5, Step 6.
Step 10: Verify
Subtasks:
cargo build --workspace.cargo clippy --workspace --all-targets -- -D warnings.cargo test --workspace.grep -rn 'single_bin\|bin_companions\|bin_ui\|client_crate_dir\|sdk_types_crate\|with_wasm\|nested_layout\|autobins = false' .returns zero hits.grep -rn 'hero_livekit::livekit::' crates/returns zero hits.grep -rn 'hero_livekit_sdk::livekit::\|hero_livekit_sdk::openrpc' crates/returns zero hits.find crates/hero_livekit -type freturns nothing.cargo run --example basic_usage(against a local hero_livekit_server) as a smoke test.Dependencies: all prior.
Parallelization Notes
Acceptance Criteria
crates/hero_livekit/directory does not exist.crates/hero_livekit_server/build.rsmatches the compute pattern (nosingle_bin,bin_companions,bin_ui,client_crate_dir,sdk_types_crate,with_wasm,nested_layout,sdk_dir).crates/hero_livekit_server/src/livekit/rpc.rscontains the orchestrator (install, configure, start, stop, restart, status, room/participant ops, token signing, lifecycle triggers).crates/hero_livekit_server/openrpc.jsonexists at the crate root and is consumed byopenrpc_client!in the SDK.crates/hero_livekit_sdk/src/lib.rsis a single file, nopub moddeclarations beyond macro re-exports.crates/hero_livekit_sdk/build.rsdoes not exist.crates/hero_livekit_sdk/src/livekit/andcrates/hero_livekit_sdk/src/openrpc.rsdo not exist.crates/hero_livekit_ui/src/lib.rsdoes not exist;[lib]removed from itsCargo.toml.crates/hero_livekit_ui/src/main.rsis ~10 lines and delegates toserver::run().Cargo.tomllists exactly:hero_livekit_server,hero_livekit_sdk,hero_livekit_backend,hero_livekit_ui,hero_livekit_examples,hero_livekit_rhai.hero_livekit_backendsource code is byte-identical to before.hero_livekit_rhaionly difference is the import line inclient.rs.cargo build --workspace,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspaceall green.single_bin,bin_companions,bin_ui,client_crate_dir,sdk_types_crate,with_wasm,nested_layout,autobins = false,hero_livekit::livekit::,hero_livekit_sdk::openrpc::,hero_livekit_sdk::livekit::.Notes / risks / caveats
SERVER_RPC_PATHconstant: hero_livekit'sOServer::run_cli+register_domainmay serve a different HTTP path than hero_compute's/api/root/cloud/rpc. Current callers useLiveKitClient::connect_socket(...)which works as-is — recommend omittingSERVER_RPC_PATH/connect_server_socketfrom the new SDK and adding them later only if a real consumer needs them.openrpc.jsondual location: the build.rs emitssrc/livekit/openrpc.json; the SDK macro readscrates/hero_livekit_server/openrpc.json(crate root). The new build.rs adds astd::fs::copystep to keep them in sync.Deleting
crates/hero_livekit/src/livekit/server/rpc.rsis destructive: it is the only handwritten code in the entire core crate. Step 1 must succeed before Step 5 runs.#[cfg(feature = "livekit")]cleanup: the movedrpc.rscontains no feature-flag guards; safe to drop thelivekitfeature flag.Generated
types_wasm_generated.rs: emitted by default; the cfg-gatedcore/mod.rskeeps it harmless on native targets.openrpc.client.generated.rsat the server crate root: side-effect file from the SDK macro. Existing behavior; no action.Cargo lock churn: removing
hero_rpc_client,herolib_otomland addingdotenvywill reshuffleCargo.lock. Expected.Tests touching
/tmp:crates/hero_livekit_server/src/livekit/tests.rswrites to/tmp/osis_test_*— already works in the server crate; the new bridge module exportsOsisLivekitcorrectly.Backwards compatibility: anything that imported
hero_livekit::livekit::core::Roomdirectly from the old core crate breaks. Repo-wide grep confirms only consumers within this workspace did so, and they're all updated in Steps 4 & 7. External consumers (none known) would migrate tohero_livekit_sdk::Room.Test Results
cargo build --workspace: PASScargo clippy --workspace --all-targets -- -D warnings: PASScargo test --workspace: PASSTest breakdown
Total: 31 passed, 0 failed, 2 doc-tests ignored.
Acceptance criteria — all green
crates/hero_livekit/no longer existscrates/hero_livekit_server/build.rsexists with the minimal compute-style configcrates/hero_livekit_server/openrpc.jsonis the single source of truth for SDK consumerscrates/hero_livekit_sdk/src/lib.rsis one file, nobuild.rs, nolivekit/subtreesingle_bin,bin_companions,bin_ui,client_crate_dir,sdk_types_crate,with_wasm,nested_layout,autobins = falsehero_livekit::livekit::*hero_livekit_sdk::openrpc::*orhero_livekit_sdk::livekit::*hero_livekit_server,hero_livekit_sdk,hero_livekit_backend,hero_livekit_ui,hero_livekit_examples,hero_livekit_rhaihero_livekit_backendsource unchangedhero_livekit_rhaisource unchanged except for the SDK import pathDeviations from the spec
livekit/mod.rsandlivekit/core/mod.rsafter the OschemaBuilder run. The current generator emits a flat-layoutmod.rscontainingpub use self as core;andpub use self as server;, both of which are invalid Rust syntax. The build.rs now overwritesmod.rswith the canonical nested-bridge form (matchinghero_compute_server) and createscore/mod.rs(the cfg-gated bridge totypes.rs/types_wasm_generated.rs). This is the same shapehero_compute_serverships, but committed via build.rs rather than by hand.osis_server_generated.rsto fix an incorrectinclude_str!("../core/openrpc.json")emitted by the generator. The replacement points atopenrpc.jsonnext to the file, which is where the generator writes it.herolib_coredep updated todefault-features = false, features = ["openrpc-transport"]to match the SDK override (matcheshero_compute's workspace).dotenvy = "0.15"added (used by the SDK).WhitelistState::new()async ctor inhero_livekit_ui/src/whitelist.rs(callers usenew_blocking()only;cargo clippy -- -D warningsflagged it).Implementation Summary
Workspace shape — before vs after
Before (post PR #18):
hero_livekit(core w/ build.rs),hero_livekit_server,hero_livekit_sdk(with build.rs hack +livekit/subtree),hero_livekit_ui(lib + bin),hero_livekit_examples,hero_livekit_rhai,hero_livekit_backendOschemaBuildConfigchain:single_bin,bin_companions,bin_ui,client_crate_dir,sdk_types_crate,with_wasm,nested_layout,sdk_dirsrc/bin/hero_livekit.rsorchestrator that neededautobins = falseto compileAfter (this branch):
hero_livekit_server(ownsbuild.rs+ generated code),hero_livekit_sdk(one-file lib),hero_livekit_ui(bin-only),hero_livekit_examples,hero_livekit_rhai,hero_livekit_backendOschemaBuildConfigchain:schemas_dir,docs_dir,domain,generate_server,debug— matcheshero_compute_serverChanges by crate
crates/hero_livekit/— deleted entirely.livekit/server/rpc.rsorchestrator (install / configure / start / stop / restart / status / room+participant ops / token signing / lifecycle triggers) was harvested intohero_livekit_server/src/livekit/rpc.rs.crates/hero_livekit_server/— refactored to own all server-side code.build.rswith compute-style minimal config, plus three local-only fixes for generator quirks: rewrites the broken generator-emittedlivekit/mod.rs, creates thelivekit/core/mod.rsbridge, and patches the badinclude_str!("../core/openrpc.json")in the generated server file.Cargo.toml: droppedhero_livekitdep, addedreqwest,jsonwebtoken,flate2,tar,dirs,herolib_sid, plus[build-dependencies] hero_rpc_osis. Added[features] default = ["livekit"]; livekit = []to mirror compute and silenceunexpected_cfgs.livekit/server/mod.rsis the compute bridge pattern (path-includes the flat generated files + handwrittenrpc.rs).openrpc.jsonlives at the crate root (synced fromsrc/livekit/openrpc.jsonbybuild.rs).crates/hero_livekit_sdk/— collapsed to a single file.src/lib.rsis now ~270 lines modeled onhero_compute_sdk/src/lib.rs:openrpc_client!("../hero_livekit_server/openrpc.json", name = "LiveKitClient"), plus env / socket / proxy / HTTP-RPC helpers.build.rs,src/openrpc.rs, and the entiresrc/livekit/subtree are gone.Cargo.tomltrimmed to compute's dep set (hero_rpc_derive,hero_rpc_openrpc,herolib_core,tokio,serde,serde_json,dotenvy); droppedhero_rpc_client,herolib_otoml,herolib_sid, the[features]block, and[lints.clippy].crates/hero_livekit_ui/— collapsed lib + bin into bin-only.src/lib.rsdeleted; contents moved tosrc/server.rswith apub async fn run() -> anyhow::Result<()>entry point.src/main.rsis now 9 lines:mod assets; mod server; mod whitelist;thenserver::run().await.src/assets.rsextracted as a smallrust_embedmodule (mirrorshero_compute_ui).[lib]target removed fromCargo.toml. All deps preserved.WhitelistState::new()async ctor; onlynew_blocking()remains (the one used by the router).crates/hero_livekit_examples/,crates/hero_livekit_rhai/— single-line import fix:hero_livekit_sdk::openrpc::*→hero_livekit_sdk::*. No behavior change.crates/hero_livekit_backend/— untouched.Workspace
Cargo.toml— removedcrates/hero_livekitfrom members and thehero_livekitworkspace dep. Addeddotenvy = "0.15". Updatedherolib_coretodefault-features = false, features = ["openrpc-transport"]to match compute and the SDK's override pattern.File-level diff stat (
main..HEAD)Test results
cargo build --workspace: PASScargo clippy --workspace --all-targets -- -D warnings: PASScargo test --workspace: PASS — 31 tests passed, 0 failed, 2 doc-tests ignoredNotes / caveats
SERVER_RPC_PATHconstant andconnect_server_socket()impl described in the spec were intentionally deferred — current callers useLiveKitClient::connect_socket(...)(the macro default), and adding them now would be speculative. They can be added in a follow-up if a real consumer needs a non-default path.build.rsworkarounds for theOschemaBuildergenerator (overwrite ofmod.rs, manualcore/mod.rsbridge,include_str!patch) are local, contained, and documented inline. If/when the generator is fixed upstream, those three blocks can be removed.refactor/align-with-hero-compute. Commit not yet created — awaiting user approval.